RL icon indicating copy to clipboard operation
RL copied to clipboard

gemma-3-4b-it got nan probs_ratio in both FSDP1/FSDP2

Open yuki-97 opened this issue 1 year ago • 5 comments

repro: commit id: 0d05ba2d493907a24fc48e949da1cda192967907

RUN_COMMAND="uv run python examples/run_grpo_math.py \
    --config examples/configs/grpo_math_8B.yaml \
    grpo.max_num_steps=100 \
    grpo.val_period=1000 \
    policy.model_name=google/gemma-3-4b-it \
    policy.dtensor_cfg.enabled=true \
    policy.dtensor_cfg.tensor_parallel_size=2 \
    policy.generation.vllm_cfg.tensor_parallel_size=2 \
    checkpointing.enabled=false \
    logger.wandb_enabled=true \
    logger.tensorboard_enabled=false \
    logger.monitor_gpus=true \
    logger.wandb.project={WANDB_PROJECT} \
    logger.wandb.name=${EXP_NAME} \
    cluster.num_nodes=${NUM_ACTOR_NODES} \
    cluster.gpus_per_node=8"

at step15, some metrics are still normal, but the probs_ratio is nan. at step16, almost all the metrics become abnormal. Image

yuki-97 avatar May 20 '25 08:05 yuki-97

Hi :-) @yuki-666 I am encountering difficulties running the Gemma-3-4B-IT model with GRPO implementation. Specifically, I consistently receive the following error: AttributeError: 'Gemma3TextModel' object has no attribute 'model'. Could you provide guidance on the proper configuration and execution methodology for this setup?

Minniesse avatar May 26 '25 09:05 Minniesse

Hi @Minniesse , uv run python examples/run_grpo_math.py policy.model_name=google/gemma-3-4b-it could run well.

I feel it may be because of the version of transformers, transformers==4.51.3 is ok. Can you provide your run script and transformers version?

yuki-97 avatar May 26 '25 11:05 yuki-97

Trace another issue for AttributeError: 'Gemma3TextModel' object has no attribute 'model' here: https://github.com/NVIDIA/NeMo-RL/issues/453

yuki-97 avatar May 29 '25 09:05 yuki-97

This issue is stale because it has been open for 30 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jul 24 '25 02:07 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale.

github-actions[bot] avatar Jul 31 '25 02:07 github-actions[bot]