Skip to content

Commit 9c7a151

Browse files
authored
Merge pull request #760 from intel/sync_msft_24_7_25
Sync msft 24 7 25
2 parents 3faf7d9 + 99e516b commit 9c7a151

File tree

121 files changed

+2955
-3165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+2955
-3165
lines changed

.gdn/.gdntsa

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/workflows/macos-ci-build-and-test-workflow.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ jobs:
5454
${{ inputs.use_webgpu && '--use_webgpu' || '' }}
5555
${{ inputs.use_xnnpack && '--use_xnnpack' || '' }}
5656
${{ inputs.use_coreml && '--use_coreml' || '' }}
57+
${{ inputs.use_coreml && '--use_coreml --skip_onnx_tests' || '' }}
5758
--use_vcpkg --use_vcpkg_ms_internal_asset_cache
5859
--config ${{ matrix.build_config }}
5960
xcode_version: ${{ matrix.platform_machine == 'x86_64' && '14.3.1' || '16' }}

.github/workflows/windows_cuda.yml

Lines changed: 125 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@ concurrency:
1515
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.ref || github.sha }}
1616
cancel-in-progress: true
1717

18+
#TODO: enable --build_nodejs
1819
jobs:
19-
build_x64_RelWithDebInfo:
20-
name: Windows GPU CUDA CI Pipeline # Job name set here
21-
runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-Win2022-GPU-A10"]
20+
build:
21+
name: Windows GPU CUDA CI Pipeline
22+
runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-vs2022-mms"]
2223
steps:
2324
- uses: actions/checkout@v4
2425
with:
25-
fetch-depth: 0 # Fetch all history for all tags and branches
26+
fetch-depth: 0
2627
submodules: 'none'
2728

2829
- uses: actions/setup-python@v5
@@ -96,40 +97,146 @@ jobs:
9697
run: nuget restore ${{ github.workspace }}\packages.config -ConfigFile ${{ github.workspace }}\NuGet.config -PackagesDirectory ${{ runner.temp }}\build\RelWithDebInfo
9798
shell: cmd
9899

99-
- name: Export GitHub Actions cache environment variables
100-
uses: actions/github-script@v7
101-
with:
102-
script: |
103-
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
104-
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
105-
106100
- name: Set OnnxRuntimeBuildDirectory
107101
shell: pwsh
108102
run: |
109103
$buildDir = Join-Path ${{ runner.temp }} "build"
110104
echo "OnnxRuntimeBuildDirectory=$buildDir" >> $env:GITHUB_ENV
111105
112-
- name: Build and Test
106+
- name: Build and Clean Binaries
113107
working-directory: ${{ runner.temp }}
114108
run: |
115-
python.exe ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --build_dir build --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --build_wheel --build_java --build_nodejs --use_cuda --cuda_home="$env:RUNNER_TEMP\v12.2" --enable_cuda_profiling --enable_transformers_tool_test --use_vcpkg --use_vcpkg_ms_internal_asset_cache --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 --cmake_extra_defines onnxruntime_BUILD_UNIT_TESTS=ON --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON
109+
npm install -g typescript
110+
if ($lastExitCode -ne 0) {
111+
exit $lastExitCode
112+
}
113+
# Execute the build process
114+
python.exe ${{ github.workspace }}\tools\ci_build\build.py --update --build --config RelWithDebInfo --build_dir build --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --build_wheel --build_java --use_cuda --cuda_home="$env:RUNNER_TEMP\v12.2" --enable_cuda_profiling --use_vcpkg --use_vcpkg_ms_internal_asset_cache --enable_transformers_tool_test --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON
116115
if ($lastExitCode -ne 0) {
117116
exit $lastExitCode
118117
}
119-
Remove-Item "${{ runner.temp }}\build\RelWithDebInfo" -Include "*.obj" -Recurse
118+
119+
# Clean up the output directory before uploading artifacts
120+
$outputDir = "${{ runner.temp }}\build\RelWithDebInfo"
121+
Write-Host "Cleaning up files from $outputDir..."
122+
123+
Remove-Item -Path "$outputDir\onnxruntime" -Recurse -Force -ErrorAction SilentlyContinue
124+
Remove-Item -Path "$outputDir\pybind11" -Recurse -Force -ErrorAction SilentlyContinue
125+
Remove-Item -Path "$outputDir\models" -Recurse -Force -ErrorAction SilentlyContinue
126+
Remove-Item -Path "$outputDir\vcpkg_installed" -Recurse -Force -ErrorAction SilentlyContinue
127+
Remove-Item -Path "$outputDir\_deps" -Recurse -Force -ErrorAction SilentlyContinue
128+
Remove-Item -Path "$outputDir\CMakeCache.txt" -Force -ErrorAction SilentlyContinue
129+
Remove-Item -Path "$outputDir\CMakeFiles" -Recurse -Force -ErrorAction SilentlyContinue
130+
# Remove intermediate object files as in the original script
131+
Remove-Item -Path $outputDir -Include "*.obj" -Recurse
120132
shell: pwsh
121133

122-
- name: Validate C# native delegates
123-
run: python tools\ValidateNativeDelegateAttributes.py
124-
working-directory: ${{ github.workspace }}\csharp
134+
- name: Upload build artifacts
135+
uses: actions/upload-artifact@v4
136+
with:
137+
name: build-artifacts
138+
path: ${{ runner.temp }}\build
139+
env:
140+
OrtPackageId: Microsoft.ML.OnnxRuntime.Gpu
141+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true
142+
setVcvars: true
143+
ALLOW_RELEASED_ONNX_OPSET_ONLY: '0'
144+
DocUpdateNeeded: false
145+
ONNXRUNTIME_TEST_GPU_DEVICE_ID: '0'
146+
AZCOPY_AUTO_LOGIN_TYPE: MSI
147+
AZCOPY_MSI_CLIENT_ID: 63b63039-6328-442f-954b-5a64d124e5b4
148+
149+
test:
150+
name: Windows GPU CUDA CI Pipeline Test Job
151+
needs: build
152+
timeout-minutes: 300
153+
runs-on: ["self-hosted", "1ES.Pool=onnxruntime-github-Win2022-GPU-A10"]
154+
steps:
155+
- uses: actions/checkout@v4
156+
with:
157+
fetch-depth: 0
158+
submodules: 'none'
159+
160+
- name: Download build artifacts
161+
uses: actions/download-artifact@v4
162+
with:
163+
name: build-artifacts
164+
path: ${{ runner.temp }}\build
165+
166+
- uses: actions/setup-python@v5
167+
with:
168+
python-version: '3.12'
169+
architecture: x64
170+
171+
- uses: actions/setup-node@v4
172+
with:
173+
node-version: '20.x'
174+
175+
- uses: actions/setup-java@v4
176+
with:
177+
distribution: 'temurin'
178+
java-version: '17'
179+
architecture: x64
180+
181+
- name: Locate vcvarsall and Setup Env
182+
uses: ./.github/actions/locate-vcvarsall-and-setup-env
183+
with:
184+
architecture: x64
185+
186+
- name: Install python modules
187+
run: python -m pip install -r .\tools\ci_build\github\windows\python\requirements.txt
188+
working-directory: ${{ github.workspace }}
125189
shell: cmd
126190

191+
- name: Download CUDA SDK v12.2
192+
working-directory: ${{ runner.temp }}
193+
run: |
194+
azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v12.2" .
195+
dir
196+
shell: pwsh
197+
198+
- name: Add CUDA to PATH
199+
shell: powershell
200+
run: |
201+
Write-Host "Adding CUDA to PATH"
202+
Write-Host "CUDA Path: $env:RUNNER_TEMP\v12.2\bin"
203+
Add-Content -Path $env:GITHUB_PATH -Value "$env:RUNNER_TEMP\v12.2\bin"
204+
Add-Content -Path $env:GITHUB_PATH -Value "$env:RUNNER_TEMP\v12.2\extras\CUPTI\lib64"
205+
206+
- name: Set OnnxRuntimeBuildDirectory
207+
shell: pwsh
208+
run: |
209+
$buildDir = Join-Path ${{ runner.temp }} "build"
210+
echo "OnnxRuntimeBuildDirectory=$buildDir" >> $env:GITHUB_ENV
211+
127212
- name: Install ONNX Runtime Wheel
128213
uses: ./.github/actions/install-onnxruntime-wheel
129214
with:
130215
whl-directory: ${{ runner.temp }}\build\RelWithDebInfo\RelWithDebInfo\dist
131216

132-
timeout-minutes: 300
217+
- name: Run Tests
218+
working-directory: ${{ runner.temp }}
219+
run: |
220+
npm install -g typescript
221+
if ($lastExitCode -ne 0) {
222+
exit $lastExitCode
223+
}
224+
225+
python.exe ${{ github.workspace }}\tools\python\update_ctest_path.py "${{ runner.temp }}\build\RelWithDebInfo\CTestTestfile.cmake" "${{ runner.temp }}\build\RelWithDebInfo"
226+
if ($lastExitCode -ne 0) {
227+
exit $lastExitCode
228+
}
229+
230+
python.exe ${{ github.workspace }}\tools\ci_build\build.py --test --config RelWithDebInfo --build_dir build --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --build_wheel --build_java --use_cuda --cuda_home="$env:RUNNER_TEMP\v12.2" --enable_cuda_profiling --use_vcpkg --use_vcpkg_ms_internal_asset_cache --enable_transformers_tool_test --cmake_extra_defines CMAKE_CUDA_ARCHITECTURES=86 --cmake_extra_defines onnxruntime_ENABLE_CUDA_EP_INTERNAL_TESTS=ON
231+
if ($lastExitCode -ne 0) {
232+
exit $lastExitCode
233+
}
234+
shell: pwsh
235+
236+
- name: Validate C# native delegates
237+
run: python tools\ValidateNativeDelegateAttributes.py
238+
working-directory: ${{ github.workspace }}\csharp
239+
shell: cmd
133240
env:
134241
OrtPackageId: Microsoft.ML.OnnxRuntime.Gpu
135242
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: true

.github/workflows/windows_dml.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ jobs:
9898
- name: Build and Test
9999
working-directory: ${{ runner.temp }}
100100
run: |
101-
python.exe ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --build_dir build --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --enable_onnx_tests --build_wheel --use_dml --enable_wcos --use_vcpkg --use_vcpkg_ms_internal_asset_cache
101+
python.exe ${{ github.workspace }}\tools\ci_build\build.py --config RelWithDebInfo --build_dir build --skip_submodule_sync --build_csharp --parallel --use_binskim_compliant_compile_flags --cmake_generator "Visual Studio 17 2022" --build_shared_lib --skip_onnx_tests --build_wheel --use_dml --enable_wcos --use_vcpkg --use_vcpkg_ms_internal_asset_cache
102102
if ($lastExitCode -ne 0) {
103103
exit $lastExitCode
104104
}

cmake/CMakeLists.txt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,7 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
4747
# NOTE: POSITION INDEPENDENT CODE hurts performance, and it only make sense on POSIX systems
4848
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
4949

50-
# Enable CTest
5150
enable_testing()
52-
include(CTest)
5351
if (NOT CMAKE_BUILD_TYPE)
5452
message(STATUS "Build type not set - using RelWithDebInfo")
5553
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose build type: Debug Release RelWithDebInfo MinSizeRel." FORCE)
@@ -858,6 +856,11 @@ if (onnxruntime_USE_MIGRAPHX)
858856
list(APPEND ORT_PROVIDER_FLAGS -DUSE_MIGRAPHX=1)
859857
list(APPEND ONNXRUNTIME_PROVIDER_NAMES migraphx)
860858
endif()
859+
860+
if (onnxruntime_USE_MIGRAPHX_INTERFACE AND (NOT onnxruntime_USE_MIGRAPHX))
861+
list(APPEND ORT_PROVIDER_FLAGS -DUSE_MIGRAPHX_PROVIDER_INTERFACE=1)
862+
endif()
863+
861864
if (onnxruntime_USE_ARMNN)
862865
list(APPEND ORT_PROVIDER_FLAGS -DUSE_ARMNN=1)
863866
list(APPEND ONNXRUNTIME_PROVIDER_NAMES armnn)

cmake/node_helper.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.25)
66
# Function to get NPM path from Node.js path
77
function(get_npm_path_from_node result_var node_path)
88
get_filename_component(NODE_DIR ${node_path} DIRECTORY)
9-
if(WIN32)
9+
if(CMAKE_HOST_WIN32)
1010
set(NPM_CLI_CANDIDATE "${NODE_DIR}/npm.cmd")
1111
if(NOT EXISTS ${NPM_CLI_CANDIDATE})
1212
set(NPM_CLI_CANDIDATE "${NODE_DIR}/npm")

csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/runtest.sh

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ RunTestNative=${RunTestNative:-true}
1111

1212
set -x -e
1313

14-
pushd .
1514
cd $BUILD_SOURCESDIRECTORY
1615

1716
echo "Current NuGet package version is $CurrentOnnxRuntimeVersion"
@@ -40,9 +39,6 @@ if [ $RunTestCsharp = "true" ]; then
4039
exit 1
4140
fi
4241
dotnet test -p:DefineConstants=USE_TENSORRT $BUILD_SOURCESDIRECTORY/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/Microsoft.ML.OnnxRuntime.EndToEndTests.csproj --no-restore --verbosity detailed
43-
elif [ $PACKAGENAME = "Microsoft.ML.OnnxRuntime.ROCm" ]; then
44-
export TESTONGPU=ON
45-
dotnet test -p:DefineConstants=USE_ROCM $BUILD_SOURCESDIRECTORY/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/Microsoft.ML.OnnxRuntime.EndToEndTests.csproj --no-restore --verbosity detailed
4642
else
4743
dotnet test $BUILD_SOURCESDIRECTORY/csharp/test/Microsoft.ML.OnnxRuntime.EndToEndTests/Microsoft.ML.OnnxRuntime.EndToEndTests.csproj --no-restore --verbosity detailed
4844
fi
@@ -52,5 +48,3 @@ if [ $RunTestCsharp = "true" ]; then
5248
fi
5349
fi
5450

55-
cd $OldDir
56-
popd

include/onnxruntime/core/session/onnxruntime_c_api.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5588,6 +5588,21 @@ struct OrtApi {
55885588
*/
55895589
ORT_API2_STATUS(Graph_GetName, _In_ const OrtGraph* graph, _Outptr_ const char** graph_name);
55905590

5591+
/** \brief Get the filepath to the model from which an OrtGraph is constructed.
5592+
*
5593+
* \note The model's filepath is empty if the filepath is unknown, such as when the model is loaded from bytes
5594+
* via CreateSessionFromArray.
5595+
*
5596+
* \param[in] graph The OrtGraph instance.
5597+
* \param[out] model_path Output parameter set to the model's null-terminated filepath.
5598+
* Set to an empty path string if unknown.
5599+
*
5600+
* \snippet{doc} snippets.dox OrtStatus Return Value
5601+
*
5602+
* \since Version 1.23.
5603+
*/
5604+
ORT_API2_STATUS(Graph_GetModelPath, _In_ const OrtGraph* graph, _Outptr_ const ORTCHAR_T** model_path);
5605+
55915606
/** \brief Returns the ONNX IR version.
55925607
*
55935608
* \param[in] graph The OrtGraph instance.

onnxruntime/core/graph/abi_graph_types.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,12 @@ struct OrtGraph {
276276
/// <returns>The graph's name.</returns>
277277
virtual const std::string& GetName() const = 0;
278278

279+
/// <summary>
280+
/// Returns the model's path, which is empty if unknown.
281+
/// </summary>
282+
/// <returns>The model path.</returns>
283+
virtual const ORTCHAR_T* GetModelPath() const = 0;
284+
279285
/// <summary>
280286
/// Returns the model's ONNX IR version. Important in checking for optional graph inputs
281287
/// (aka non-constant initializers), which were introduced in ONNX IR version 4.

onnxruntime/core/graph/ep_api_types.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -692,6 +692,10 @@ Status EpGraph::CreateImpl(std::unique_ptr<EpGraph> ep_graph, const GraphViewer&
692692

693693
const std::string& EpGraph::GetName() const { return graph_viewer_.Name(); }
694694

695+
const ORTCHAR_T* EpGraph::GetModelPath() const {
696+
return graph_viewer_.ModelPath().c_str();
697+
}
698+
695699
int64_t EpGraph::GetOnnxIRVersion() const { return graph_viewer_.GetOnnxIRVersion(); }
696700

697701
Status EpGraph::GetNumOperatorSets(size_t& num_operator_sets) const {

0 commit comments

Comments
 (0)