feat(weight-free): weight-free ONNX export for causalLM - #1248
Open
quic-amitraj wants to merge 1 commit into
Open
feat(weight-free): weight-free ONNX export for causalLM#1248quic-amitraj wants to merge 1 commit into
quic-amitraj wants to merge 1 commit into
Conversation
Signed-off-by: Amar <amarshar@qti.qualcomm.com> Signed-off-by: Amit Raj <amitraj@qti.qualcomm.com> Co-authored-by: Amit Raj <amitraj@qti.qualcomm.com>
quic-amitraj
force-pushed
the
quic-enable-weightfree-for-causallm
branch
from
August 7, 2026 08:16
366a956 to
ffa2688
Compare
quic-amitraj
marked this pull request as ready for review
August 7, 2026 08:16
quic-amitraj
requested review from
ochougul,
quic-hemagnih,
quic-rishinr and
vbaddi
August 7, 2026 08:30
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
Adds weight-free ONNX export for causal LM models on top of the dynamo export infrastructure.
Weight-free export builds the model on meta device (no weights in RAM), exports ONNX graph structure only, and lets the QAIC compiler load weights directly from the original safetensors checkpoint at compile time via
weight_spec.json.New files
QEfficient/exporter/weight_free/— core weight-free export, weight spec format, checkpoint prep pipeline (MoE expert stacking, dtypeconversion, .bin→safetensors auto-convert)
examples/text_generation/weight_free/— single-model smoke test, CB weight-free smoke testKey changes
modeling_qeff.py—use_weight_free_exportflag; reorderexample_inputs/dynamic_shapesbyforward()signature sotorch.exportbinds them correctly; skip
SplitTensorsTransform; embedweight_spec.jsonas ONNX metadata; symlink prepared checkpoint next to ONNXmodeling_auto.py—use_weight_free_exportwired throughexport()andcompile(); auto-enabledynamo=Trueonnx_transforms.py— disable unsupported transforms for dynamo pathexport_utils.py— separate dynamo/TorchScript subfunction setup pathstorch_patches.py—temporarily_enable/disable_nested_compile_regions()core.py— dtype suffix in prepared checkpoint dir; prune fake initializers after meta-device exportModel fixes
codegen— fixembed_positionsdevice/dtype for weight-free subfunction tracingglm4_moe—logits.float()to fix runtime buffer mismatch; rotary cos/sin device sync;_rotary_dimattribute; MoE expert placeholderdtype
granitemoe,mixtral,phi3,qwen3_moe— rotary cos/sin device/dtype sync for meta-device tracing; MoE expert placeholder dtypecontinuous_batching.py— fixuse_dynamo=True→dynamo=TrueTests
pip install -e .[test] pytest tests/weight_free/ -m "not on_qaic" -n auto -v