You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
DeepSeek V4.1: GPTQModel.load(placement=Placement.budget(...)) raises ValueError: dtype is not a valid dtype: torch.int8 #6541
On main (c649fcb), loading a DeepSeek V4.1 Flash checkpoint with a byte budget fails before any weights are placed:
fromgptqmodelimportGPTQModelfromgptqmodel.weight_loaderimportPlacementGPTQModel.load(v41_dir, placement=Placement.budget({"cuda:0": "40GiB"})) # or {"cpu": "..."}
gptqmodel/models/ports/deepseek_v41_flash/checkpoint.py:143: in _infer_placements
sizes = compute_module_sizes(model)
gptqmodel/utils/vram.py:157: in compute_module_sizes
gptqmodel/utils/vram.py:66: ValueError: `dtype` is not a valid dtype: torch.int8.
tests/module_tree/test_deepseek_v41_flash.py::test_v41_cuda_load_runs_packed_projections[128] fails with the same error on CUDA.
Root cause
#6473 replaced Accelerate's infer_auto_device_map in the V4.1 budget path with gptqmodel.utils.vram.compute_module_sizes. Its dtype_byte_size only knows bool/fp8-family/fp16/bf16/fp32/int32 and raises for every other torch dtype. V4.1 stores packed FP4/FP8 payloads and scales as int8/uint8, so every budget placement fails. gptqmodel.utils.get_vram hits the same error for any model with int8/uint8/int64/float64 tensors.
Expected
Every torch dtype counts its element size (torch.empty((), dtype=d).element_size()); the budget packs and loads, and a budget too small for a unit raises the documented "does not fit" error.
Activity
fix(vram): size every torch dtype so DeepSeek V4.1 budget placement l…