Skip to content

[TLE] Add device intra node barrier and change the logic of pulling the third-party tileir#739

Merged
Galaxy1458 merged 38 commits into
mainfrom
add_intra_node_barrier
Jul 18, 2026
Merged

[TLE] Add device intra node barrier and change the logic of pulling the third-party tileir#739
Galaxy1458 merged 38 commits into
mainfrom
add_intra_node_barrier

Conversation

@Galaxy1458

@Galaxy1458 Galaxy1458 commented Jul 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR adds support for GPU-to-GPU (device-to-device) barriers within a node in the TLE backend, enabling synchronization across multiple GPUs through the FlagCX runtime.
Also fix build tilrir backend.

Changes

Python frontend

  • Extend check_and_handle_device_intra_barrier() to recognize device barriers.
  • Lower distributed_barrier(..., space="device", comm_ptr=...) into the tle.device_intra_barrier operation.

MLIR

Introduce a new operation:

  • tle.device_intra_barrier for FlagCxOp

The operation represents an intra-node GPU-to-GPU synchronization barrier with configurable:

  • barrier type (arrive, wait, sync)
  • cooperative group scope
  • barrier index
  • memory ordering
  • multimem mode

LLVM Lowering

Lower tle.device_intra_barrier to the corresponding FlagCX runtime APIs:

  • flagcxIntraBarrierArriveS
  • flagcxIntraBarrierWaitS
  • flagcxIntraBarrierSyncS

The runtime function is selected based on the requested barrier type.

Motivation

This PR introduces a dedicated IR representation for intra-node GPU-to-GPU synchronization, instead of representing it as a generic distributed barrier. It also establishes the infrastructure for future multi-GPU synchronization primitives built on the FlagCX runtime.

Example:

 tle.distributed_barrier(
              device_dptr=device_dptr, space="device",barrier_kind="sync"
)

@Galaxy1458
Galaxy1458 requested a review from sunnycase as a code owner July 2, 2026 09:50
@Galaxy1458
Galaxy1458 marked this pull request as draft July 2, 2026 09:50
@github-actions github-actions Bot added the nvidia label Jul 3, 2026
@Galaxy1458
Galaxy1458 marked this pull request as ready for review July 9, 2026 03:08
Comment thread .github/workflows/nv3.6-build-and-test.yml Outdated
Comment thread python/triton/runtime/__init__.py
Comment thread third_party/nvidia/backend/driver.py Outdated
@Galaxy1458 Galaxy1458 changed the title [TLE] Add device intra node barrier [TLE] Add device intra node barrier and change the logic of pulling the third-party tileir Jul 17, 2026
sunnycase
sunnycase previously approved these changes Jul 17, 2026

@sunnycase sunnycase left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment thread python/triton/runtime/jit.py
Comment thread python/triton/runtime/jit.py Outdated
Comment thread third_party/nvidia/backend/compiler.py
Comment thread python/triton/runtime/jit.py
Removed commented line related to flagtree in distributed context.
zhzhcookie
zhzhcookie previously approved these changes Jul 17, 2026

@zhzhcookie zhzhcookie left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zhzhcookie
zhzhcookie force-pushed the add_intra_node_barrier branch from a196e55 to 3ec900f Compare July 17, 2026 16:54
@Galaxy1458
Galaxy1458 merged commit 2a2e9c0 into main Jul 18, 2026
16 of 20 checks passed
@Galaxy1458
Galaxy1458 deleted the add_intra_node_barrier branch July 18, 2026 15:16
zhzhcookie added a commit that referenced this pull request Jul 19, 2026
…he third-party tileir (#739)

* init device intra node barrier

* add conversions

* fix conversion bug

* add python api args

* add python api args

* fix conversion bug

* add test case

* adjust dir

* fix test case bug

* solve conflict

* polish code

* fix third_party/nvidia/backend/distributed.py

* fix bugs

* add arg for GroupKind

* add flag to control tileir

* add flag to control tileir

* polish code

* enable distribued params pass

* fix bug

* update

* update

* fix comment

* polist code

* fix backend bugs

* fix comment

* Remove commented line in jit.py

Removed commented line related to flagtree in distributed context.

* Update jit.py

* Update compiler.py

* Apply code-format changes

* Initialize params list in JIT class

* Apply code-format changes

* [Build] Fix default_backends without tileir

---------

Co-authored-by: flagtree-bot <flagtree_ai@163.com>
Co-authored-by: zhzhcookie <zhengyang@baai.ac.cn>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants