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
Commit 11cd1b8
Browse filesBrowse the repository at this point in the historyBrowse files
Serialize GGUF weights as packed constants (pytorch#22856)
Summary:
Keep GGUF-quantized weights in their packed block form through lowering and
serialization, instead of materializing a dequantized float weight inside the
delegate.
- The partitioner claims torchao::dequantize_gguf (importing
executorch.extension.llm.export.gguf to register it), so a GGUF weight
dequantize stays inside the delegate rather than forcing a partition boundary.
- graph_serialize._fold_gguf_dequant folds the dequantize at write time, the way
XNNPACK folds a weight dequantize. Graph topology is not rewritten; instead
each dequantize_gguf node is tagged to skip serialization, its packed weight
placeholder is tagged with the logical shape and codec, and references to the
dequantize output are redirected to the packed weight. The consuming
linear/embedding is therefore emitted directly over the packed constant.
- The packed constant serializes as TensorMeta(dtype=BYTE, sizes=<logical
shape>, quant=QuantSpec(scheme=PackedQuant(codec="gguf:<qtype>"))). The raw
GGUF block bytes ship as-is, and the runtime dequantizes inside the
matmul/gather.
Reviewed By: digantdesai
Differential Revision: D111753294
Pull Request resolved: pytorch#22856
0 commit comments