fix: remove GPU test, just check quantization

This commit is contained in:
Christian Medina
2026-07-02 21:14:34 -04:00
parent 43f5426583
commit 170243de25

View File

@@ -43,14 +43,11 @@ print(f"BnB 4-bit parameters: {bnb_params / 1e9:.2f}B")
print(f"BF16 parameters: {bf16_params / 1e9:.2f}B")
print(f"Estimated size: {(bnb_params * 0.5 + bf16_params * 2) / 1e9:.2f} GB")
# Try to move to GPU
print("\n Moving to GPU 0...")
try:
model = model.to("cuda:0")
print(f"✓ Success! GPU 0: {torch.cuda.memory_allocated(0) / 1e9:.2f} GB")
print(f" Free VRAM: {torch.cuda.get_device_properties(0).total_memory / 1e9 - torch.cuda.memory_allocated(0) / 1e9:.2f} GB")
except Exception as e:
print(f"✗ FAILED: {e}")
if bnb_params / total_params > 0.9:
print("\n✓ SUCCESS: Model is properly quantized to 4-bit!")
else:
print(f"\n✗ FAILED: Only {bnb_params/total_params*100:.1f}% of parameters are 4-bit")
print(" Expected: ~100%, Got: this percentage")
del model
import gc