[JAX] Triton binding#2437
Merged
Merged
Conversation
Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
for more information, see https://pre-commit.ci
Contributor
Greptile OverviewGreptile SummaryThis PR adds a new
Key implementation details:
Confidence Score: 4/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant User as JAX Primitive
participant TCL as triton_call_lowering
participant CT as compile_triton
participant GPU as gpu_triton (JAX)
participant FFI as JAX FFI
User->>TCL: Call with kernel_fn, ctx, arrays, grid
TCL->>TCL: Get compute capability
TCL->>TCL: Build signature from avals
TCL->>TCL: Normalize grid to 3D
alt Autotuned Kernel
loop For each config
TCL->>CT: Compile with config params
CT->>CT: Check cache
CT->>CT: Build ASTSource
CT->>CT: Compile to PTX
CT->>GPU: Create TritonKernel
GPU-->>CT: Return kernel
CT-->>TCL: Return cached/compiled kernel
TCL->>GPU: Create TritonKernelCall
end
TCL->>GPU: Create TritonAutotunedKernelCall
else Regular Kernel
TCL->>CT: Compile kernel
CT-->>TCL: Return kernel
TCL->>GPU: Create TritonKernelCall
end
TCL->>GPU: Serialize to protobuf
TCL->>FFI: ffi_lowering with compressed proto
FFI-->>User: Return MLIR result
|
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
Collaborator
Author
|
/te-ci JAX L0 |
jberchtold-nvidia
previously approved these changes
Dec 2, 2025
jberchtold-nvidia
left a comment
Collaborator
There was a problem hiding this comment.
LGTM, thanks!
Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com> Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
for more information, see https://pre-commit.ci
Collaborator
Author
|
/te-ci JAX L0 |
Signed-off-by: Phuong Nguyen <phuonguyen@nvidia.com>
Collaborator
Author
|
/te-ci JAX L0 |
for more information, see https://pre-commit.ci
jberchtold-nvidia
approved these changes
Dec 2, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds utilities to lower the JAX custom call to the Triton kernel.
Type of change
Checklist: