Preserve complete CompositeModel packages after component builds - #2680
Xiaoyu Z (xiaoyu-work) wants to merge 9 commits into
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Unresolved critical issues affect external-data preservation, overlapping input/output safety, and unrelated output retention; a moderate directory-copy issue also remains.
Get a fresh assessment by requesting another Copilot review.
Review effort: Lite
Findings: 3
Open (3)
What changed in this PR
Adds assembly of directory-based ONNX CompositeModel builds into complete output packages while preserving untouched components and runtime files.
Changes:
- Adds component workflow tracking and package assembly.
- Separates workflow and build output directories.
- Adds tests and documentation for multi-build behavior.
- Unresolved findings remain around external-data preservation, overlapping paths, output merging, and directory copying.
| File | Description |
|---|---|
test/workflows/test_run_config_builds.py |
Tests build parsing and output semantics. |
test/workflows/test_run_builds.py |
Tests workflow integration. |
test/workflows/test_composite_model_assembly.py |
Tests ONNX package assembly. |
olive/workflows/run/run.py |
Invokes component assembly. |
olive/workflows/run/config.py |
Documents build output scoping. |
olive/workflows/run/composite_model_assembly.py |
Implements package assembly and cleanup. |
olive/workflows/run/builds.py |
Tracks component workflows and output roots. |
docs/source/how-to/configure-workflows/build-workflow.md |
Documents multi-build assembly. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Assembly currently mishandles ancestor output paths, directory artifacts, context-binary collisions, and single-component composites.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 2
Open (4)
Full-team review: changes requestedReviewed PR head The assembly direction is sound, but the current implementation has blocking filesystem-safety and build-artifact/package-contract issues. I found 1 Critical and 8 Major issues after deduplicating and verifying the team findings. Blocking findings
Additional correctness issues
Suggested fix order
Review dispositions
This was a static review. It did not execute the PR or validate Windows junctions/reparse points, concurrent output mutation, fault-injection rollback, or an end-to-end ORT GenAI package load. |
Confine source, build, and output paths while retaining build artifacts and unrelated package files. Stage ONNX external data, EPContext binaries, and OpenVINO XML/BIN companions without cross-component collisions; publish without overwriting existing output. Cover linked paths, shared assets, rollback, and single-component assembly with regression tests. Signed-off-by: Xiaoyu Zhang <xiaoyuzhang@microsoft.com>
|
Addressed F1-F9 and the filename/selection follow-ups in cc61fa3. Component builds now preflight source/output/build paths and reject links, keep build artifacts under .builds, stage optimized ONNX assets and package-level updates without overwriting shared files, and publish without deleting unrelated output. Single-component composites and OpenVINO XML/BIN context pairs are handled; potentially shared source external data remains intact. |
|
Copilot resolve the merge conflicts in this pull request |
…ve-composite-components # Conflicts: # olive/workflows/run/builds.py # olive/workflows/run/run.py Co-authored-by: xiaoyu-work <85524621+xiaoyu-work@users.noreply.github.com>
Resolved in 467788e: merged |


Describe your changes
ComponentBuildContextand onetry_assemble_component_buildsentry point that dispatches by input model format.CompositeModelcomponent builds back into a complete package; HfModel builds continue through the checkpoint assembler.componentsare assembled.output_dirfor the assembled model while keeping named build andbuilds._default.output_dirsettings scoped to build artifacts.Validation
python -m pytest -q test\workflows— 107 passedruff checkandruff format --checkon changed Python filespylinton changed Python files — 10.00/10Checklist before requesting a review
lintrunner -aRelease note: Component-scoped multi-build workflows for directory-based ONNX CompositeModels now emit a complete package containing optimized and untouched components at the engine output directory.
(Optional) Issue link
N/A