Skip to content

Commit 393f700

Browse files
authored
[Windows] Enable lit tests and CXX tests (#3294)
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent e7e6fa3 commit 393f700

File tree

10 files changed

+28
-8
lines changed

10 files changed

+28
-8
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,13 @@ jobs:
8383
pip install -r scripts\requirements-test.txt
8484
pip uninstall pytest_forked -y
8585
86+
- name: Run unit tests
87+
run: |
88+
.venv\Scripts\activate.ps1
89+
Invoke-BatchFile "C:\Program Files (x86)\Intel\oneAPI\setvars.bat"
90+
cd ${{ env.NEW_WORKSPACE }}
91+
${{ env.TRITON_TEST_CMD }} --unit
92+
8693
- name: Run core tests
8794
run: |
8895
.venv\Scripts\activate.ps1

.github/workflows/pip-test-windows.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,13 @@ jobs:
100100
.venv\Scripts\activate.ps1
101101
pip list -v
102102
103+
- name: Run unit tests
104+
run: |
105+
.venv\Scripts\activate.ps1
106+
Invoke-BatchFile "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
107+
cd ${{ env.NEW_WORKSPACE }}
108+
${{ env.TRITON_TEST_CMD }} --unit
109+
103110
- name: Run core tests
104111
run: |
105112
.venv\Scripts\activate.ps1

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,12 @@ if(TRITON_BUILD_PYTHON_MODULE)
299299
target_link_libraries(triton PRIVATE ${CMAKE_DL_LIBS})
300300
set_target_properties(triton PROPERTIES SUFFIX ".pyd")
301301
set_target_properties(triton PROPERTIES PREFIX "lib")
302+
if(DEFINED TRITON_PYD_PATH)
303+
string(TOUPPER "${CMAKE_BUILD_TYPE}" UPPER_CMAKE_BUILD_TYPE)
304+
set_target_properties(triton PROPERTIES
305+
RUNTIME_OUTPUT_DIRECTORY_${UPPER_CMAKE_BUILD_TYPE}
306+
"${TRITON_PYD_PATH}")
307+
endif(DEFINED TRITON_PYD_PATH)
302308
else()
303309
target_link_libraries(triton PRIVATE z)
304310
endif()

python/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ def build_extension(self, ext):
454454

455455
cmake_args += [f"-DCMAKE_BUILD_TYPE={cfg}"]
456456
if platform.system() == "Windows":
457-
cmake_args += [f"-DCMAKE_RUNTIME_OUTPUT_DIRECTORY_{cfg.upper()}={extdir}"]
457+
cmake_args += [f"-DTRITON_PYD_PATH={extdir}"]
458458
else:
459459
max_jobs = os.getenv("MAX_JOBS", str(2 * os.cpu_count()))
460460
build_args += ['-j' + max_jobs]

scripts/test-triton.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ run_unit_tests() {
178178
echo "****** Running Triton LIT tests ******"
179179
echo "***************************************************"
180180
cd $TRITON_PROJ/python/build/cmake*/test
181-
lit -v .
181+
lit -v . || $TRITON_TEST_IGNORE_ERRORS
182182
}
183183

184184
run_core_tests() {

test/Conversion/intel/tritongpu_to_gen_dot.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// RUN: triton-opt %s -split-input-file --intel-allocate-shared-memory --convert-triton-intel-gpu-to-llvm --cse -canonicalize | FileCheck %s --implicit-check-not=llvm.inline_asm --check-prefixes=CHECK,NO-AGGRESSIVE-REUSE
2-
// RUN: TRITON_INTEL_AGGRESSIVE_DPAS_REUSE=1 triton-opt %s -split-input-file --intel-allocate-shared-memory --convert-triton-intel-gpu-to-llvm --cse -canonicalize | FileCheck %s --implicit-check-not=llvm.inline_asm --check-prefixes=CHECK,AGGRESSIVE-REUSE
2+
// RUN: env TRITON_INTEL_AGGRESSIVE_DPAS_REUSE=1 triton-opt %s -split-input-file --intel-allocate-shared-memory --convert-triton-intel-gpu-to-llvm --cse -canonicalize | FileCheck %s --implicit-check-not=llvm.inline_asm --check-prefixes=CHECK,AGGRESSIVE-REUSE
33

44
#dpas = #triton_intel_gpu.dpas<{repeatCount = 8, systolicDepth = 8, executionSize = 16, opsPerChan = 2, threadsPerWarp = 16, warpsPerCTA = [1, 1], repCluster = [1, 1]}>
55
#dot_operand_a = #ttg.dot_op<{opIdx=0, parent=#dpas, kWidth=1}>

test/Conversion/intel/tritongpu_to_llvm_intel_advanced_path.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: TRITON_INTEL_ADVANCED_PATH=1 triton-opt %s --convert-triton-intel-gpu-to-llvm --split-input-file | FileCheck %s
1+
// RUN: env TRITON_INTEL_ADVANCED_PATH=1 triton-opt %s --convert-triton-intel-gpu-to-llvm --split-input-file | FileCheck %s
22

33
module attributes {"triton_intel_gpu.support_sg_2d_block", "triton_intel_gpu.support_dpas", "ttg.num-warps" = 32 : i32, "ttg.threads-per-warp" = 1 : i32} {
44
// CHECK-DAG: llvm.func spir_funccc @_Z38intel_sub_group_f16_f16_matrix_mad_k16Dv8_sDv8_iDv8_f(vector<8xi16>, vector<8xi32>, vector<8xf32>) -> vector<8xf32> attributes {convergent, memory_effects = #llvm.memory_effects<other = none, argMem = none, inaccessibleMem = none>, no_unwind, will_return}

test/Conversion/intel/tritongpu_to_llvm_intel_advanced_path_invalid.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// RUN: TRITON_INTEL_ADVANCED_PATH=1 triton-opt %s --convert-triton-intel-gpu-to-llvm --verify-diagnostics --split-input-file
1+
// RUN: env TRITON_INTEL_ADVANCED_PATH=1 triton-opt %s --convert-triton-intel-gpu-to-llvm --verify-diagnostics --split-input-file
22

33
module attributes {"triton_intel_gpu.support_sg_2d_block", "triton_intel_gpu.support_dpas", "ttg.num-warps" = 32 : i32, "ttg.threads-per-warp" = 16 : i32} {
44
tt.func public @matmul_kernel_with_block_pointers(%arg0: !tt.ptr<f32>, %arg1: i64, %arg2: i32) {

test/Conversion/intel/tritonintelgpu_to_llvm.mlir

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module attributes { "ttg.threads-per-warp" = 16 : i32, "ttg.num-warps" = 4 : i32
88
// As the assert message is shared, a single instance is emitted.
99

1010
// CHECK-DAG: llvm.mlir.global internal constant @assertFunc_("unknown\00") {addr_space = 1 : i32}
11-
// CHECK-DAG: llvm.mlir.global internal constant @assertFile_("{{.*}}/test/Conversion/intel/tritonintelgpu_to_llvm.mlir\00") {addr_space = 1 : i32}
11+
// CHECK-DAG: llvm.mlir.global internal constant @assertFile_("{{.*}}tritonintelgpu_to_llvm.mlir\00") {addr_space = 1 : i32}
1212
// CHECK-DAG: llvm.mlir.global internal constant @assertMessage_("assert text\00") {addr_space = 1 : i32}
1313
// CHECK-DAG: llvm.mlir.global internal constant @assertMessage_3("different assert text\00") {addr_space = 1 : i32}
1414
// CHECK-DAG: llvm.func spir_funccc @__assert_fail(!llvm.ptr<4>, !llvm.ptr<4>, i32, !llvm.ptr<4>)

test/TritonIntelGPU/schedule-load.mlir

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
// RUN: TRITON_INTEL_ENABLE_INSTR_SCHED=1 triton-opt %s -split-input-file -tritonintelgpu-schedule-load | FileCheck %s --check-prefixes=CHECK,SINK-ACROSS-REGIONS
2-
// RUN: TRITON_INTEL_ENABLE_INSTR_SCHED=1 TRITON_INTEL_DO_NOT_SINK_INSTR_ACROSS_RGN=1 triton-opt %s -split-input-file -tritonintelgpu-schedule-load | FileCheck %s --check-prefixes=CHECK,DO-NOT-SINK-ACROSS-REGIONS
1+
// RUN: env TRITON_INTEL_ENABLE_INSTR_SCHED=1 triton-opt %s -split-input-file -tritonintelgpu-schedule-load | FileCheck %s --check-prefixes=CHECK,SINK-ACROSS-REGIONS
2+
// RUN: env TRITON_INTEL_ENABLE_INSTR_SCHED=1 TRITON_INTEL_DO_NOT_SINK_INSTR_ACROSS_RGN=1 triton-opt %s -split-input-file -tritonintelgpu-schedule-load | FileCheck %s --check-prefixes=CHECK,DO-NOT-SINK-ACROSS-REGIONS
33

44
// -----
55
// COM: Inst Schedule for Flash Attention case

0 commit comments

Comments
 (0)