Skip to content

Qwen3 finetune recipes - #975

Merged
ananthsub merged 8 commits into
NVIDIA-NeMo:mainfrom
ananthsub:qwen3-finetune
Oct 22, 2025
Merged

Qwen3 finetune recipes#975
ananthsub merged 8 commits into
NVIDIA-NeMo:mainfrom
ananthsub:qwen3-finetune

Conversation

@ananthsub

@ananthsub ananthsub commented Oct 16, 2025

Copy link
Copy Markdown
Contributor
  1. Import the pretrained checkpoints using AutoBridge: https://github.com/NVIDIA-NeMo/Megatron-Bridge/blob/main/examples/conversion/convert_checkpoints.py

  2. In the user train script, import qwen3 finetuning configs + specify paths to pretrained checkpoints from step 1 to begin finetuning

train script: https://gist.github.com/ananthsub/69139c3a8e30f57b4aa09eef422559cb

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
@copy-pr-bot

copy-pr-bot Bot commented Oct 16, 2025

Copy link
Copy Markdown

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.

@ananthsub

Copy link
Copy Markdown
Contributor Author

/ok to test d0ecaf0

Comment thread src/megatron/bridge/recipes/qwen/qwen3.py
return _qwen3_finetune_common(**combined_kwargs)


def _qwen3_finetune_common(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

how is finetune common different from common? do we need 2 of them? @cuichenx as well

@ananthsub ananthsub Oct 16, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

i find it easier to read when they're split up. otherwise the user has to keep track of branching between pretraining vs sft vs peft across parallelisms, lr, dataset, and tokenizers. in addition, the finetuning recipe configs will have a lot of code in common, at least based on https://github.com/NVIDIA-NeMo/NeMo/blob/main/nemo/collections/llm/recipes/finetune_default.py

if anything, having _qwen3_sft_common and _qwen3_peft_common helpers will make the split even more obvious to users/developers. wdyt?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i think it makes sense to separate finetune and pretrain. the data config, checkpoint config and tokenizer are all different. i think it even makes sense to have a common finetune helper for all models

Comment thread src/megatron/bridge/recipes/qwen/qwen3.py
Comment thread src/megatron/bridge/recipes/qwen/qwen3.py Outdated
Comment thread src/megatron/bridge/recipes/qwen/qwen3.py
Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
@ananthsub

Copy link
Copy Markdown
Contributor Author

/ok to test 37e0a2f

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
@ananthsub

Copy link
Copy Markdown
Contributor Author

/ok to test 8bb57ab

@ananthsub
ananthsub merged commit a8f15a1 into NVIDIA-NeMo:main Oct 22, 2025
31 checks passed
@ananthsub
ananthsub deleted the qwen3-finetune branch October 22, 2025 16:21
chtruong814 pushed a commit that referenced this pull request Oct 22, 2025
* qwen3 finetuning configs

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* qwen3 finetuning configs

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* qwen3 finetune

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* qwen3 finetune recipes

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* updates

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* revert changes to gpt step

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* address feedback

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* add load dir

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

---------

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: NeMo Bot <nemo-bot@nvidia.com>
ananthsub added a commit that referenced this pull request Oct 23, 2025
* qwen3 finetuning configs



* qwen3 finetuning configs



* qwen3 finetune



* qwen3 finetune recipes



* updates



* revert changes to gpt step



* address feedback



* add load dir



---------

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: NeMo Bot <nemo-bot@nvidia.com>
Co-authored-by: Ananth Subramaniam <ansubramania@nvidia.com>
paul-gibbons pushed a commit to paul-gibbons/Megatron-Bridge that referenced this pull request Oct 29, 2025
* qwen3 finetuning configs

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* qwen3 finetuning configs

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* qwen3 finetune

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* qwen3 finetune recipes

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* updates

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* revert changes to gpt step

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* address feedback

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* add load dir

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

---------

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: Paul Gibbons <pgibbons@nvidia.com>
nv-mollys pushed a commit that referenced this pull request Oct 31, 2025
* qwen3 finetuning configs

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* qwen3 finetuning configs

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* qwen3 finetune

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* qwen3 finetune recipes

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* updates

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* revert changes to gpt step

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* address feedback

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

* add load dir

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>

---------

Signed-off-by: Ananth Subramaniam <ansubramania@nvidia.com>
Signed-off-by: mollys <mollys@mollys.nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

r0.2.0 Cherry-pick label for r0.2.0 release branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants