Skip to content

upgrade dawn to 6dcc11a009787a661ed9780bbde8d83fba4a74e7 #25703

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/deps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ cutlass;https://github.com/NVIDIA/cutlass/archive/refs/tags/v3.9.2.zip;b7f8dc4a8
extensions;https://github.com/microsoft/onnxruntime-extensions/archive/c24b7bab0c12f53da76d0c31b03b9f0f8ec8f3b4.zip;239063aee4946a9af147b473a4c3da78ba7413b4
directx_headers;https://github.com/microsoft/DirectX-Headers/archive/refs/tags/v1.613.1.zip;47653509a3371eabb156360f42faf582f314bf2e
cudnn_frontend;https://github.com/NVIDIA/cudnn-frontend/archive/refs/tags/v1.12.0.zip;7e733cfdc410d777b76122d64232499205589a96
dawn;https://github.com/google/dawn/archive/794b6fadc4171f7b853a77ffdf0948fbec431f41.zip;77bb02deace0d140411f02a2fb8f5f925ea6a1b6
dawn;https://github.com/google/dawn/archive/6dcc11a009787a661ed9780bbde8d83fba4a74e7.zip;7d404a0af303d6def25d5fb282f461f9efc14e26
kleidiai;https://github.com/ARM-software/kleidiai/archive/refs/tags/v1.9.0.tar.gz;a2765979f64efb173a4b8ba4de39dcba9c655786
duktape;https://github.com/svaarala/duktape/releases/download/v2.7.0/duktape-2.7.0.tar.xz;8200c8e417dbab7adcc12c4dbdef7651cfc55794
24 changes: 0 additions & 24 deletions onnxruntime/core/providers/webgpu/webgpu_context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,30 +41,6 @@ void WebGpuContext::Initialize(const WebGpuBufferCacheConfig& buffer_cache_confi
std::call_once(init_flag_, [this, &buffer_cache_config, backend_type, enable_pix_capture]() {
if (device_ == nullptr) {
// Create wgpu::Adapter
#if !defined(__wasm__) && defined(_MSC_VER) && defined(DAWN_ENABLE_D3D12) && !defined(USE_EXTERNAL_DAWN)
// If we are using the D3D12 backend on Windows and the build does not use external Dawn, dxil.dll and dxcompiler.dll are required.
//
// Dawn will try to load them later, but if they are in the different directory to the executable, it may fail to find them.
// To avoid this issue, we try to load them from the same directory as current module (usually onnxruntime.dll).
auto runtime_path = Env::Default().GetRuntimePath();
if (!runtime_path.empty()) {
Status status;
void* module_handle = nullptr;

PathString dxil_path = runtime_path + ToPathString(L"dxil.dll");
status = Env::Default().LoadDynamicLibrary(dxil_path, false, &module_handle);
if (status.IsOK() && module_handle != nullptr) {
modules_.Add(dxil_path, module_handle);
}

PathString dxcompiler_path = runtime_path + ToPathString(L"dxcompiler.dll");
status = Env::Default().LoadDynamicLibrary(dxcompiler_path, false, &module_handle);
if (status.IsOK() && module_handle != nullptr) {
modules_.Add(dxcompiler_path, module_handle);
}
}
#endif

wgpu::RequestAdapterOptions req_adapter_options = {};
req_adapter_options.backendType = static_cast<wgpu::BackendType>(backend_type);
req_adapter_options.powerPreference = wgpu::PowerPreference::HighPerformance;
Expand Down
3 changes: 0 additions & 3 deletions onnxruntime/core/providers/webgpu/webgpu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
#include "core/providers/webgpu/webgpu_external_header.h"

#include "core/common/common.h"
#include "core/framework/library_handles.h"
#include "core/providers/webgpu/buffer_manager.h"
#include "core/providers/webgpu/program_manager.h"

Expand Down Expand Up @@ -217,8 +216,6 @@ class WebGpuContext final {

std::once_flag init_flag_;

LibraryHandles modules_;

wgpu::Instance instance_;
wgpu::Device device_;

Expand Down
45 changes: 0 additions & 45 deletions onnxruntime/wasm/wasm_post_build.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,49 +47,4 @@ if (path.basename(mjsFilePath).includes('-threaded')) {
);
}

// STEP.2 - Workaround the issue referred in https://issues.chromium.org/issues/435879324

// Closure compiler will minimize the key of object `FeatureNameString2Enum`, turning `subgroup` into something else.

// This workaround is to replace the generated code as following:
//
// (for debug build)
//
// > subgroups: "18",
// --- change to -->
// > "subgroups": "18",
//
// (for release build)
//
// > Pe:"18",
// --- change to -->
// > "subgroups":"18",
//

// This step should only be applied for WebGPU EP builds
if (path.basename(mjsFilePath).includes('.async')) {
const regexDebug = 'subgroups: "18"';
const regexRelease = '[a-zA-Z_$][a-zA-Z0-9_$]*:"18"';

const matchesDebug = [...contents.matchAll(new RegExp(regexDebug, 'g'))];
const matchesRelease = [...contents.matchAll(new RegExp(regexRelease, 'g'))];

if (matchesDebug.length === 1 && matchesRelease.length === 0) {
contents = contents.replace(
new RegExp(regexDebug),
'"subgroups": "18"',
);
} else if (matchesDebug.length === 0 && matchesRelease.length === 1) {
contents = contents.replace(
new RegExp(regexRelease),
'"subgroups":"18"',
);
} else {
throw new Error(
`Unexpected number of matches for "${regexDebug}" and "${regexRelease}" in "${mjsFilePath}": Debug=${matchesDebug.length}, Release=${matchesRelease.length}.`,
);
}
}


fs.writeFileSync(mjsFilePath, contents);
Loading