You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[executorch][examples] Muse Glimmer: export 8da4w checkpoints for CUDA - #26093
export_solo --torchao DIR --backend cuda --use-offgraph-kv-cache exports an 8da4w checkpoint for the CUDA batching runtime, text only. It goes through the same replace_8da4w_weights transform as MLX, which gains two optional, backend-neutral hooks for an operator with integer kernels: pack_codes rewrites each linear's codes once at replacement into the layout its packed_linear reads, and packed_embedding serves the token embedding from the canonical buffers. Without them the transform and the exported MLX graph are unchanged. The packed weights are copies held as frozen parameters, and with pack_codes the norm gains are copied too: AOTInductor clones every buffer for each compiled method, and a view would keep a memory-mapped checkpoint, with the canonical codes read to pack, resident beside the packed copies.
replace_8da4w_weights_for_cuda passes q4_zpf16_a8_linear with quantize_activations=False, so every linear, the MLP's fused gate/up projection included, gets its unquantized BF16 input and quantizes it with triton::int8_act_quant, which is bitwise the shared quantize_per_token_int8; pack_q4_zpf16_linear as pack_codes; and triton::q4_zpf16_embedding. The MLP's SiLU gating stays the model's own. export_cuda_batching applies it to an 8da4w model before swapping in the off-graph KV cache. Norm gains and runtime constants stay FP32, as on MLX. validate_torchao_export accepts CUDA, still requires the off-graph KV cache and BF16 activations, and rejects a DFlash draft or a vision encoder with an 8da4w CUDA target.
If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.
To add a label, you can comment to pytorchbot, for example @pytorchbot label "release notes: none"
meta-claBot
added
the
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
label
Dec 4, 2026
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
CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.meta-exported
2 participants
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.
Stack from ghstack (oldest at bottom):
export_solo --torchao DIR --backend cuda --use-offgraph-kv-cacheexports an 8da4w checkpoint for the CUDA batching runtime, text only. It goes through the samereplace_8da4w_weightstransform as MLX, which gains two optional, backend-neutral hooks for an operator with integer kernels:pack_codesrewrites each linear's codes once at replacement into the layout itspacked_linearreads, andpacked_embeddingserves the token embedding from the canonical buffers. Without them the transform and the exported MLX graph are unchanged. The packed weights are copies held as frozen parameters, and withpack_codesthe norm gains are copied too: AOTInductor clones every buffer for each compiled method, and a view would keep a memory-mapped checkpoint, with the canonical codes read to pack, resident beside the packed copies.replace_8da4w_weights_for_cudapassesq4_zpf16_a8_linearwithquantize_activations=False, so every linear, the MLP's fused gate/up projection included, gets its unquantized BF16 input and quantizes it withtriton::int8_act_quant, which is bitwise the sharedquantize_per_token_int8;pack_q4_zpf16_linearaspack_codes; andtriton::q4_zpf16_embedding. The MLP's SiLU gating stays the model's own.export_cuda_batchingapplies it to an 8da4w model before swapping in the off-graph KV cache. Norm gains and runtime constants stay FP32, as on MLX.validate_torchao_exportaccepts CUDA, still requires the off-graph KV cache and BF16 activations, and rejects a DFlash draft or a vision encoder with an 8da4w CUDA target.Differential Revision: D135947978