Do not wait for a thunk's input buffers before executing #3686
All Vouch review confidence checks passed
Residual risk 0.14 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 213 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.321
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3686"
general
weight: 0.35
giordano
Found while profiling PracticalLuxBench's U-net (Lux + Reactant, batch 16). In the training loop the host spends ~7.5 ms of each 9.5 ms step blocked in
cuLaunchHostFunc/future wait, then does ~2 ms of launch work while the GPU sits idle: the generated thunk callsXLA.synced_bufferon every input, and the inputs of step n+1 are the outputs of step n.PJRT (and IFRT) already order an execution after the computations that produce its input buffers (definition events on the device stream), the same way JAX dispatches without waiting on input futures. So pass the buffers through without waiting (
unsynced_buffer) and leave each buffer's future in place, soto_host/synchronize/raw pointer access on the host still wait.Train step: 9.5 → 8.5 ms/step with identical losses (same env, stock JLL). Together with EnzymeAD/Enzyme-JAX#3841 (cuDNN backward-filter lowering of the transposed-conv filter gradient) the step is 5.7–6.2 ms, vs. 6.8 ms for
torch.compileon the same RTX 5090.Error propagation: if a producing execution failed, PJRT surfaces the error on the dependent execution and on the buffer's future, so a failing step is still reported at the next step or on readback rather than lost.
Tests run locally on CUDA:
core/compile core/buffer_donation core/aliasing core/autodiff core/control_flow core/array_ops core/ops, 1249/1250 passing; the one failure (condition12: compile test,-1.78e-15 ≈ 0.0) fails identically on unmodified main (a GPU reduction-order rounding against an exact zero).🤖 Generated with Claude Code
https://claude.ai/code/session_01K1GPCnUaQKiMLASni1N1eu