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

[cuda] Move to hal/drivers and wire up BUILD files #14620

Merged
merged 1 commit into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -79,5 +79,6 @@
# Runtime
/runtime/src/iree/ @benvanik
/runtime/src/iree/hal/cts/ @ScottTodd
/runtime/src/iree/hal/drivers/cuda2/ @antiagainst
/runtime/src/iree/hal/drivers/metal/ @antiagainst
/runtime/src/iree/hal/drivers/vulkan/ @antiagainst @ScottTodd
22 changes: 6 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,10 @@ option(IREE_HAL_DRIVER_DEFAULTS "Sets the default value for all runtime HAL driv
# not cross compiling. Note: a CUDA-compatible GPU with drivers is still
# required to actually run CUDA workloads.
set(IREE_HAL_DRIVER_CUDA_DEFAULT ${IREE_HAL_DRIVER_DEFAULTS})
set(IREE_HAL_DRIVER_CUDA2_DEFAULT ${IREE_HAL_DRIVER_DEFAULTS})
if(NOT IREE_CUDA_AVAILABLE OR CMAKE_CROSSCOMPILING)
set(IREE_HAL_DRIVER_CUDA_DEFAULT OFF)
set(IREE_HAL_DRIVER_CUDA2_DEFAULT OFF)
endif()

# Vulkan support is enabled by default if the platform might support Vulkan.
Expand All @@ -258,6 +260,7 @@ if(NOT APPLE OR NOT ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm64")
endif()

option(IREE_HAL_DRIVER_CUDA "Enables the 'cuda' runtime HAL driver" ${IREE_HAL_DRIVER_CUDA_DEFAULT})
option(IREE_HAL_DRIVER_CUDA2 "Enables the 'cuda2' runtime HAL driver" ${IREE_HAL_DRIVER_CUDA2_DEFAULT})
Comment on lines 262 to +263
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we come up with a plan for switching from the old cuda to the new cuda2? Maybe post an RFC and an update to #13245, and could link to one or both of those here.

Some ideas:

Ideally we'd have a timeline in mind so we don't stay in this state of having two similar paths for long.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SG. I've commented on #13245 with #13245 (comment). I'll send out a mail later too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hard for me to give a precise timeline though; given I'm multiplexing over quite a few work streams. But yeah agreed we don't want to be in a hybrid state for too long; I'm hoping to get feature parity down soon.

option(IREE_HAL_DRIVER_LOCAL_SYNC "Enables the 'local-sync' runtime HAL driver" ${IREE_HAL_DRIVER_DEFAULTS})
option(IREE_HAL_DRIVER_LOCAL_TASK "Enables the 'local-task' runtime HAL driver" ${IREE_HAL_DRIVER_DEFAULTS})
option(IREE_HAL_DRIVER_VULKAN "Enables the 'vulkan' runtime HAL driver" ${IREE_HAL_DRIVER_VULKAN_DEFAULT})
Expand Down Expand Up @@ -313,6 +316,9 @@ message(STATUS "IREE HAL drivers:")
if(IREE_HAL_DRIVER_CUDA)
message(STATUS " - cuda")
endif()
if(IREE_HAL_DRIVER_CUDA2)
message(STATUS " - cuda2")
endif()
if(IREE_HAL_DRIVER_LOCAL_SYNC)
message(STATUS " - local-sync")
endif()
Expand Down Expand Up @@ -575,22 +581,6 @@ set(IREE_PACKAGE_ROOT_PREFIX "iree")

set(CMAKE_POSITION_INDEPENDENT_CODE TRUE)

#-------------------------------------------------------------------------------
# Experimental next-generation CUDA HAL driver
# Enable with: -DIREE_EXTERNAL_HAL_DRIVERS=cuda2
#-------------------------------------------------------------------------------

iree_register_external_hal_driver(
NAME
cuda2
SOURCE_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/experimental/cuda2"
DRIVER_TARGET
iree::experimental::cuda2::registration
REGISTER_FN
iree_hal_cuda2_driver_module_register
)

#-------------------------------------------------------------------------------
# Experimental ROCM HAL driver
# Enable with: -DIREE_EXTERNAL_HAL_DRIVERS=rocm
Expand Down
21 changes: 0 additions & 21 deletions experimental/cuda2/registration/CMakeLists.txt

This file was deleted.

7 changes: 0 additions & 7 deletions experimental/cuda2/tests/CMakeLists.txt

This file was deleted.

169 changes: 0 additions & 169 deletions experimental/cuda2/tests/stablehlo_ops/CMakeLists.txt

This file was deleted.

131 changes: 0 additions & 131 deletions experimental/cuda2/tests/tosa_ops/CMakeLists.txt

This file was deleted.

Loading
Loading