Skip to content

Add callbacks to finetune function#2278

Merged
michal2409 merged 2 commits intomainfrom
mfutrega/finetune
Feb 9, 2026
Merged

Add callbacks to finetune function#2278
michal2409 merged 2 commits intomainfrom
mfutrega/finetune

Conversation

@michal2409
Copy link
Copy Markdown
Contributor

@michal2409 michal2409 commented Feb 9, 2026

What does this PR do ?

Add callbacks to finetune function

Changelog

  • Add specific line by line info of high level changes in this PR.

GitHub Actions CI

See the CI sectionin the Contributing doc for how to trigger the CI. A Nvidia developer will need to approve and trigger the CI for external contributors.

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Did you add or update any necessary documentation?
  • Does the PR affect components that are optional to install? (Ex: Numba, Pynini, Apex etc)
    • Reviewer: Does the PR have correct import guards for all optional libraries?

If you haven't finished some of the above items you can still open "Draft" PR.

Additional Information

  • Related to # (issue)

Summary by CodeRabbit

  • New Features
    • Added callback support to fine-tuning, allowing users to hook into and customize the training process.

@copy-pr-bot
Copy link
Copy Markdown

copy-pr-bot bot commented Feb 9, 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.

@michal2409 michal2409 requested a review from ananthsub February 9, 2026 11:57
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 9, 2026

📝 Walkthrough

Walkthrough

The finetune function in the training bridge module now accepts an optional callbacks parameter and forwards it to the underlying pretrain function. This enables callback support in finetune operations through simple parameter pass-through.

Changes

Cohort / File(s) Summary
Callback support in finetune
src/megatron/bridge/training/finetune.py
Added Callback and CallbackManager imports, introduced optional callbacks parameter to finetune function, updated docstring, and forwarded the parameter to pretrain.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 3 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Test Results For Major Changes ⚠️ Warning PR introduces callbacks parameter to finetune function but lacks test results and breaks existing tests that don't account for new keyword argument. Update existing unit tests to handle callbacks keyword argument and add new test cases verifying callbacks parameter forwarding with corrected results.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add callbacks to finetune function' accurately and concisely describes the main change: introducing callback functionality to the finetune function.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch mfutrega/finetune

No actionable comments were generated in the recent review. 🎉


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@michal2409
Copy link
Copy Markdown
Contributor Author

/ok to test 559730a

ananthsub
ananthsub previously approved these changes Feb 9, 2026
@michal2409
Copy link
Copy Markdown
Contributor Author

/ok to test cdbb03e

@michal2409 michal2409 merged commit 5793969 into main Feb 9, 2026
89 of 92 checks passed
@michal2409 michal2409 deleted the mfutrega/finetune branch February 9, 2026 20:46
sowmen pushed a commit to sowmen/Megatron-Bridge that referenced this pull request Feb 11, 2026
Signed-off-by: sowmen <sowmendipta@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants