-
Notifications
You must be signed in to change notification settings - Fork 5
Swarm training #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Removed limitations section and Chinese version from TinkerScript documentation.
…ndling and configuration updates
…handling and episode management
Summary of ChangesHello @binary-husky, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request introduces the 'Swarm training' feature, a significant architectural shift designed to enable distributed reinforcement learning for large language models. It establishes a client-server model where the heavy computational load of LLM inference and training resides on a GPU-equipped server, while agent execution and reward calculation can be performed on lighter client machines. This decoupling facilitates development on non-GPU environments and scales data generation by allowing multiple clients to contribute to the training process, ultimately making LLM agent training more accessible and flexible. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces the "Swarm training" feature, a significant architectural change that decouples the agent execution and data collection from the main training loop. This enables distributed data generation, potentially on machines without GPUs, by using a client-server model with FastAPI and ZMQ. The changes are extensive, affecting configuration, the launcher, task readers, and the core training logic. While the overall direction is promising, I've identified a couple of critical issues, including a leftover debug statement that will crash the application and a bug in path handling. I've also included some medium-severity suggestions to improve the robustness of the new networking components.
| """ | ||
| assert yaml_path.endswith(".yaml"), "Configuration file must be a YAML file" | ||
| exp_base = os.path.dirname(yaml_path) | ||
| exp_base = os.path.exists(os.path.dirname(yaml_path)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line incorrectly assigns a boolean value from os.path.exists() to exp_base, which is expected to be a path string. This will cause the subsequent check os.path.exists(exp_base) to fail. The intention was likely to get the directory name.
| exp_base = os.path.exists(os.path.dirname(yaml_path)) | |
| exp_base = os.path.dirname(yaml_path) |
| self._write_swarm_rollout_dynamic_log(observation_window) | ||
|
|
||
| time.sleep(10) | ||
| raise RuntimeError("DEBUG") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| self.socket = context.socket(zmq.REP) | ||
| self.socket.bind(f"{self.episode_contect_address}") | ||
| self.socket.setsockopt(zmq.RCVTIMEO, 3*1000) # 3 second timeout for REP | ||
| self.socket.setsockopt(zmq.RCVTIMEO, 1*1000) # 3 second timeout for REP |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ZMQ receive timeout has been reduced to 1 second. This might be too aggressive and could lead to premature timeouts, especially in environments with high network latency or server load. Consider making this value configurable or reverting to a more conservative timeout to improve robustness.
| self.socket.setsockopt(zmq.RCVTIMEO, 1*1000) # 3 second timeout for REP | |
| self.socket.setsockopt(zmq.RCVTIMEO, 3*1000) # 3 second timeout for REP |
| host="0.0.0.0", | ||
| port=self.port, | ||
| log_level="error", | ||
| log_level="info", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The uvicorn log level is now hardcoded to "info". While this is helpful for debugging, it can generate a large volume of logs in a production or large-scale training environment. It would be better to make this configurable or set it to a less verbose level like "warning" or "error" by default.
| log_level="info", | |
| log_level="error", |
No description provided.