Skip to content

Commit 6148e07

Browse files
Revert "Remove SPV_KHR_bfloat16 workaround"
Signed-off-by: Whitney Tsang <[email protected]>
1 parent d1590f3 commit 6148e07

File tree

3 files changed

+36
-0
lines changed

3 files changed

+36
-0
lines changed

.github/workflows/build-test-reusable.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ jobs:
124124
build_llvm: ${{ inputs.build_llvm }}
125125
use_spirv_backend: ${{ inputs.use_spirv_backend }}
126126
command: >
127+
source ./scripts/capture-hw-details.sh &&
127128
DEBUG=1
128129
python -m build --wheel --no-isolation && pip install dist/*.whl
129130

scripts/skiplist/lts/language.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
# https://github.com/intel/intel-xpu-backend-for-triton/issues/4665
22
python/test/unit/language/test_core.py::test_dot3d[8-1-32-32-32-32-32-float64-float64]
33
python/test/unit/language/test_core.py::test_dot3d[4-1-64-64-64-32-32-float64-float64]
4+
# Below bfloat16 tests require IGC 1188 or above
5+
python/test/unit/language/test_core.py::test_atomic_rmw["*bfloat16*"]@regexp
6+
python/test/unit/language/test_core.py::test_tensor_atomic_rmw["*bfloat16*"]@regexp
7+
python/test/unit/language/test_core.py::test_tensor_atomic_add_non_exclusive_offset["*bfloat16*"]@regexp
8+
python/test/unit/language/test_core.py::test_tensor_atomic_add_shift_1["*bfloat16*"]@regexp
9+
python/test/unit/language/test_core.py::test_tensor_atomic_add_access_patterns["*bfloat16*"]@regexp

third_party/intel/cmake/FindSPIRVToLLVMTranslator.cmake

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,35 @@ if (NOT SPIRVToLLVMTranslator_FOUND)
2626

2727
FetchContent_MakeAvailable(spirv-llvm-translator)
2828

29+
# FIXME: Don't apply patch when LTS driver is updated.
30+
if(DEFINED ENV{AGAMA_VERSION} AND "$ENV{AGAMA_VERSION}" STREQUAL "1146")
31+
message(STATUS "Apply 3122.patch to SPIRV-LLVM-Translator")
32+
execute_process(
33+
COMMAND git apply --check ${CMAKE_CURRENT_LIST_DIR}/3122.patch
34+
WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
35+
ERROR_QUIET
36+
RESULT_VARIABLE PATCH_RESULT
37+
)
38+
if(PATCH_RESULT EQUAL 0)
39+
execute_process(
40+
COMMAND git apply ${CMAKE_CURRENT_LIST_DIR}/3122.patch
41+
WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
42+
RESULT_VARIABLE PATCH_RESULT
43+
)
44+
else()
45+
execute_process( # Check if the patch is already applied
46+
COMMAND git apply --reverse --check ${CMAKE_CURRENT_LIST_DIR}/3122.patch
47+
WORKING_DIRECTORY ${spirv-llvm-translator_SOURCE_DIR}
48+
RESULT_VARIABLE PATCH_RESULT
49+
)
50+
endif()
51+
if(NOT PATCH_RESULT EQUAL 0)
52+
message(FATAL_ERROR "Failed to apply 3122.patch to SPIRV-LLVM-Translator")
53+
endif()
54+
else()
55+
message(STATUS "No need to apply 3122.patch to SPIRV-LLVM-Translator")
56+
endif()
57+
2958
# FIXME: Don't apply patch when Agama driver is updated to incorporate with the SPV_INTEL_bfloat16_arithmetic extension.
3059
execute_process(
3160
COMMAND git apply --check ${CMAKE_CURRENT_LIST_DIR}/3388.patch

0 commit comments

Comments
 (0)