Skip to content
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

Adding DML to python cuda package #22606

Merged
merged 62 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
1fe6bae
Adding new Python package testing pipeline for CUda Alt
jchen351 Oct 24, 2024
e973742
Remove Linux_Test_GPU_x86_64_stage from stage final
jchen351 Oct 24, 2024
2a5be8c
Adding dependencies
jchen351 Oct 24, 2024
7690e26
Distinguish between DML and the generic 'GPU' term. This is needed fo…
pranavsharma Oct 25, 2024
a0918e0
Update dml pkg with python
jchen351 Oct 25, 2024
10dcad9
Update dml pkg with python
jchen351 Oct 25, 2024
3b9630e
Update dml pkg with python
jchen351 Oct 25, 2024
381f55f
Address code review comment
pranavsharma Oct 25, 2024
b671f41
Merge remote-tracking branch 'origin/package_dml' into Cjian/pydml
jchen351 Oct 25, 2024
8196b65
remove --enable_wcos and --cmake_extra_defines "CMAKE_SYSTEM_VERSION=…
jchen351 Oct 25, 2024
6dd4694
Merge branch 'main' into Cjian/pytest
jchen351 Oct 25, 2024
5ba0c12
Split DML test out of cuda
jchen351 Oct 26, 2024
847a7ff
Merge branch 'Cjian/pytest' into Cjian/pydml
jchen351 Oct 26, 2024
36c5bde
Split DML test out of cuda
jchen351 Oct 26, 2024
7113a15
Split DML test out of cuda
jchen351 Oct 26, 2024
bdce800
Split DML test out of cuda
jchen351 Oct 26, 2024
3755562
Split DML test out of cuda
jchen351 Oct 26, 2024
7a2cd9c
Split DML test out of cuda
jchen351 Oct 26, 2024
5188f4c
Split DML test out of cuda
jchen351 Oct 26, 2024
e334bfe
Merge remote-tracking branch 'origin/Cjian/pytest' into Cjian/pytest
jchen351 Oct 26, 2024
ff73270
lintrunner
jchen351 Oct 26, 2024
4c29c54
Merge branch 'Cjian/pytest' into Cjian/pydml
jchen351 Oct 26, 2024
a9b5a90
update ruff
jchen351 Oct 28, 2024
775ff5b
Merge branch 'Cjian/pytest' into Cjian/pydml
jchen351 Oct 28, 2024
9557f40
update cuda
jchen351 Oct 28, 2024
42c8702
exclude test_convtranspose_autopad_same_cuda
jchen351 Oct 28, 2024
2007bb3
update os.environ["ORT_ONNX_BACKEND_EXCLUDE_PROVIDERS"]
jchen351 Oct 29, 2024
a4dddc5
# exclude DML EP when CUDA test is running.
jchen351 Oct 29, 2024
b11b993
Distinguish between DML and the generic 'GPU' term. This is needed fo…
pranavsharma Oct 30, 2024
b3fa3b2
Merge remote-tracking branch 'origin/dml_device' into Cjian/pydml
jchen351 Oct 30, 2024
b66393c
Move py_packaging_test_step into a template
jchen351 Oct 30, 2024
9d61bf4
parameters
jchen351 Oct 30, 2024
e4c3269
$(Agent.TempDirectory)
jchen351 Oct 30, 2024
a1d0985
Merge branch 'main' into Cjian/pydml
jchen351 Nov 1, 2024
2470bd0
Lintrunner -a
jchen351 Nov 1, 2024
4993088
Update DNNL CI python to 310
jchen351 Nov 1, 2024
12b5ff6
Merge branch 'Cjian/dnnl' into Cjian/pydml
jchen351 Nov 1, 2024
f963b6e
Replace reference to python 3.8 with python 3.19
jchen351 Nov 1, 2024
e0b895b
Merge branch 'Cjian/dnnl' into Cjian/pydml
jchen351 Nov 1, 2024
ba7dd01
Replace reference to python 3.8 with python 3.10
jchen351 Nov 1, 2024
c16a1d4
Merge branch 'Cjian/dnnl' into Cjian/pydml
jchen351 Nov 1, 2024
b8b98ea
Enable Win CUDA python test
jchen351 Nov 4, 2024
bcd173b
Enable Win CUDA python test
jchen351 Nov 4, 2024
720fce9
Disable 3 failed test due to upgrading to python 3.10
jchen351 Nov 4, 2024
94e152c
Merge branch 'Cjian/dnnl' into Cjian/pydml
jchen351 Nov 4, 2024
3a66769
Using Iterable instead of list
jchen351 Nov 4, 2024
5bb6617
Undo Iterable instead of list
jchen351 Nov 4, 2024
a48cccd
linrunner -a
jchen351 Nov 4, 2024
0efb9fc
Merge branch 'Cjian/dnnl' into Cjian/pydml
jchen351 Nov 4, 2024
015b32b
exclude failed cuda 12 tests
jchen351 Nov 5, 2024
ef629ad
Adding verbose to run onnx_backend_test_series.py
jchen351 Nov 5, 2024
bc4e825
Adding verbose to run onnx_backend_test_series.py
jchen351 Nov 5, 2024
cb3b48b
Merge branch 'Cjian/enable_cuda_py_test' into Cjian/pydml
jchen351 Nov 5, 2024
f9f0d46
Merge branch 'main' into Cjian/pydml
jchen351 Nov 5, 2024
d462901
rolling back dml texts exclusions,
jchen351 Nov 5, 2024
099d7dd
remove CudaVersion: ${{ parameters.cuda_version }}
jchen351 Nov 5, 2024
057ae40
Merge branch 'Cjian/enable_cuda_py_test' into Cjian/pydml
jchen351 Nov 5, 2024
4cd9ecd
Merge branch 'main' into Cjian/pydml
jchen351 Nov 6, 2024
01a4359
Merge branch 'main' into Cjian/pydml
jchen351 Nov 13, 2024
82d3f6e
Merge remote-tracking branch 'origin/main' into Cjian/pydml
jchen351 Nov 16, 2024
bc8e9d7
Exclude failed cuda test that running during the DML testing
jchen351 Nov 18, 2024
ce4666d
Reduce parallel counts
jchen351 Nov 19, 2024
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
1 change: 1 addition & 0 deletions include/onnxruntime/core/framework/ortdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct OrtDevice {
static const DeviceType GPU = 1; // Nvidia or AMD
static const DeviceType FPGA = 2;
static const DeviceType NPU = 3; // Ascend
static const DeviceType DML = 4;

struct MemType {
// Pre-defined memory types.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace Dml
OrtMemoryInfo(
"DML",
OrtAllocatorType::OrtDeviceAllocator,
OrtDevice(OrtDevice::GPU, OrtDevice::MemType::DEFAULT, 0)
OrtDevice(OrtDevice::DML, OrtDevice::MemType::DEFAULT, 0)
)
),
m_device(device),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ namespace Dml
OrtMemoryInfo(
"DML",
OrtAllocatorType::OrtDeviceAllocator,
OrtDevice(OrtDevice::GPU, OrtDevice::MemType::DEFAULT, 0)
OrtDevice(OrtDevice::DML, OrtDevice::MemType::DEFAULT, 0)
))
{
m_device = onnxruntime::DMLProviderFactoryCreator::CreateD3D12Device(device_id, false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ namespace Dml
bool enableGraphCapture,
bool enableSyncSpinning,
bool disableMemoryArena) :
IExecutionProvider(onnxruntime::kDmlExecutionProvider, OrtDevice(OrtDevice::GPU, OrtDevice::MemType::DEFAULT, 0))
IExecutionProvider(onnxruntime::kDmlExecutionProvider, OrtDevice(OrtDevice::DML, OrtDevice::MemType::DEFAULT, 0))
{
D3D12_COMMAND_LIST_TYPE queueType = executionContext->GetCommandListTypeForQueue();
if (queueType != D3D12_COMMAND_LIST_TYPE_DIRECT && queueType != D3D12_COMMAND_LIST_TYPE_COMPUTE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ namespace Dml

bool CanCopy(const OrtDevice& srcDevice, const OrtDevice& dstDevice) const final
{
return (srcDevice.Type() == OrtDevice::GPU) ||
(dstDevice.Type() == OrtDevice::GPU);
return (srcDevice.Type() == OrtDevice::DML) ||
(dstDevice.Type() == OrtDevice::DML);
}

private:
Expand Down
8 changes: 3 additions & 5 deletions onnxruntime/python/onnxruntime_pybind_state.cc
Original file line number Diff line number Diff line change
Expand Up @@ -288,11 +288,9 @@ const char* GetDeviceName(const OrtDevice& device) {
case OrtDevice::CPU:
return CPU;
case OrtDevice::GPU:
#ifdef USE_DML
return DML;
#else
return CUDA;
#endif
case OrtDevice::DML:
return DML;
case OrtDevice::FPGA:
return "FPGA";
case OrtDevice::NPU:
Expand Down Expand Up @@ -1579,7 +1577,7 @@ void addObjectMethods(py::module& m, ExecutionProviderRegistrationFn ep_registra
.def_static("cann", []() { return OrtDevice::NPU; })
.def_static("fpga", []() { return OrtDevice::FPGA; })
.def_static("npu", []() { return OrtDevice::NPU; })
.def_static("dml", []() { return OrtDevice::GPU; })
.def_static("dml", []() { return OrtDevice::DML; })
.def_static("default_memory", []() { return OrtDevice::MemType::DEFAULT; });

py::class_<OrtArenaCfg> ort_arena_cfg_binding(m, "OrtArenaCfg");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ stages:
EP_NAME: gpu
CudaVersion: ${{ parameters.cuda_version }}
${{ if eq(parameters.cuda_version, '11.8') }}:
EP_BUILD_FLAGS: --enable_lto --use_tensorrt --tensorrt_home=$(Agent.TempDirectory)\TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8 --cuda_home=$(Agent.TempDirectory)\v11.8 --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80"
EP_BUILD_FLAGS: --use_dml --enable_wcos --enable_lto --use_tensorrt --tensorrt_home=$(Agent.TempDirectory)\TensorRT-10.4.0.26.Windows10.x86_64.cuda-11.8 --cuda_home=$(Agent.TempDirectory)\v11.8 --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" --cmake_extra_defines "CMAKE_SYSTEM_VERSION=10.0.18362.0"
jchen351 marked this conversation as resolved.
Show resolved Hide resolved
${{ if eq(parameters.cuda_version, '12.2') }}:
EP_BUILD_FLAGS: --enable_lto --use_tensorrt --tensorrt_home=$(Agent.TempDirectory)\TensorRT-10.4.0.26.Windows10.x86_64.cuda-12.6 --cuda_home=$(Agent.TempDirectory)\v12.2 --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80"
EP_BUILD_FLAGS: --use_dml --enable_wcos --enable_lto --use_tensorrt --tensorrt_home=$(Agent.TempDirectory)\TensorRT-10.4.0.26.Windows10.x86_64.cuda-12.6 --cuda_home=$(Agent.TempDirectory)\v12.2 --cmake_extra_defines "CMAKE_CUDA_ARCHITECTURES=52;60;61;70;75;80" --cmake_extra_defines "CMAKE_SYSTEM_VERSION=10.0.18362.0"
jchen351 marked this conversation as resolved.
Show resolved Hide resolved

- ${{ if eq(parameters.enable_linux_cuda, true) }}:
- template: py-linux-gpu-stage.yml
Expand Down
Loading