From 27c6dbc1b6488e5f14d34279463bdb7b2248dc7a Mon Sep 17 00:00:00 2001 From: wutianyao Date: Tue, 1 Sep 2026 15:29:58 +0800 Subject: [PATCH] [triton-dist](feat) update triton-distributed version --- setup_ascend.py | 2 +- third_party/ascend/backend/compiler.py | 3 ++- third_party/ascend/lib/TritonToLinalg/TritonToLinalgPass.cpp | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/setup_ascend.py b/setup_ascend.py index ac368e008a..e52158b3c4 100644 --- a/setup_ascend.py +++ b/setup_ascend.py @@ -289,7 +289,7 @@ def _ensure_distributed_submodule(): if os.getenv("TRITON_BUILD_TD", "OFF").upper() not in ["ON", "1", "YES", "TRUE", "Y"]: return distributed_dir = _THIS_DIR / "third_party" / "ascend" / "Triton-distributed-ascend" - commit_id = "7786ae06d5cf16fc232d3ccfeb4a18f5d6a9e26e" + commit_id = "c3d161a6745c36c1dd46000d793768ba682d3e13" if not distributed_dir.is_dir(): try: _git_check_call_with_retry([ diff --git a/third_party/ascend/backend/compiler.py b/third_party/ascend/backend/compiler.py index 76159ca50b..960f7d2e34 100644 --- a/third_party/ascend/backend/compiler.py +++ b/third_party/ascend/backend/compiler.py @@ -234,7 +234,7 @@ def ttir_to_linalg(mod, metadata, opt, *, named_ops=False): pm = ir.pass_manager(mod.context) pm.enable_debug() if distributed is not None: - distributed.ascend_passes.ttgpuir.add_convert_triton_distributed_to_hivm(pm) + distributed.ascend_passes.ttgpuir.add_convert_triton_distributed_to_hivm(pm, opt.core_ratio) ascend.passes.ttir.add_triton_control_flow_opt(pm) ascend.passes.ttir.add_triton_to_structure(pm, False, False) @@ -1123,6 +1123,7 @@ class NPUOptions: # Canonical modes: SIMD (D), SIMD with template-SIMT (P), and pure-SIMT # (T). ``unstructured_in_simt`` is an equivalent P spelling. compile_mode: str = "simd_simt_template" + core_ratio: str = "" simt_stack_limit: int = None # take effect on the reorder instruction pattern for SIMT. The pattern is disabled by default. enable_simt_reorder_instruction: bool = False diff --git a/third_party/ascend/lib/TritonToLinalg/TritonToLinalgPass.cpp b/third_party/ascend/lib/TritonToLinalg/TritonToLinalgPass.cpp index 76221882c3..893f08802d 100644 --- a/third_party/ascend/lib/TritonToLinalg/TritonToLinalgPass.cpp +++ b/third_party/ascend/lib/TritonToLinalg/TritonToLinalgPass.cpp @@ -1158,6 +1158,10 @@ void TritonToLinalgPass::convertTTFunc(triton::FuncOp func, const bool existDot, if (autoBlockifyAttr) funcFunc->setAttr("auto_blockify_size", autoBlockifyAttr); + auto coreRatioAttr = func->getAttr("hivm.core_ratio"); + if (coreRatioAttr) + funcFunc->setAttr("hivm.core_ratio", coreRatioAttr); + auto &funcFuncBody = funcFunc.getBody(); auto &funcBody = func.getBody();