Skip to content

Commit

Permalink
Add sync_memory_optimization_level for yamls
Browse files Browse the repository at this point in the history
  • Loading branch information
haolin-nju committed Jan 6, 2025
1 parent b4d9ee1 commit d861352
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions chatlearn/runtime/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@ def learn(self):
self.timers("sync_parameters").start()
self.model_manager.sync_parameters(requires_grad=False, validate=self.runtime_args.validate_param_sync)
self.timers("sync_parameters").stop()
logger.info(f"{LOG_START} " + get_full_proc_memory_info('After first param sync'))
logger.info(
f"{LOG_START} {self._name} sync_parameters summary {self.timers.log(names=['sync_parameters'])} " \
+ get_full_proc_memory_info('After first param sync')
f"{LOG_START} {self._name} sync_parameters summary {self.timers.log(names=['sync_parameters'])} "
)
self._data_loader = data_loader
for episode_id in range(self._start_episode, self.runtime_args.num_episode):
Expand Down
1 change: 1 addition & 0 deletions examples/megatron/configs/llama2/grpo_math_vllm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -66,3 +66,4 @@ runtime:
max_relay_episode: 1
exp_name: ${exp_name:chatlearn}
validate_param_sync: ${validate_param_sync:False}
sync_memory_optimization_level: ${sync_memory_optimization_level:1}
1 change: 1 addition & 0 deletions examples/megatron/configs/llama2/online_dpo_vllm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,4 @@ runtime:
output_dir: ${output_dir}
exp_name: ${exp_name:chatlearn}
validate_param_sync: ${validate_param_sync:False}
sync_memory_optimization_level: ${sync_memory_optimization_level:1}
1 change: 1 addition & 0 deletions examples/megatron/configs/llama2/vllm_param_sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ runtime:
exp_name: ${exp_name:chatlearn}
debug: ${debug:False}
validate_param_sync: ${validate_param_sync:False}
sync_memory_optimization_level: ${sync_memory_optimization_level:1}
1 change: 1 addition & 0 deletions examples/megatron/configs/llama2/vllm_rlhf.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,4 @@ runtime:
exp_name: ${exp_name:chatlearn}
debug: ${debug:False}
validate_param_sync: ${validate_param_sync:False}
sync_memory_optimization_level: ${sync_memory_optimization_level:1}

0 comments on commit d861352

Please sign in to comment.