Fix IndexError during Qwen3.5/3.6 quantization by disabling in_proj_qkv/in_proj_z by default#1936
Fix IndexError during Qwen3.5/3.6 quantization by disabling in_proj_qkv/in_proj_z by default#1936heyparth1 wants to merge 2 commits into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
📝 WalkthroughWalkthroughPTQ configs now default-disable packed linear-attention projections, Qwen3.5 quant configs re-enable FP8 for those projections after the default import, and tests validate the resulting enable state for recipes, presets, and a CPU quantization model. The example HF PTQ script also updates its skip-quantization logging. ChangesPacked linear-attn FP8 quantizer config and tests
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant QuantConfigYAML
participant DefaultDisabledQuantizers
participant RecipeLoader
QuantConfigYAML->>DefaultDisabledQuantizers: import default_disabled_quantizers
DefaultDisabledQuantizers->>RecipeLoader: disable in_proj_qkv/in_proj_z rules
QuantConfigYAML->>RecipeLoader: add FP8 enable rules after import
RecipeLoader->>RecipeLoader: apply quant_cfg entries in order
RecipeLoader-->>QuantConfigYAML: final state - in_proj_qkv/z enabled, in_proj_a/b and conv1d disabled
Suggested reviewers: 🚥 Pre-merge checks | ✅ 6✅ Passed checks (6 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
This is not fixing the error, https://gist.github.com/kristianpaul/34b3421fb84be82339c1f5e3efa1b118 |
|
Thanks for re-testing! Your log shows the run reused the checkpoint exported before the fix — note the line "Quantized model config /workspace/output_models/saved_models_Qwen3_6-35B-A3B_nvfp4/config.json exists, skipping the quantization stage" — so the corrected quantization config was never applied. Please delete |
This PR fixes the
IndexError: tuple index out of rangeencountered during NVPF4 quantization of Qwen3.5/3.6 models.Root Cause:
TRT-LLM's Qwen3.5 weight mapper repacks
in_proj_qkvandin_proj_zinto the fusedin_proj_qkvzby splitting the checkpoint tensor along dim 0. The scalar per-tensor scales of quantized modules are 0-dim, which crashes the split operation.Changes:
*linear_attn.in_proj_qkv*and*linear_attn.in_proj_z*by default indefault_disabled_quantizers.yaml.Closes #1933
Summary by CodeRabbit
in_proj_qkv/in_proj_z) are kept in the intended precision to prevent repacking-related runtime crashes.