Qualcomm AI Engine Direct - [GenAI Pipeline] PR2: Strategy Interfaces & Stage Wrappers#20795
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/20795
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ✅ You can merge normally! (1 Unrelated Failure)As of commit b666b79 with merge base 477d278 ( BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "release notes: qualcomm" |
… & Stage Wrappers
|
Great to see a clean framework. Is the plan for this new pipeline to eventually replace / wrap / coexist with the existing oss_scripts/llama stack (which already has QuantizationStrategy, ModelInference, etc.)? Also, the genai_pipeline tests don't seem to be wired into CI (not in pytest.ini or the QNN test jobs). is that intentional for now, or should they be added so the suite actually runs? |
|
self-contained skeleton with zero consumers atm, lgtm |
Yes, that's the plan: Phase 1 (PRs 1-7, what's listed in the decription): The framework skeleton coexists alongside the existing oss_scripts/llama stack, no modifications to existing code. Phase 2 (3 PRs, ready locally): The framework wraps the existing code. The existing Phase 3: Once the framework is validated to produce identical outputs, the old llama.py becomes a thin wrapper (or is deprecated), and new models are onboarded exclusively via the pipeline. Regarding the CI integration, that's intentional for now. The tests require only The plan is to add a dedicated CI job for |
|
Hey @psiddh, can we merge this pr if I've answered all your questions above? I'd like to raise the next PR in the series |
Summary
This PR adds the strategy interfaces, and stage wrappers for the GenAI pipeline. This is the second of 7 PRs establishing the framework skeleton. It builds on PR1 (data model + engine routing) and introduces the Strategy pattern ABCs, concrete stage delegation wrappers and Executorch strategy stubs. No existing files are modified (except
__init__.pyintroduced in PR1 for imports).What's included
Strategy ABCs (one class per file):
ModelPreparationStrategy— instrategies/model_preparation/QuantizationStrategy— instrategies/quantization/CompilationStrategy— instrategies/compilation/InferenceStrategy— instrategies/inference/Each ABC defines
invoke(context, input_config) -> output_config.Strategy stubs (raise
NotImplementedError):ExecuTorchModelPreparationStrategyExecuTorchQuantizationStrategyExecuTorchCompilationStrategyExecuTorchInferenceStrategyStage wrappers:
ModelPreparationStage,QuantizationStage,CompilationStage,InferenceStage.invoke().nameproperty returns stage constant frompipeline_types.py.Pipeline stage ABC:
PipelineStage— abstract base withnameproperty andinvoke()method.Unit tests (16 tests across 6 test files):
invoke()).NotImplementedErrorraised).assert_called_once_with).PR Review Checklist
__init__.pyupdated to addPipelineStageexport).Related PRs
Test plan
All 16 unit-tests passed.
Test Coverage
Command to run:
Result: