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] AWQ quantization grows reserved VRAM by ~1 GiB per layer on ROCm (256 MiB segments never reused), starving other processes on the GPU #4313
Severity: medium. Status: confirmed by repro on a Radeon AI PRO R9700 (ROCm). Kind: pre-existing; reproduces identically at 9dad249.
Description
During AWQ quantization, PyTorch's reserved memory grows linearly per layer while active memory stays flat:
Qwen3-0.6B, AWQ GEMM, 32 samples, batch_size=4, 1 GPU, PYTHON_GIL=0: MemDiag reserved goes from 0.10 GiB at layer 0 to 26.3 GiB at layer 27. Active stays at 0.04 GiB throughout.
gemma-3-1b-it (GIL on): about 0.25 GiB per layer, reaching 7.0 GiB.
GPTQ on the same model and settings stays flat at 0.39 GiB.
Evidence
torch.cuda.memory_snapshot() at each layer end shows each layer adding four new 256.0 MiB segments on stream 0.
Each segment is a single block with 0 bytes allocated, and later layers never reuse them.
256 MiB matches the max_split_size_mb:256 that GPT-QModel sets automatically on ROCm (PYTORCH_ALLOC_CONF='max_split_size_mb:256,garbage_collection_threshold:0.7', without expandable segments).
Note that garbage_collection_threshold has no effect unless a memory fraction is set.
Impact
On a 32 GB card, other jobs sharing the GPU failed during these runs, with Hip error: 'out of memory' in hipBLASLt init (segfault, exit 139) and HIPSOLVER_STATUS_ALLOC_FAILED. Larger models will hit allocator retries or OOM.
Repro
fromgptqmodelimportGPTQModel, QuantizeConfig, METHOD, FORMATqcfg=QuantizeConfig(bits=4, group_size=128, quant_method=METHOD.AWQ, format=FORMAT.GEMM)
m=GPTQModel.load("Qwen/Qwen3-0.6B", quantize_config=qcfg)
m.quantize(wiki_rows[:32], batch_size=4) # on ROCm; watch "MemDiag: layer=N ... reserved=" or torch.cuda.memory_reserved() in layer_callback
Expected: reserved memory stays flat across layers, as with GPTQ, or the cache is released at layer boundaries.
Not yet known: which AWQ allocation produces the 256 MiB segments. CUDA was not checked.
Found during an AI-assisted review (Claude Code, round 11) of 842d666; repros were run at that commit on RTX 4090/5090 (CUDA 13) and/or Radeon AI PRO R9700 (ROCm) unless marked static/suspected.
Taking this. I'll investigate against current main, add a targeted regression test, and open a PR. Will report back here if the claim turns out to be invalid or already fixed.
Fix: AWQ now releases its freed per-layer clip-search scratch from the ROCm allocator cache at each layer boundary, stopping the ~1 GiB/layer reserved growth. PR: #4342
Activity
Qubitium commentedon Nov 16, 2026
Taking this. I'll investigate against current
main, add a targeted regression test, and open a PR. Will report back here if the claim turns out to be invalid or already fixed.Qubitium commentedon Nov 16, 2026
Fix: AWQ now releases its freed per-layer clip-search scratch from the ROCm allocator cache at each layer boundary, stopping the ~1 GiB/layer reserved growth. PR: #4342
fix: release the AWQ per-layer ROCm allocator cache (ModelCloud#4313) (…
fix(awq,qlinear): keep clip scratch splittable and bound pack_gpu tra…