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
[BUG] Dense load with whole-model placement="cpu>accel:0" keeps every weight on the accelerator; "disk>accel:0" raises at load #6581
A whole-model offload placement on a dense (unquantized) load does not offload:
GPTQModel.load(model_id, placement="cpu>accel:0") (documented in docs/weight-loader.md: "Weights stay on CPU; the module executes on accel:N") puts every weight on the accelerator. TinyLlama-1.1B: 2100 MiB allocated after load, all parameters on cuda:0, identical to placement="accel:0".
GPTQModel.load(model_id, placement="disk>accel:0", offload_dir=...) fails during load: ValueError: weight is on the meta device, a value is required to place it on cuda:0. (weight_loader/hooks.pyinit_hook via WeightLoader.dispatch).
Root cause
WeightLoader.dispatch (gptqmodel/weight_loader/loader.py) computes _subtree_targets; with one root rule the whole model is a single uniform subtree, so the result is {"": target} and no child has an entry. dispatch adds the root AlignDevicesHook and then visits the children, which find no target, recurse to the leaves and give every tensor-owning leaf a residentAlignDevicesHook(execution_device). For cpu> that moves the weights onto the accelerator; for disk> it tries to place meta tensors and raises. Placements that name sub-trees (e.g. {"": "accel:0", "model.layers.[8:]": "cpu>accel:0"}) are not affected.
Repro (ROCm 7.16 R9700; the code path is device-independent)
Weights stay on CPU / in offload_dir (meta in the module) and are onloaded per forward, as for sub-tree cpu>/disk> rules and as the quantized path (simple_dispatch_model) already does.
Activity