Fix: Skip JIT warmup when fusion is disabled via arguments - #2827
Fix: Skip JIT warmup when fusion is disabled via arguments#2827kisseternity wants to merge 21 commits into
Conversation
asolergi-nv
left a comment
There was a problem hiding this comment.
Looks nice, but we should check exhaustively the conditions that trigger the torch.compiled functions. Could you also add geglu? Thanks!
Thanks for the feedback! I've updated the code to add exhaustive condition checks based on the MLP & shared experts implementation. Please let me know if any additional conditions should be considered. |
asolergi-nv
left a comment
There was a problem hiding this comment.
Just remove some comments & we are ready!
Addressed, thanks! |
|
/ok to test 201e816 |
|
/ok to test b0d1dd1 |
|
/ok to test d3af9b3 |
|
/claude fix |
|
❌ Claude fix stopped because a workflow step failed. Inspect the run. |
|
@kisseternity please fix failing tests |
|
@kisseternity May you please fix failing tests? |
|
/ok to test d3af9b3 |
|
waiting on @kisseternity |
|
/claude fix |
|
❌ Claude fix stopped because a workflow step failed. Inspect the run. |
|
I'm assuming that the contribution may have changed seeding, since certain |
@cspades @janEbert — figured out what's going on and pushed a fix: 8b94191. Root cause. The PR didn't change the seed itself, but it changed how many Previously the warmup executed 5 unconditional draws. With the new conditional This is now concrete for the two failing jobs: both ran Fix. Instead of regenerating golden values, the new commit makes the warmup (The 2× sizing in the GEGLU warmup itself is intentional and kept: GEGLU Could you re-trigger the merge queue / functional tests when you get a chance? |
|
/ok to test 8b94191 |
|
@kisseternity Let me know if there's any flaw in that understanding. I guess the functional tests run on this commit will confirm/refute. |
The JIT warmup runs after _set_random_seed (pretrain() -> set_jit_fusion_options()), and historically always executed the same torch.rand warmup draws and fused bias+dropout+add warmup for every config. Those consumptions are baked into determinism-sensitive output, e.g. the golden values of the functional tests, so gating them on arguments shifts the default CUDA RNG stream and breaks golden-value comparisons. This was seen on the two --disable-bias-linear GPT jobs in the merge queue (validate_args forces bias_gelu_fusion=False there), and restoring the RNG state instead would have shifted every baseline. Make warmup RNG consumption identical to before for every config: - keep all torch.rand draws unconditional with historical shapes/order; - gate only the RNG-free bias_swiglu/bias_gelu/bias_geglu kernel calls on the fusion arguments; - for GEGLU configs warm up bias_geglu (the historical code warmed bias_gelu), doubling the drawn tensors via torch.cat so no extra RNG is consumed; - run the fused bias+dropout+add warmup unconditionally. Update the unit tests to pin this determinism contract. Signed-off-by: kisseternity <15059072+kisseternity@users.noreply.github.com>
@maanug-nv, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
|
/ok to test ed28045 |
|
/claude fix |
Signed-off-by: svcnvidia-nemo-ci <svcnvidia-nemo-ci@nvidia.com>
|
🛠️ Claude fix commit
What changed Files changed by Claude
Why DCO Sanitized and posted by |
|
/ok to test c7671d8 |
|
❌ Claude fix stopped because exact-SHA CI did not complete in time. View exact-SHA CI. |
What does this PR do ?
This PR adds conditional checks to _warmup_jit_function in initialize.py to ensure JIT fusions (Bias+GeLU/SwiGLU and Bias+Dropout+Add) are only warmed up when they are enabled via arguments (e.g., checks args.bias_gelu_fusion, args.bias_dropout_fusion). This prevents unnecessary warmup execution when users explicitly disable these fusions using flags like --no-bias-gelu-fusion.
Pre-checks
Core 0.8)