Skip to content

Fix: Skip JIT warmup when fusion is disabled via arguments#2827

Queued
kisseternity wants to merge 11 commits intoNVIDIA:mainfrom
kisseternity:dev
Queued

Fix: Skip JIT warmup when fusion is disabled via arguments#2827
kisseternity wants to merge 11 commits intoNVIDIA:mainfrom
kisseternity:dev

Conversation

@kisseternity
Copy link

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

  • [done ] I want this PR in a versioned release and have added the appropriate Milestone (e.g., Core 0.8)
  • [done ] I have added relevant unit tests
  • [done ] I have added relevant functional tests
  • [done ] I have added proper typing to my code Typing guidelines
  • [done ] I have added relevant documentation
  • [done ] I have run the autoformatter.sh on my PR

@copy-pr-bot
Copy link

copy-pr-bot bot commented Jan 6, 2026

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@chtruong814 chtruong814 added the needs-follow-up Issue needs follow-up label Jan 11, 2026
@asolergi-nv asolergi-nv self-assigned this Jan 14, 2026
Copy link
Contributor

@asolergi-nv asolergi-nv left a comment

Choose a reason for hiding this comment

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

Looks nice, but we should check exhaustively the conditions that trigger the torch.compiled functions. Could you also add geglu? Thanks!

@kisseternity
Copy link
Author

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.

@chtruong814 chtruong814 added needs-follow-up Issue needs follow-up and removed needs-follow-up Issue needs follow-up labels Feb 5, 2026
Copy link
Contributor

@asolergi-nv asolergi-nv left a comment

Choose a reason for hiding this comment

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

Just remove some comments & we are ready!

@Phlip79 Phlip79 removed their request for review February 9, 2026 17:03
@kisseternity
Copy link
Author

Just remove some comments & we are ready!

Addressed, thanks!

@chtruong814 chtruong814 removed the needs-follow-up Issue needs follow-up label Feb 10, 2026
@chtruong814 chtruong814 added the needs-follow-up Issue needs follow-up label Feb 12, 2026
@asolergi-nv
Copy link
Contributor

/ok to test 201e816

@svcnvidia-nemo-ci svcnvidia-nemo-ci added this to the Core 0.16 milestone Mar 3, 2026
@chtruong814 chtruong814 removed the needs-follow-up Issue needs follow-up label Mar 3, 2026
@asolergi-nv asolergi-nv enabled auto-merge March 3, 2026 17:50
@kisseternity
Copy link
Author

@mcore-oncall Hello, could you please approve the pending workflow run so the CI checks can proceed? The branch has been updated and is ready for testing. Thanks!

@asolergi-nv
Copy link
Contributor

/ok to test 11eb966

@asolergi-nv asolergi-nv added this pull request to the merge queue Mar 4, 2026
@svcnvidia-nemo-ci
Copy link

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/22682094495

@svcnvidia-nemo-ci
Copy link

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/22684909191

@svcnvidia-nemo-ci
Copy link

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/22685078517

@svcnvidia-nemo-ci
Copy link

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/22685362301

@svcnvidia-nemo-ci
Copy link

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/22685853817

@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Mar 4, 2026
@Phlip79 Phlip79 added this pull request to the merge queue Mar 4, 2026
@svcnvidia-nemo-ci
Copy link

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/22694249359

@svcnvidia-nemo-ci
Copy link

🔄 Merge queue validation started!

You can track the progress here: https://github.com/NVIDIA/Megatron-LM/actions/runs/22695853372

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