Repository navigation
[WebGPU] Accelerated model loading using Win32 and D3D12 #33055
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
Merged
Sushanth Rajasankar (sushraja-msft)
merged 46 commits into
main
from
user/sushraja/d3d12_file_loading
Oct 9, 2026
Merged
Changes from 45 commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
ed4aa1f
Add D3D12 accelerated weight loading
sushraja-msft c10c419
Remove dxil.dll from the list of WebGPU/Dawn libraries in setup.py
sushraja-msft ee9dc3b
Refactor WebGPU context and execution provider for improved clarity a…
sushraja-msft b7c2575
Enhance D3D12 file loading support and improve weight loading tests
sushraja-msft abf77ca
Address D3D12 loading review and CI feedback
sushraja-msft 45e4978
Refine D3D12 loading lifecycle and waits
sushraja-msft 556d342
Handle unaligned D3D12 file tails safely
sushraja-msft dcbde12
Expose aligned imported WebGPU buffers
sushraja-msft 3a0a661
Make WebGPU loading tests configuration-safe
sushraja-msft 49b612b
Polish D3D12 loading diagnostics
sushraja-msft 7fbdf83
Fix acceleration portability test
sushraja-msft 9166268
Scope accelerated loading lifecycle to D3D12
sushraja-msft fbd0819
Gate batched loading API with D3D12 support
sushraja-msft 2ccf5bf
Complete non-D3D12 loader guards
sushraja-msft f075c3d
Normalize D3D12 loading diagnostics and paths
sushraja-msft 46b51b5
Harden D3D12 file grouping and cancellation
sushraja-msft 692346b
Bypass custom loaders for in-memory data
sushraja-msft 5c71fc0
Use ordinal comparison for D3D12 paths
sushraja-msft aed801e
Gate D3D12 import features by loading mode
sushraja-msft 2975458
Preserve D3D12 features for shared WebGPU contexts
sushraja-msft 027a14d
Clarify D3D12 loading diagnostics and backend state
sushraja-msft c9573de
Clean stale D3D12 loading batches safely
sushraja-msft d370fa3
Export D3D12 loader for static WebGPU installs
sushraja-msft bcd3c5e
Detect D3D12 device removal during fence waits
sushraja-msft 52dd63c
Preserve D3D12 file identity and submission safety
sushraja-msft df3adb8
Simplify D3D12 file buffer loader
sushraja-msft 9ac9de2
Handle custom WebGPU initializer allocators
sushraja-msft 0136742
Serialize shared WebGPU command recording
sushraja-msft 4a7c942
Simplify WebGPU allocator compatibility
sushraja-msft 681b277
Clarify external tensor loading contract
sushraja-msft 2deb450
Simplify accelerated initializer state
sushraja-msft 39ed974
Clarify D3D12 loader event names
sushraja-msft e77cebd
Integrate D3D12 loader with current external data API
sushraja-msft 647c8c8
Fix unused allocator in external data loading
sushraja-msft 2e6ac76
Clarify D3D12 file loader resource and operation names
sushraja-msft 1f2a105
Remove unnecessary preprocessor directive for D3D12 file loading in I…
sushraja-msft 17c181c
Expose external tensor loader overload in WebAssembly builds
sushraja-msft 60589c4
Document WebGPU copy recording synchronization
sushraja-msft 4c93022
Refactor D3D12 accelerated external data loader to remove Impl struct…
sushraja-msft 0efb674
Refactor D3D12 file loading structures and update related references …
sushraja-msft 5a04a4d
Refactor D3D12 external data loading methods to improve clarity and c…
sushraja-msft a9f1a35
Refactor WebGPU external data loader and related components to enhanc…
sushraja-msft 1ae02b0
Fix WebGPU concurrent data transfer test
sushraja-msft 32c852a
Adapt D3D12 loading to WebGPU device IDs
sushraja-msft da8d322
Restore WebGPU device error propagation
sushraja-msft 4b92e7d
Preserve in-memory external data loaders
sushraja-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. | ||
|
|
||
| include_guard(GLOBAL) | ||
|
|
||
| if(NOT WIN32 OR NOT MSVC) | ||
| message(FATAL_ERROR "onnxruntime_d3d12_file_loader requires native Windows MSVC.") | ||
| endif() | ||
|
|
||
| set(onnxruntime_d3d12_file_loader_srcs | ||
| "${ONNXRUNTIME_ROOT}/core/platform/windows/d3d12_file_loader/d3d12_file_buffer_loader.h" | ||
| "${ONNXRUNTIME_ROOT}/core/platform/windows/d3d12_file_loader/d3d12_file_buffer_loader.cc" | ||
| ) | ||
|
|
||
| source_group(TREE ${ONNXRUNTIME_ROOT} FILES ${onnxruntime_d3d12_file_loader_srcs}) | ||
| onnxruntime_add_static_library( | ||
| onnxruntime_d3d12_file_loader | ||
| ${onnxruntime_d3d12_file_loader_srcs}) | ||
| onnxruntime_add_include_to_target( | ||
| onnxruntime_d3d12_file_loader | ||
| onnxruntime_common ${WIL_TARGET} ${GSL_TARGET}) | ||
| target_link_libraries( | ||
| onnxruntime_d3d12_file_loader | ||
| PUBLIC d3d12.lib dxgi.lib dxguid.lib | ||
| PRIVATE ${WIL_TARGET} ${GSL_TARGET}) | ||
| set_target_properties( | ||
| onnxruntime_d3d12_file_loader | ||
| PROPERTIES FOLDER "ONNXRuntime") | ||
|
|
||
| if(NOT onnxruntime_BUILD_SHARED_LIB) | ||
| install( | ||
| TARGETS onnxruntime_d3d12_file_loader | ||
| EXPORT ${PROJECT_NAME}Targets | ||
| ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) | ||
| endif() | ||
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
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
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
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
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
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.