Skip to content

Commit ee7c1cb

Browse files
authored
Merge branch 'main' into add_nv_dist_ci_20260810
2 parents 39df70e + a0d5682 commit ee7c1cb

24 files changed

Lines changed: 3784 additions & 1351 deletions

File tree

cmake/FlagTreeOptions.cmake

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,14 @@ function(flagtree_add_tle_generated_header_dependencies)
454454
list(APPEND _flagtree_tle_codegen_deps TritonTLETransformsIncGen)
455455
endif()
456456
457+
set(_flagtree_enflame_tle_header_targets
458+
MLIRTritonToGCU_gcu300
459+
MLIRTritonToGCU_gcu400
460+
MLIRGCUTritonToTritonGPU_gcu400
461+
MLIRTritonGCUTransforms_gcu400
462+
triton_gcu300_core
463+
triton_gcu400_core)
464+
457465
# Native compiler targets include TLE generated headers under __TLE__ guards.
458466
# The TLE dialect is added after the core libraries, so the dependency must be
459467
# attached explicitly once the TLE tablegen targets exist; otherwise a clean
@@ -466,16 +474,21 @@ function(flagtree_add_tle_generated_header_dependencies)
466474
TritonNVIDIAGPUToLLVM
467475
TritonGPUToLLVM
468476
NVHopperTransforms
477+
${_flagtree_enflame_tle_header_targets}
469478
triton
470479
triton-opt
471480
triton-reduce
472481
triton-lsp
473482
triton-llvm-opt
474483
triton-tensor-layout)
475-
if(TARGET ${_flagtree_tle_header_target})
476-
add_dependencies(${_flagtree_tle_header_target}
477-
${_flagtree_tle_codegen_deps})
478-
endif()
484+
foreach(_flagtree_tle_dependency_target IN ITEMS
485+
${_flagtree_tle_header_target}
486+
obj.${_flagtree_tle_header_target})
487+
if(TARGET ${_flagtree_tle_dependency_target})
488+
add_dependencies(${_flagtree_tle_dependency_target}
489+
${_flagtree_tle_codegen_deps})
490+
endif()
491+
endforeach()
479492
endforeach()
480493
endfunction()
481494
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
set(LLVM_TARGET_DEFINITIONS Passes.td)
1+
flagtree_spec_td_set(LLVM_TARGET_DEFINITIONS Passes.td)
22
mlir_tablegen(Passes.h.inc -gen-pass-decls -name TritonGPU)
33
add_public_tablegen_target(TritonGPUTransformsIncGen)

python/setup_tools/utils/enflame.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -85,19 +85,6 @@ def install_extension(*args, **kargs):
8585

8686
project_root_dir = cmake_dir.parent.parent
8787

88-
# Modify nvidia driver's is_active() to return False for enflame backend
89-
drvfile = project_root_dir / 'third_party' / 'nvidia' / 'backend' / 'driver.py'
90-
if drvfile.exists():
91-
with open(drvfile, 'r') as f:
92-
lines = f.readlines()
93-
for i, line in enumerate(lines):
94-
if 'def is_active():' in line:
95-
if i + 1 < len(lines) and 'return False' not in lines[i + 1]:
96-
lines.insert(i + 1, ' return False\n')
97-
break
98-
with open(drvfile, 'w') as f:
99-
f.writelines(lines)
100-
10188
dst_dir = project_root_dir / "third_party" / "enflame" / "backend"
10289
dst_dir.mkdir(parents=True, exist_ok=True)
10390

python/test/tle/unit/test_tle_d2d_barrier.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,15 @@ export FLAGCX_P2P_DISABLE=1
3131
#export FLAGCX_DEBUG=TRACE
3232
#export FLAGCX_DEBUG_SUBSY
3333

34+
port=8333
35+
# Check whether port is occupied
36+
while ss -ltn | grep -q ":${port} "; do
37+
echo "Port ${port} is occupied, trying next..."
38+
port=$((port + 2))
39+
done
40+
41+
echo "Using master_port=${port}"
42+
3443
run_test() {
3544
local script_dir
3645
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -40,7 +49,7 @@ run_test() {
4049
--nnodes=1 \
4150
--node_rank=0 \
4251
--master_addr=localhost \
43-
--master_port=8333 \
52+
--master_port=${port} \
4453
"${script_dir}/test_tle_d2d_barrier.py"
4554
}
4655

python/test/tle/unit/test_tle_distributed_d2d.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@ export FLAGCX_MEM_ENABLE=1
88
export FLAGCX_VMM_ENABLE=0
99
export FLAGCX_P2P_DISABLE=1
1010

11+
port=8333
12+
# Check whether port is occupied
13+
while ss -ltn | grep -q ":${port} "; do
14+
echo "Port ${port} is occupied, trying next..."
15+
port=$((port + 2))
16+
done
17+
18+
echo "Using master_port=${port}"
19+
1120
run_test() {
1221
local script_dir
1322
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -17,7 +26,7 @@ run_test() {
1726
--nnodes=1 \
1827
--node_rank=0 \
1928
--master_addr=localhost \
20-
--master_port=8333 \
29+
--master_port=${port} \
2130
"${script_dir}/test_tle_distributed_d2d.py"
2231
}
2332

python/test/tle/unit/test_tle_get_local_pe.sh

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export FLAGCX_USE_HETERO_COMM=1
1717
export FLAGCX_MEM_ENABLE=1
1818
export FLAGCX_VMM_ENABLE=0
1919
export FLAGCX_P2P_DISABLE=1
20-
export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
2120
# Need to preload customized gloo library specified for FlagCX linkage
2221
#export LD_PRELOAD=/usr/local/lib/libgloo.so
2322
#export LD_PRELOAD=/usr/local/nccl/build/lib/libnccl.so
@@ -30,6 +29,17 @@ export CUDA_VISIBLE_DEVICES=0,1,2,3,4,5,6,7
3029
#export FLAGCX_DMABUF_ENABLE=1
3130
#export FLAGCX_DEBUG=TRACE
3231
#export FLAGCX_DEBUG_SUBSY
32+
33+
34+
port=8333
35+
# Check whether port is occupied
36+
while ss -ltn | grep -q ":${port} "; do
37+
echo "Port ${port} is occupied, trying next..."
38+
port=$((port + 2))
39+
done
40+
41+
echo "Using master_port=${port}"
42+
3343
run_test() {
3444
local script_dir
3545
script_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
@@ -39,7 +49,7 @@ run_test() {
3949
--nnodes=1 \
4050
--node_rank=0 \
4151
--master_addr=localhost \
42-
--master_port=8333 \
52+
--master_port=${port} \
4353
"${script_dir}/test_tle_get_local_pe.py"
4454
}
4555

python/triton/experimental/tle/language/communication.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ def cleanup_communicator():
157157

158158
def init_communicator():
159159
global comm, rank, _init_communicator_
160-
if _init_communicator_:
160+
if enabled and _init_communicator_:
161161
return
162162
dist.init_process_group(backend="nccl")
163163
rank = dist.get_rank()

0 commit comments

Comments
 (0)