Skip to content

Commit f2dbc81

Browse files
committed
Address reviewer comments
1 parent 367b038 commit f2dbc81

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

megatron/rl/rl_utils.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1355,7 +1355,7 @@ def prepare_data_for_update(
13551355

13561356
packing_context = None
13571357
# Build trajectories based on sequence packing or standard processing
1358-
if args.rl_use_sequence_packing:
1358+
if sequence_packing:
13591359
with nvtx_range("rl/sequence-packing", time=True):
13601360
runtime_state.packing_context = packing_context = pack_all_trajectories(
13611361
trajs,
@@ -1942,11 +1942,11 @@ def megatron_rl_inference_mode(
19421942
_maybe_prefetch_separate_inference_model_weights(model_core, to_cpu=True)
19431943

19441944
if offload_optimizer_during_inference:
1945-
with nvtx_range("rl/onload-optimizer-after-inference", time=True):
1946-
with nvtx_range("rl/onload/grad-buffers", time=True):
1945+
with nvtx_range("rl/restore-optimizer-after-inference", time=True):
1946+
with nvtx_range("rl/restore/grad-buffers", time=True):
19471947
model_for_grad_offload = training_model if training_model is not None else model
19481948
model_for_grad_offload[0].restore_grad_buffers()
1949-
with nvtx_range("rl/onload/optimizer-state", time=True):
1949+
with nvtx_range("rl/restore/optimizer-state", time=True):
19501950
optimizer.restore_from_cpu()
19511951

19521952
# Set training model back to train mode (not inference model if they're separate)

0 commit comments

Comments
 (0)