diff --git a/check_model_size.py b/check_model_size.py index 76c9cab..f544a6b 100644 --- a/check_model_size.py +++ b/check_model_size.py @@ -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