Skip to content

Commit 961a823

Browse files
authored
Tentative E2E tests for gfx12, copying gfx11 with relevant sed, adding fp8 (#20084)
Add e2e matmul tests for gfx12 mirroring gfx11 with the addition of fp8 (f8E4M3) tests. While there's currently no CI for these, I have ran them on the relevant machine and they pass.
1 parent ecb2467 commit 961a823

File tree

5 files changed

+307
-9
lines changed

5 files changed

+307
-9
lines changed

build_tools/bazel/build_test_all.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
# * IREE_VULKAN_DISABLE
1919
# * IREE_NVIDIA_GPU_TESTS_DISABLE
2020
# * IREE_AMD_RDNA3_GPU_TESTS_DISABLE
21+
# * IREE_AMD_RDNA4_GPU_TESTS_DISABLE
2122
# * IREE_ARM_SME_DISABLE
2223
#
2324
# Freeform filters can be appended using:
@@ -57,6 +58,9 @@ fi
5758
if ! [[ -v IREE_AMD_RDNA3_GPU_TESTS_DISABLE ]]; then
5859
IREE_AMD_RDNA3_GPU_TESTS_DISABLE=1
5960
fi
61+
if ! [[ -v IREE_AMD_RDNA4_GPU_TESTS_DISABLE ]]; then
62+
IREE_AMD_RDNA4_GPU_TESTS_DISABLE=1
63+
fi
6064
if ! [[ -v IREE_ARM_SME_DISABLE ]]; then
6165
IREE_ARM_SME_DISABLE=1
6266
fi
@@ -69,6 +73,7 @@ declare -a test_env_args=(
6973
--test_env=IREE_VULKAN_DISABLE="${IREE_VULKAN_DISABLE}"
7074
--test_env=IREE_NVIDIA_GPU_TESTS_DISABLE="${IREE_NVIDIA_GPU_TESTS_DISABLE}"
7175
--test_env=IREE_AMD_RDNA3_GPU_TESTS_DISABLE="${IREE_AMD_RDNA3_GPU_TESTS_DISABLE}"
76+
--test_env=IREE_AMD_RDNA4_GPU_TESTS_DISABLE="${IREE_AMD_RDNA4_GPU_TESTS_DISABLE}"
7277
)
7378

7479
if ! [[ -n IREE_LLVM_SYSTEM_LINKER_PATH ]]; then
@@ -100,6 +105,9 @@ fi
100105
if (( IREE_AMD_RDNA3_GPU_TESTS_DISABLE == 1 )); then
101106
default_test_tag_filters+=("-requires-gpu-rdna3")
102107
fi
108+
if (( IREE_AMD_RDNA4_GPU_TESTS_DISABLE == 1 )); then
109+
default_test_tag_filters+=("-requires-gpu-rdna4")
110+
fi
103111
if (( IREE_ARM_SME_DISABLE == 1 )); then
104112
default_test_tag_filters+=("-requires-arm-sme")
105113
fi

build_tools/cmake/ctest_all.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ export IREE_NVIDIA_GPU_TESTS_DISABLE="${IREE_NVIDIA_GPU_TESTS_DISABLE:-1}"
4242
export IREE_NVIDIA_SM80_TESTS_DISABLE="${IREE_NVIDIA_SM80_TESTS_DISABLE:-1}"
4343
# Respect the user setting, but default to skipping tests that require RDNA3 AMD GPU.
4444
export IREE_AMD_RDNA3_TESTS_DISABLE="${IREE_AMD_RDNA3_TESTS_DISABLE:-1}"
45+
# Respect the user setting, but default to skipping tests that require RDNA4 AMD GPU.
46+
export IREE_AMD_RDNA4_TESTS_DISABLE="${IREE_AMD_RDNA4_TESTS_DISABLE:-1}"
4547
# Respect the user setting, but default to skipping tests that require more than one device(GPU).
4648
export IREE_MULTI_DEVICE_TESTS_DISABLE="${IREE_MULTI_DEVICE_TESTS_DISABLE:-1}"
4749
# Respect the user setting, default to no --repeat-until-fail.
@@ -97,6 +99,9 @@ fi
9799
if (( IREE_AMD_RDNA3_TESTS_DISABLE == 1 )); then
98100
label_exclude_args+=("^requires-gpu-rdna3$")
99101
fi
102+
if (( IREE_AMD_RDNA4_TESTS_DISABLE == 1 )); then
103+
label_exclude_args+=("^requires-gpu-rdna4$")
104+
fi
100105
if (( IREE_MULTI_DEVICE_TESTS_DISABLE == 1 )); then
101106
label_exclude_args+=("^requires-multiple-devices$")
102107
fi

tests/e2e/matmul/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,4 +640,4 @@ iree_generated_e2e_runner_test(
640640
("f32", "f32"),
641641
]]
642642

