[WebGPU] Proposal: Default non-debug validation mode set to disabled#28679
Open
hariharans29 wants to merge 5 commits into
Open
[WebGPU] Proposal: Default non-debug validation mode set to disabled#28679hariharans29 wants to merge 5 commits into
hariharans29 wants to merge 5 commits into
Conversation
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.
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.
In non-debug builds, the provider now enables Dawn
skip_validationby default only whenvalidationModeis not explicitly configured by the user. IfvalidationModeis explicitly provided, that setting is honored.Debug build behavior is unchanged.
Motivation
Release users generally prioritize performance, while advanced users still need predictable diagnostic control when they explicitly request a validation mode.
This change provides a release-friendly default without removing configurability.
Behavior Matrix
skip_validationby defaultvalidationMode; do not force default skip behaviorImplementation
validationModewas explicitly provided during provider option parsing.skip_validationonly whenvalidationModeis not explicitly set.Why this approach
Related PRs