Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
V
verl
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ZhangXiaoyun
verl
Commits
cb943be5
Unverified
Commit
cb943be5
authored
Mar 15, 2025
by
Guangming Sheng
Committed by
GitHub
Mar 15, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[misc] fix: validation batch repeat before feed into rollout (#614)
parent
6133ae92
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
4 deletions
+8
-4
verl/trainer/ppo/ray_trainer.py
+5
-0
verl/workers/rollout/vllm_rollout/vllm_rollout.py
+2
-3
verl/workers/rollout/vllm_rollout/vllm_rollout_spmd.py
+1
-1
No files found.
verl/trainer/ppo/ray_trainer.py
View file @
cb943be5
...
...
@@ -505,6 +505,10 @@ class RayPPOTrainer(object):
for
test_data
in
self
.
val_dataloader
:
test_batch
=
DataProto
.
from_single_dict
(
test_data
)
# repeat test batch
test_batch
=
test_batch
.
repeat
(
repeat_times
=
self
.
config
.
actor_rollout_ref
.
rollout
.
val_kwargs
.
n
,
interleave
=
True
)
# we only do validation on rule-based rm
if
self
.
config
.
reward_model
.
enable
and
test_batch
[
0
]
.
non_tensor_batch
[
'reward_model'
][
'style'
]
==
'model'
:
return
{}
...
...
@@ -537,6 +541,7 @@ class RayPPOTrainer(object):
# pad to be divisible by dp_size
test_gen_batch_padded
,
pad_size
=
pad_dataproto_to_divisor
(
test_gen_batch
,
self
.
actor_rollout_wg
.
world_size
)
test_output_gen_batch_padded
=
self
.
actor_rollout_wg
.
generate_sequences
(
test_gen_batch_padded
)
# unpad
test_output_gen_batch
=
unpad_dataproto
(
test_output_gen_batch_padded
,
pad_size
=
pad_size
)
print
(
'validation generation end'
)
...
...
verl/workers/rollout/vllm_rollout/vllm_rollout.py
View file @
cb943be5
...
...
@@ -191,7 +191,7 @@ class vLLMRollout(BaseRollout):
'top_k'
:
self
.
config
.
val_kwargs
.
top_k
,
'top_p'
:
self
.
config
.
val_kwargs
.
top_p
,
'temperature'
:
self
.
config
.
val_kwargs
.
temperature
,
'n'
:
self
.
config
.
val_kwargs
.
n
,
'n'
:
1
,
# if validate, already repeat in ray_trainer
}
# users can customize different sampling_params at different run
...
...
@@ -248,4 +248,4 @@ class vLLMRollout(BaseRollout):
if
self
.
config
.
free_cache_engine
:
self
.
inference_engine
.
free_cache_engine
()
return
DataProto
(
batch
=
batch
)
\ No newline at end of file
return
DataProto
(
batch
=
batch
)
verl/workers/rollout/vllm_rollout/vllm_rollout_spmd.py
View file @
cb943be5
...
...
@@ -204,7 +204,7 @@ class vLLMRollout(BaseRollout):
'top_k'
:
self
.
config
.
val_kwargs
.
top_k
,
'top_p'
:
self
.
config
.
val_kwargs
.
top_p
,
'temperature'
:
self
.
config
.
val_kwargs
.
temperature
,
'n'
:
self
.
config
.
val_kwargs
.
n
,
'n'
:
1
,
# if validate, already repeat in ray_trainer
}
# users can customize different sampling_params at different run
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment