Commit ad404cb
[megatron] fix: add protections for logits_processor_args.pop("loss_mask"), which may cause the
### What does this PR do?
Fix a bug in `gpt_model_forward_no_padding`.
The `MegatronEngineWithValueHead` class fails to pass
`logits_processor_args` to `forward_fn`, causing a crash when
`gpt_model_forward_no_padding` attempts to pop the `loss_mask`.
### Test
> No need.
### Design & Code Changes
> add `if logits_processor_args and "loss_mask" in
logits_processor_args:` check before try to
`logits_processor_args.pop("loss_mask")`
Co-authored-by: albertyi <albertyi@tencent.com>forward_fn of value net collapse (verl-project#5204)1 parent 2320603 commit ad404cb
1 file changed
+4
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
201 | | - | |
| 201 | + | |
| 202 | + | |
202 | 203 | | |
203 | 204 | | |
204 | 205 | | |
| |||
251 | 252 | | |
252 | 253 | | |
253 | 254 | | |
254 | | - | |
| 255 | + | |
| 256 | + | |
255 | 257 | | |
256 | 258 | | |
257 | 259 | | |
| |||
0 commit comments