verl icon indicating copy to clipboard operation
verl copied to clipboard

TP与SP配置问题

Open andyzhang778 opened this issue 1 year ago • 4 comments

请问有TP与SP的配置有冲突/限制么,我们在4x8 A100上训练Qwen3-32B,在不同的TP(tensor_model_parallel_size)与SP(ulysses_sequence_parallel_size)的组合下,模型的generate出现不同的现象,TP=8,SP=4时总会出现严重的幻觉,同时调小这两个参数时又会正常。

python3 -m verl.trainer.main_ppo \
    data.train_files=$DATA_DIR/train.parquet \
    data.val_files=$DATA_DIR/test.parquet \
    data.train_data_num=null \
    data.val_data_num=null \
    data.train_batch_size=256 \
    data.val_batch_size=256 \
    data.max_prompt_length=30720 \
    data.max_response_length=4096 \
    data.max_start_length=4096 \
    data.max_obs_length=4096 \
    algorithm.adv_estimator=grpo \
    actor_rollout_ref.model.path=$BASE_MODEL \
    actor_rollout_ref.model.enable_gradient_checkpointing=True \
    actor_rollout_ref.model.use_remove_padding=True \
    actor_rollout_ref.actor.optim.lr=2e-7 \
    actor_rollout_ref.actor.optim.lr_warmup_steps_ratio=0.285 \
    actor_rollout_ref.actor.use_kl_loss=True \
    actor_rollout_ref.actor.ppo_mini_batch_size=128 \
    actor_rollout_ref.actor.ppo_micro_batch_size=64 \
    actor_rollout_ref.actor.use_dynamic_bsz=true \
    actor_rollout_ref.actor.fsdp_config.param_offload=true \
    actor_rollout_ref.actor.fsdp_config.optimizer_offload=true \
    actor_rollout_ref.actor.ppo_max_token_len_per_gpu=12288 \
    actor_rollout_ref.actor.ulysses_sequence_parallel_size=2 \
    actor_rollout_ref.rollout.log_prob_micro_batch_size=64 \
    actor_rollout_ref.rollout.tensor_model_parallel_size=4 \
    actor_rollout_ref.rollout.name=vllm \
    actor_rollout_ref.rollout.enable_chunked_prefill=false \
    actor_rollout_ref.rollout.gpu_memory_utilization=0.8 \
    actor_rollout_ref.rollout.enforce_eager=$ENFORCE_EAGER \
    actor_rollout_ref.rollout.free_cache_engine=$FREE_CACHE_ENGINE \
    actor_rollout_ref.ref.log_prob_micro_batch_size=64 \
    actor_rollout_ref.ref.fsdp_config.param_offload=true \
    actor_rollout_ref.actor.kl_loss_coef=0.001 \
    actor_rollout_ref.actor.kl_loss_type=low_var_kl \
    algorithm.no_think_rl=false \
    actor_rollout_ref.rollout.n_agent=10 \
    actor_rollout_ref.rollout.temperature=1 \
    actor_rollout_ref.actor.state_masking=True \
    trainer.logger=['wandb'] \
    +trainer.val_only=false \
    +trainer.val_before_train=true \
    trainer.default_hdfs_dir=null \
    trainer.n_gpus_per_node=8 \
    trainer.nnodes=4 \
    trainer.save_freq=3 \
    trainer.test_freq=3 \
    trainer.project_name=$WANDB_PROJECT \
    trainer.experiment_name=$EXPERIMENT_NAME \
    trainer.total_epochs=5 \
    trainer.total_training_steps=100 \
    trainer.default_hdfs_dir=null \
    trainer.default_local_dir=$DEFAULT_LOCAL_DIR \

andyzhang778 avatar Jun 04 '25 12:06 andyzhang778

so, what you have figured out?

xiaolouge123 avatar Jul 09 '25 07:07 xiaolouge123

我们测评时发现单节点32B不同TP SP不影响测评效果,多节点不同TP SP会影响分数,有时候和单机一样的分数,大部分情况远低于单机score

wzyxwqx avatar Jul 24 '25 13:07 wzyxwqx

@wzyxwqx 我们发现该现象主要出现在a100上,换到h20后多节点score正常

andyzhang778 avatar Aug 07 '25 03:08 andyzhang778

定时清理检查结论:根据该 issue 的 comments 与 timeline,最近一次非当前运行账号的公开回复或公开引用是 2025-08-07T03:53:57Z,来源为 mentioned(作者 wzyxwqx,链接:https://github.com/verl-project/verl/issues/1848)。这个时间距离当前定时任务运行日期 2026-07-07 已超过 6 个月。

因此按照社区 issue 定时清理标准关闭此 issue。检查来源包括该 issue 的公开页面 https://github.com/verl-project/verl/issues/1848、comments 列表和 timeline 事件。如果作者或社区成员仍能提供新的复现、证据或需求背景,欢迎重新评论请求重开,或创建新的 issue 并引用本 issue。


Scheduled cleanup check: based on this issue's comments and timeline, the latest public reply or public reference from an account other than the current automation account was 2025-08-07T03:53:57Z. The source was mentioned by wzyxwqx: https://github.com/verl-project/verl/issues/1848. This is more than 6 months before the scheduled run date, 2026-07-07.

Therefore, this issue is being closed under the scheduled issue cleanup policy. The checked sources include the public issue page https://github.com/verl-project/verl/issues/1848, the comments list, and timeline events. If the author or community can still provide a fresh reproduction, evidence, or requirement context, please comment to request reopening or file a new issue referencing this one.

This response was generated by a scheduled Codex GPT5.5 issue processing task.

Kirrito-k423 avatar Jul 07 '26 01:07 Kirrito-k423