Add --gguf_file support for exporting GGUF models to ExecuTorch#223
Merged
larryliu0820 merged 1 commit intohuggingface:mainfrom Mar 19, 2026
Merged
Conversation
larryliu0820
approved these changes
Mar 18, 2026
20bfe21 to
9c5c771
Compare
Many popular quantized models on Hugging Face Hub are distributed only as GGUF files. This adds a --gguf_file CLI argument that lets users export GGUF models to .pte directly, without manually converting to HF format first. The GGUF file is dequantized to float by Transformers' existing loader, then re-quantized via torchao for the target backend. Warns users that GGUF dequantization loads weights as float32, which increases peak memory, and suggests --dtype float16 to mitigate. Also bumps nightly dependency pins in install_dev.py — the previous executorch==1.1.0.dev20260104 version doesn't exist on PyPI.
9c5c771 to
6260447
Compare
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.
This adds a --gguf_file CLI argument that lets users export GGUF models to .pte directly, without manually converting to HF format first. The GGUF file is dequantized to float by Transformers' existing loader, then re-quantized via torchao for the target backend.
Test
optimum-cli export executorch -m TheBloke/TinyLlama-1.1B-Chat-v1.0-GGUF --gguf_file tinyllama-1.1b-chat-v1.0.Q4_K_M.gguf --task text-generation --recipe xnnpack -o /tmp/gguf_test/