-
Notifications
You must be signed in to change notification settings - Fork 47
Distinguish repeatable/non-repeatable workflows #162
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
Conversation
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.
Summary of Changes
Hello @hiyuchang, 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 refines the system's handling of workflow execution by introducing a clear distinction between repeatable and non-repeatable workflows. The primary goal is to improve the management and assignment of unique run identifiers (run_id) to experiences, regardless of how many times a task's workflow is conceptually repeated. This change centralizes repetition logic within the workflow and runner components, leading to more robust and predictable experience generation.
Highlights
- Workflow Repeatability Distinction: Introduced a
repeatableproperty to the baseWorkflowclass and its implementations, allowing workflows to explicitly declare whether they can generate multiple experiences in a singlerun()call (repeatable) or only one (non-repeatable). - Enhanced Run ID Management: Implemented a
set_repeat_timesmethod on workflows and updated theWorkflowRunnerto passrepeat_timesandrun_id_base. This ensures that each generated experience, whether from a single repeatable workflow call or multiple non-repeatable workflow calls, receives a uniquerun_idfor better tracking. - Scheduler and Runner Adaptations: Modified the
Schedulerto correctly chunk and submit tasks, passing the appropriaterepeat_timesandrun_id_baseto theWorkflowRunner. TheWorkflowRunnernow dynamically adjusts its execution loop based on a workflow'srepeatableproperty, either calling the workflow'srun()method once for repeatable workflows or multiple times for non-repeatable ones. - Configuration Simplification: Removed the automatic setting of
rollout_args.nin the global configuration, decentralizing the control of repetition to individual workflows and theWorkflowRunnerfor more flexible and explicit management.
Using Gemini Code Assist
The 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 in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands.
| Feature | Command | Description |
|---|---|---|
| Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
| Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
| Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
| Help | /gemini help |
Displays a list of available commands. |
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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.
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 or fill out our survey to provide feedback.
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
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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 a distinction between repeatable and non-repeatable workflows. The changes to the scheduler and workflow runner are logical, and the new functionality is well-covered by tests.
My review focuses on a couple of areas to improve robustness and clarity. I've identified a potential conflict in how run_id is assigned for non-repeatable workflows, which could lead to subtle bugs. I've also pointed out a minor code redundancy in the scheduler. Addressing these points will make the implementation even more solid.
|
/unittest-module-explorer |
|
/unittest-module-explorer |
Summary
Tests
Github Test Reporter by CTRF 💚 |
|
/unittest-module-explorer |
Summary
Tests
Github Test Reporter by CTRF 💚 |
|
/unittest-all |
|
/unittest-all |
Summary
Tests
Github Test Reporter by CTRF 💚 |
|
/unittest-all |
Summary
Tests
Github Test Reporter by CTRF 💚 |
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.
Pull Request Overview
This PR introduces a distinction between repeatable and non-repeatable workflows by adding run ID management and proper handling of workflow repetition. The key changes include:
- Addition of
run_idtracking for all workflows to properly identify individual executions - Introduction of
repeatableproperty andset_repeat_times()method to distinguish workflow types - Implementation of proper loop handling for non-repeatable workflows in the workflow runner
Reviewed Changes
Copilot reviewed 22 out of 22 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| trinity/explorer/workflow_runner.py | Refactored task execution to handle repeatable vs non-repeatable workflows and manage run IDs |
| trinity/explorer/scheduler.py | Updated TaskWrapper to include run_id_base and repeat_times for proper task scheduling |
| trinity/common/workflows/workflow.py | Added base workflow properties for repeatability and run ID management |
| trinity/common/workflows/step_wise_workflow.py | Marked step-wise workflows as non-repeatable |
| trinity/common/workflows/math_rm_workflow.py | Updated run ID assignment to use run_id_base |
| trinity/common/workflows/eval_workflow.py | Marked evaluation workflows as non-repeatable |
| trinity/common/workflows/envs/ | Updated environment workflows to handle repeat times properly |
| trinity/common/workflows/customized_*_workflows.py | Updated run ID assignment and removed deprecated rollout_args handling |
| trinity/common/config.py | Added repeat_times to StorageConfig and updated config validation |
| trinity/buffer/reader/file_reader.py | Added repeat_times initialization when creating tasks |
| tests/ | Updated test cases to include repeat_times in Task initialization |
| examples/ | Removed deprecated rollout_args.n configurations |
| docs/ | Updated documentation to reflect repeat_times configuration |
|
/unittest-all |
Summary
Tests
Github Test Reporter by CTRF 💚 |
|
/unittest-all |
Summary
Tests
Github Test Reporter by CTRF 💚 |
Description
run_idfor all workflowsrepeatableandset_repeat_times()for workflows_run_task()repeat_timestoStorageConfigandTaskChecklist
Please check the following items before code is ready to be reviewed.