Skip to content

[WebGPU] Proposal: Default non-debug validation mode set to disabled#28679

Open
hariharans29 wants to merge 5 commits into
mainfrom
hari/webgpu-release-validation-disabled
Open

[WebGPU] Proposal: Default non-debug validation mode set to disabled#28679
hariharans29 wants to merge 5 commits into
mainfrom
hari/webgpu-release-validation-disabled

Conversation

@hariharans29
Copy link
Copy Markdown
Member

@hariharans29 hariharans29 commented May 26, 2026

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_validation by default only when validationMode is not explicitly configured by the user. If validationMode is 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

Build Type validationMode explicitly set? Result
Debug Yes/No No behavior change
Release No Enable skip_validation by default
Release Yes Respect explicit validationMode; do not force default skip behavior

Implementation

  • Track whether validationMode was explicitly provided during provider option parsing.
  • Plumb explicitness into WebGpuContext initialization.
  • Apply release default skip_validation only when validationMode is not explicitly set.

Why this approach

  • Improves release-path defaults for performance-sensitive scenarios.
  • Preserves explicit override semantics for diagnostics/troubleshooting.
  • Keeps the change narrowly scoped and low risk.

Related PRs

  • PR to use direct dispatch instead of indirect dispatch in the FA kernels to work-around the Dawn inefficiency with basic valiation mode - This is no longer needed
  • PR fix to create the dummy ORT session with user provided device knobs is still needed for other knobs (validation mode is just one such knob)

@hariharans29 hariharans29 force-pushed the hari/webgpu-release-validation-disabled branch from 77c6517 to af805ba Compare May 26, 2026 21:13
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can commit the suggested changes from lintrunner.

Comment thread onnxruntime/core/providers/webgpu/webgpu_context.h Outdated
hariharans29 and others added 2 commits May 26, 2026 14:18
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can commit the suggested changes from lintrunner.

Comment thread onnxruntime/core/providers/webgpu/webgpu_context.h Outdated
hariharans29 and others added 2 commits May 26, 2026 14:35
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 validationMode was explicitly provided via a new validation_mode_explicitly_set flag in WebGpuContextConfig.
  • Plumb the flag through WebGpuContext's constructor and store it as a member.
  • In GetEnabledDeviceToggles, in non-debug builds, force skip_validation on when the user did not explicitly set validationMode; otherwise honor the explicit ValidationMode selection.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants