NVIDIA-NeMo / NVIDIA-NeMo/RL

SFT on Qwen 1B with PP=2 VPP=2 fails for megatron backend

Open
#2,494 0 comments 0 reactions 1 assignee Claimed by @terrykong View on GitHub
accuracy bug
Dominant language
Python
Stars
2k
Forks
561
Avg merge
4d 5h
Merged PRs (30d)
145

Description

**Describe the bug**

This is a follow-up of https://github.com/NVIDIA-NeMo/RL/pull/1126/changes, when using https://github.com/NVIDIA-NeMo/RL/pull/1126/changes, the following functional test is failing:

```bash
#!/bin/bash

uv run examples/run_sft.py \
--config examples/configs/recipes/llm/sft-llama3.1-8b-1n8g-megatron.yaml \
policy.model_name=Qwen/Qwen3-0.6B \
policy.tokenizer.name=Qwen/Qwen3-0.6B \
cluster.gpus_per_node=2 \
sft.max_num_steps=3 \
sft.val_batches=1 \
sft.val_period=3 \
logger.tensorboard_enabled=true \
policy.megatron_cfg.tensor_model_parallel_size=1 \
policy.megatron_cfg.sequence_parallel=false \
policy.megatron_cfg.pipeline_model_parallel_size=2 \
policy.megatron_cfg.virtual_pipeline_model_parallel_size=7 \
policy.sequence_packing.enabled=true \
policy.train_global_batch_size=16 \
$@

uv run tests/json_dump_tb_logs.py $LOG_DIR --output_path $JSON_METRICS

uv run tests/check_metrics.py $JSON_METRICS \
'data["train/loss"]["3"] < 0.8' \
```

The same test runs if we set PP=4, we need to figure out if this is a MCore bug or a NemoRL one.

**Steps/Code to reproduce bug**

Please list *minimal* steps or code snippet for us to be able to reproduce the bug.

A helpful guide on on how to craft a minimal bug report http://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports.

**Expected behavior**

A clear and concise description of what you expected to happen.

**Additional context**

Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.