[JAX] Warmup FFIs with "initialize" stage#2800
Open
jberchtold-nvidia wants to merge 2 commits intoNVIDIA:mainfrom
Open
[JAX] Warmup FFIs with "initialize" stage#2800jberchtold-nvidia wants to merge 2 commits intoNVIDIA:mainfrom
jberchtold-nvidia wants to merge 2 commits intoNVIDIA:mainfrom
Conversation
Signed-off-by: Jeremy Berchtold <jberchtold@nvidia.com>
for more information, see https://pre-commit.ci
Collaborator
Author
|
/te-ci L1 jax |
Contributor
Greptile SummaryThis PR adds XLA FFI "initialize" stage handlers to warm up CUDA/cuDNN kernels for JAX custom calls, addressing JIT compilation latency on first use. Each new Key changes:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant JAX as JAX/XLA Runtime
participant Prepare as prepare stage
participant Init as initialize stage<br/>(new in this PR)
participant Exec as execute stage
JAX->>Prepare: prepare (e.g. CudnnHandleInitHandler)
Note over Prepare: cuDNN/cuBLAS handles init,<br/>UB buffer allocation
JAX->>Init: initialize (e.g. FusedAttnForwardInitializeHandler)
Note over Init: wrapInStreamCapture(...)
Init->>Init: cudaStreamBeginCapture(stream, Relaxed)
Init->>Init: OriginalFFI(stream, args...)
Note over Init: CUDA/cuDNN kernels JIT-compiled<br/>but not executed
Init->>Init: cudaStreamEndCapture(stream, &graph)
Init->>Init: cudaGraphDestroy(graph)
Note over Init: Graph discarded — warmup only
JAX->>Exec: execute (e.g. FusedAttnForwardHandler)
Note over Exec: Actual kernel execution<br/>uses pre-warmed JIT cache
Reviews (2): Last reviewed commit: "[pre-commit.ci] auto fixes from pre-comm..." | Re-trigger Greptile |
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
Add "initialize" stage to TE FFIs that didn't previously have them.
Type of change
Changes
Checklist: