Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
98468bf
[WebGPU] Cache sparse indexer QSA visibility and scores (#33017)
sayanshaw24 Oct 6, 2026
ec1add8
Validate CUDA GatherND indices bounds in release mode (#31646)
apsonawane Oct 6, 2026
053d9b0
Validate CPU kernel registrations at compile time (#29649)
GopalakrishnanN Oct 6, 2026
38dc99f
Work around certificate regression on Windows (#33142)
eserscor Oct 6, 2026
60e534a
Detect Jetson GPUs in Linux DRM device discovery (#32544)
Copilot Oct 6, 2026
123f085
Fix C API tensor element type conversions at ONNX boundaries (#33066)
Copilot Oct 7, 2026
8420709
Fix Windows clang/no-exceptions portability (#33140)
mustjab Oct 7, 2026
1b355c5
Merge branch 'microsoft:main' into master
hdharpure9922 Oct 7, 2026
43c6f17
Bump sharp from 0.35.4 to 0.35.5 in /js/web/test/e2e/exports/testcase…
dependabot[bot] Oct 7, 2026
8478e36
Optimize CPU BatchNormalization for NC inputs (#33113)
artyomrabosh Oct 7, 2026
b40377d
fix(quantization): avoid intermediate overflow when calculating quant…
galleonli Oct 7, 2026
5652d3f
Fix ReshapeFusion crash when fused Reshape's shape input is node-prod…
anubhavagr Oct 7, 2026
ae245d0
Handle missing ConstantOfShape value during float16 conversion (#33089)
Copilot Oct 7, 2026
0d427f8
Account for string payloads in initializer size limits (#32867)
danielsongmicrosoft Oct 7, 2026
958927f
Validate ORT format input argument counts (#32865)
danielsongmicrosoft Oct 7, 2026
9a7c193
Fix dead links in docs and CONTRIBUTING (#32880)
pratikgx Oct 7, 2026
0eb8a04
[CUDA] Suppress CUDA 13 MSVC build warnings (#33149)
tianleiwu Oct 7, 2026
ec82e2a
[CUDA] Extract GQA seq-free route eligibility into shared helpers (#3…
chilo-ms Oct 7, 2026
e3f71e0
[CUDA] Consolidate GQA scratch sizing (MEA, unfused, XQA, Flash) into…
chilo-ms Oct 7, 2026
f83bf57
[CUDA] Plumb GQA workspace KV-length envelope knob into the L1 estima…
chilo-ms Oct 7, 2026
3d9d664
Update Android minimal binary size baseline (#33164)
xadupre Oct 7, 2026
05517e1
[CUDA] Fix GQA build regression after eligibility/workspace integrati…
chilo-ms Oct 7, 2026
397657d
Fix broken link to ONNX Runtime technical reference docs (#33030)
Zapakio6 Oct 7, 2026
0628838
Merge remote-tracking branch 'upstream/main'
AIFrameworksIntegration Oct 7, 2026
a0bf4d7
Merge remote-tracking branch 'origin/master' into sync_msft_08102026
AIFrameworksIntegration Oct 7, 2026
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 .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ jobs:
run: |
set -e -x
BINARY_SIZE_THRESHOLD_ARGS=""
BINARY_SIZE_THRESHOLD_IN_BYTES=1605632
BINARY_SIZE_THRESHOLD_IN_BYTES=1607680
echo "Binary size threshold in bytes: ${BINARY_SIZE_THRESHOLD_IN_BYTES}"
BINARY_SIZE_THRESHOLD_ARGS="--threshold_size_in_bytes ${BINARY_SIZE_THRESHOLD_IN_BYTES}"

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ To preview your changes, you can push to the gh-pages branch in your fork and th

Once your PR is approved and merged, your changes will be automatically published to https://onnxruntime.ai/docs.

Note: technical reference docs for developers of ONNX Runtime source code can be found [here](https://github.com/microsoft/onnxruntime/docs)
Note: technical reference docs for developers of ONNX Runtime source code can be found [here](https://github.com/microsoft/onnxruntime/tree/main/docs)

## Licensing guidelines

Expand Down
1 change: 1 addition & 0 deletions cmake/onnxruntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ function(get_c_cxx_api_headers HEADERS_VAR)
"${REPO_ROOT}/include/onnxruntime/core/session/onnxruntime_lite_custom_op.h"
"${REPO_ROOT}/include/onnxruntime/core/session/onnxruntime_run_options_config_keys.h"
"${REPO_ROOT}/include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h"
"${REPO_ROOT}/include/onnxruntime/core/session/onnxruntime_type_conversion.h"
)

if (onnxruntime_ENABLE_TRAINING_APIS)
Expand Down
1 change: 1 addition & 0 deletions cmake/onnxruntime_common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ elseif (WIN32)
elseif (LINUX)
list(APPEND onnxruntime_common_src_patterns
"${ONNXRUNTIME_ROOT}/core/platform/linux/device_discovery.cc"
"${ONNXRUNTIME_ROOT}/core/platform/linux/drm_device_discovery.h"
"${ONNXRUNTIME_ROOT}/core/platform/linux/pci_device_discovery.h")
elseif (APPLE)
list(APPEND onnxruntime_common_src_patterns
Expand Down
11 changes: 10 additions & 1 deletion cmake/onnxruntime_providers_cuda_plugin.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -273,9 +273,13 @@ if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL 13.0)
)

if (MSVC)
# Suppress unrecognized __pragma warnings emitted from CUDA headers in device code.
# Suppress diagnostics from CUDA 13 headers: unrecognized __pragma in device code,
# cuda_fp4.hpp's unused parameter, and CCCL's unmatched #pragma warning(pop)
# in the MSVC host compiler.
list(APPEND _cuda_plugin_shared_compile_options
"$<$<COMPILE_LANGUAGE:CUDA>:--diag-suppress=20199>"
"$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler /wd4100>"
"$<$<COMPILE_LANGUAGE:CUDA>:SHELL:-Xcompiler /wd4193>"
)
endif()
endif()
Expand Down Expand Up @@ -331,6 +335,11 @@ target_compile_options(onnxruntime_providers_cuda_plugin PRIVATE
"$<$<COMPILE_LANGUAGE:CUDA>:SHELL:--threads \"${onnxruntime_plugin_nvcc_threads}\">"
)

if(MSVC)
# NVCC emits CodeView references to a host compiler PDB that it does not retain.
target_link_options(onnxruntime_providers_cuda_plugin PRIVATE "/IGNORE:4099")
endif()

# SM-specific OBJECT libraries — compiled with restricted CUDA architectures.
# SM90/SM120 TMA and LLM contain MoE and MatMulNBits kernels (contrib ops only).

Expand Down
130 changes: 130 additions & 0 deletions cmake/patches/onnx/onnx.patch
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,133 @@ index 0c271d5..6d64da7 100644
fail_shape_inference(
"Unexpected axis value (",
axis,
diff --git a/onnx/common/assertions.h b/onnx/common/assertions.h
--- a/onnx/common/assertions.h
+++ b/onnx/common/assertions.h
@@ -27,9 +27,9 @@
#endif
std::string barf(const char* fmt, ...);

-[[noreturn]] void throw_assert_error(std::string& /*msg*/);
+[[noreturn]] void throw_assert_error(const std::string& /*msg*/);

-[[noreturn]] void throw_tensor_error(std::string& /*msg*/);
+[[noreturn]] void throw_tensor_error(const std::string& /*msg*/);

} // namespace ONNX_NAMESPACE

diff --git a/onnx/common/assertions.cc b/onnx/common/assertions.cc
--- a/onnx/common/assertions.cc
+++ b/onnx/common/assertions.cc
@@ -42,11 +42,11 @@
}

-void throw_assert_error(std::string& msg) {
+void throw_assert_error(const std::string& msg) {
ONNX_THROW_EX(assert_error(msg));
}

-void throw_tensor_error(std::string& msg) {
+void throw_tensor_error(const std::string& msg) {
ONNX_THROW_EX(tensor_error(msg));
}

} // namespace ONNX_NAMESPACE
diff --git a/onnx/common/tensor.h b/onnx/common/tensor.h
--- a/onnx/common/tensor.h
+++ b/onnx/common/tensor.h
@@ -51,13 +51,13 @@
/// size_from_dim() cannot handle this case, while elem_num() handles it correctly
int64_t elem_num() const {
- return safe_dim_product(sizes_, [](const char* msg) { throw tensor_error(msg); });
+ return safe_dim_product(sizes_, [](const char* msg) { throw_tensor_error(msg); });
}
int64_t size_from_dim(int dim) const {
if (dim < 0) {
dim += static_cast<int>(sizes_.size());
}
ONNX_ASSERT(dim >= 0 && (size_t)dim < sizes_.size())
- return safe_dim_product(sizes_.begin() + dim, sizes_.end(), [](const char* msg) { throw tensor_error(msg); });
+ return safe_dim_product(sizes_.begin() + dim, sizes_.end(), [](const char* msg) { throw_tensor_error(msg); });
}

int32_t elem_type() const {
diff --git a/onnx/common/scoped_resource.h b/onnx/common/scoped_resource.h
--- a/onnx/common/scoped_resource.h
+++ b/onnx/common/scoped_resource.h
@@ -25,18 +25,18 @@
// Usage:
-// using ScopedFd = ScopedResource<-1, close_fd>;
-// ScopedFd guard(fd); // destructor calls close_fd(fd)
+// using ScopedFd = ScopedResource<FdTraits>;
+// ScopedFd guard(fd); // destructor calls FdTraits::close(fd)
// int raw = guard.release(); // relinquish ownership
-template <auto Invalid, void (*Close)(decltype(Invalid))>
+template <typename Traits>
class ScopedResource {
- using T = decltype(Invalid);
+ using T = typename Traits::type;
T val_;

public:
explicit ScopedResource(T v) : val_(v) {}
~ScopedResource() {
- if (val_ != Invalid) {
- Close(val_);
+ if (val_ != Traits::invalid()) {
+ Traits::close(val_);
}
}
T get() const {
return val_;
@@ -44,7 +44,7 @@
}
T release() {
T tmp = val_;
- val_ = Invalid;
+ val_ = Traits::invalid();
return tmp;
}
ScopedResource(const ScopedResource&) = delete;
@@ -55,20 +55,32 @@
#ifdef _WIN32
-inline void close_handle(HANDLE h) {
- CloseHandle(h);
-}
-using ScopedHandle = ScopedResource<INVALID_HANDLE_VALUE, close_handle>;
+struct HandleTraits {
+ using type = HANDLE;
+ static HANDLE invalid() {
+ return INVALID_HANDLE_VALUE;
+ }
+ static void close(HANDLE h) {
+ CloseHandle(h);
+ }
+};
+using ScopedHandle = ScopedResource<HandleTraits>;
#endif

-inline void close_fd(int fd) {
+struct FdTraits {
+ using type = int;
+ static constexpr int invalid() {
+ return -1;
+ }
+ static void close(int fd) {
#ifdef _WIN32
- _close(fd);
+ _close(fd);
#else
- close(fd);
+ ::close(fd);
#endif
-}
-using ScopedFd = ScopedResource<-1, close_fd>;
+ }
+};
+using ScopedFd = ScopedResource<FdTraits>;

// RAII guard that invokes a callable on destruction (scope exit).
template <typename F>
class ScopeExit {
F fn_;
130 changes: 130 additions & 0 deletions cmake/vcpkg-ports/onnx/binskim.patch
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,133 @@ index 0c271d5..6d64da7 100644
fail_shape_inference(
"Unexpected axis value (",
axis,
diff --git a/onnx/common/assertions.h b/onnx/common/assertions.h
--- a/onnx/common/assertions.h
+++ b/onnx/common/assertions.h
@@ -27,9 +27,9 @@
#endif
std::string barf(const char* fmt, ...);

-[[noreturn]] void throw_assert_error(std::string& /*msg*/);
+[[noreturn]] void throw_assert_error(const std::string& /*msg*/);

-[[noreturn]] void throw_tensor_error(std::string& /*msg*/);
+[[noreturn]] void throw_tensor_error(const std::string& /*msg*/);

} // namespace ONNX_NAMESPACE

diff --git a/onnx/common/assertions.cc b/onnx/common/assertions.cc
--- a/onnx/common/assertions.cc
+++ b/onnx/common/assertions.cc
@@ -42,11 +42,11 @@
}

-void throw_assert_error(std::string& msg) {
+void throw_assert_error(const std::string& msg) {
ONNX_THROW_EX(assert_error(msg));
}

-void throw_tensor_error(std::string& msg) {
+void throw_tensor_error(const std::string& msg) {
ONNX_THROW_EX(tensor_error(msg));
}

} // namespace ONNX_NAMESPACE
diff --git a/onnx/common/tensor.h b/onnx/common/tensor.h
--- a/onnx/common/tensor.h
+++ b/onnx/common/tensor.h
@@ -51,13 +51,13 @@
/// size_from_dim() cannot handle this case, while elem_num() handles it correctly
int64_t elem_num() const {
- return safe_dim_product(sizes_, [](const char* msg) { throw tensor_error(msg); });
+ return safe_dim_product(sizes_, [](const char* msg) { throw_tensor_error(msg); });
}
int64_t size_from_dim(int dim) const {
if (dim < 0) {
dim += static_cast<int>(sizes_.size());
}
ONNX_ASSERT(dim >= 0 && (size_t)dim < sizes_.size())
- return safe_dim_product(sizes_.begin() + dim, sizes_.end(), [](const char* msg) { throw tensor_error(msg); });
+ return safe_dim_product(sizes_.begin() + dim, sizes_.end(), [](const char* msg) { throw_tensor_error(msg); });
}

int32_t elem_type() const {
diff --git a/onnx/common/scoped_resource.h b/onnx/common/scoped_resource.h
--- a/onnx/common/scoped_resource.h
+++ b/onnx/common/scoped_resource.h
@@ -25,18 +25,18 @@
// Usage:
-// using ScopedFd = ScopedResource<-1, close_fd>;
-// ScopedFd guard(fd); // destructor calls close_fd(fd)
+// using ScopedFd = ScopedResource<FdTraits>;
+// ScopedFd guard(fd); // destructor calls FdTraits::close(fd)
// int raw = guard.release(); // relinquish ownership
-template <auto Invalid, void (*Close)(decltype(Invalid))>
+template <typename Traits>
class ScopedResource {
- using T = decltype(Invalid);
+ using T = typename Traits::type;
T val_;

public:
explicit ScopedResource(T v) : val_(v) {}
~ScopedResource() {
- if (val_ != Invalid) {
- Close(val_);
+ if (val_ != Traits::invalid()) {
+ Traits::close(val_);
}
}
T get() const {
return val_;
@@ -44,7 +44,7 @@
}
T release() {
T tmp = val_;
- val_ = Invalid;
+ val_ = Traits::invalid();
return tmp;
}
ScopedResource(const ScopedResource&) = delete;
@@ -55,20 +55,32 @@
#ifdef _WIN32
-inline void close_handle(HANDLE h) {
- CloseHandle(h);
-}
-using ScopedHandle = ScopedResource<INVALID_HANDLE_VALUE, close_handle>;
+struct HandleTraits {
+ using type = HANDLE;
+ static HANDLE invalid() {
+ return INVALID_HANDLE_VALUE;
+ }
+ static void close(HANDLE h) {
+ CloseHandle(h);
+ }
+};
+using ScopedHandle = ScopedResource<HandleTraits>;
#endif

-inline void close_fd(int fd) {
+struct FdTraits {
+ using type = int;
+ static constexpr int invalid() {
+ return -1;
+ }
+ static void close(int fd) {
#ifdef _WIN32
- _close(fd);
+ _close(fd);
#else
- close(fd);
+ ::close(fd);
#endif
-}
-using ScopedFd = ScopedResource<-1, close_fd>;
+ }
+};
+using ScopedFd = ScopedResource<FdTraits>;

// RAII guard that invokes a callable on destruction (scope exit).
template <typename F>
class ScopeExit {
F fn_;
6 changes: 3 additions & 3 deletions docs/ReleaseNotesWorkflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

ONNX Runtime release notes are drafted using the `ort-release-notes` agent skill:

- [`.agents/skills/ort-release-notes/SKILL.md`](../.agents/skills/ort-release-notes/SKILL.md)
- [`.github/skills/ort-release-notes/SKILL.md`](../.github/skills/ort-release-notes/SKILL.md)

The skill is the source of truth for the release-note workflow, including inputs, artifact discovery, contributor
handling, draft structure, validation, and PowerShell command patterns. Keep procedural details there so this document
Expand All @@ -12,7 +12,7 @@ does not drift out of sync.

Preset definitions live in:

- [`.agents/skills/ort-release-notes/presets.json`](../.agents/skills/ort-release-notes/presets.json)
- [`.github/skills/ort-release-notes/presets.json`](../.github/skills/ort-release-notes/presets.json)

For example, there is a preset for the core ONNX Runtime release and one for the WebGPU plugin EP release.

Expand All @@ -30,6 +30,6 @@ plugin-ep-webgpu/v0.1.0 to <target-ref>.
## Adding A Preset

To add release-note support for another component, add a preset to
[`presets.json`](../.agents/skills/ort-release-notes/presets.json). Component presets should define a version file and,
[`presets.json`](../.github/skills/ort-release-notes/presets.json). Component presets should define a version file and,
when the release should be scoped, a path filter file similar to
[`plugin-ep-webgpu/paths.txt`](../plugin-ep-webgpu/paths.txt).
2 changes: 1 addition & 1 deletion docs/Roadmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ONNX Runtime is an active, fast-paced project backed by a strong team of Microso
ONNX Runtime as a robust, versatile, and high performance inference engine for DNN and traditional ML models.

## High Level Goals
ONNX Runtime is a runtime accelerator that supports interoperable ML and DNN models based on the [ONNX](https://onnx.ai/) spec. For key technical design objectives and considerations, see [ONNX Runtime Inference High Level Design](./InferenceHighLevelDesign.md).
ONNX Runtime is a runtime accelerator that supports interoperable ML and DNN models based on the [ONNX](https://onnx.ai/) spec.

We recognize the challenges involved in operationalizing ML models performantly in an agile way, and we understand that high volume production services can be highly performance-sensitive and often need to support a variety of compute targets (we experience these first-hand at Microsoft across our vast array of products and services).

Expand Down
13 changes: 8 additions & 5 deletions docs/contrib_ops/webgpu/sparse_attention_indexer.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,13 @@ The rank-3 query projection is logically reshaped into heads inside the shader.
projections therefore both connect directly to the operator; their consecutive norm-weight inputs
are applied internally before rotary embedding.

The initial implementation prioritizes correctness and uses one independently
writable workgroup per query or completed CSA window. Candidate scoring during
selection is recomputed rather than materialized, avoiding candidate-count
limits and GPU-to-CPU synchronization at the cost of additional computation.
The implementation uses one independently writable workgroup per query or
completed CSA window. For QSA, each workgroup caches visible token positions
and candidate scores, and reuses query/key RMS normalization within a score.
The caches cover up to 3,072 visible tokens and 768 candidate blocks within
WebGPU's guaranteed 16 KiB of workgroup storage. Beyond either bound, the
corresponding lookup falls back to visibility scans or score recomputation,
preserving exact TopK ordering without host readback.

## Follow-up work

Expand All @@ -43,7 +46,7 @@ limits and GPU-to-CPU synchronization at the cost of additional computation.
- specialized large-candidate TopK;
- subgroup-optimized reductions;
- fused projection, pooling, and scoring;
- reduced recomputation and temporary-buffer use;
- staged scoring and selection for rows exceeding workgroup-cache bounds;
- selector/executor fusion;
- WebGPU `DynamicSparseAttention` and `SparsePagedAttention`;
- additional element types.
2 changes: 1 addition & 1 deletion docs/design/webgpu_paged_attention.md
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ Feature guards (v1 rejects with `NOT_IMPLEMENTED` and a specific message):
## 9. Testing plan

- **Correctness (host-side enforce paths, lavapipe-compatible)**: input
validation tests. See the [`webgpu-local-testing`](../../.agents/skills/webgpu-local-testing/SKILL.md)
validation tests. See the [`webgpu-local-testing`](../../.github/skills/webgpu-local-testing/SKILL.md)
skill for lavapipe details.
- **End-to-end op tests** (`onnxruntime/test/contrib_ops/paged_attention_op_test.cc`,
`PagedAttention.EndToEnd_*`): cover MHA, GQA, single/multi-batch,
Expand Down
Loading
Loading