Repository navigation
Qualcomm AI Engine Direct - HF API sample script - #24830
Draft
winskuo-quic wants to merge 2 commits into
Draft
winskuo-quic wants to merge 2 commits into
winskuo-quic wants to merge 2 commits into
Conversation
This PR needs a
|
winskuo-quic
force-pushed
the
dev1/winskuo/minimal_io_alignment
branch
from
November 10, 2026 09:06
7e45489 to
6558afa
Compare
This branch has not been deployed
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
This PR is meant to be a PoC. If everyone agrees on the overall design, then we will start designing the overall file structure and make it an official PR.
Sample scripts to support the HF lowering flow. For LLM, user now only needs to pass in
cache_positionandinput_token.This lowering flow is general so image models can also be supported.
LLM model sample
python examples/qualcomm/oss_scripts/hf_llm_exporter.py --prompt "Simply put, the theory of relativity states that" --soc_model SM8750 --device $DEVICE --build_folder build-android/ --max_seq_len 128Image model sample
python examples/qualcomm/oss_scripts/hf_image_sample_exporter.py --soc_model SM8750 --device $DEVICE --build_folder build-android/ --dataset ../datasets/imagenet-mini/val/Deprecated HF Flow still works
python examples/qualcomm/oss_scripts/hf_causal_lm.py --prompt "Simply put, the theory of relativity states that" --soc_model SM8750 --device $DEVICE --build_folder build-android/ --max_seq_len 1024 --decoder_model_id "NousResearch/Llama-3.2-1B"Test plan
[PLEASE REMOVE] How did you test this PR? Please write down any manual commands you used and note down tests that you have written if applicable.