Skip to content

Add QairtPipelinePass: single-pass QAIRT LLM pipeline via YAML recipe#2465

Open
qti-kromero wants to merge 8 commits into
microsoft:mainfrom
CodeLinaro:dev/qti-kromero/qairt-pipeline-pass
Open

Add QairtPipelinePass: single-pass QAIRT LLM pipeline via YAML recipe#2465
qti-kromero wants to merge 8 commits into
microsoft:mainfrom
CodeLinaro:dev/qti-kromero/qairt-pipeline-pass

Conversation

@qti-kromero
Copy link
Copy Markdown
Contributor

@qti-kromero qti-kromero commented May 14, 2026

Describe your changes

Add QairtPipelinePass, a new Olive pass that runs QAIRT's LLMPipeline end-to-end from a YAML recipe, replacing the multi-step QairtPreparation → QairtGenAIBuilder workflow with a single configurable pass.

  • Accepts an HfModelHandler and a YAML recipe path; executes the full pipeline (model loading, quantization, compilation) and emits a QairtModelHandler.
  • The input HfModelHandler is the authoritative model source — if the recipe also specifies model_id_or_path and it conflicts with the handler's path, the pass raises a ValueError.
  • cache_dir and log_level config params allow Olive-level overrides of the corresponding recipe fields.

Files changed:

  • olive/passes/qairt/pipeline.py — new QairtPipelinePass implementation
  • olive/olive_config.json — registers the pass for QNNExecutionProvider/NPU
  • test/passes/qairt/test_pipeline_pass.py — unit tests covering success, model-id conflict, override params, missing recipe, invalid input model, and import error cases

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.

Release Note:

  • Add QairtPipeline pass for preparation of GenAI models for QCOM devices

QairtEncapsulation needs config.json and generation_config.json to generate
genai_config.json. Copy them from the source HF model if not already present.
@qti-kromero qti-kromero changed the title Dev/qti kromero/qairt pipeline pass Add QairtPipelinePass: single-pass QAIRT LLM pipeline via YAML recipe May 14, 2026
Comment thread olive/passes/qairt/pipeline.py Fixed
Comment thread test/passes/qairt/test_pipeline_pass.py Fixed
Use snapshot_download(local_files_only=True) to resolve the local HF cache
path before copying config.json and generation_config.json. Fixes the case
where model.model_path is a HuggingFace repo ID rather than a local directory.
The pipeline export writes chat_template.jinja and tokenizer_config.json
into a chat_template/ subdirectory, but QairtEncapsulation expects them
as flat files in the model root. Mirror the existing config.json and
generation_config.json copy step so encapsulation can resolve both
files without changes on the consumer side.
… fixture clarity

- Fix log_level description to match QairtLogLevel enum (WARNING/TRACE, not WARN)
- Add logger.warning() to bare except in HF cache resolution block
- Add comment to validate_config noting sub-module limitation
- Simplify recipe fixtures to empty files with clarifying comments
- Remove unused yaml import from test file
@qti-kromero qti-kromero marked this pull request as ready for review May 19, 2026 21:15
Copilot AI review requested due to automatic review settings May 19, 2026 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants