Add --test HF CLI path for 2-layer random model configs, olive run and ModelBuilder support, Qwen how-to/layer-types fix, and merge conflict resolution#2459
Open
Copilot wants to merge 63 commits into
Conversation
7 tasks
Agent-Logs-Url: https://github.com/microsoft/Olive/sessions/e2149604-9db1-438e-a31f-01a53886093d Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/Olive/sessions/e2149604-9db1-438e-a31f-01a53886093d Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/Olive/sessions/e2149604-9db1-438e-a31f-01a53886093d Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add section in config.json for random model with 2 hidden layers
Add May 11, 2026
--test HF CLI path for 2-layer random model configs
xadupre
reviewed
May 11, 2026
Agent-Logs-Url: https://github.com/microsoft/Olive/sessions/d4221aaf-b4a3-4bed-85fe-30a12dcdfd6e Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Copilot
AI
changed the title
Add
Add May 11, 2026
--test HF CLI path for 2-layer random model configs--test HF CLI path for 2-layer random model configs with fail-fast loading
Agent-Logs-Url: https://github.com/microsoft/Olive/sessions/57fd060e-5678-4015-b277-c7d14ec52145 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/Olive/sessions/57fd060e-5678-4015-b277-c7d14ec52145 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
xadupre
reviewed
May 11, 2026
Agent-Logs-Url: https://github.com/microsoft/Olive/sessions/cf4d7fdc-1de9-4098-adc3-3bedd436d7d0 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/Olive/sessions/cf4d7fdc-1de9-4098-adc3-3bedd436d7d0 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Agent-Logs-Url: https://github.com/microsoft/Olive/sessions/cf4d7fdc-1de9-4098-adc3-3bedd436d7d0 Co-authored-by: xadupre <22452781+xadupre@users.noreply.github.com>
Copilot
AI
changed the title
Add
Add May 11, 2026
--test HF CLI path for 2-layer random model configs with fail-fast loading--test HF CLI path for 2-layer random model configs with reusable saved test models
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
xadupre
reviewed
May 25, 2026
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…ments in a call' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
…com/microsoft/Olive into copilot/fr-add-model-to-config-json
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
shaahji
approved these changes
May 26, 2026
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe your changes
Adds a CLI test path for Hugging Face models so generated
config.jsoncan carry a lightweight random-model definition instead of always using pretrained weights. When--testis passed, Olive now preserves the source architecture, instantiates a random model with 2 hidden layers, and can persist that test model for reuse.CLI/config support
--testto HF-backed CLI commands using shared input-model options.--testnow accepts an optional folder path where the generated test model is saved for reuse.input_model.test_model_configinto generated run configs, and now also emitsinput_model.test_model_pathwhen a save folder is provided or derived.{ "input_model": { "type": "HfModel", "model_path": "model-id", "test_model_config": { "hidden_layers": 2 }, "test_model_path": "path/to/test_model" } }--testis used without an explicit folder, Olive uses<output_path>/test_model.--testis used in a context where no output path is available, Olive now fails clearly instead of silently skipping persistence.olive runsupportolive run --testso it can apply the same lightweight HF test-model override to an existing Hugging Faceinput_modelalready present in a workflow config.olive run --testis used without an explicit folder, it derives the saved test-model location from the effective workflow output path.olive run --testnow fails clearly when the workflow config does not contain a Hugging Faceinput_model.HF model loading
test_model_config.num_hidden_layers,num_layers,n_layer,n_layers).layer_typesto match the reduced hidden-layer count so the saved reduced config remains valid when reloaded.from_config) so the model is random-initialized rather than loaded from pretrained weights.from_configloading path to avoid nestedtry/excepthandling by only passingtrust_remote_codewhen the model class signature supports it.test_model_pathalready contains a saved HF model, Olive loads that model instead of recreating it; otherwise it creates the reduced model once and saves it there.ModelBuilder support
--testworkflows export from the saved reduced Hugging Face test checkpoint instead of still using the original full checkpoint.test_model_configis present, ModelBuilder now materializes or reusestest_model_pathbefore export and passes that saved checkpoint to the builder.IO config / dummy input propagation
test_model_configthrough HF IO-config and dummy-input generation so the reduced-layer model shape metadata stays consistent with the generated test model.Documentation
--testsmoke check first, then rerun the full conversion.olive optimize --dry_runfollowed byolive run --test, matching the new CLI support.Qwen/Qwen3-0.6Band renamed the how-to page and index entry to match.Merge conflict resolution
origin/maininto this PR branch and resolved the conflict intest/passes/onnx/test_model_builder.py.ModelBuilderfallback/multi-file output test coverage and this PR's saved test-model-path coverage.ModelBuildertests to define the new Hugging Face test-model attributes used by this PR (test_model_configandtest_model_path).Targeted coverage
--testtest_model_configtest_model_path--testneeds an explicit folderolive run --testoverriding an existing HFinput_modelfrom a workflow configolive run --testis used on a non-HF workflow configtrust_remote_codehandling for supported, omitted, and unsupportedfrom_configsignaturestest_model_configis activeolive optimize --dry_runthenolive run --testcommands withhf-internal-testing/tiny-random-LlamaForCausalLMand verifies an ONNX artifact is producedlayer_typesaligned with the reduced hidden-layer count and can be reloaded successfullyModelBuildertests covering saved test-model reuse, single-file annotation fallback, and multi-file output component namingExamples:
Checklist before requesting a review
lintrunner -aRelease notes: Added a
--testoption for Hugging Face CLI workflows that can take a folder path, writes a lightweight 2-layer random-model config, saves and reuses the generated HF test model from that folder, fails fast if the reduced test model cannot be instantiated from the expected model class, only passestrust_remote_codewhen the targetfrom_configsupports it, and now keeps Qwen-stylelayer_typesmetadata aligned with reduced test-model layer counts so saved reduced configs reload cleanly. Also addedolive run --testsupport for workflow configs with Hugging Face input models, updated ModelBuilder to export from the saved reduced test checkpoint for--testflows, and added a Qwen3 0.6B how-to page for running a quick smoke test before the full conversion with an explicit output path for the generated ONNX files.(Optional) Issue link