fix: remove GPU test, just check quantization
This commit is contained in:
@@ -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"BF16 parameters: {bf16_params / 1e9:.2f}B")
|
||||||
print(f"Estimated size: {(bnb_params * 0.5 + bf16_params * 2) / 1e9:.2f} GB")
|
print(f"Estimated size: {(bnb_params * 0.5 + bf16_params * 2) / 1e9:.2f} GB")
|
||||||
|
|
||||||
# Try to move to GPU
|
if bnb_params / total_params > 0.9:
|
||||||
print("\n Moving to GPU 0...")
|
print("\n✓ SUCCESS: Model is properly quantized to 4-bit!")
|
||||||
try:
|
else:
|
||||||
model = model.to("cuda:0")
|
print(f"\n✗ FAILED: Only {bnb_params/total_params*100:.1f}% of parameters are 4-bit")
|
||||||
print(f"✓ Success! GPU 0: {torch.cuda.memory_allocated(0) / 1e9:.2f} GB")
|
print(" Expected: ~100%, Got: this percentage")
|
||||||
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}")
|
|
||||||
|
|
||||||
del model
|
del model
|
||||||
import gc
|
import gc
|
||||||
|
|||||||
Reference in New Issue
Block a user