Skip to content

Commit 120972c

Browse files
xiaoyu-workCopilot
andauthored
Align generate-model-package CLI with onnxruntime-genai (microsoft#2495)
This pull request updates the test suite for the model packaging CLI to reflect a new package layout and metadata schema. The changes remove the generation and validation of `variant.json` files, update how execution provider (EP) compatibility and inference settings are represented, and ensure external data blobs are handled per-variant rather than being deduplicated. The tests now check for the presence of new fields and files, and for the absence of deprecated ones. **Test updates for new package schema and layout:** * Removed all references to `variant.json`; tests now assert that this file is not emitted, and instead check for the presence of `model.onnx` and, where applicable, `genai_config_overlay.json` in variant directories. [[1]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L211-R222) [[2]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L268-R270) [[3]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L436-R476) [[4]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8R503-R505) [[5]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L500-R526) [[6]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L799-R828) * Updated assertions for metadata structure: - EP compatibility is now represented inline within the `variants` mapping, not as an `ep_compatibility` array. [[1]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L211-R222) [[2]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L237-R244) [[3]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L315-R332) [[4]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L342-R391) [[5]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L728-R757) - Added checks for new manifest and metadata fields, such as `schema_version`, `component_name`, `package_name`, `package_version`, and `configs_dir`. [[1]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L211-R222) [[2]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8R294-R296) [[3]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L315-R332) **Inference settings and overlay configuration:** * Runtime and provider options are now placed in `genai_config_overlay.json` instead of `variant.json`, and tests verify the correct structure and location of these overlays. [[1]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L342-R391) [[2]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L401-R445) [[3]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L799-R828) * Added and updated tests to ensure overlays are omitted for variants without options, and that provider options are matched to the correct EP by name. [[1]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L401-R445) [[2]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L342-R391) **External data handling:** * Shared weights deduplication has been removed; tests confirm that each variant keeps its own external data blob inline and that no `shared_weights` directory or `variant.json` is created. [[1]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L436-R476) [[2]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8R503-R505) [[3]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L500-R526) **Naming and documentation improvements:** * Test and comment names have been updated for clarity, reflecting the new schema and file layout. [[1]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L302-R307) [[2]](diffhunk://#diff-291ba4d264af5a5f10bd3fe2338221960606e304d631554d25e222cc6fdd7df8L714-R739) These changes ensure the test suite accurately validates the new packaging format and metadata conventions. --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 79f1ee5 commit 120972c

2 files changed

Lines changed: 1310 additions & 460 deletions

File tree

0 commit comments

Comments
 (0)