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] Staged AWQ GSQ (AWQConfig(gsq_training=...)) crashes on every GPU after layer 0: linear.weight.data = weight across inference_mode makes post_quantize view() raise #4561
Found on main @ 4b65923, AMD Radeon AI PRO R9700 (gfx1201, ROCm 10.1). The root cause is not ROCm-specific: it affects every GPU run, CUDA included.
What is wrong
AWQConfig(gsq_training=GSQTrainingConfig(enabled=True, initializer="awq")) crashes on any GPU right after the first layer finishes its staged fit:
File "gptqmodel/looper/stage_layer.py", line 1342, in run_layer_stage
layers[layer_index] = looper.gptq_model.post_quantize(module)
File "gptqmodel/models/base.py", line 4378, in post_quantize
return move_module_to_cpu_pinned(module)
File "gptqmodel/utils/model.py", line 364, in to_cpu
source_flat = source.view(-1)
RuntimeError: Inference tensors do not track version counter.
Cause: refine_awq_staged_layer (gptqmodel/looper/gsq_training_awq.py:87) runs inside torch.inference_mode(False) and does
linear.weight.data=weight
The layer's weight Parameter was created under the looper's inference_mode, so it is an inference tensor. Swapping .data for a normal tensor gives a Parameter that reports is_inference() == False but has no version counter. Back in inference mode, any view of it raises. move_module_to_cpu_pinned takes views for every GPU tensor above pin_min_bytes (utils/model.py:364), so post_quantize always crashes on layer 0.
The CPU test tests/test_gsq_staged_public.py (AWQ, device=DEVICE.CPU) does not catch this: on CPU to_cpu returns tensor.to(CPU) and never takes a view.
Output: 4 stages of layer 0 train (GSQ stage update 2/2 loss=...), then the RuntimeError above. Nothing is saved.
Suggested fix
Do not swap .data across the inference-mode boundary. Either:
copy in place under inference mode: with torch.inference_mode(): linear.weight.copy_(weight) (the shape and dtype already match), or
replace the parameter: linear.weight = nn.Parameter(weight, requires_grad=False) created inside inference mode.
Then extend test_gsq_staged_public.py with a CUDA/ROCm case, or with a CPU case that runs move_module_to_cpu_pinned with its view path, so the inference-tensor mix is exercised.
Severity
High for this feature: staged AWQ GSQ cannot complete a single layer on any GPU. The GPTQ staged path is unaffected (it does not go through refine_awq_staged_layer).
Activity
Qubitium commentedon Nov 17, 2026
Claimed. This issue is now owned by a dedicated worker; a fix PR referencing it will follow.
fix(gsq): keep staged AWQ weights consistent across inference mode an…