Skip to content

Conversation

@chenjiaoAngel
Copy link
Contributor

@chenjiaoAngel chenjiaoAngel commented Dec 26, 2025

What does this PR do?

Add concise overview of what this PR aims to achieve or accomplish. Reference related GitHub issues and PRs that help with the review.

User Trainer node to do validate process when run mode on fully-async, It can save time for validate computing and reduce perf/time_of_step peak

  • add new use_trainer_do_validate on fully_async async_training config to decide whether using trainer node to do validate process
  • use_trainer_do_validate: default is false
  • It can improve performance of validate, such as in dapo_7b_math_fsdp2_8_8.sh, it can improve about 1X speed
image image
  • optimized the process_validation_metrics() on _validate() process, when input datasets len=1444, it latency reduce from 150+s to 40+s
image image

Checklist Before Starting

  • Search for similar PRs. Paste at least one query link here: ...
  • Format the PR title as [{modules}] {type}: {description} (This will be checked by the CI)
    • {modules} include fsdp, megatron, sglang, vllm, rollout, trainer, ci, training_utils, recipe, hardware, deployment, ray, worker, single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data, cfg, reward
    • If this PR involves multiple modules, separate them with , like [megatron, fsdp, doc]
    • {type} is in feat, fix, refactor, chore, test
    • If this PR breaks any API (CLI arguments, config, function signature, etc.), add [BREAKING] to the beginning of the title.
    • Example: [BREAKING][fsdp, megatron] feat: dynamic batching

Test

For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluation results, etc.

  • on test scripts such as dapo_7b_math_fsdp2_8_8.sh add async_training.use_trainer_do_validate=True command to do compute
  • the result of this function on Qwen2.5-Math-7B model
  • the baseline scripts is dapo_7b_math_fsdp2_8_8.sh
  • the optimized scripts is dapo_7b_math_fsdp2_8_8.sh +async_training.use_trainer_do_validate=True
  • the acc and perfomance is below:
image image
  • green: optimized case (async_training.use_trainer_do_validate=True )
  • gray: baseline case (async_training.use_trainer_do_validate=False )

API and Usage Example

Demonstrate how the API changes if any, and provide usage example(s) if possible.

# Add code snippet or script demonstrating how to use this
async_training.use_trainer_do_validate=True \

Design & Code Changes

Demonstrate the high-level design if this PR is complex, and list the specific changes.

Checklist Before Submitting

Important

Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces the functionality to perform validation on the trainer node, controlled by the use_trainer_do_validate flag. The changes span across configuration, worker logic, data handling, and synchronization. Key modifications include adding the use_trainer_do_validate flag, conditionally assigning the ActorRollout role to the trainer, splitting the validation dataset, and updating the trainer to merge validation metrics. The overall approach is sound, but I've identified a few critical issues related to robustness and potential runtime errors that should be addressed. Specifically, there are concerns with how unique actor names are generated, how validation results are merged, and how datasets are split. These are detailed in the comments.

@chenjiaoAngel chenjiaoAngel changed the title [fsdp, fully-async] feat: add validate process on trainer node when use_trainer_do_valida… [fsdp, fully-async] feat: add validate process on trainer node when use_trainer_do_validate=True … Dec 29, 2025
@ArronHZG ArronHZG self-requested a review December 29, 2025 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant