[Perf][SM70] Coalesce AWQ QPN W13 compact metadata loads and enable compact metadata by default - #522
Conversation
Reuse the existing active-stage operator for TP4 g32 M2-8 decode, align warmup admission, and annotate scratch mutations. Keep C1 and unmatched contracts on existing routes; add focused coverage without new public operators or GEMM kernels. Validated with 51 GPU-directed tests, 32 dynamic-route operator comparisons, and QSA-fixed matched model runs. Single-run pure-decode gains: C4x64K +5.62%, C8x16K +2.24%. Natural-EOS AWQ outputs match 17/18; the retained and/+ near-tie and W13 rounding differences are not claimed bitwise exact. No precision-default changes or deployment. Co-authored-by: OpenAI Codex Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com>
Separate implementation-only and existing-autotune gains; document EOS rounding limitations, capacity and startup observations, rollback, and the dual-format C1 follow-up. Co-authored-by: OpenAI Codex Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com>
Record the new main integration gate separately from frozen GPU results; keep prefill and grouped decode admission disjoint. Co-authored-by: OpenAI Codex Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com>
Co-authored-by: OpenAI Codex Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com>
Assisted-by: OpenAI Codex Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com>
Use the retained engine log instead of extrapolating cache block count. No production or benchmark changes. Co-authored-by: OpenAI Codex <noreply@openai.com> Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com>
Add the typed inference operator, prepared-bank decoder, FP32 reduction kernels and standalone GPU tests without changing model dispatch. Keep 3B scalar loading here so cooperative metadata access can be reviewed separately. Assisted-by: OpenAI Codex <noreply@openai.com> Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com> (cherry picked from commit 27a27d3) (cherry picked from commit 5b4135f)
Gate the native operator to the existing Qwen3.8 TP4 E512 M1 contract, retaining default-off behavior and neighboring routes. Document numerical attribution, observed quality changes, and incomplete production acceptance. Assisted-by: OpenAI Codex <noreply@openai.com> Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com> (cherry picked from commit 37fb5d2)
Evaluate both AWQ arithmetic paths against an independent fixed-weight reference; distinguish existing quantization error, local arithmetic bounds, and task-level quality. Assisted-by: OpenAI Codex <noreply@openai.com> Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com> (cherry picked from commit 6f73eac)
Load 3-byte W13 metadata cooperatively without changing dequantization or reduction order. Keep scalar W2 and the 4-byte path unchanged; document the component-only validation scope. Assisted-by: OpenAI Codex <noreply@openai.com> Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com> (cherry picked from commit 636db1d)
Default VLLM_SM70_AWQ_MOE_COMPACT_METADATA to 1 for the supported Qwen3.8 TP4 E512 native-g32 shape. A default-on request that the build or layer cannot serve falls back to the 4-byte layout with an info log; an explicit =1 still fails closed. The decision is a pure helper covered by unit tests. Same-contract regression: engine-reported KV cache 427,385 -> 497,983 tokens, C1 x 64K pure decode within 0.2% of the 4-byte layout, C4/C8 within noise. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Leonccaa <166551845+Leonccaa@users.noreply.github.com>
Fresh regression: reader, layout capacity, and updated default (2026-09-06 UTC)There are two source snapshots in this addendum. The original operator and The two exact git archives differ only in two Python files, one test and one Startup-peak clarification: neither tested #522 snapshot includes the still-open Reader-level evidenceThe original exact-head SM70 build passed 2 portable GPU tests, 256 A same-layout 3B scalar-reader -> cooperative-reader operator comparison, Layout-level capacity and serving measurementsContract: 4 x V100 32GB / TP4, frozen AWQ native-g32 weights and prompt token
Each cell has one scored run after warmup, max 320 output tokens, Prepared banks save 943,718,400 bytes = 900 MiB per rank across 48 layers. The 65 frozen quality scores and all finish reasons are unchanged in this Teacher-forced same-arm A/A is exact (70 rows each). Cross-process C1 x 64K Updated implicit-default validationThe default/fallback-specific CPU tests pass (5 tests). The updated exact The actual default combination completed a separate full capture on the new
All 13 performance outputs match. This is an explicitly audited cross-source- The new default's 65 per-record quality scores are unchanged relative to Separately measured prompt processingBoth 3B and explicit 4B/QPN-OFF PP captures completed on the same updated
There are 8/32/16 measured model steps respectively, all prefill-only. C4/C8 The first appended PP warmup after the original complete model captures AI assistance: Codex performed this regression and prepared the addendum at |
Purpose
Two things, in two commits: read the 3-byte
{FP16 scale, u8 zero}W13 metadata of the AWQ M=1 operator (#519) cooperatively instead of byte by byte, without changing dequantization, bias reconstruction, MMA order or any rounding boundary.Depends on #519 (the operator) and is stacked on #521 (whose design document this PR extends). The commits specific to this PR are the last two,
9c5b69950e(cooperative reader) and9e23886bdc(default switch); the rest of the diff belongs to #520, #519 and #521 and disappears once they merge.Operator results
Real layer-1 AWQ weights, TP4 rank 0, M=1, top-k 10, 48 calls per CUDA Graph replay, 7 samples, medians in ms per 48 calls (evidence
qwen38-c1-qpn-awq-20260905/evidence-r1andevidence-r2):For W2 the cooperative reader measured 0.4492 / 0.4826 against the scalar 0.4015 / 0.4331, so W2 is left scalar. A separate single-layer graph probe of the combined W13/W2 step measured 21.528 us scalar versus 20.616 us cooperative, about 4.2%. These are component observations, not model throughput; the full-model results in #521 use 4-byte metadata and do not exercise this path.
Default switch (second commit)
With the cooperative reader in place, the 3-byte layout no longer costs decode speed on the M=1 route, so
VLLM_SM70_AWQ_MOE_COMPACT_METADATAnow defaults to1for the supported Qwen3.8 TP4 / E512 / native-group-32 shape. The compact layout has been inmainsince #498 as an opt-in; it frees about 0.88 GiB of resident metadata per GPU, which the engine hands straight to the KV cache.0keeps the 4-byte layout, as before.awq_sm70_prepare_compactop, or a non-Qwen3.8-TP4 shape) falls back to the 4-byte layout with an info log instead of raising. An explicit=1still fails closed with the same messages as before._resolve_compact_metadata, covered by unit tests for all cases.Same-day regression on 4x Tesla V100 PCIe 32 GB, TP4/MTP0, FP16 activations and KV, native-group-32 AWQ, max model length 131,328, GPU memory utilization 0.89, the stack #520 + #519 + #521 + this PR, one score per cell:
The earlier acceptance of the compact layout on the TurboMind route (#498) measured a warm-state cost of about +1.22% on an 8192-token prefill and +0.27% on 32-token decode against +19.36% KV capacity at fixed memory utilization. Other AWQ MoE models keep the 4-byte layout through the fallback.
Tests
tests/kernels/test_sm70_awq_qpn_m1.py), 256 real-weight/dynamic-graph exact comparisons against the validated prototype, 72 independent FP64 stage checks with no rounding-bound violations, and 48 invalid-argument rejections, covering both metadata layouts and all four TP partitions. Outputs of the scalar, cooperative and prototype builds are identical on those inputs.55010c76...9481b5).git diff --check: clean.tests/quantization/test_sm70_awq_compact_metadata.py(default on,0disables, fallback cases, explicit fail-closed cases) plus the neighbouring AWQ CPU suites: 97 passed. Two unchanged modules still show their pre-existing teardown errors on a GPU-less host (torch.accelerator.empty_cache()), identical before and after this change.Duplicate-work check
Open-PR searches on 2026-09-06 in
1CatAI/1Cat-vLLMfor AWQ compact metadata, "AWQ QPN" and "SM70 AWQ" found no competing AWQ metadata reader. Base ismain@755baae1d0.Provenance
Fork review draft: Leonccaa#11 (same commit).
AI assistance was used. OpenAI Codex implemented and validated the cooperative reader under Leon's direction; Claude Code reviewed the tile and shuffle index arithmetic, implemented the default switch and its tests after Leon decided the default, re-ran pre-commit on this branch, and prepared this submission. The regression measurements come from the run driven by OpenAI Codex. Human review is still required.
🤖 Generated with Claude Code