Fix bugs on the train ppo - #54
Merged
Merged
Conversation
* fix(train_ppo): 使用 setsid 和 kill PGID 改进后台服务器清理 - 使用 `setsid` 在独立的进程组中启动 AgentGym 服务器。这确保了由 `conda run` 启动的所有子进程都属于同一个组。 - 修改 `trap EXIT` 清理逻辑,使用 `kill -- -PGID` 杀死整个进程组,而不是仅杀死初始的 `conda run` PID。这样可以更可靠地终止服务器及其所有潜在的子进程。 - 将存储的 ID 从 PID 改为 PGID。 - 移除了之前检查服务器进程是否存在的逻辑,因为 `setsid` 很快退出,该检查不再可靠。 此更改解决了主脚本退出时 AgentGym 服务器可能由于信号未通过 `conda run` 正确传播而无法正确终止的问题。 TODO: 检查 train_grpo.sh 并应用类似的服务端清理逻辑。 * fix(train_ppo): 改进 AgentGym 服务器管理和启动检查 - **新增基于网络端口 (`nc`) 的服务器启动检查逻辑,替代原先不可靠的 PID 检查。** - 实现端口检查的重试机制,并在检查失败时触发清理并退出。 --------- Co-authored-by: chenzp15 <chenzp15@lenovo.com>
realtmxi
pushed a commit
that referenced
this pull request
May 23, 2025
* adding new reward & delete unused modules * Fix/agentgym server cleanup (#53) * fix(train_ppo): 使用 setsid 和 kill PGID 改进后台服务器清理 - 使用 `setsid` 在独立的进程组中启动 AgentGym 服务器。这确保了由 `conda run` 启动的所有子进程都属于同一个组。 - 修改 `trap EXIT` 清理逻辑,使用 `kill -- -PGID` 杀死整个进程组,而不是仅杀死初始的 `conda run` PID。这样可以更可靠地终止服务器及其所有潜在的子进程。 - 将存储的 ID 从 PID 改为 PGID。 - 移除了之前检查服务器进程是否存在的逻辑,因为 `setsid` 很快退出,该检查不再可靠。 此更改解决了主脚本退出时 AgentGym 服务器可能由于信号未通过 `conda run` 正确传播而无法正确终止的问题。 TODO: 检查 train_grpo.sh 并应用类似的服务端清理逻辑。 * fix(train_ppo): 改进 AgentGym 服务器管理和启动检查 - **新增基于网络端口 (`nc`) 的服务器启动检查逻辑,替代原先不可靠的 PID 检查。** - 实现端口检查的重试机制,并在检查失败时触发清理并退出。 --------- Co-authored-by: chenzp15 <chenzp15@lenovo.com> * fix config bugs * . * . --------- Co-authored-by: rxdaozhang <37535540+rxdaozhang@users.noreply.github.com> Co-authored-by: chenzp15 <chenzp15@lenovo.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix bugs on the train_ppo.sh and adding more dependency to the requirements.txt
✅ Checks
type/descript(e.g.feature/add-llm-agents)ℹ Additional Information