Skip to content

Commit cb5c745

Browse files
authored
[PROTON] Enable Proton dialect for XPU backend and run test_record.py in CI (#3942)
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent ca4e857 commit cb5c745

File tree

4 files changed

+8
-3
lines changed

4 files changed

+8
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ jobs:
176176
if: ${{ inputs.driver_version == 'rolling' && inputs.device == 'max1100' }}
177177
run: |
178178
cd third_party/proton/test
179-
pytest test_api.py test_lib.py test_profile.py test_viewer.py -s -v
179+
pytest test_api.py test_lib.py test_profile.py test_viewer.py test_record.py -s -v
180180
cd ..
181181
182182
- name: Run unit tests

third_party/intel/lib/TritonIntelGPUToLLVM/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,5 @@ add_triton_library(TritonIntelGPUToLLVM
3434
TritonGENToLLVM
3535
TritonIntelGPUIR
3636
TritonIntelUtils
37+
TritonProtonToLLVM
3738
)

third_party/intel/lib/TritonIntelGPUToLLVM/PipelineManager.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@
3030

3131
#include "PatternTritonGPUOpToLLVM.h"
3232

33+
#include "third_party/proton/dialect/include/TritonProtonToLLVM/PatternTritonProtonOpToLLVM.h"
34+
3335
namespace mlir {
3436

3537
FailureOr<LLVM::LLVMFuncOp>
@@ -231,6 +233,8 @@ class TritonGPUToLLVMPipelineManager {
231233
benefit);
232234
mlir::triton::populateMemoryOpToLLVMPatterns(typeConverter, targetInfo,
233235
patterns, benefit);
236+
mlir::triton::proton::populateRecordOpToLLVMPattern(
237+
typeConverter, patterns, targetInfo, benefit);
234238
intel::populateControlFlowOpToLLVMPattern(typeConverter, patterns,
235239
targetInfo, benefit);
236240
mlir::triton::populateMakeRangeOpToLLVMPattern(typeConverter, targetInfo,

third_party/proton/test/test_record.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ def add_kernel(
2929

3030
torch.manual_seed(0)
3131
size = 2**12
32-
x = torch.rand(size, device='cuda')
33-
y = torch.rand(size, device='cuda')
32+
x = torch.rand(size, device='xpu')
33+
y = torch.rand(size, device='xpu')
3434
output = torch.empty_like(x)
3535
n_elements = output.numel()
3636
grid = (1, 1, 1)

0 commit comments

Comments
 (0)