Skip to content

[Bug] VIME: Gemma4-26B-MOE, Garbled Rollout Outputs on 4×8 A800 40GB GPUs with EP4/PP2/TP2 ,Notice that HF1 !=HF1-Megatron-HF2 #388

Description

@chenchao9999

Bug Description

Environment

  • Framework: VIME
  • GPU: NVIDIA A800 40GB
  • Cluster: 4 nodes × 8 GPUs
  • Parallelism: EP4 / PP2 / TP2

Problem

The rollout outputs are garbled.

Preliminary investigation suggests that the issue may be related to weight transfer/synchronization between the actor and rollout workers.

The torch_dist checkpoint was generated using the official VIME conversion script.

Training / Inference Deployment

I am using the disaggregated training and inference mode, with actor and rollout workers separated.

The relevant configuration is:

--actor-num-nodes "${NNODES}" \
--actor-num-gpus-per-node "${ACTOR_GPUS_PER_NODE}" \
--rollout-num-gpus "${ROLLOUT_NUM_GPUS}" \

### Steps to Reproduce

# VIME: Garbled Rollout Outputs on 4×8 A800 40GB GPUs with EP4/PP2/TP2

## Environment

* Framework: VIME
* GPU: NVIDIA A800 40GB
* Cluster: 4 nodes × 8 GPUs
* Model parallelism: EP4 / PP2 / TP2
* Training/inference mode: Disaggregated actor and rollout deployment

## Problem

The rollout outputs are garbled.

Preliminary investigation suggests that the issue may be related to the **weight transfer/synchronization process** between the actor and rollout workers.

The initial `torch_dist` checkpoint was generated using the **official VIME conversion script**.

## Training / Inference Deployment

I am using a disaggregated training and inference setup, with actor and rollout workers separated.

