Skip to content

Load quantized weights per component - #669

Draft
xiaoyu-work wants to merge 2 commits into
refactor/typed-weight-pipelinefrom
feat/per-component-quantization-loader
Draft

Load quantized weights per component#669
xiaoyu-work wants to merge 2 commits into
refactor/typed-weight-pipelinefrom
feat/per-component-quantization-loader

Conversation

@xiaoyu-work

Copy link
Copy Markdown
Contributor

Summary

  • parse an authoritative component_quantization plan for each package component
  • map component-local module paths to candidate HuggingFace full module names
  • apply exact and re: modules_to_not_convert rules per projection, rather than collapsing the whole component
  • keep excluded per_layer_input_gate and per_layer_projection modules floating point while quantizing the rest of the decoder
  • normalize existing Olive/GPTQ/AWQ packed sidecars through the typed codec layer; never quantize float weights
  • fail closed for specialized quantized subclasses, packed experts/tied tables awaiting model adapters, and unrouted packed weights

Stack

Validation

  • 331 focused loader, config, component, Gemma4 exclusion, and all-model matrix tests
  • 104 independent-layout builds across VL, speech, and seq2seq model configurations
  • 77 non-Base config and diffusers compatibility tests

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown

Performance Comparison

Comparing 15c0dfce5ce365

Model Metric Baseline Current Delta
bert (feature-extraction) model_size_bytes 359 KB 359 KB +0.0%
bert (feature-extraction) num_nodes 68 68 +0.0%
falcon model_size_bytes 364 KB 364 KB +0.0%
falcon num_nodes 66 66 +0.0%
gemma2 model_size_bytes 428 KB 428 KB +0.0%
gemma2 num_nodes 105 105 +0.0%
gpt2 model_size_bytes 324 KB 324 KB +0.0%
gpt2 num_nodes 54 54 +0.0%
llama model_size_bytes 425 KB 425 KB +0.0%
llama num_nodes 60 60 +0.0%
llama (static-cache) model_size_bytes 425 KB 425 KB +0.0%
llama (static-cache) num_nodes 56 56 +0.0%
mamba (ssm-text-generation) model_size_bytes 296 KB 296 KB +0.0%
mamba (ssm-text-generation) num_nodes 94 94 +0.0%
phi3 model_size_bytes 421 KB 421 KB +0.0%
phi3 num_nodes 58 58 +0.0%
phi3 (static-cache) model_size_bytes 421 KB 421 KB +0.0%
phi3 (static-cache) num_nodes 54 54 +0.0%
qwen2 model_size_bytes 425 KB 425 KB +0.0%
qwen2 num_nodes 60 60 +0.0%
qwen2 (static-cache) model_size_bytes 425 KB 425 KB +0.0%
qwen2 (static-cache) num_nodes 56 56 +0.0%
qwen3_5_moe (hybrid-text-generation) model_size_bytes 506 KB 506 KB +0.0%
qwen3_5_moe (hybrid-text-generation) num_nodes 265 265 +0.0%
qwen3_5_text (hybrid-text-generation) model_size_bytes 458 KB 458 KB +0.0%
qwen3_5_text (hybrid-text-generation) num_nodes 127 127 +0.0%
qwen3_5_vl (hybrid-qwen-vl) model_size_bytes 977 KB 977 KB +0.0%
qwen3_5_vl (hybrid-qwen-vl) num_nodes 450 450 +0.0%
t5 (seq2seq) model_size_bytes 836 KB 836 KB +0.0%
t5 (seq2seq) num_nodes 176 176 +0.0%
whisper (speech-to-text) model_size_bytes 1008 KB 1008 KB +0.0%
whisper (speech-to-text) num_nodes 128 128 +0.0%

No performance regressions.

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing 15c0dfce5ce365

Model Sub-model Changes Status
bert (feature-extraction) model 0
falcon model 0
gemma2 model 0
gemma4 (gemma4) decoder 0
gemma4 (gemma4) embedding 0
gemma4 (gemma4) vision_encoder 0
gemma4_text model 0
gpt2 model 0
llama model 0
llama (static-cache) model 0
mamba (ssm-text-generation) model 0
phi3 model 0
phi3 (static-cache) model 0
qwen model 0
qwen (static-cache) model 0
qwen2 model 0
qwen2 (static-cache) model 0
qwen2_moe model 0
qwen2_moe (static-cache) model 0
qwen3 model 0
qwen3 (static-cache) model 0
qwen3_5_moe (hybrid-text-generation) model 0
qwen3_5_text (hybrid-text-generation) model 0
qwen3_5_vl (hybrid-qwen-vl) decoder 0
qwen3_5_vl (hybrid-qwen-vl) embedding 0
qwen3_5_vl (hybrid-qwen-vl) vision_encoder 0
qwen3_moe model 0
qwen3_moe (static-cache) model 0
qwen3_next (hybrid-text-generation) model 0
t5 (seq2seq) decoder 0
t5 (seq2seq) encoder 0
whisper (speech-to-text) decoder 0
whisper (speech-to-text) encoder 0

No architecture changes detected.


Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed)

@xiaoyu-work
xiaoyu-work force-pushed the refactor/typed-weight-pipeline branch from fabb835 to b1ea32f Compare August 27, 2026 02:41
@xiaoyu-work
xiaoyu-work force-pushed the feat/per-component-quantization-loader branch from e3efe95 to e409b2d Compare August 27, 2026 02:41
@xiaoyu-work
xiaoyu-work force-pushed the refactor/typed-weight-pipeline branch from b1ea32f to e02875f Compare August 27, 2026 21:06
@xiaoyu-work
xiaoyu-work force-pushed the feat/per-component-quantization-loader branch from e409b2d to a8a5c5b Compare August 27, 2026 21:08
@xiaoyu-work
xiaoyu-work force-pushed the refactor/typed-weight-pipeline branch from e02875f to ea9c144 Compare August 27, 2026 21:13
@xiaoyu-work
xiaoyu-work force-pushed the feat/per-component-quantization-loader branch from a8a5c5b to 7562458 Compare August 27, 2026 21:22
Comment thread src/mobius/_component_quantization.py Fixed
@xiaoyu-work
xiaoyu-work force-pushed the refactor/typed-weight-pipeline branch from ea9c144 to 15c0dfc Compare August 27, 2026 21:30
Parse authoritative component quantization plans, map component-local modules to HuggingFace names, honor exact and regex float exclusions per projection, and normalize existing packed sidecars through typed codecs. Mobius does not quantize float weights.

Signed-off-by: Xiaoyu Zhang <xiaoyuzhang@microsoft.com>
Apply Ruff formatting preserved across the manifest field rename rebase.

Signed-off-by: Xiaoyu Zhang <xiaoyuzhang@microsoft.com>
@xiaoyu-work
xiaoyu-work force-pushed the feat/per-component-quantization-loader branch from 7562458 to e5ce365 Compare August 27, 2026 21:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants