Fix stale output shape metadata in WebGPU external-data E2E model#28805
Draft
Copilot wants to merge 2 commits into
Draft
Fix stale output shape metadata in WebGPU external-data E2E model#28805Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Copilot
AI
changed the title
[WIP] Fix failing Web CI job due to inconsistent model metadata
Fix stale output shape metadata in WebGPU external-data E2E model
Jun 5, 2026
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.
Description
Web CI WebGPU external-data E2E was emitting an ORT output-shape warning because
model_with_orig_ext_data.onnxdeclaredYas{1,4}while execution produces{2,3}.This change aligns model metadata with actual output and keeps the duplicated web/core test artifacts consistent.
Canonical generator update
/onnxruntime/test/testdata/model_with_external_initializers.pyto support explicit output shape and generatemodel_with_orig_ext_data.onnxwithY: [2, 3].Generated artifact sync
model_with_orig_ext_data.onnx:/onnxruntime/test/testdata/model_with_orig_ext_data.onnx/js/web/test/e2e/model_with_orig_ext_data.onnxExternal-data companion
model_with_orig_ext_data.binremains valid and unchanged (metadata-only correction).Motivation and Context
The failing Web CI signal came from inconsistent model metadata, not runtime computation: declared output shape
{1,4}disagreed with actual output{2,3}forY.Aligning metadata to
[2,3]removes the warning in the WebGPU external-data E2E path without changing test expectations or runtime behavior.Original prompt
Fix the failing Web CI job in
microsoft/onnxruntimecaused by the external-data WebGPU E2E model metadata being inconsistent with actual runtime output.Context:
.github/workflows/web.ymljs/web/test/e2e/browser-test-webgpu-external-data.js9e7bd662656371005b3749133441c790461ef5eeObserved failure signature from the job logs:
Expected shape from model of {1,4} does not match actual shape of {2,3} for output YYto have shape[2, 3]and values matching a 2x3 tensor.Relevant code:
js/web/test/e2e/browser-test-webgpu-external-data.jscreates a session from./model_with_orig_ext_data.onnxand asserts:Y.dims.length === 2 && Y.dims[0] === 2 && Y.dims[1] === 3Task:
model_with_orig_ext_data.onnxand any generator or checked-in artifact used by this test.Ymatches the actual runtime output shape[2, 3].model_with_orig_ext_data.bin) or companion files also need regeneration.Implementation guidance:
[2, 3].{1,4}) while actual output is{2,3}.Success criteria:
Expected shape from model of {1,4} does not match actual shape of {2,3} for output Ywarning.The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Please find a solution for this failing job. Use the logs, job definition, and any referenced files where the failure occurred. Keep your response focused on the solution and include code suggestions when appropriate.
Assistant: The fix is to correct the model’s declared output shape so it matches what the test actually produces.
Root cause
The failing job is not failing because of WebGPU execution itself. The log shows the E2E test passes, but ORT emits a shape verification warning during model execution:
Expected shape from model of {1,4} does not match actual shape of {2,3} for output YThis happens in the WebGPU external-data E2E test here:
js/web/test/e2e/browser-test-webgpu-external-data.jsThe test explicitly asserts that output
Yis shape[2, 3]:So the ONNX model metadata says
Yis{1,4}, while actual runtime output is{2,3}. That mismatch is the real issue.What to change
Update the ONNX model
model_with_orig_ext_data.onnxso the outputYshape in the graph definition is[2, 3]instead of[1, 4].If the model is generated from source code or a script, fix the generator there. If the model is checked in as a binary artifact, regenerate it with the correct output shape and replace the checked-in file.
Suggested correction
Conceptually, the model output should be defined like this:
instead of:
Why this is the right fix
[2, 3].[2, 3].Notes on other log noise
The repeated
Unsupported ONNX opset: 1/6and EP assignment warnings appear to be non-fatal warnings from broader test coverage and are not the failure signature tied to the external-data test. The actionable issue shown by the referenced test is the output shape mismatch in the external-data model.Files involved
.github/workflows/web.yml](https://github.com/microsoft/onnxruntime/blob/9e7bd662656371005b3749133441c790461ef5ee/.gith...This pull request was created from Copilot chat.