verl icon indicating copy to clipboard operation
verl copied to clipboard

Cannot pass kwargs in generate_sequences

Open JackCai1206 opened this issue 1 year ago • 4 comments

The generate_sequences() method in the vLLMRollout class supports overriding the sampling parameters with kwargs passed to the function, but since we are calling generate_sequences() using a WorkerDict, I cannot pass any kwargs to the function (since the kwargs is not a DataProto object). Is there any workarounds to this issue? Or should I modify the code to pass in the sampling param in the metadata field of the prompts input?

JackCai1206 avatar Aug 09 '25 22:08 JackCai1206

For example, kwargs is available in vLLMRollout

    @GPUMemoryLogger(role="vllm rollout spmd", logger=logger)
    @torch.no_grad()
    def generate_sequences(self, prompts: DataProto, **kwargs) -> DataProto:

But not in ActorRolloutRefWorker

    @register(dispatch_mode=Dispatch.DP_COMPUTE_PROTO)
    @DistProfiler.annotate(color="red", role="rollout_generate")
    def generate_sequences(self, prompts: DataProto):

JackCai1206 avatar Aug 09 '25 23:08 JackCai1206

  • I have the same question. In the vllm_rollout_spmd.py, the kwargs in the generate_sequences() method of the vLLMRollout class should be for modifying some parameters. If you want to add parameters, you can load them through the config at the beginning. The sampling_params will load parameters from the config and override them during initialization __init__ below. Alternatively, you can directly modify the generate_sequences() method.
            # supporting adding any sampling params from the config file
            for k in config.keys():
                if hasattr(SamplingParams(), str(k)):
                    kwargs[k] = config.get(k)
    
            print(f"kwargs: {kwargs}")
    
  • For the async mode, the logic for passing sampling parameters should mainly be in the AgentLoopWorker.generate_sequences method in agent_loop.py. If you want to change the corresponding parameters, you can modify them here. Some basic parameters can still be passed through the config. There are also some structural parameters that are completed at the HTTP server layer (vLLMHttpServerBase) in vllm_async_server.py. I haven't found any other ways to pass additional sampling parameters in async mode. If you want to modify parameters other than those that can be changed by default in the config, you may have to modify the corresponding functions in the files.

Thats2Great avatar Dec 03 '25 09:12 Thats2Great

Same question

krzz2q avatar Dec 07 '25 13:12 krzz2q

定时清理检查结论 / Scheduled cleanup conclusion

该 issue 最近一次非当前运行账号的公开回复或引用是 2025-12-07T13:15:00Z(comment, actor: krzz2q),距 2026-07-15 已超过 6 个月。因此按定时清理标准关闭。若作者或社区成员仍能提供新的复现、证据或需求背景,可以继续评论请求重开,或创建新的 issue。

The latest public reply or reference from an account other than the current runner was 2025-12-07T13:15:00Z (comment, actor: krzz2q), which is more than 6 months before 2026-07-15. Therefore this is being closed under the scheduled cleanup rule. If the reporter or community can still provide a fresh reproduction, evidence, or requirement context, please comment to request reopening or open a new issue.

检查来源 / Checked sources:

  • Issue: https://github.com/verl-project/verl/issues/2994
  • Comments API: https://api.github.com/repos/verl-project/verl/issues/2994/comments
  • Timeline API: https://api.github.com/repos/verl-project/verl/issues/2994/timeline
  • Latest non-self public activity: https://github.com/verl-project/verl/issues/2994#issuecomment-3622038178

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

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