```bash
--actor-num-nodes "${NNODES}" \
--actor-num-gpus-per-node "${ACTOR_GPUS_PER_NODE}" \
--rollout-num-gpus "${ROLLOUT_NUM_GPUS}" \

The deployment configuration is:

  • Actor: 4
  • Rollout: 4
  • TP = 2
  • PP = 2
  • EP = 4

Key Configuration

Checkpoint

CKPT_ARGS=(
    --hf-checkpoint "$HF_CKPT"
    --ref-load "$_REF_PATH"
    --load "$_LOAD_PATH"
    --save "$SAVE_DIR"
    --save-interval "$SAVE_INTERVAL"
)

Rollout

ROLLOUT_ARGS=(
    --prompt-data "$PROMPT_DATA"
    --input-key prompt
    --label-key label
    --apply-chat-template
    --apply-chat-template-kwargs '{"enable_thinking": false}'
    --rollout-shuffle
    --group-rm
    --custom-rm-path rewards.translation_rm.reward_func
    --rollout-function-path rollout.gen_then_batch_rm.generate_rollout
    --num-rollout "$NUM_ROLLOUT"
    --rollout-batch-size "$ROLLOUT_BS"
    --over-sampling-batch-size "$OVER_SAMPLING_BS"
    --n-samples-per-prompt "$N_SAMPLES"
    --rollout-max-response-len "$MAX_RESP"
    --rollout-temperature "$TEMPERATURE"
    --num-steps-per-rollout "$NUM_STEPS_PER_ROLLOUT"
    --global-batch-size "$GLOBAL_BS"
    --balance-data
)

Model Parallelism / Performance

PERF_ARGS=(
    --tensor-model-parallel-size "$TP"
    --sequence-parallel
    --pipeline-model-parallel-size "$PP"
    --context-parallel-size "$CP"
    --expert-model-parallel-size "$EP"
    --expert-tensor-parallel-size "$ETP"
    --recompute-granularity full
    --recompute-method uniform
    --recompute-num-layers 1
    --use-dynamic-batch-size
    --calculate-per-token-loss
    --max-tokens-per-gpu "$MAX_TOKENS_PER_GPU"
)

GRPO

GRPO_ARGS=(
    --advantage-estimator grpo
    --use-kl-loss
    --kl-loss-coef 0.00
    --kl-loss-type low_var_kl
    --entropy-coef 0.00
    --eps-clip 0.2
    --eps-clip-high 0.28
)

Optimizer

OPTIMIZER_ARGS=(
    --optimizer adam
    --lr "$LR"
    --lr-decay-style constant
    --weight-decay 0.1
    --adam-beta1 0.9
    --adam-beta2 0.98
    --optimizer-cpu-offload
    --overlap-cpu-optimizer-d2h-h2d
    --use-precision-aware-optimizer
)

vLLM Rollout

VLLM_ARGS=(
    --rollout-num-gpus-per-engine "$VLLM_TP"
    --vllm-gpu-memory-utilization "${VLLM_GPU_MEMORY_UTILIZATION}"
    --vllm-max-model-len "$((MAX_RESP + 2048))"
    --vllm-max-cudagraph-capture-size "${VLLM_MAX_CUDAGRAPH_CAPTURE_SIZE:-1}"
    --vllm-max-num-seqs "${VLLM_MAX_NUM_SEQS:-32}"
    --vllm-server-concurrency "${VLLM_SERVER_CONCURRENCY:-128}"
    --vllm-language-model-only
)

Weight Update / Synchronization

MISC_ARGS=(
    --attention-dropout 0.0
    --hidden-dropout 0.0
    --accumulate-allreduce-grads-in-fp32
    --attention-softmax-in-fp32
    --attention-backend flash
    --loss-mask-type gemma4
    --megatron-to-hf-mode "${MEGATRON_TO_HF_MODE}"
    --check-weight-update-equal
    --update-weight-mode full
    --update-weight-transport disk
    --update-weight-disk-dir /xx/vime_output/gemma4_weight_disk_debug
    --update-weight-disk-keep-files
)

In particular, I am using full weight updates with disk-based transport:

--update-weight-mode full
--update-weight-transport disk
--check-weight-update-equal

Current Investigation

The initial torch_dist checkpoint was generated using the official VIME conversion script.

At the moment, the issue appears to be related to the weight migration/update path, potentially involving one of the following stages:

  1. torch_dist checkpoint loading on the actor side.
  2. Megatron-to-HF weight conversion.
  3. Actor-to-rollout weight transfer.
  4. Weight synchronization on the vLLM rollout workers.

The rollout model can start successfully, but the generated outputs are garbled, which suggests that the rollout workers may not be receiving or reconstructing the correct model weights.

I am currently using:

--megatron-to-hf-mode "${MEGATRON_TO_HF_MODE}"
--check-weight-update-equal
--update-weight-mode full
--update-weight-transport disk

Any suggestions on how to further verify the correctness of the weight conversion and actor-to-rollout synchronization would be appreciated.

Expected Behavior

Additional Investigation

I expected the original HF checkpoint (HF1) and the checkpoint obtained through the HF1 -> Megatron -> HF2 conversion process to produce consistent inference results when deployed with vLLM.

Actual Behavior

However, the actual results are:

  • HF1: normal outputs
  • HF2: abnormal / garbled outputs

Both checkpoints were tested independently using vLLM.

Therefore, the issue appears to occur during the following conversion path:

HF1 -> Megatron (torch_dist) -> HF2

### Environment

- vime version: latest branch, commit `6cefd8463f7fa6b80b6692175975d91975f6bd3c`
- Python version: from the latest official VIME Docker image
- PyTorch version: from the latest official VIME Docker image
- CUDA/ROCm version: from the latest official VIME Docker image
- GPU type and count: 4 nodes × 8 NVIDIA A800 40GB GPUs (32 GPUs total)
- OS: Linux
- vLLM version: from the latest official VIME Docker image
- vllm-router version: from the latest official VIME Docker image
- Megatron-LM version (if relevant): from the latest official VIME Docker image

### Logs

```shell

Additional Context

Runtime Behavior

The training logs look normal and no obvious errors are reported.

However, the rollout outputs are garbled/abnormal.

In other words:

  • Training process starts and runs normally.
  • No obvious exceptions are observed in the logs.
  • Actor/rollout processes appear to initialize successfully.
  • The rollout generation itself is abnormal and produces garbled text.

Combined with the previous test:

  • HF1 deployed with vLLM: normal output
  • HF1 -> Megatron -> HF2, then deploy HF2 with vLLM: garbled output

This suggests that the issue is likely related to the model weight conversion path rather than a runtime crash or an obvious rollout initialization failure.

Pre-submission Checklist

  • I have read the CONTRIBUTING.md and understand the collaboration scope.
  • I have read the documentation and my issue is not addressed there.
  • I have searched for existing issues and this is not a duplicate.
  • I have provided a minimal, reproducible example.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions