Skip to content

Qualcomm AI Engine Direct - [GenAI Pipeline] PR3: Pipeline Orchestrator#21149

Open
qti-horodnic wants to merge 1 commit into
pytorch:mainfrom
CodeLinaro:pr1c
Open

Qualcomm AI Engine Direct - [GenAI Pipeline] PR3: Pipeline Orchestrator#21149
qti-horodnic wants to merge 1 commit into
pytorch:mainfrom
CodeLinaro:pr1c

Conversation

@qti-horodnic

@qti-horodnic qti-horodnic commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Summary

This PR adds the pipeline orchestrator (GenAIPipeline) that wires together all the components from PRs 1 and 2. It assembles stages from EngineProxy, builds InputConfig objects from OutputConfig results, executes stages sequentially with timing, and returns InferenceOutputConfig. No existing files are modified.

What's included

Pipeline orchestrator:

  • GenAIPipeline: main orchestrator class with:

    • _STRATEGY_REGISTRY: maps (stage_name, engine_type)(StageClass, StrategyClass) for extensibility
    • from_proxy(): factory method that resolves stages from EngineProxy
    • invoke(): executes model_preparation → quantization → compilation → inference
    • Private _run_* methods: each builds an InputConfig, calls the stage, returns the OutputConfig
    • Structured logging with [GenAIPipeline] StageName started/completed in X.Xs format per LLD Section 5.2
  • executorch_model_preparation_strategy.py: ExecuTorch model preparation strategy stub (implementation in a subsequent PR)

Unit tests (13 tests):

  • from_proxy(): creates all stages, skip stages, default engines
  • from_proxy() error paths: unsupported engine for each stage
  • invoke(): full pipeline with mock strategies, compile-only, no stages
  • Data wiring: quantization receives soc_model, compilation receives backend_type, inference receives prompt

PR Review Checklist

  • All new classes follow single responsibility (one class per file) - Yes.
  • All dependencies are injected via constructor with sensible defaults - Yes.
  • All external calls are behind injectable interfaces - Yes (via strategy pattern).
  • Unit tests cover every public method - Yes.
  • No existing files are modified (Phase 1 constraint) - Yes (only __init__.py updated to add GenAIPipeline export).
  • Docstrings on all public classes and methods - Yes.
  • Type annotations on all function signatures - Yes.
  • Logging follows the strategy in the LLD - Yes ([GenAIPipeline] prefix, timing).

Related PRs

Test plan

python -m pytest \
  backends/qualcomm/genai_pipeline/tests/test_genai_pipeline.py \
  -v

All 13 unit-tests passed.

Test Coverage

Command to run:

coverage run --rcfile=backends/qualcomm/.coveragerc \
  -m pytest \
    backends/qualcomm/genai_pipeline/tests/test_genai_pipeline.py \
  -v

coverage report --rcfile=backends/qualcomm/.coveragerc \
  --include="backends/qualcomm/genai_pipeline/genai_pipeline.py"

Result:

Name                                                 Stmts   Miss Branch BrPart  Cover   Missing
------------------------------------------------------------------------------------------------
backends/qualcomm/genai_pipeline/genai_pipeline.py      98      7     12      1    93%   184-195
------------------------------------------------------------------------------------------------
TOTAL                                                   98      7     12      1    93%

@pytorch-bot

pytorch-bot Bot commented Jul 22, 2026

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/21149

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

⚠️ 12 Awaiting Approval

As of commit e3bdc68 with merge base 53551c1 (image):

AWAITING APPROVAL - The following workflows need approval before CI can run:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 22, 2026
@qti-horodnic

Copy link
Copy Markdown
Contributor Author

@pytorchbot label "release notes: qualcomm"

@pytorch-bot pytorch-bot Bot added the release notes: qualcomm Changes to the Qualcomm backend delegate label Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. release notes: qualcomm Changes to the Qualcomm backend delegate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant