fix(qualcomm): harden compile_npu.py with CLI options and container format pre-flight checks (Fixes #121) - #314
Open
jhaabhijeet864 wants to merge 1 commit into
Conversation
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
Resolves #121 by replacing hardcoded machine paths in
compile_npu.pywith standard CLI arguments, environment variable detection, and adding container format pre-flight inspection.Key Changes
argparseflags (--model_path,--output_dir,--soc_model,--qairt_root) and fallback to$QAIRT_ROOT.SM8750/ Snapdragon 8 Elite,SM8650/ 8 Gen 3,SM8550/ 8 Gen 2, etc.).check_model_magic_bytes): informs users when a.litertlmcontainer (RTLM) is passed intoaot_compile(which requires flat.tfliteTFL3graphs) with actionable guidance, preventing low-level C++ FlatBuffer crashes.NPU_COMPILATION_GUIDE.mdacrossllm_chatbot_npuandgemma3/nputo document the new CLI parameters.Verification
compile_npu.py --helpCLI parameter parsing.RTLMandTFL3models.Fixes #121