You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Integration between NeMo and NeMo-RL for audio LLMs #619
Now we'd like to apply RL training to these models and we'd like to use NeMo-RL for that. What's the easiest way to load our models into NeMo-RL? Is this something that's relatively simple to add or do you think it's a really big task?
Regarding the size of the task, it depends on the support of other upstream repos:
For text, since we already have a reference math task, as long as there's a:
hf model implementation
mcore reference implementation (configured with nemo -- for now; subject to change)
vllm implementation
the work is just to write a converter for HF -> mcore state dict & mcore -> HF state dict. We have plans to cover more common cases in the future differently than how we currently do it, so stay tuned for that 😄. The vllm implementation and mcore -> hf state dict converter isn't necessary if you use the megatron backend (provided that the megatron inference path works for that model class)
I'd say ^ is a small task if you're familiar with nemo-rl, and maybe a medium one if you are getting familiarized.
Several other things would potentially increase the effort involved, which could include (1) no vllm implementation or (2) you don't have a task (dataset + environment + loss).
That being said, we'd be happy to discuss supporting this use case!
While we don't have a guide for this since we don't have a standard prescription for it, you can get a feel for the work involved with these PRs:
I think having an audio LLM example would be pretty neat! My preference would be to have some replication of some open source recipe so that we have a reference for correctness. I'm not as familiar with the latest in the audio space; is there a popular exemplar RL recipe in the audio space?
Sorry for sending a link to our private fork :/ Yes, it's exactly the file you mention.
We are currently exploring the possibility of doing the entire training (first SFT, then RL) with NeMo libraries. We have managed to do SFT with NVIDIA/NeMo and now we want to try doing RL with NeMo-RL. We hoped that since the output of SFT is a NeMo/Megatron native model, it will be easy to just plug in into NeMo-RL, but after a quick look it does not seem that straightforward.
The point of exploring NVIDIA libraries is so that we can stay within a single ecosystem during the entire training (so that if we experiment with a new architecture, we just need to define in one framework). If we have to convert to HF after SFT, then this advantage is lost.
So I guess my question is: if we have a SpeechLM NeMo/Megatron model produced by NVIDIA/NeMo can it be easily imported to NeMo-RL or is it necessary to make substantial changes (e.g. because NeMo-RL requires models to provide additional method/attributes)?
We have managed to do SFT with NVIDIA/NeMo and now we want to try doing RL with NeMo-RL. We hoped that since the output of SFT is a NeMo/Megatron native model, it will be easy to just plug in into NeMo-RL, but after a quick look it does not seem that straightforward.
Ah I see, so your starting place is a SFT Nemo model (mcore backend && nemo2 checkpoint)? Could you share a pointer to the model config in nemo as an example? It should be possible to convert nemo2 checkpoints to a mcore checkpoint that we can consume in NeMo RL, but it would help to see the model config to make sure there's nothing surprising. FYI @yaoyu-33@hemildesai
The point of exploring NVIDIA libraries is so that we can stay within a single ecosystem during the entire training (so that if we experiment with a new architecture, we just need to define in one framework). If we have to convert to HF after SFT, then this advantage is lost.
That is very reasonable. To understand your use case: regarding converting to HF, do you purely work with megatron (nemo) checkpoints and don't deal with open-source models on HF and have your own base megatron models that you continually train?
if we have a SpeechLM NeMo/Megatron model produced by NVIDIA/NeMo can it be easily imported to NeMo-RL or is it necessary to make substantial changes (e.g. because NeMo-RL requires models to provide additional method/attributes)?
The checkpoint format (pytorch DCP) is the same, but to continually SFT in NeMo RL, we need a converter of the NeMo checkpoint model metadata to the "preferred" NeMo RL format.
Of course, at the very end there is a requirement to export to HF, but for the actual training we could rely fully on Megatron format.
Either way, it seems like the disconnect between NeMo and NeMo-RL pushes us towards the HF ecosystem, which is a bit more friendly for teams with limited engineering support.
Activity
terrykong commentedon Jul 9, 2025
Hi @jkaniewski-tii . Thanks for your interest in NeMo RL. I'm not able to view the link, but just to confirm, is that just a fork of https://github.com/nvidia/nemo/tree/main/nemo/collections/speechlm ?
Regarding the size of the task, it depends on the support of other upstream repos:
For text, since we already have a reference math task, as long as there's a:
the work is just to write a converter for HF -> mcore state dict & mcore -> HF state dict. We have plans to cover more common cases in the future differently than how we currently do it, so stay tuned for that 😄. The vllm implementation and mcore -> hf state dict converter isn't necessary if you use the megatron backend (provided that the megatron inference path works for that model class)
I'd say ^ is a small task if you're familiar with nemo-rl, and maybe a medium one if you are getting familiarized.
Several other things would potentially increase the effort involved, which could include (1) no vllm implementation or (2) you don't have a task (dataset + environment + loss).
That being said, we'd be happy to discuss supporting this use case!
While we don't have a guide for this since we don't have a standard prescription for it, you can get a feel for the work involved with these PRs:
mcore model support
* https://github.com/NVIDIA-NeMo/RL/pull/590/files
* #591
new modality
* #521
I think having an audio LLM example would be pretty neat! My preference would be to have some replication of some open source recipe so that we have a reference for correctness. I'm not as familiar with the latest in the audio space; is there a popular exemplar RL recipe in the audio space?
jkaniewski-tii commentedon Jul 9, 2025
Hi, thanks for your reply.
Sorry for sending a link to our private fork :/ Yes, it's exactly the file you mention.
We are currently exploring the possibility of doing the entire training (first SFT, then RL) with NeMo libraries. We have managed to do SFT with NVIDIA/NeMo and now we want to try doing RL with NeMo-RL. We hoped that since the output of SFT is a NeMo/Megatron native model, it will be easy to just plug in into NeMo-RL, but after a quick look it does not seem that straightforward.
The point of exploring NVIDIA libraries is so that we can stay within a single ecosystem during the entire training (so that if we experiment with a new architecture, we just need to define in one framework). If we have to convert to HF after SFT, then this advantage is lost.
So I guess my question is: if we have a SpeechLM NeMo/Megatron model produced by NVIDIA/NeMo can it be easily imported to NeMo-RL or is it necessary to make substantial changes (e.g. because NeMo-RL requires models to provide additional method/attributes)?
Thanks for the refs, I'll take a look.
Regarding a popular recipe for audio LLM: I don't think there is one. Some research papers have published their code, but I wouldn't call them popular. Here is one example:
https://github.com/xiaomi-research/r1-aqa
In terms of models Qwen2-Audio is a popular audio LLM available from HF:
https://huggingface.co/Qwen/Qwen2-Audio-7B
jkaniewski-tii commentedon Jul 9, 2025
Oh, and maybe one more question: if we want to run NeMo-RL inside a container, is there a specific Docker image you'd recommend?
terrykong commentedon Jul 9, 2025
Ah I see, so your starting place is a SFT Nemo model (mcore backend && nemo2 checkpoint)? Could you share a pointer to the model config in nemo as an example? It should be possible to convert nemo2 checkpoints to a mcore checkpoint that we can consume in NeMo RL, but it would help to see the model config to make sure there's nothing surprising. FYI @yaoyu-33 @hemildesai
That is very reasonable. To understand your use case: regarding converting to HF, do you purely work with megatron (nemo) checkpoints and don't deal with open-source models on HF and have your own base megatron models that you continually train?
The checkpoint format (pytorch DCP) is the same, but to continually SFT in NeMo RL, we need a converter of the NeMo checkpoint model metadata to the "preferred" NeMo RL format.
terrykong commentedon Jul 9, 2025
re: docker image
we plan on publishing one to save time, but we've had to punt on that due to limited BW. The container we'd publish can be built here
https://docs.nvidia.com/nemo/rl/latest/docker.html (recommend either the hermetic or release one. the base one has issues and we will likely remove it)
We'll look at publishing one next release (post v0.3 which is imminent)
jkaniewski-tii commentedon Jul 15, 2025
Hi, sorry for a slow reply.
Yes, we have the pretraining done in Megatron and we wanted to do SFT and then possibly RL within NVIDIA ecosystem. Our model config is something similar to this:
https://github.com/NVIDIA/NeMo/blob/main/examples/speechlm/conf/salm/salm_llama3.2-3b_fc_fc_peft.yaml
Of course, at the very end there is a requirement to export to HF, but for the actual training we could rely fully on Megatron format.
Either way, it seems like the disconnect between NeMo and NeMo-RL pushes us towards the HF ecosystem, which is a bit more friendly for teams with limited engineering support.
But thanks a lot for assistance and discussion
snowmanwwg commentedon Jul 30, 2025
@jkaniewski-tii Do you think this would help https://github.com/NVIDIA-NeMo/RL/tree/main/nemo_rl/models/megatron/converters This is still WIP and will be merged in the next release.
snowmanwwg commentedon Dec 6, 2025
@jkaniewski-tii To update you (1) NeMo-RL now uses NeMo Megatron-bridge which accepts megatron model checkpoint, or HF checkpoint as we have an online-conversion built in. (2) We also have a container published in case you need that. More updates in our release notes https://github.com/NVIDIA-NeMo/RL/releases/tag/v0.4.0
21 remaining items