643-
# TODO(#19465): add large matmul tests for rdna3.
643+
# TODO(#19465): add large matmul tests for rdna3 and rdna4.

tests/e2e/matmul/CMakeLists.txt

Lines changed: 256 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,7 @@ iree_generated_e2e_runner_test(
13741374

13751375
### BAZEL_TO_CMAKE_PRESERVES_ALL_CONTENT_BELOW_THIS_LINE ###
13761376

1377-
# To distinguish between CDNA(gfx9) and RDNA3(gfx11)
1377+
# To distinguish between CDNA(gfx9), RDNA3(gfx11), and RDNA4(gfx12)
13781378
if(IREE_HIP_TEST_TARGET_CHIP MATCHES "^gfx9")
13791379

13801380
unset(IREE_HIP_TEST_COMPILER_FLAGS)
@@ -1925,4 +1925,259 @@ iree_generated_e2e_runner_test(
19251925
"requires-gpu-rdna3"
19261926
)
19271927

1928+
elseif(IREE_HIP_TEST_TARGET_CHIP MATCHES "^gfx12")
1929+
1930+
unset(IREE_HIP_TEST_COMPILER_FLAGS)
1931+
list(APPEND IREE_HIP_TEST_COMPILER_FLAGS
1932+
"--iree-hip-target=${IREE_HIP_TEST_TARGET_CHIP}"
1933+
)
1934+
1935+
iree_generated_e2e_runner_test(
1936+
NAME
1937+
e2e_matmul_rocm_f16_large_rdna4_wmma
1938+
TEST_TYPE
1939+
matmul
1940+
GENERATOR
1941+
"generate_e2e_matmul_tests.py"
1942+
GENERATOR_ARGS
1943+
"--lhs_rhs_type=f16"
1944+
"--acc_type=f32"
1945+
"--compilation_info=LLVMGPUVectorDistributeWMMAR4"
1946+
"--shapes=easy_large_static"
1947+
TEST_RUNNER
1948+
iree_tools_testing_e2e_iree-e2e-matmul-test
1949+
TARGET_BACKENDS
1950+
"rocm"
1951+
DRIVERS
1952+
"hip"
1953+
COMPILER_FLAGS
1954+
${IREE_HIP_TEST_COMPILER_FLAGS}
1955+
RUNNER_ARGS
1956+
"--require_exact_results=false"
1957+
"--acceptable_fp_delta=1e-04"
1958+
LABELS
1959+
"noasan"
1960+
"nomsan"
1961+
"notsan"
1962+
"noubsan"
1963+
"requires-gpu-rdna4"
1964+
)
1965+
1966+
iree_generated_e2e_runner_test(
1967+
NAME
1968+
e2e_matmul_rocm_f16_large_rdna4_wmma_tb
1969+
TEST_TYPE
1970+
matmul
1971+
GENERATOR
1972+
"generate_e2e_matmul_tests.py"
1973+
GENERATOR_ARGS
1974+
"--lhs_rhs_type=f16"
1975+
"--acc_type=f32"
1976+
"--transpose_rhs"
1977+
"--compilation_info=LLVMGPUVectorDistributeWMMAR4"
1978+
"--shapes=easy_large_static"
1979+
TEST_RUNNER
1980+
iree_tools_testing_e2e_iree-e2e-matmul-test
1981+
TARGET_BACKENDS
1982+
"rocm"
1983+
DRIVERS
1984+
"hip"
1985+
COMPILER_FLAGS
1986+
${IREE_HIP_TEST_COMPILER_FLAGS}
1987+
RUNNER_ARGS
1988+
"--require_exact_results=false"
1989+
"--acceptable_fp_delta=1e-04"
1990+
LABELS
1991+
"noasan"
1992+
"nomsan"
1993+
"notsan"
1994+
"noubsan"
1995+
"requires-gpu-rdna4"
1996+
)
1997+
1998+
iree_generated_e2e_runner_test(
1999+
NAME
2000+
e2e_matmul_rocm_f8E4M3FN_large_rdna4_wmma
2001+
TEST_TYPE
2002+
matmul
2003+
GENERATOR
2004+
"generate_e2e_matmul_tests.py"
2005+
GENERATOR_ARGS
2006+
"--lhs_rhs_type=f8E4M3FN"
2007+
"--acc_type=f32"
2008+
"--compilation_info=LLVMGPUVectorDistributeWMMAR4"
2009+
"--shapes=easy_large_static"
2010+
TEST_RUNNER
2011+
iree_tools_testing_e2e_iree-e2e-matmul-test
2012+
TARGET_BACKENDS
2013+
"rocm"
2014+
DRIVERS
2015+
"hip"
2016+
COMPILER_FLAGS
2017+
${IREE_HIP_TEST_COMPILER_FLAGS}
2018+
RUNNER_ARGS
2019+
"--require_exact_results=false"
2020+
"--acceptable_fp_delta=1e-04"
2021+
LABELS
2022+
"noasan"
2023+
"nomsan"
2024+
"notsan"
2025+
"noubsan"
2026+
"requires-gpu-rdna4"
2027+
)
2028+
2029+
iree_generated_e2e_runner_test(
2030+
NAME
2031+
e2e_matmul_rocm_f8e4M3FN_large_rdna4_wmma_tb
2032+
TEST_TYPE
2033+
matmul
2034+
GENERATOR
2035+
"generate_e2e_matmul_tests.py"
2036+
GENERATOR_ARGS
2037+
"--lhs_rhs_type=f8E4M3FN"
2038+
"--acc_type=f32"
2039+
"--transpose_rhs"
2040+
"--compilation_info=LLVMGPUVectorDistributeWMMAR4"
2041+
"--shapes=easy_large_static"
2042+
TEST_RUNNER
2043+
iree_tools_testing_e2e_iree-e2e-matmul-test
2044+
TARGET_BACKENDS
2045+
"rocm"
2046+
DRIVERS
2047+
"hip"
2048+
COMPILER_FLAGS
2049+
${IREE_HIP_TEST_COMPILER_FLAGS}
2050+
RUNNER_ARGS
2051+
"--require_exact_results=false"
2052+
"--acceptable_fp_delta=1e-04"
2053+
LABELS
2054+
"noasan"
2055+
"nomsan"
2056+
"notsan"
2057+
"noubsan"
2058+
"requires-gpu-rdna4"
2059+
)
2060+
2061+
iree_generated_e2e_runner_test(
2062+
NAME
2063+
e2e_matmul_rocm_i8_large_rdna4_wmma_tb
2064+
TEST_TYPE
2065+
matmul
2066+
GENERATOR
2067+
"generate_e2e_matmul_tests.py"
2068+
GENERATOR_ARGS
2069+
"--lhs_rhs_type=i8"
2070+
"--acc_type=i32"
2071+
"--transpose_rhs"
2072+
"--compilation_info=LLVMGPUVectorDistributeWMMAR4"
2073+
"--shapes=easy_large_static"
2074+
TEST_RUNNER
2075+
iree_tools_testing_e2e_iree-e2e-matmul-test
2076+
TARGET_BACKENDS
2077+
"rocm"
2078+
DRIVERS
2079+
"hip"
2080+
COMPILER_FLAGS
2081+
${IREE_HIP_TEST_COMPILER_FLAGS}
2082+
LABELS
2083+
"noasan"
2084+
"nomsan"
2085+
"notsan"
2086+
"noubsan"
2087+
"requires-gpu-rdna4"
2088+
)
2089+
2090+
iree_generated_e2e_runner_test(
2091+
NAME
2092+
e2e_matmul_rdna4_dt_f16
2093+
TEST_TYPE
2094+
matmul
2095+
GENERATOR
2096+
"generate_e2e_matmul_tests.py"
2097+
GENERATOR_ARGS
2098+
"--lhs_rhs_type=f16"
2099+
"--acc_type=f32"
2100+
TEST_RUNNER
2101+
iree_tools_testing_e2e_iree-e2e-matmul-test
2102+
TARGET_BACKENDS
2103+
"rocm"
2104+
DRIVERS
2105+
"hip"
2106+
COMPILER_FLAGS
2107+
${IREE_HIP_TEST_COMPILER_FLAGS}
2108+
"--iree-opt-data-tiling"
2109+
"--iree-global-opt-experimental-rocm-data-tiling"
2110+
"--iree-global-opt-enable-early-materialization=true"
2111+
RUNNER_ARGS
2112+
"--require_exact_results=false"
2113+
"--acceptable_fp_delta=1e-04"
2114+
LABELS
2115+
"noasan"
2116+
"nomsan"
2117+
"notsan"
2118+
"noubsan"
2119+
"requires-gpu-rdna4"
2120+
)
2121+
2122+
iree_generated_e2e_runner_test(
2123+
NAME
2124+
e2e_matmul_rdna4_dt_f8E4M3FN
2125+
TEST_TYPE
2126+
matmul
2127+
GENERATOR
2128+
"generate_e2e_matmul_tests.py"
2129+
GENERATOR_ARGS
2130+
"--lhs_rhs_type=f8E4M3FN"
2131+
"--acc_type=f32"
2132+
TEST_RUNNER
2133+
iree_tools_testing_e2e_iree-e2e-matmul-test
2134+
TARGET_BACKENDS
2135+
"rocm"
2136+
DRIVERS
2137+
"hip"
2138+
COMPILER_FLAGS
2139+
${IREE_HIP_TEST_COMPILER_FLAGS}
2140+
"--iree-opt-data-tiling"
2141+
"--iree-global-opt-experimental-rocm-data-tiling"
2142+
"--iree-global-opt-enable-early-materialization=true"
2143+
RUNNER_ARGS
2144+
"--require_exact_results=false"
2145+
"--acceptable_fp_delta=1e-04"
2146+
LABELS
2147+
"noasan"
2148+
"nomsan"
2149+
"notsan"
2150+
"noubsan"
2151+
"requires-gpu-rdna4"
2152+
)
2153+
2154+
iree_generated_e2e_runner_test(
2155+
NAME
2156+
e2e_matmul_rdna4_dt_i8
2157+
TEST_TYPE
2158+
matmul
2159+
GENERATOR
2160+
"generate_e2e_matmul_tests.py"
2161+
GENERATOR_ARGS
2162+
"--lhs_rhs_type=i8"
2163+
"--acc_type=i32"
2164+
TEST_RUNNER
2165+
iree_tools_testing_e2e_iree-e2e-matmul-test
2166+
TARGET_BACKENDS
2167+
"rocm"
2168+
DRIVERS
2169+
"hip"
2170+
COMPILER_FLAGS
2171+
${IREE_HIP_TEST_COMPILER_FLAGS}
2172+
"--iree-opt-data-tiling"
2173+
"--iree-global-opt-experimental-rocm-data-tiling"
2174+
"--iree-global-opt-enable-early-materialization=true"
2175+
LABELS
2176+
"noasan"
2177+
"nomsan"
2178+
"notsan"
2179+
"noubsan"
2180+
"requires-gpu-rdna4"
2181+
)
2182+
19282183
endif()

0 commit comments

Comments
 (0)