Skip to content

Commit 82bb685

Browse files
committed
Merge branch 'mdziado/gluon' of https://github.com/intel/intel-xpu-backend-for-triton into mdziado/gluon
2 parents b8e202a + 86e1a9e commit 82bb685

File tree

232 files changed

+4980
-4518
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

232 files changed

+4980
-4518
lines changed

.github/workflows/inductor-tests.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ env:
5252
inductor/test_select_algorithm.py
5353
inductor/test_max_autotune.py
5454
inductor/test_compile_subprocess.py
55+
inductor/test_analysis.py
5556
5657
jobs:
5758
compute-params:

.github/workflows/third-party-benchmarks.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,18 @@ jobs:
223223
--max-new-tokens $MAX_NEW_TOKENS \
224224
--batch-size $BATCH_SIZE
225225
226+
- name: Run launch microbenchmark tests
227+
if: ${{ steps.install.outcome == 'success' && !cancelled() && (inputs.benchmarks == '' || contains(fromJson(inputs.benchmarks || '[]'), 'launch_micro_benchmarks')) && !contains(fromJson(inputs.skip_benchmarks || '[]'), 'launch_micro_benchmarks') }}
228+
run: |
229+
source scripts/capture-hw-details.sh
230+
python python/test/microbenchmark/launch_overhead.py --reports $REPORTS
231+
232+
python benchmarks/third_party/vllm/transform_results.py $REPORTS/launch_overhead_results.csv $REPORTS/launch_overhead-report.csv \
233+
--tag $TAG \
234+
--bgroup overhead \
235+
--benchmark launch-overhead \
236+
--param_cols="input_type"
237+
226238
- name: Upload benchmark reports
227239
if: ${{ steps.install.outcome == 'success' && !cancelled() }}
228240
uses: actions/upload-artifact@v5

.github/workflows/triton-benchmarks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ env:
6565
VERIFY: ${{ (github.event_name == 'pull_request' || github.event_name == 'schedule' || inputs.verify) && '1' || '0' }}
6666
TAG: ${{ inputs.tag || (github.event_name == 'pull_request' && format('pr-{0}', github.event.number)) || (github.event_name == 'schedule' && 'ci') || 'test' }}
6767
N_RUNS: ${{ inputs.n_runs || '1' }}
68+
# FIXME: Enable Level Zero v2 loader once it's stable.
69+
# https://github.com/intel/intel-xpu-backend-for-triton/issues/5572
70+
UR_LOADER_USE_LEVEL_ZERO_V2: "0"
6871

6972
jobs:
7073
build:

.github/workflows/try-latest-pytorch.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ jobs:
9696
inductor/test_select_algorithm.py
9797
inductor/test_max_autotune.py
9898
inductor/test_compile_subprocess.py
99+
inductor/test_analysis.py
99100
runner_label: ${{ inputs.runner_label }}
100101
python_version: "3.10"
101102

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ pytest.ini
5151
# Instrumentation
5252
python/triton/instrumentation
5353

54+
# MLIR Plugin
55+
python/triton/plugins
56+
5457
# Python caches
5558
__pycache__/
5659
*.py[cod]

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ option(TRITON_BUILD_PYTHON_MODULE "Build Python Triton bindings" OFF)
2020
option(TRITON_BUILD_PROTON "Build the Triton Proton profiler" ON)
2121
option(TRITON_BUILD_UT "Build C++ Triton Unit Tests" ON)
2222
option(TRITON_BUILD_WITH_CCACHE "Build with ccache (if available)" ON)
23+
option(LLVM_BUILD_SHARED_LIBS
24+
"Build all libraries as shared libraries instead of static" OFF)
2325
set(TRITON_CODEGEN_BACKENDS "" CACHE STRING "Enable different codegen backends")
2426

2527
if(TRITON_BUILD_WITH_CCACHE)
@@ -64,6 +66,7 @@ if(WIN32)
6466
set(CMAKE_EXE_LINKER_FLAGS_TRITONRELBUILDWITHASSERTS "/debug:fastlink /INCREMENTAL")
6567
set(CMAKE_MODULE_LINKER_FLAGS_TRITONRELBUILDWITHASSERTS "/debug:fastlink /INCREMENTAL")
6668
set(CMAKE_SHARED_LINKER_FLAGS_TRITONRELBUILDWITHASSERTS "/debug:fastlink /INCREMENTAL")
69+
set(LLVM_BUILD_SHARED_LIBS "0")
6770
else()
6871
message(FATAL_ERROR "Unsupported compiler")
6972
endif()

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ test-unit: all
4343
$(PYTEST) --tb=short -vs python/examples/gluon/01-attention-forward.py
4444
TRITON_ALWAYS_COMPILE=1 TRITON_DISABLE_LINE_INFO=0 LLVM_PASS_PLUGIN_PATH=python/triton/instrumentation/libGPUInstrumentationTestLib.so \
4545
$(PYTEST) --capture=tee-sys -rfs -vvv python/test/unit/instrumentation/test_gpuhello.py
46+
TRITON_PASS_PLUGIN_PATH=python/triton/plugins/libTritonPluginsTestLib.so \
47+
$(PYTEST) -vvv python/test/unit/plugins/test_plugin.py
4648
$(PYTEST) --tb=short -s -n $(NUM_PROCS) python/test/gluon
4749

4850
.PHONY: test-distributed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def inspect_stages(_self, stages, options, language, capability):
272272
# inspect or modify add_stages here
273273
triton.knobs.runtime.add_stages_inspection_hook = inspect_stages
274274
```
275-
275+
Examples of how to use this for out of tree plugin passes is [here](lib/Plugins/README.md)
276276
# Changelog
277277

278278
Version 2.0 is out! New features include:

benchmarks/third_party/vllm/transform_results.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def serialize_params(row):
4646

4747
dfs = []
4848
for compiler_name in compilers:
49-
for value_name in ['TFlops', 'GB/s']:
49+
for value_name in ['TFlops', 'GB/s', 'time_us']:
5050
col = f'{compiler_name}-{value_name}'
5151
if col not in df.columns:
5252
continue

bin/RegisterTritonDialects.h

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@
5555
#include "mlir/Conversion/NVVMToLLVM/NVVMToLLVM.h"
5656
#include "mlir/Conversion/UBToLLVM/UBToLLVM.h"
5757

58+
#include "triton/Tools/PluginUtils.h"
59+
#include "triton/Tools/Sys/GetEnv.hpp"
60+
5861
namespace mlir {
5962
namespace test {
6063
namespace intel {
@@ -165,6 +168,21 @@ inline void registerTritonDialects(mlir::DialectRegistry &registry) {
165168
mlir::triton::proton::gpu::registerScheduleBufferStorePass();
166169
mlir::triton::proton::gpu::registerAddSchedBarriersPass();
167170

171+
// Plugin passes
172+
if (std::string filename =
173+
mlir::triton::tools::getStrEnv("TRITON_PASS_PLUGIN_PATH");
174+
!filename.empty()) {
175+
176+
TritonPlugin TP(filename);
177+
std::vector<const char *> passNames;
178+
if (auto result = TP.getPassHandles(passNames); !result)
179+
llvm::report_fatal_error(result.takeError());
180+
181+
for (const char *passName : passNames)
182+
if (auto result = TP.registerPass(passName); !result)
183+
llvm::report_fatal_error(result.takeError());
184+
}
185+
168186
registry.insert<
169187
mlir::triton::TritonDialect, mlir::cf::ControlFlowDialect,
170188
mlir::triton::nvidia_gpu::TritonNvidiaGPUDialect,

0 commit comments

Comments
 (0)