Skip to content

Commit

Permalink
[runtime][HIP] Retire ROCm HAL backend (iree-org#17029)
Browse files Browse the repository at this point in the history
This patch retires the ROCm HAL backend given the new HIP HAL backend is
functionally complete (iree-org#15790).
The new backend has been tested and proved to give on par or better
performance compared to the ROCm backend.

The documentation still preserves the `ROCm` term to denote the AMD
compute software while using `HIP` specifically for the runtime.
  • Loading branch information
nithinsubbiah authored Jul 30, 2024
1 parent f004bf1 commit 6c45bef
Show file tree
Hide file tree
Showing 44 changed files with 19 additions and 4,187 deletions.
16 changes: 0 additions & 16 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -580,22 +580,6 @@ include(iree_plugin_register)
set(IREE_PACKAGE_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}")
set(IREE_PACKAGE_ROOT_PREFIX "iree")

#-------------------------------------------------------------------------------
# Experimental ROCM HAL driver
# Enable with: -DIREE_EXTERNAL_HAL_DRIVERS=rocm
#-------------------------------------------------------------------------------

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

#-------------------------------------------------------------------------------
# Experimental WebGPU HAL driver
# Enable with: -DIREE_EXTERNAL_HAL_DRIVERS=webgpu
Expand Down
1 change: 0 additions & 1 deletion build_tools/cmake/test_riscv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ declare -a label_exclude_args=(
"^driver=vulkan$"
"^driver=metal$"
"^driver=cuda$"
"^driver=rocm$"
"^driver=hip$"
"^vulkan_uses_vk_khr_shader_float16_int8$"
"^requires-filesystem$"
Expand Down
2 changes: 1 addition & 1 deletion build_tools/pkgci/build_linux_packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function build_wheel() {
function build_iree_runtime() {
# We install the needed build deps below for the tools.
IREE_RUNTIME_BUILD_TRACY=ON IREE_RUNTIME_BUILD_TRACY_TOOLS=ON \
IREE_EXTERNAL_HAL_DRIVERS="rocm" \
IREE_HAL_DRIVER_HIP=ON \
build_wheel runtime/
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ iree_lit_test_suite(
FileCheck
iree-compile
LABELS
"driver=rocm"
"driver=hip"
"hostonly"
)
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ the IREE compiler, then enable the ROCm compiler target with the

### Get the IREE runtime

Next you will need to get an IREE runtime that includes the ROCm HAL driver.
Next you will need to get an IREE runtime that includes the HIP HAL driver.

#### :material-hammer-wrench: Build the runtime from source

Please make sure you have followed the
[Getting started](../../building-from-source/getting-started.md) page to build
IREE from source, then enable the experimental ROCm HAL driver with the
`IREE_EXTERNAL_HAL_DRIVERS=rocm` option.
IREE from source, then enable the HIP HAL driver with the `IREE_HAL_DRIVER_HIP`
option.

## Compile and run a program model

Expand Down Expand Up @@ -108,7 +108,7 @@ Run the following command:

``` shell hl_lines="2"
iree-run-module \
--device=rocm \
--device=hip \
--module=mobilenet_rocm.vmfb \
--function=predict \
--input="1x224x224x3xf32=0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,15 +223,15 @@ def test_step_a100_vulkan_stripped(llama2_7b_f16qi4_a100_vulkan_vmfb):
def test_step_rdna3_rocm_stripped(llama2_7b_f16qi4_stripped_rdna3_rocm_vmfb):
iree_benchmark_module(
llama2_7b_f16qi4_stripped_rdna3_rocm_vmfb,
device="rocm",
device="hip",
function="first_vicuna_forward",
args=[
"--input=1x1xi64",
],
)
iree_benchmark_module(
llama2_7b_f16qi4_stripped_rdna3_rocm_vmfb,
device="rocm",
device="hip",
function="second_vicuna_forward",
args=[
"--input=1x1xi64",
Expand Down
16 changes: 8 additions & 8 deletions experimental/regression_suite/tests/pregenerated/test_ukernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ def test_correctness_gfx90a_rocm(
):
iree_run_module(
argmax_ukernel_gfx90a_rocm_vmfb,
device="rocm",
device="hip",
function="argmax_3d_dyn_f16i32",
args=[
f"--input=@{argmax_input_f16.path}",
Expand All @@ -165,7 +165,7 @@ def test_correctness_gfx90a_rocm(
)
iree_run_module(
argmax_ukernel_gfx90a_rocm_vmfb,
device="rocm",
device="hip",
function="argmax_3d_dyn_f16i64",
args=[
f"--input=@{argmax_input_f16.path}",
Expand All @@ -175,7 +175,7 @@ def test_correctness_gfx90a_rocm(

iree_run_module(
argmax_ukernel_gfx90a_rocm_vmfb,
device="rocm",
device="hip",
function="argmax_3d_dyn_f32i32",
args=[
f"--input=@{argmax_input_f32.path}",
Expand All @@ -184,7 +184,7 @@ def test_correctness_gfx90a_rocm(
)
iree_run_module(
argmax_ukernel_gfx90a_rocm_vmfb,
device="rocm",
device="hip",
function="argmax_3d_dyn_f32i64",
args=[
f"--input=@{argmax_input_f32.path}",
Expand All @@ -205,7 +205,7 @@ def test_correctness_gfx940_rocm(
):
iree_run_module(
argmax_ukernel_gfx940_rocm_vmfb,
device="rocm",
device="hip",
function="argmax_3d_dyn_f16i32",
args=[
f"--input=@{argmax_input_f16.path}",
Expand All @@ -214,7 +214,7 @@ def test_correctness_gfx940_rocm(
)
iree_run_module(
argmax_ukernel_gfx940_rocm_vmfb,
device="rocm",
device="hip",
function="argmax_3d_dyn_f16i64",
args=[
f"--input=@{argmax_input_f16.path}",
Expand All @@ -224,7 +224,7 @@ def test_correctness_gfx940_rocm(

iree_run_module(
argmax_ukernel_gfx940_rocm_vmfb,
device="rocm",
device="hip",
function="argmax_3d_dyn_f32i32",
args=[
f"--input=@{argmax_input_f32.path}",
Expand All @@ -233,7 +233,7 @@ def test_correctness_gfx940_rocm(
)
iree_run_module(
argmax_ukernel_gfx940_rocm_vmfb,
device="rocm",
device="hip",
function="argmax_3d_dyn_f32i64",
args=[
f"--input=@{argmax_input_f32.path}",
Expand Down
116 changes: 0 additions & 116 deletions experimental/rocm/CMakeLists.txt

This file was deleted.

47 changes: 0 additions & 47 deletions experimental/rocm/api.h

This file was deleted.

24 changes: 0 additions & 24 deletions experimental/rocm/context_wrapper.h

This file was deleted.

35 changes: 0 additions & 35 deletions experimental/rocm/cts/CMakeLists.txt

This file was deleted.

Loading

0 comments on commit 6c45bef

Please sign in to comment.