[WebGPU] Default non-debug validation mode set to disabled - #28679
Merged
Conversation
hariharans29
force-pushed
the
hari/webgpu-release-validation-disabled
branch
from
May 26, 2026 21:13
77c6517 to
af805ba
Compare
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Changes the default WebGPU release-build behavior to enable Dawn's skip_validation toggle when the user has not explicitly set validationMode, improving release performance while preserving explicit overrides.
Changes:
- Track whether
validationModewas explicitly provided via a newvalidation_mode_explicitly_setflag inWebGpuContextConfig. - Plumb the flag through
WebGpuContext's constructor and store it as a member. - In
GetEnabledDeviceToggles, in non-debug builds, forceskip_validationon when the user did not explicitly setvalidationMode; otherwise honor the explicitValidationModeselection.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| onnxruntime/core/providers/webgpu/webgpu_provider_factory.cc | Sets validation_mode_explicitly_set = true when kValidationMode is present in config options. |
| onnxruntime/core/providers/webgpu/webgpu_context.h | Adds the validation_mode_explicitly_set field to WebGpuContextConfig and new constructor parameter/member in WebGpuContext. |
| onnxruntime/core/providers/webgpu/webgpu_context.cc | Implements release-mode default to include skip_validation toggle unless validationMode was explicitly set; forwards new field when constructing the context. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
guschmue
approved these changes
Jun 3, 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.
Summary
This PR updates WebGPU release behavior to improve default runtime performance while preserving explicit user control over validation.
In non-debug builds, the provider enables Dawn's
skip_validationtoggle by default only whenvalidationModeis not explicitly configured or when explicitly configured to a mode weaker than strict validation. IfvalidationModeis explicitly set to a stricter validation level (> disabled), that setting is honored andskip_validationis not forced.Debug build behavior is unchanged.
Motivation
Release users generally prioritize performance, while advanced users need predictable diagnostic control when they explicitly request a stronger validation mode.
This change provides a release-friendly default without removing configurability or forcing performance penalties when users explicitly enable validation for debugging.
Behavior Matrix
Implementation
validationModewas explicitly provided during provider option parsing.skip_validationdefault only whenvalidationModeis absent or weaker than strict validation; otherwise honor explicit choice.Why this approach
Related PRs
Motivation and Context
Perf improvement on Vulkan backend for Qwen3-1.7B model on a Windows machine with RTX 5060Ti card
The default state for validationMode to disabled greatly helps deocde TPS on Vulkan as it helps reduce the indirect dispatch inefficiency on Vulkan. There is a very small marginal improvement on D3D12 as well although not as marked as the inefficiency with indirect dispatch on D3D12 backend is greatly helped by D3D12's aggressive sub-allocator pooling (something Vulkan backend lacks).
NOTE: The "Branch" perf improvement numbers also includes the fusion in #28484 but the fusion's decode TPS gains is under 10%. The rest are contributed by the validationMode default.