如何设置全局种子以确保所有训练均可控?How to set seed to ensure controlable training.
对于GRPO训练,其中dataloader的种子可在参数表里配置,但generate,optimizer的种子如何设置,或者说有没有ray训练进程全局种子的设置方法?我在说明文档中没有找到这一点。 For GRPO training, the seed for the dataloader can be configured in the parameter list, but how can the seeds for generate and the optimizer be set? Or rather, is there a way to set a global seed for the Ray training process? I couldn’t find this in the documentation.
There is no way to reproduce exactly experiments due to rollout. Rollout uses a non-deterministic torch operator torch.cumsum.
Setting seed is useless if the operator is non-deterministic as the divergence will become larger and larger as training progresses.
I agree with with @vermouth1992. At this point providing deterministic RLVR training is pointless due to extremely non-deterministic behavior in vLLM. Setting the the dataloader seed to ensure the ordering of the training samples is the best we can do.
@youkaichao @WoosukKwon any plan to make vllm deterministic? Verifying the correctness of RL algorithms are typically resource consuming. For regression test, if the training can be deterministic, it would be much easier to draw conclusions without running experiments for hundreds of steps
theoretically it is possible to make vllm fully deterministic, and i know there are some private deployments of vllm with this feature.
in the open-source world, it might be complicated. basically we need to control any single kernel we use, and swap it with a deterministic version. notably, cublas matmul can be non-deterministic itself.
@youkaichao @WoosukKwon any plan to make vllm deterministic? Verifying the correctness of RL algorithms are typically resource consuming. For regression test, if the training can be deterministic, it would be much easier to draw conclusions without running experiments for hundreds of steps
I completely agree this point. Even though it’s impossible to make every aspect of RL training deterministic, verl as a framework should at least—like PyTorch or Transformers—provide a way to set most of the random seeds.
theoretically it is possible to make vllm fully deterministic, and i know there are some private deployments of vllm with this feature.
in the open-source world, it might be complicated. basically we need to control any single kernel we use, and swap it with a deterministic version. notably, cublas matmul can be non-deterministic itself.
Cublas can be made deterministic via a single env var and I'm not worried. @youkaichao could you share more experience on what other kernels have non-determinism found in private deployment?
Hi @butterluo Have you find any way for deterministic training for vllm? I am encoutering non-deterministic evaluation with vllm==0.10.1 Do you have any clue for solving this?
请问将 data.seed 固定,是否就可以让每次训练的样本顺序完全一致呢?
If I fix the data.seed, will the order of the samples used in each training session be exactly the same?
请问将 data.seed 固定,是否就可以让每次训练的样本顺序完全一致呢?
If I fix the data.seed, will the order of the samples used in each training session be exactly the same?
@zhangxixi551 From my experience. The answer is yes.
请问将 data.seed 固定,是否就可以让每次训练的样本顺序完全一致呢? If I fix the data.seed, will the order of the samples used in each training session be exactly the same?
@zhangxixi551 From my experience. The answer is yes.
Thank you very much!