Mistral-7B-Instruct-v0.3 recipe for QAIRT - #577
Conversation
|
ssandhya-qti please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
There was a problem hiding this comment.
Pull request overview
Adds a new QAIRT recipe package for optimizing and exporting mistralai/Mistral-7B-Instruct-v0.3 for the OGA→Genie workflow, including supporting utilities, model-adaptation helpers, and target-specific Olive configurations.
Changes:
- Introduces a full QAIRT workflow directory (docs + pinned dependencies) and Olive configs for SC8380XP/SC8480XP HTP targets.
- Adds/ports a GenAI helper library for LLM preparation (static-shape helpers, KV-cache utilities, evaluation, test-vector capture).
- Adds mixed-precision exception configuration and utilities to apply overrides during quantization.
Reviewed changes
Copilot reviewed 31 out of 31 changed files in this pull request and generated 18 comments.
Show a summary per file
| File | Description |
|---|---|
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/utilities/README.md | Documents shared utilities folder purpose. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/utilities/nsptargets.py | Adds platform/SoC target enums for selecting DSP arch / SoC IDs. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/utilities/model_utils.py | Adds helper to clone a model while sharing parameter objects. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/utilities/get_on_target_peak_ram.sh | Adds on-target peak memory sampling script. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/utilities/enc-validate/encoding_validation.md | Adds documentation for an encoding validation tool and rules. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/requirements.txt | Pins Python dependencies for the recipe environment. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/README.md | Provides end-to-end usage instructions and validated setups. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/llm_utils/wikitext_dataloader.py | Adds WikiText dataset preprocessing/dataloaders for evaluation/calibration. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/llm_utils/mixed_precision_overrides.py | Adds logic to apply mixed-precision exceptions to quantsim quantizers. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/llm_utils/generic_dataloader.py | Adds generic JSON dataset preprocessing/dataloader helper. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/htp_sc8480xp.json | Olive config for SC8480XP HTP build/export. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/htp_sc8380xp.json | Olive config for SC8380XP HTP build/export. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/genai_lib/llm/utils.py | Adds core tensor utilities and model I/O name helpers. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/genai_lib/llm/test_vectors.py | Adds utilities for capturing layer outputs and serializing test vectors. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/genai_lib/llm/static_graph_utils.py | Adds slicing/padding utilities for static-shape inference inputs. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/genai_lib/llm/model_preparation_utils.py | Adds helper to construct converter/preparer input-layout args. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/genai_lib/llm/long_context_utils.py | Adds long-context scoring/compression and eviction utilities. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/genai_lib/llm/evaluation_utils.py | Adds perplexity evaluation helpers. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/genai_lib/llm/dev/model_adaptation/phi/utils.py | Adds Phi-specific causal mask / RoPE helpers for adaptation. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/genai_lib/llm/dev/model_adaptation/phi/adaptation.py | Adds Phi3 adaptation code for HTP execution and cache handling. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/genai_lib/llm/dev/model_adaptation/mistral/utils.py | Adds Mistral-specific causal mask / RoPE helpers for adaptation. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/genai_lib/llm/dev/model_adaptation/mistral/adaptation.py | Adds Mistral adaptation code for HTP execution and cache handling. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/genai_lib/llm/dev/model_adaptation/llama/utils.py | Adds LLaMA-specific causal mask / RoPE helpers for adaptation. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/genai_lib/llm/dev/model_adaptation/llama/adaptation.py | Adds LLaMA adaptation code for HTP execution and cache handling. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/genai_lib/llm/dev/model_adaptation/common/utils.py | Adds shared KV-cache update/trim helpers and compatibility mixin. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/genai_lib/common/dev/utils.py | Adds general helpers (recursive getattr/setattr, logging once, kernel reset). |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/genai_lib/common/dev/model_adaptation/linear_to_conv.py | Adds helper to replace Linear with Conv2d inplace modules. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/genai_lib/common/debug/recipe_logger.py | Adds structured logging utilities for recipe runs. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/genai_lib/common/debug/profiler.py | Adds profiling utilities for time/RAM/GPU usage. |
| mistralai-Mistral-7B-Instruct-v0.3/QAIRT/config/mixed_precision_config/exceptions.json | Provides mixed-precision exception rules for selected ops/modules. |
Suppressed comments (2)
mistralai-Mistral-7B-Instruct-v0.3/QAIRT/utilities/enc-validate/encoding_validation.md:52
- Typo in documentation: "vialate" → "violate".
The QNN encoding validation uses the net.json that is generated from qnn-onnx-converter in Notebook 2, and the AIMET encodings file from Notebook 1 as the inputs. The QNN encoding validation first identify the mismatches between QNN encodings and AIMET encodings, then it checks QNN encodings to detect the encodings that vialate the validation rules.
mistralai-Mistral-7B-Instruct-v0.3/QAIRT/utilities/enc-validate/encoding_validation.md:54
- Typo in documentation: "vialate" → "violate".
The DLC encoding validation uses the .dlc file that is generated from qairt-converter and qairt-quantizer in Notebook 2, and the qimet encodings file from Notebook 1 as the inputs. The DLC encoding validation first identify the mismatches between the DLC encodings and AIMET encodings, then it checks QNN encodings to detect the encodings that vialate the validation rules.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Company = "Qualcomm" |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
[QAIRT] Add Mistral-7B-Instruct-v0.3 recipe for OGA->Genie workflow