transformers
Integrate finegrained kernels: SOTA performance and per-module quantization
#49658
Open

Integrate finegrained kernels: SOTA performance and per-module quantization #49658

IlyasMoutawwakil wants to merge 210 commits into main from finegrained-quantizer-redesign
IlyasMoutawwakil
IlyasMoutawwakil finegrained kernels
64708a24
IlyasMoutawwakil deepgemm and tp/ep fixes
7b21bdb7
IlyasMoutawwakil finegrained: adopt the interleaved gate|up layout
05bd0f35
IlyasMoutawwakil finegrained: keep DeepGEMM Mega MoE on the stacked gate|up layout
686238ed
IlyasMoutawwakil fix
641fcb2c
IlyasMoutawwakil Merge remote-tracking branch 'origin/main' into finegrained-unified
e6b20c4a
IlyasMoutawwakil finegrained: build the per-call kernel objects instead of caching them
cb04cbe0
IlyasMoutawwakil finegrained: fuse both MoE biases into the GEMMs
e1c7a921
IlyasMoutawwakil Merge origin/main into finegrained-unified
0a1b49b7
IlyasMoutawwakil Merge remote-tracking branch 'origin/main' into finegrained-unified
90413201
IlyasMoutawwakil finegrained: expert layouts as conversion ops; experts forwards on th…
eac0ee87
IlyasMoutawwakil style
1d94e557
IlyasMoutawwakil finegrained: on-the-fly quantization for every format; loader keeps c…
fb16472d
IlyasMoutawwakil finegrained: pass input_recipe to the dispatchers, drop the Quantizat…
07dae500
IlyasMoutawwakil Revert "finegrained: pass input_recipe to the dispatchers, drop the Q…
0b6ca4c9
IlyasMoutawwakil finegrained: pass activation_format straight through; let deep-gemm s…
513e2314
IlyasMoutawwakil hub_kernels: finegrained-kernels ships as version 0
240abc9b
IlyasMoutawwakil hub_kernels: load finegrained-kernels from the kernels-staging build …
30ab2c21
IlyasMoutawwakil finegrained: consume modelopt's calibrated globals, and fuse a model'…
a562fb8c
IlyasMoutawwakil finegrained: address the integration review
89267bf3
IlyasMoutawwakil finegrained: freeze the mxfp4 and nvfp4 integrations, and serve what …
09ea21c0
IlyasMoutawwakil Merge branch 'main' into finegrained-unified
d59f9037
IlyasMoutawwakil fix style
e139d2a0
IlyasMoutawwakil FineGrainedFP8Config is its own class again, not an alias of the new one
c6656441
IlyasMoutawwakil FineGrainedFP8Config: drop the frozen-notice docstring line
29cca042
IlyasMoutawwakil Tolerate an experts module without the norm, and a machine without CUDA
f63ad97d
IlyasMoutawwakil Pin that every modelopt converter target is a slot the module holds
1265f0cc
IlyasMoutawwakil is_sm100: answer False without CUDA, and fake both halves in the tests
97dfa106
IlyasMoutawwakil fix
788d02dd
IlyasMoutawwakil finegrained: drop the DTensor unwrap, and pass the kernel operands by…
53a8970a
IlyasMoutawwakil deepgemm: only Mega MoE cannot apply a post-expert norm
e8e6b879
IlyasMoutawwakil Shard quantized expert companions under EP and TP
43b9a748
IlyasMoutawwakil fixes for the new model
fe0b7182
IlyasMoutawwakil fix multimodal and add some testing
22b1001c
IlyasMoutawwakil static
f9302cc2
IlyasMoutawwakil Load a calibrated checkpoint's input_scale, and fix what per-tensor w…
daa24205
IlyasMoutawwakil fix
b4dcb7b0
IlyasMoutawwakil Finish the finegrained integration: reload, TP sharding, dsv4 norms
f7081ecf
IlyasMoutawwakil Fix a destructive Qwen3 TP-plan override; split out the conversions
9ddb2140
IlyasMoutawwakil Collapse the conversion-op boilerplate; shorten the longest units
e83eadf5
IlyasMoutawwakil Key on capability not name; drop the last op boilerplate
60f904e6
IlyasMoutawwakil Quantize per module group; split the arms by producer, not by format
4cb5d9cb
IlyasMoutawwakil Carry the quantized-load fixes onto the per-scheme arms, and the same…
a67e7acf
IlyasMoutawwakil Address the per-scheme review
9fc683de
IlyasMoutawwakil trim
95b3e44f
IlyasMoutawwakil fixes
2392e6a6
IlyasMoutawwakil last
f7a8e543
IlyasMoutawwakil Cover the groups feature, and export what it asks callers to build
4cbbe7ff
IlyasMoutawwakil Point everything at the fine-grained integration; deprecate the froze…
f6878604
IlyasMoutawwakil Bring two comment blocks under the noisy-comment limits
fab7f741
IlyasMoutawwakil Bring two comment blocks under the noisy-comment limits
21c0a070
IlyasMoutawwakil Do not let the tied-head plan raise in post_init
12f5aa8e
IlyasMoutawwakil Do not let the tied-head plan raise in post_init
7abcedf9
IlyasMoutawwakil Address the second review round
db85a446
IlyasMoutawwakil Merge finegrained-replace-frozen-fp8 into finegrained-per-scheme-demo
d5c361cf
IlyasMoutawwakil Carry the review's comment and lint fixes to the sites it did not name
9f7326c6
IlyasMoutawwakil Make tests/kernels a package so the moved fp8 test can import its fix…
f1b593dc
IlyasMoutawwakil Declare GLM-4v-MoE's head plan instead of deriving it in the mixin
0067189d
IlyasMoutawwakil cleanup guards and post expert norm in deepgemm
bb24085b
IlyasMoutawwakil not now
39eb1d19
IlyasMoutawwakil minimal peft integration preparation
bf0e7ec4
IlyasMoutawwakil addressing review comments
5b2b7f00
IlyasMoutawwakil Tiny checkpoints for every shipped layout, and the save/load fixes th…
f3c7cc8d
IlyasMoutawwakil Keep pre-quantized scale dtypes through the dtype plan
6a7c92e3
IlyasMoutawwakil Update src/transformers/distributed/sharding_utils.py
2d1f0bc7
IlyasMoutawwakil Update src/transformers/distributed/sharding_utils.py
f37d1d46
IlyasMoutawwakil adapters
5ea2a3ea
IlyasMoutawwakil Fine-grained layout ops: follow the experts module each tensor fills
c766206b
IlyasMoutawwakil Revert "adapters"
7d44b81e
IlyasMoutawwakil trimming
eb9c09fe
IlyasMoutawwakil Fine-grained NVFP4: exact per-expert gate_up activation globals
77f135cd
IlyasMoutawwakil Fine-grained quantization: one quantizer per format, and FineGrainedC…
8dc70c4d
IlyasMoutawwakil Block-scaled quantization: config review fixes, scoped checkpoint ren…
0b3eba2f
IlyasMoutawwakil Merge remote-tracking branch 'origin/main' into finegrained-per-schem…
6ccaac76
IlyasMoutawwakil Block-scaled quantization: name per-tensor scales `replicate` in the …
d89e0c4b
IlyasMoutawwakil Borrow the expert-parallel dispatch wait for raw-pointer kernels
ae746d55
IlyasMoutawwakil Merge origin/main into finegrained-quantizer-redesign
504d2c38
IlyasMoutawwakil Merge main into finegrained-quantizer-redesign
6c162bca
IlyasMoutawwakil Add Muse Spark NVFP4 checkpoint test
e8886aba
IlyasMoutawwakil Apply repository consistency fixes
30b036fd
IlyasMoutawwakil Merge main and simplify fine-grained quantizers
79af6725
IlyasMoutawwakil IlyasMoutawwakil changed the title Finegrained-Kernels + Finegrained-Quantizer: SOTA perf and extreme flexibility Unify block-scaled quantization and support mixed-format checkpoints 4 days ago
IlyasMoutawwakil Limit kernel correctness tests to one autotuning trial
7a7e5fd2
IlyasMoutawwakil IlyasMoutawwakil changed the title Unify block-scaled quantization and support mixed-format checkpoints Integrate finegrained kernels: SOTA performance and per-module quantization 4 days ago
HuggingFaceDocBuilderDev
IlyasMoutawwakil Clarify autotuning trial budget and remaining refinement
9dba82da
IlyasMoutawwakil Restore fused dense scale containers and align MiniMax dtype expectat…
363e4198
IlyasMoutawwakil Use temporary masked EP and test compiled static-cache decoding
5b2cb429
IlyasMoutawwakil Apply minimal tuning to standalone generation tests and fix style
5d234d3d
IlyasMoutawwakil Reuse tuning context in distributed quantization tests
040d4a9c
IlyasMoutawwakil Simplify finegrained conversions and separate distributed test coverage
aea13cac
IlyasMoutawwakil Merge main and drop unrelated GLM4V-MoE tensor parallel changes
6ccd9832
IlyasMoutawwakil Remove scale container conversions and only quantize weights
e1f3eae4
IlyasMoutawwakil Fix finegrained loading regressions and map ModelOpt mixed precision
6624d7ad
IlyasMoutawwakil Reject conflicting producer quantization group targets
903b70c8
IlyasMoutawwakil Preserve ModelOpt native exclusions and trailing-dot module prefixes
3af3c2b9
IlyasMoutawwakil Refresh Muse NVFP4 fixture expectations and verify normalized FP8 scales
63e39561
IlyasMoutawwakil Keep format rules in their quantizers and load packed NVFP4 embeddings
0a193c0b
IlyasMoutawwakil Dispatch quantized embedding lookups through the required kernel API
4622833f
IlyasMoutawwakil Reject unsupported quantized embedding vocabulary sharding
abe8b7c2
IlyasMoutawwakil Disable extra autotuning phases explicitly in correctness tests
4272b401
IlyasMoutawwakil Use finegrained refinement iteration limit in tests
3606b29c
IlyasMoutawwakil Route rowwise FP8 through finegrained and migrate Llama4 experts
319658d7
IlyasMoutawwakil Fix finegrained CI docstrings, TP fixtures, and MuseSpark expert plans
1d744428
IlyasMoutawwakil Merge origin/main into finegrained-quantizer-redesign
f9048ed8
IlyasMoutawwakil Fix the fine-grained review's bugs
86e5eaf3
IlyasMoutawwakil Rename BlockFp8Config to Fp8Config
f16b3256
IlyasMoutawwakil Drop rowwise FP8, the FBGEMM routing and the Llama4 experts migration…
f66c1bea
IlyasMoutawwakil Fuse MuseSpark's post-expert norm
0f1d4057
IlyasMoutawwakil Keep each format's producer layouts in one table
edcb6f57
IlyasMoutawwakil Pass a format its experts' up projections instead of setting them on it
05d449ad
IlyasMoutawwakil Build the dequantize chains directly
385944ed
IlyasMoutawwakil Hold what each format fixes as its config's class attributes
9d043497
IlyasMoutawwakil Name a model's modules back in the checkpoint's namespace in one place
f54f0f54
IlyasMoutawwakil Split the quantizer's parallel plan update into named steps
f4f4fc04
IlyasMoutawwakil Make prefers_deepgemm_linear the single gate of the DeepGEMM linear
d37b720a
IlyasMoutawwakil Declare each experts backend's layout once and check it on switch
55415b4b
IlyasMoutawwakil Resolve the MoE operands' static half once and name a projection's te…
a805c4d0
IlyasMoutawwakil Share the formats' storage facts and the slot names between modules a…
d42d3a7a
IlyasMoutawwakil Stop requiring finegrained-kernels symbols nothing calls
76d1482c
IlyasMoutawwakil Read the shared gate_up activation global's scope from the quantizati…
8a146662
IlyasMoutawwakil Make the shared NVFP4 gate_up activation global an `NVFP4Config` option
9ab9a644
IlyasMoutawwakil Keep only the per-tensor FP8 embedding tables finegrained-fp8 supported
22b7ec74
IlyasMoutawwakil Read other tools' checkpoints through a registry of config readers
ada7743d
IlyasMoutawwakil Pass the model to `get_weight_conversions`
b118cc5e
IlyasMoutawwakil Keep a capturing group's escapes when reversing a conversion pattern
0fb81a0b
IlyasMoutawwakil Let a model's config adapt the quantization config its checkpoints de…
fe3418f9
IlyasMoutawwakil Name DeepSeek-V4's block scales through its producer layout, not a mo…
efa0c159
IlyasMoutawwakil Resolve a checkpoint's skip-list in the model's names in core, and ma…
38c8be5e
IlyasMoutawwakil Let related quantization config classes lend each other their loading…
4152cf26
IlyasMoutawwakil Let core save a dequantized load through the model's own conversions
9ae01bdb
IlyasMoutawwakil Read experts layout flags from the instance or class in use_experts_i…
e75f48a5
IlyasMoutawwakil Declare each experts implementation's requirements in the ExpertsInte…
43a26a13
IlyasMoutawwakil Declare a module's local-tensor TP forward with a public tp_uses_loca…
f79fdfa5
IlyasMoutawwakil Make the intra-expert TP styles and 0-dim replication generic in dist…
9d7cd1b5
IlyasMoutawwakil Match a skip-list's layer index whole, and keep its other matches as …
08ce100a
IlyasMoutawwakil Make the block-scaled tests that could not fail able to fail
b86ce0ae
IlyasMoutawwakil Declare the experts weight layouts on the fine-grained interface
a38525fa
IlyasMoutawwakil Drop tests/kernels/conftest.py
00a9a377
IlyasMoutawwakil Drop block-scaled tests that duplicate others or only pin internals
e84c6e10
IlyasMoutawwakil Make patch_finegrained_kernel a context manager
47fa055d
IlyasMoutawwakil Table-drive the repeated block-scaled test patterns
864a2173
IlyasMoutawwakil Make the fine-grained page the hub of the block-scaled format docs
c9c1885b
IlyasMoutawwakil Remove dead branches and leftovers in the fine-grained quantizers
7b00974d
IlyasMoutawwakil Say why update_weight_conversions keeps for_save
36057ef5
IlyasMoutawwakil Trim the fine-grained integration's comments and docstrings
836fd56b
IlyasMoutawwakil Trim the fine-grained quantizers' comments and docstrings
af98b63a
IlyasMoutawwakil Shrink the DeepGEMM and hub-kernel diffs against main
f29c0286
IlyasMoutawwakil Simplify the FP8 table placement exclusion and the plan resolution check
5b791ba7
IlyasMoutawwakil Cut the slow block-scaled runs: four mixed-scheme pairs, fewer checkp…
30da1693
IlyasMoutawwakil Run the FP8 Hub tests without a gated checkpoint
601a0abd
IlyasMoutawwakil Keep main's activation_scale argument on deepgemm_fp8_fp4_linear
22163f1c
IlyasMoutawwakil Merge branch 'fg-cleanup-tests' into finegrained-quantizer-redesign
f6e7141a
IlyasMoutawwakil Drop weight-only FP8, which no kernel serves
b0ac2e71
IlyasMoutawwakil Point the MiniMax-M3-VL docs at the public checkpoint and drop the ol…
9ed300bc
IlyasMoutawwakil Merge origin/main into finegrained-quantizer-redesign (split target)
1590677a
IlyasMoutawwakil Use FINEGRAINED_AUTOTUNE_CONFIG=fast for cheap kernel tuning
558204f3
IlyasMoutawwakil Test the fine-grained machinery against test-only formats
8cfa85ef
IlyasMoutawwakil Match a skip-list entry from the start only up to a module boundary
9d753a45
IlyasMoutawwakil Add new tests at the end of their existing test classes
23868896
IlyasMoutawwakil [fix-skip-list-index] Shorten the should_convert_module docstring
1e529c91
IlyasMoutawwakil [fix-reverse-escaping] Place the escaping comment next to the unescap…
9e87bcf9
IlyasMoutawwakil [1-weight-loading] Test the loader fixes and let WeightConverter.copy…
8a3817ea
IlyasMoutawwakil [2-quantizer-api] Give the legacy FP8 quantizer the checkpoint renami…
8f7a8243
IlyasMoutawwakil [2-quantizer-api] Drop the reader registration and always adapt a con…
14ed3b26
IlyasMoutawwakil [3-experts-tp] Drop the legacy FP8 copies of the plan rewrites and te…
97a93dfa
IlyasMoutawwakil [4-machinery] Follow the private _apply_experts_parallel_styles
d583819b
IlyasMoutawwakil [4-machinery] Quantize nothing on the fly below the required compute …
eadd1a30
IlyasMoutawwakil [4-machinery] Check the DeepGEMM experts calls in plain code and test…
59a85854
IlyasMoutawwakil [4-machinery] Spell out the expert operands and keep internal helpers…
9d008014
IlyasMoutawwakil [8-mxfp8] Patch the finish helpers where the quantizer imports them
716fa601
IlyasMoutawwakil [5-fp8] Keep KV-cache checkpoints on compressed-tensors and warn abou…
d7cd4215
IlyasMoutawwakil [5-fp8] Keep the legacy FP8 tests while the legacy path ships
22b00b73
IlyasMoutawwakil [8-mxfp8] Shorten the compressed-tensors note and say KV-cache checkp…
9019ac6f
IlyasMoutawwakil [4-machinery] Let a single-format quantizer own every module it built
eb5311fe
IlyasMoutawwakil [5-fp8] Quantize embedding tables in one place with a per-tensor FP8 …
180f2a3b
IlyasMoutawwakil [4-machinery] Align the overview table row
583adb9b
IlyasMoutawwakil [6-mxfp4] Align the overview table row
ef3701df
IlyasMoutawwakil [7-nvfp4] Align the overview table row
f9515ce8
IlyasMoutawwakil [8-mxfp8] Align the overview table row
c0740875
IlyasMoutawwakil [4-machinery] Dequantize a quantized checkpoint when the kernels pack…
f823cb96
IlyasMoutawwakil [4-machinery] Apply one fallback rule when quantized compute is not p…
d99f5b9f
IlyasMoutawwakil [6-mxfp4] Restore main's MXFP4 behaviours and the tests that covered …
49b8c458
IlyasMoutawwakil [6-mxfp4] Build DeepSeek-V4's plan in its config and fix the docs tha…
bf094703
IlyasMoutawwakil [4-machinery] Add the per-format activation-format check and drop the…
a860ae9a
IlyasMoutawwakil [6-mxfp4] Test that Mxfp4Config takes main's positional arguments
a47b68da
IlyasMoutawwakil [7-nvfp4] Drop the shared gate_up activation global and take the skip…
419d2d38
IlyasMoutawwakil [7-nvfp4] Delete the frozen NVFP4 integration
f5f07f9c
IlyasMoutawwakil [7-nvfp4] Test MuseSpark's TP plan with the common expert-sharding test
c9ec382f
IlyasMoutawwakil [7-nvfp4] Show NVFP4 on-the-fly quantization and tidy the NVFP4 names…
ed00a9bf
IlyasMoutawwakil [8-mxfp8] Point the MiniMax-M3-VL speed example at the bf16 repo
7839921c
IlyasMoutawwakil [8-mxfp8] Build the MiniMax-M3-VL parallel fixture from its model tester
796da64f
IlyasMoutawwakil [1-weight-loading] Write the comments and docstrings in short plain s…
478865c2
IlyasMoutawwakil [2-quantizer-api] Write the comments and docstrings in short plain se…
f3ac21dd
IlyasMoutawwakil [3-experts-tp] Write the comments and docstrings in short plain sente…
191cfa07
IlyasMoutawwakil [4-machinery] Write the comments and docstrings in short plain sentences
dc931650
IlyasMoutawwakil [5-fp8] Write the comments and docstrings in short plain sentences
44ef6070
IlyasMoutawwakil [6-mxfp4] Write the comments and docstrings in short plain sentences
08d81e75
IlyasMoutawwakil [7-nvfp4] Write the comments and docstrings in short plain sentences
72c202d8
IlyasMoutawwakil [8-mxfp8] Write the comments and docstrings in short plain sentences
79a51891
IlyasMoutawwakil Sync with the stack: one 8.9 minimum, main's config merge, no W8A4
ddaa2023
IlyasMoutawwakil Pin MiniMax-M3-VL's routing in the parallel fixture and restore its d…
8bb91a5c
IlyasMoutawwakil Quantize partial blocks in the legacy FP8 integration
2d1dcbfc
IlyasMoutawwakil Transpose a dequantized expert stack back for a transposed module
128e6ec8
IlyasMoutawwakil Keep expert scale grids row-major when the kernels cannot read them s…
6bbad813
IlyasMoutawwakil Re-record the DeepSeek-V3 FP8 logits slice for the fixed block-FP8 ke…
650b5399
IlyasMoutawwakil Give the DeepGEMM refusal test's experts two K bands so MX scales swi…
0f695533
IlyasMoutawwakil Move the skip-list test to a general quantizer utils file
8b2f5392
IlyasMoutawwakil Sync with the fg-split stack: fold in the review fixes and drop the M…
2cdb10c1
IlyasMoutawwakil Split the reverse key renaming into explicit converter and renaming s…
fd8d7fd2
IlyasMoutawwakil Explain why each piece of the fine-grained stack exists
e7ff882c
IlyasMoutawwakil Keep main's Mega MoE plan rewrite and drop the experts requirements API
f19e8e76
IlyasMoutawwakil Sync with the stack: the experts layout follows the GPU
8ab6e03f
github-actions

Login to write a write a comment.

Login via GitHub

Reviewers
No reviews
Assignees
No one assigned
Labels
Milestone