You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[WebGPU] Validate MatMul execution plans in planner - #33288
Change MatMulExecutionPlanner::CreateExecutionPlan to return Status and publish its output plan only after validation succeeds.
Validate algorithm/configuration compatibility, host-known algorithm prerequisites, packed tuning, subgroup size agreement, and overflow-safe packed/Split-K dispatch arithmetic in the planner.
Remove duplicated prerequisite reconstruction and validation from MatMulComputeDispatcher.
Add contract tests for unsupported forced requests, unchanged output on failure, invalid vendor configurations, and dispatch overflow.
Update the WebGPU MatMul planner design documentation.
Motivation and Context
Follow-up to #32630. A successful CreateExecutionPlan should mean that the returned plan is executable for all prerequisites already known to the host. Previously the planner returned an unchecked proposal and the dispatcher reconstructed the same prerequisite facts to validate it, which weakened the plan contract and allowed the two paths to drift.
Forced test selections still bypass performance heuristics, but unsupported requests now fail in plan creation without silently falling back.
Testing
Static Vulkan onnxruntime_provider_test build
41 planner, configuration, and execution-plan validation tests passed
The full local plugin onnxruntime_provider_test link remains blocked by an existing MSVC C4744 Abseil/GoogleTest signedness warning promoted to C2220, followed by LNK1257; no changed planner source failed compilation.
The planner checks each logical dispatch dimension independently, but it never checks their combined workgroup count. ProgramManager::NormalizeDispatchGroupSize rejects x * y * z > UINT32_MAX because logical workgroup IDs are flattened into a u32 (program_manager.cc:36-39), so dimensions such as packed_m == n == UINT32_MAX pass plan creation and then fail in RunProgram. Compute all three group counts here and validate their overflow-safe product; for Split-K, repeat the product check after replacing Z with batch * splits_per_batch, and add combined-dimension coverage.
The reason will be displayed to describe this comment to others. Learn more.
Re-reviewed cfc378e against the merge base. The combined packed/Split-K dispatch checks and Naive/GEMV conversion checks address my previous comments. The added subgroup validation also matches execution's shared batch-folding and per-thread tuning decisions. Failure-atomic plan publication and existing selection/failure behavior are preserved. No further actionable code findings.
This approval is based on source/test review and the successful relevant WebGPU CI checks, not a local test run. Remaining failed checks are in environment setup (Rust setup, Java networking, and Android apt locking); approval does not mean all CI checks are green.
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
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
MatMulExecutionPlanner::CreateExecutionPlanto returnStatusand publish its output plan only after validation succeeds.MatMulComputeDispatcher.Motivation and Context
Follow-up to #32630. A successful
CreateExecutionPlanshould mean that the returned plan is executable for all prerequisites already known to the host. Previously the planner returned an unchecked proposal and the dispatcher reconstructed the same prerequisite facts to validate it, which weakened the plan contract and allowed the two paths to drift.Forced test selections still bypass performance heuristics, but unsupported requests now fail in plan creation without silently falling back.
Testing
onnxruntime_provider_testbuildThe full local plugin
onnxruntime_provider_testlink remains blocked by an existing MSVCC4744Abseil/GoogleTest signedness warning promoted toC2220, followed byLNK1257; no changed planner source failed compilation.