Add dense qwen3_5 support for learned quantization#1200
Open
iamwavecut wants to merge 1 commit intoml-explore:mainfrom
Open
Add dense qwen3_5 support for learned quantization#1200iamwavecut wants to merge 1 commit intoml-explore:mainfrom
qwen3_5 support for learned quantization#1200iamwavecut wants to merge 1 commit intoml-explore:mainfrom
Conversation
Enable AWQ traversal for dense qwen3_5 hybrid blocks, including linear-attention, full-attention, and dense MLP projections. Avoid qwen3_5 inference-only CustomKernel VJP during dynamic quantization sensitivity estimation, and expose calibration controls for smaller local smoke runs. Harden DWQ with KL loss fallback selection, target metadata validation, shape checks, and non-finite loss/weight guards so corrupted checkpoints fail before save. Add unit coverage and opt-in slow qwen3_5 quantization smoke tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds learned quantization support for dense
qwen3_5text models and hardens DWQ failure handling.Changes:
qwen3_5hybrid layers:self_attn.{q,k,v,o}_projlinear_attn.in_proj_*dynamic_quantcalibration controls for small local runs:--num-samples--sequence-length--kl-loss-impl auto|metal|mlxThis intentionally focuses on dense
qwen3_5models. MoE support is left out of scope.Motivation
Plain conversion and GPTQ already work for qwen3_5 models, but other learned quantization paths had gaps:
qwen3_5as unsupported.[Primitive::vjp] Not implemented for CustomKernelon qwen3_5 linear-attention paths.Testing
Opt-in slow smoke test on Qwen/Qwen3.5-0.8B:
Local smoke checks also verified that AWQ, dynamic quantization, and DWQ start and save loadable artifacts for the downstream finetuned model LakoMoor/QClaw-4B. GPTQ was checked to reach Hessian collection and quantization startup as an existing baseline.