Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
d00e297
security: replace unrestricted setattr with allowlist in Python backe…
titaiwangms Apr 28, 2026
45f5aba
[CUDA] PagedAttention: add SM<80 fp16 fallback via memory-efficient a…
elwhyjay Apr 28, 2026
2900ff7
chore(ci): temporarily remove react-native from NPM required publish …
sanaa-hamel-microsoft Apr 28, 2026
a53d6d7
[CoreML EP] Add QuickGelu support (#28184)
maxwbuckley Apr 28, 2026
7a795ed
Improve SparseTensors public API input validation as well as sparse u…
yuslepukhin Apr 28, 2026
3ae38b2
fix out of boundary vector per class in SVM (#27952)
xadupre Apr 28, 2026
8861ecd
Fix universal package version validation comment and add SHA prefix (…
edgchen1 Apr 28, 2026
1727b70
Add position_ids bounds validation to WebGPU/JS RotaryEmbedding kerne…
titaiwangms Apr 29, 2026
81802a9
Replace unsafe `reinterpret_cast` with C API calls in `include/onnxru…
edgchen1 Apr 29, 2026
f97b8c4
WebGPU: Support Split-K with batch size > 1 (#28151)
Jiawei-Shao Apr 29, 2026
037c02d
Add aarch64 wheel build to CUDA 13 Python packaging pipelines (#27760)
Copilot Apr 29, 2026
6f47410
webgpu: merge batchA into M dimension when batchB==1 (#28197)
xhcao Apr 29, 2026
8a77597
[WebNN] Rename roundingType to outputShapeRounding for pool2d ops (#2…
Honry Apr 29, 2026
ddea107
[OVEP] Updating OV version to 2026.1.0 (#28170)
preetha-intel Apr 29, 2026
df2b677
Fix cpuinfo init on Linux without CPU sysfs lists (#28230)
tianleiwu Apr 29, 2026
9a41944
Add update_inplace overload accepting OrtValue for device-to-device c…
Copilot Apr 29, 2026
abb284d
[WebGPU] Add GridSample operator (#28264)
TomCrypto Apr 29, 2026
11e3072
[Cuda] Upgrade cutlass to 4.4.2 (#28276)
tianleiwu Apr 29, 2026
99e811d
[React Native] Add react-native.config.js and Expo plugin MainApplica…
dccarmo Apr 30, 2026
464d8e9
ICM fixes (6/n) (#28255)
hariharans29 Apr 30, 2026
62f742f
Add RISC-V Vector (RVV) support for CPU Execution Provider (#28261)
velonica0 Apr 30, 2026
e1d2ded
Merge branch 'master' into sync_30_4_2026
jatinwadhwa921 Apr 30, 2026
5d02aae
Support of OV version to resize op
jatinwadhwa921 Apr 30, 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
59 changes: 59 additions & 0 deletions .agents/skills/python-kwargs-setattr-security/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
name: python-kwargs-setattr-security
description: When reviewing or fixing Python code that uses setattr() with user-controlled kwargs to configure C++ extension objects (SessionOptions, RunOptions, etc.) in ONNX Runtime. Use this to apply the allowlist pattern that prevents arbitrary file writes and other attacks via reflected property access.
---

## Problem Pattern

Using `hasattr(obj, k) / setattr(obj, k, v)` with user-controlled kwargs is insecure. The `hasattr` check is NOT a security guard — it returns True for ALL exposed properties including dangerous ones.

```python
# INSECURE — do not use
for k, v in kwargs.items():
if hasattr(options, k):
setattr(options, k, v)
```

## Fix: Explicit Allowlist

Define a module-level frozenset of safe attribute names. Raise RuntimeError for known-but-blocked attrs; silently ignore unknown keys.

```python
# Define at module level, before the class
_ALLOWED_SESSION_OPTIONS = frozenset({
"enable_cpu_mem_arena",
"enable_mem_pattern",
# ... only explicitly reviewed safe attrs
})

# In the method
for k, v in kwargs.items():
if k in _ALLOWED_SESSION_OPTIONS:
setattr(options, k, v)
elif hasattr(options, k): # reuse the existing instance, don't create new
raise RuntimeError(
f"SessionOptions attribute '{k}' is not permitted via the backend API. "
f"Allowed attributes: {', '.join(sorted(_ALLOWED_SESSION_OPTIONS))}"
)
# else: silently ignore (may be kwargs for a different config object)
```

## Key Rules

1. **Use the existing object** in `hasattr(options, k)` — never `hasattr(ClassName(), k)` (creates throwaway C++ objects per iteration)
2. **RuntimeError** is the ORT convention for API misuse errors (not ValueError)
3. **Silent ignore for one path is OK when kwargs are forwarded to both paths**: `run_model()` passes the same kwargs dict to both `prepare()` (validates SessionOptions) and `rep.run()` (validates RunOptions). A RunOptions kwarg unknown to SessionOptions is silently ignored by `prepare()` — this is correct because `rep.run()` will validate it. Only raise RuntimeError when the attr exists on the target object but is blocked.
4. **Frozenset constant naming**: `_ALLOWED_<CLASSNAME>` — ALL_CAPS, Google Style
5. **No type annotations** on module-level constants (ORT Python convention)

## Dangerous SessionOptions Properties (never allowlist)

- `optimized_model_filepath` — triggers Model::Save(), overwrites arbitrary files
- `profile_file_prefix` + `enable_profiling` — writes profiling JSON to arbitrary path
- `register_custom_ops_library` — loads arbitrary shared libraries (method, not property)

## Files in ONNX Runtime

- `onnxruntime/python/backend/backend.py` — `_ALLOWED_SESSION_OPTIONS`
- `onnxruntime/python/backend/backend_rep.py` — `_ALLOWED_RUN_OPTIONS`
- Tests: `onnxruntime/test/python/onnxruntime_test_python_backend.py` — `TestBackendKwargsAllowlist`
8 changes: 4 additions & 4 deletions .github/workflows/windows_openvino.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ jobs:
with:
architecture: x64

- name: Download OpenVINO Toolkit v2025.4.1
- name: Download OpenVINO Toolkit v2026.1.0
env:
OpenVINOVersion: 2025.4.1
OpenVINOVersion: 2026.1.0
shell: pwsh
run: |
$Url ="https://storage.openvinotoolkit.org/repositories/openvino/packages/2025.4.1/windows/openvino_toolkit_windows_2025.4.1.20426.82bbf0292c5_x86_64.zip"
$Url ="https://storage.openvinotoolkit.org/repositories/openvino/packages/2026.1/windows_vc_mt/openvino_toolkit_windows_vc_mt_2026.1.0.21367.63e31528c62_x86_64.zip"
$OutputPath = "$env:RUNNER_TEMP\openvino.zip"
$ExtractPath = "$env:RUNNER_TEMP\openvino-v$env:OpenVINOVersion"
$TempExtractPath = "$env:RUNNER_TEMP\openvino_temp"
Expand Down Expand Up @@ -99,7 +99,7 @@ jobs:
shell: pwsh
# Use $GITHUB_ENV to set the variable for subsequent steps
run: |
$openVinoRootDir = Join-Path $env:RUNNER_TEMP "openvino-v2025.4.1"
$openVinoRootDir = Join-Path $env:RUNNER_TEMP "openvino-v2026.1.0"
echo "OpenVINORootDir=$openVinoRootDir" >> $env:GITHUB_ENV

- name: Print OpenVINORootDir after downloading OpenVINO
Expand Down
1 change: 1 addition & 0 deletions cmake/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ option(onnxruntime_USE_RKNPU "Build with RKNPU support" OFF)
option(onnxruntime_USE_DNNL "Build with DNNL support" OFF)
option(onnxruntime_USE_JSEP "Build with JavaScript implemented kernels support" OFF)
option(onnxruntime_USE_SVE "Build with SVE support in MLAS" OFF)
option(onnxruntime_USE_RVV "Build with RISC-V Vector support in MLAS" OFF)
option(onnxruntime_USE_ARM_NEON_NCHWC "Build with ARM Neon NCHWc kernels in MLAS" OFF)

option(onnxruntime_USE_KLEIDIAI "Build with KleidiAI integration in MLAS" OFF)
Expand Down
2 changes: 1 addition & 1 deletion cmake/deps.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pytorch_cpuinfo;https://github.com/pytorch/cpuinfo/archive/403d652dca4c1046e8145
re2;https://github.com/google/re2/archive/refs/tags/2024-07-02.zip;646e1728269cde7fcef990bf4a8e87b047882e88
safeint;https://github.com/dcleblanc/SafeInt/archive/refs/tags/3.0.28.zip;23f252040ff6cb9f1fd18575b32fa8fb5928daac
tensorboard;https://github.com/tensorflow/tensorboard/archive/373eb09e4c5d2b3cc2493f0949dc4be6b6a45e81.zip;67b833913605a4f3f499894ab11528a702c2b381
cutlass;https://github.com/NVIDIA/cutlass/archive/refs/tags/v4.2.1.zip;5d2b21b10478556c5e209dd7229e298a5c9f0b02
cutlass;https://github.com/NVIDIA/cutlass/archive/refs/tags/v4.4.2.zip;4b0bae4428b84370407c0a71778b13dc2eee5be1
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
Expand Down
2 changes: 1 addition & 1 deletion cmake/external/cutlass.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ onnxruntime_fetchcontent_declare(
URL ${DEP_URL_cutlass}
URL_HASH SHA1=${DEP_SHA1_cutlass}
EXCLUDE_FROM_ALL
PATCH_COMMAND ${Patch_EXECUTABLE} --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/cutlass/cutlass_4.2.1.patch
PATCH_COMMAND ${Patch_EXECUTABLE} --ignore-whitespace -p1 < ${PROJECT_SOURCE_DIR}/patches/cutlass/cutlass_4.4.2.patch
)

FetchContent_GetProperties(cutlass)
Expand Down
12 changes: 12 additions & 0 deletions cmake/external/onnxruntime_external_deps.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -376,6 +376,18 @@ if (CPUINFO_SUPPORTED)
${Patch_EXECUTABLE} -p1 < ${PROJECT_SOURCE_DIR}/patches/cpuinfo/win_arm_fp16_detection_fallback.patch
FIND_PACKAGE_ARGS NAMES cpuinfo
)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
message(STATUS "Applying sysfs fallback patch for cpuinfo on Linux")
onnxruntime_fetchcontent_declare(
pytorch_cpuinfo
URL ${DEP_URL_pytorch_cpuinfo}
URL_HASH SHA1=${DEP_SHA1_pytorch_cpuinfo}
EXCLUDE_FROM_ALL
PATCH_COMMAND
# https://github.com/microsoft/onnxruntime/issues/10038
${Patch_EXECUTABLE} -p1 < ${PROJECT_SOURCE_DIR}/patches/cpuinfo/fix_missing_sysfs_fallback.patch
FIND_PACKAGE_ARGS NAMES cpuinfo
)
else()
onnxruntime_fetchcontent_declare(
pytorch_cpuinfo
Expand Down
46 changes: 45 additions & 1 deletion cmake/onnxruntime_mlas.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ else()
set(X86 TRUE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^(x86_64|amd64)$")
set(X86_64 TRUE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^riscv64.*")
set(RISCV64 TRUE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^loongarch64.*")
set(LOONGARCH64 TRUE)
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^s390x$")
Expand Down Expand Up @@ -903,6 +905,48 @@ endif()
set(MLAS_SOURCE_IS_NOT_SET 0)
endif()
endif()
if(RISCV64 AND MLAS_SOURCE_IS_NOT_SET)
file(GLOB_RECURSE mlas_platform_srcs CONFIGURE_DEPENDS
"${MLAS_SRC_DIR}/scalar/*.cpp")

if(onnxruntime_USE_RVV)
set(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS} -march=rv64gcv -mabi=lp64d")
check_cxx_source_compiles("
#include <stddef.h>
#include <riscv_vector.h>
int main() {
size_t vl = __riscv_vsetvl_e32m1(4);
return static_cast<int>(vl == 0);
}"
HAS_RISCV64_RVV
)
set(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS}")
unset(OLD_CMAKE_REQUIRED_FLAGS)

if(HAS_RISCV64_RVV)
list(APPEND mlas_platform_srcs
${MLAS_SRC_DIR}/riscv64/sgemm_pack_b_rvv.cpp
${MLAS_SRC_DIR}/riscv64/sgemm_kernel_rvv.cpp
${MLAS_SRC_DIR}/riscv64/softmax_kernel_rvv.cpp
)
set_source_files_properties(
${MLAS_SRC_DIR}/riscv64/sgemm_pack_b_rvv.cpp
${MLAS_SRC_DIR}/riscv64/sgemm_kernel_rvv.cpp
${MLAS_SRC_DIR}/riscv64/softmax_kernel_rvv.cpp
PROPERTIES COMPILE_FLAGS "-march=rv64gcv -mabi=lp64d")
list(APPEND mlas_private_compile_definitions MLAS_USE_RVV=1)
else()
message(
WARNING
"onnxruntime_USE_RVV was requested, but the compiler does not support rv64gcv RVV intrinsics. Falling back to scalar MLAS kernels.")
endif()
endif()

if(NOT ONNXRUNTIME_MLAS_MULTI_ARCH)
set(MLAS_SOURCE_IS_NOT_SET 0)
endif()
endif()
if(NOT ONNXRUNTIME_MLAS_MULTI_ARCH AND MLAS_SOURCE_IS_NOT_SET)
file(GLOB_RECURSE mlas_platform_srcs
"${MLAS_SRC_DIR}/scalar/*.cpp")
Expand Down Expand Up @@ -997,4 +1041,4 @@ if (NOT onnxruntime_ORT_MINIMAL_BUILD)
endif()
endif()

endif()
endif()
28 changes: 28 additions & 0 deletions cmake/onnxruntime_unittests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1400,6 +1400,7 @@ if (NOT onnxruntime_ENABLE_TRAINING_TORCH_INTEROP)

SET(MLAS_BENCH_DIR ${TEST_SRC_DIR}/mlas/bench)
file(GLOB_RECURSE MLAS_BENCH_SOURCE_FILES "${MLAS_BENCH_DIR}/*.cpp" "${MLAS_BENCH_DIR}/*.h")
list(FILTER MLAS_BENCH_SOURCE_FILES EXCLUDE REGEX "${MLAS_BENCH_DIR}/riscv64/.*")
onnxruntime_add_executable(onnxruntime_mlas_benchmark ${MLAS_BENCH_SOURCE_FILES} ${ONNXRUNTIME_ROOT}/core/framework/error_code.cc)
target_include_directories(onnxruntime_mlas_benchmark PRIVATE ${ONNXRUNTIME_ROOT}/core/mlas/inc)
target_link_libraries(onnxruntime_mlas_benchmark PRIVATE benchmark::benchmark onnxruntime_util ${ONNXRUNTIME_MLAS_LIBS} onnxruntime_common ${CMAKE_DL_LIBS})
Expand All @@ -1418,6 +1419,33 @@ if (NOT onnxruntime_ENABLE_TRAINING_TORCH_INTEROP)
target_link_libraries(onnxruntime_mlas_benchmark PRIVATE cpuinfo)
endif()
set_target_properties(onnxruntime_mlas_benchmark PROPERTIES FOLDER "ONNXRuntimeTest")

endif()

if(CMAKE_SYSTEM_PROCESSOR MATCHES "^riscv64.*")
set(MLAS_RISCV64_BENCH_DIR ${TEST_SRC_DIR}/mlas/bench/riscv64)

onnxruntime_add_executable(
onnxruntime_mlas_sgemm_riscv_bench
${MLAS_RISCV64_BENCH_DIR}/sgemm_riscv_bench.cpp)
target_include_directories(onnxruntime_mlas_sgemm_riscv_bench PRIVATE ${ONNXRUNTIME_ROOT}/core/mlas/inc)
target_link_libraries(
onnxruntime_mlas_sgemm_riscv_bench
PRIVATE ${ONNXRUNTIME_MLAS_LIBS} onnxruntime_common ${CMAKE_DL_LIBS})
target_compile_definitions(onnxruntime_mlas_sgemm_riscv_bench PRIVATE ${mlas_private_compile_definitions})
set_target_properties(onnxruntime_mlas_sgemm_riscv_bench PROPERTIES FOLDER "ONNXRuntimeTest")

onnxruntime_add_executable(
onnxruntime_mlas_softmax_riscv_compare
${MLAS_RISCV64_BENCH_DIR}/softmax_rvv_compare.cpp)
target_include_directories(
onnxruntime_mlas_softmax_riscv_compare
PRIVATE ${ONNXRUNTIME_ROOT} ${ONNXRUNTIME_ROOT}/core/mlas/inc)
target_link_libraries(
onnxruntime_mlas_softmax_riscv_compare
PRIVATE ${ONNXRUNTIME_MLAS_LIBS} onnxruntime_common ${CMAKE_DL_LIBS})
target_compile_definitions(onnxruntime_mlas_softmax_riscv_compare PRIVATE ${mlas_private_compile_definitions})
set_target_properties(onnxruntime_mlas_softmax_riscv_compare PROPERTIES FOLDER "ONNXRuntimeTest")
endif()

if(WIN32)
Expand Down
83 changes: 83 additions & 0 deletions cmake/patches/cpuinfo/fix_missing_sysfs_fallback.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
diff --git a/src/linux/processors.c b/src/linux/processors.c
index 47bee76..d0c5569 100644
--- a/src/linux/processors.c
+++ b/src/linux/processors.c
@@ -2,0 +3 @@
+#include <unistd.h>
@@ -291,0 +293,22 @@
+static uint32_t cpuinfo_linux_get_max_processor_from_sysconf(
+ uint32_t max_processors_count,
+ const char* processor_list_name) {
+ const long nproc = sysconf(_SC_NPROCESSORS_ONLN);
+ if (nproc <= 0) {
+ cpuinfo_log_warning(
+ "failed to query online processors from sysconf(_SC_NPROCESSORS_ONLN) for %s",
+ processor_list_name);
+ return UINT32_MAX;
+ }
+
+ uint32_t max_processor = (uint32_t)(nproc - 1);
+ if ((uint64_t)nproc > (uint64_t)max_processors_count) {
+ cpuinfo_log_warning(
+ "online processors count %ld exceeds system limit %" PRIu32 ": truncating to the latter",
+ nproc,
+ max_processors_count);
+ max_processor = max_processors_count - 1;
+ }
+ return max_processor;
+}
+
@@ -301 +324 @@
- return UINT32_MAX;
+ return cpuinfo_linux_get_max_processor_from_sysconf(max_processors_count, POSSIBLE_CPULIST_FILENAME);
@@ -323 +346 @@
- return UINT32_MAX;
+ return cpuinfo_linux_get_max_processor_from_sysconf(max_processors_count, PRESENT_CPULIST_FILENAME);
@@ -357,0 +381,31 @@
+static bool cpuinfo_linux_detect_processors_from_sysconf(
+ uint32_t max_processors_count,
+ uint32_t* processor0_flags,
+ uint32_t processor_struct_size,
+ uint32_t detected_flag,
+ const char* processor_list_name) {
+ const long nproc = sysconf(_SC_NPROCESSORS_ONLN);
+ if (nproc <= 0) {
+ cpuinfo_log_warning(
+ "failed to query online processors from sysconf(_SC_NPROCESSORS_ONLN) for %s",
+ processor_list_name);
+ return false;
+ }
+
+ uint32_t processors_count = (uint32_t)nproc;
+ if ((uint64_t)nproc > (uint64_t)max_processors_count) {
+ cpuinfo_log_warning(
+ "online processors count %ld exceeds system limit %" PRIu32 ": truncating to the latter",
+ nproc,
+ max_processors_count);
+ processors_count = max_processors_count;
+ }
+
+ for (uint32_t processor = 0; processor < processors_count; processor++) {
+ *((uint32_t*)((uintptr_t)processor0_flags + processor_struct_size * processor)) |= detected_flag;
+ }
+ cpuinfo_log_warning(
+ "falling back to sysconf(_SC_NPROCESSORS_ONLN) = %ld for %s", nproc, processor_list_name);
+ return true;
+}
+
@@ -373 +427,6 @@
- return false;
+ return cpuinfo_linux_detect_processors_from_sysconf(
+ max_processors_count,
+ processor0_flags,
+ processor_struct_size,
+ possible_flag,
+ POSSIBLE_CPULIST_FILENAME);
@@ -392 +451,6 @@
- return false;
+ return cpuinfo_linux_detect_processors_from_sysconf(
+ max_processors_count,
+ processor0_flags,
+ processor_struct_size,
+ present_flag,
+ PRESENT_CPULIST_FILENAME);
54 changes: 54 additions & 0 deletions include/onnxruntime/ep/adapter/allocator.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,67 @@
#endif

#include <mutex>
#include <utility>

#include "core/framework/allocator.h"

namespace onnxruntime {
namespace ep {
namespace adapter {

// Wraps an OrtAllocator* exposed by the C API as an IAllocator.
// Takes ownership of the wrapped Ort::Allocator and releases it on destruction.
class IAllocatorWrappingOrtAllocator final : public IAllocator {
public:
explicit IAllocatorWrappingOrtAllocator(Ort::Allocator ort_allocator)
: IAllocator(*(EnsureOrtAllocatorHasValue(ort_allocator).GetInfo())),
ort_allocator_(std::move(ort_allocator)) {
}

void* Alloc(size_t size) override {
return ort_allocator_.Alloc(size);
}

void Free(void* p) override {
ort_allocator_.Free(p);
}

void* Reserve(size_t size) override {
return ort_allocator_.Reserve(size);
}

bool IsStreamAware() const override {
return false;

// TODO: Enable once AllocOnStream() is implemented.

Check notice on line 43 in include/onnxruntime/ep/adapter/allocator.h

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] include/onnxruntime/ep/adapter/allocator.h#L43

Missing username in TODO; it should look like "// TODO(my_username): Stuff." [readability/todo] [2]
Raw output
include/onnxruntime/ep/adapter/allocator.h:43:  Missing username in TODO; it should look like "// TODO(my_username): Stuff."  [readability/todo] [2]
// static constexpr uint32_t kOrtAllocatorAllocOnStreamMinVersion = 23;
// const OrtAllocator* raw = ort_allocator_;
// return raw->version >= kOrtAllocatorAllocOnStreamMinVersion && raw->AllocOnStream != nullptr;
}

void* AllocOnStream(size_t /*size*/, Stream* /*stream*/) override {
// TODO: Implement AllocOnStream().

Check notice on line 50 in include/onnxruntime/ep/adapter/allocator.h

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] include/onnxruntime/ep/adapter/allocator.h#L50

Missing username in TODO; it should look like "// TODO(my_username): Stuff." [readability/todo] [2]
Raw output
include/onnxruntime/ep/adapter/allocator.h:50:  Missing username in TODO; it should look like "// TODO(my_username): Stuff."  [readability/todo] [2]
// The internal `onnxruntime::IAllocator::AllocOnStream` signature takes an internal `onnxruntime::Stream*`
// argument, while the public `::OrtAllocator::AllocOnStream` signature takes an `::OrtSyncStream*` argument.
// We need to properly map from one to the other.
// `::OrtSyncStream*` should be treated as an opaque type from the plugin EP's perspective.
ORT_NOT_IMPLEMENTED("IAllocatorWrappingOrtAllocator::AllocOnStream is not implemented yet.");
}

private:
static const Ort::Allocator& EnsureOrtAllocatorHasValue(const Ort::Allocator& ort_allocator) {
ORT_ENFORCE(ort_allocator != nullptr, "Ort::Allocator must contain a non-nullptr OrtAllocator.");
return ort_allocator;
}

// TODO: Consider adding GetStats() override. Requires parsing OrtKeyValuePairs from the C API

Check notice on line 64 in include/onnxruntime/ep/adapter/allocator.h

View workflow job for this annotation

GitHub Actions / cpplint

[cpplint] include/onnxruntime/ep/adapter/allocator.h#L64

Missing username in TODO; it should look like "// TODO(my_username): Stuff." [readability/todo] [2]
Raw output
include/onnxruntime/ep/adapter/allocator.h:64:  Missing username in TODO; it should look like "// TODO(my_username): Stuff."  [readability/todo] [2]
// into AllocatorStats; see GetStatsFromOrtAllocator() in allocator_adapters.cc for reference.

Ort::Allocator ort_allocator_;

ORT_DISALLOW_COPY_ASSIGNMENT_AND_MOVE(IAllocatorWrappingOrtAllocator);
};

/// <summary>
/// A bridge class between the EP API OrtAllocator and an IAllocator implementation.
/// </summary>
Expand Down
Loading
Loading