Add Task pipeline#189
Conversation
There was a problem hiding this comment.
Summary of Changes
Hello @pan-x-c, 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 a significant architectural overhaul for data processing within the system. The core change is the implementation of new ExperiencePipeline and TaskPipeline components, designed to streamline the pre-processing of both rollout experiences and raw task datasets. This new pipeline leverages a modular 'Operator' framework, allowing for flexible and extensible data transformations. A key aspect of this refactoring is the re-integration of advantage function calculations (e.g., GRPO, OPMD) directly into this operator-based pipeline, moving away from previous 'add_strategy' mechanisms. Furthermore, the changes lay the groundwork for robust integration with external data processing services like Data-Juicer, enhancing the system's data handling capabilities. The overall impact is a more structured, efficient, and scalable approach to managing and transforming data throughout the reinforcement learning process.
Highlights
- New Data Processing Pipelines and Operator Architecture: This PR introduces a new, modular data processing architecture with
ExperiencePipelineandTaskPipeline. These pipelines orchestrateExperienceOperators, which are reusable components for data transformations like filtering, mapping, and integrating external services. - Refactored Advantage Function Handling: The way advantage functions (like GRPO and OPMD) are handled has been refactored. They are now implemented as
GroupAdvantageoperators that run within theExperiencePipeline, providing a more flexible and integrated approach to experience pre-processing. - Integration with Data-Juicer Service: A significant new feature is the integration with the Data-Juicer service. The
DataJuicerOperatorallows users to leverage Data-Juicer's advanced data cleaning and processing capabilities directly within theExperiencePipelineandTaskPipeline. - Comprehensive Configuration and API Updates: The configuration system has been extensively updated to support the new pipeline and operator concepts. This includes new
ExperiencePipelineConfigandTaskPipelineConfigclasses, deprecation of oldadd_strategyparameters, and new service configurations for Data-Juicer. - HuggingFace Datasets Compatibility: Utility functions have been added to seamlessly convert
Experienceobjects to and from HuggingFaceDatasetformat, enhancing compatibility and interoperability with the broader ML ecosystem.
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. 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
-
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.
Code Review
This pull request introduces a significant refactoring by replacing add_strategy with a more flexible ExperiencePipeline composed of operators. This change improves modularity and allows for more complex data processing workflows. The PR also adds a new TaskPipeline for pre-processing task datasets, integrating with an external DataJuicer service. The changes are extensive, touching documentation, configuration, core logic, and tests. My review focuses on ensuring the new components are robust and correct.
|
/unittest-all |
Summary
Failed Tests
Tests
Github Test Reporter by CTRF 💚 |
|
/unittest-all |
Summary
Failed Tests
Tests
Github Test Reporter by CTRF 💚 |
|
/unittest-module-trainer |
Summary
Tests
Github Test Reporter by CTRF 💚 |
There was a problem hiding this comment.
Pull Request Overview
This PR adds task pipeline functionality for preprocessing tasksets using Data-Juicer operators. The task pipeline allows users to apply data processing operations to raw task files before they are used in the exploration phase.
- Add
TaskPipelineclass for processing task datasets - Add
process_taskendpoint to the Data-Juicer service - Refactor configuration to support both task and experience pipelines
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| trinity/utils/distributed.py | Add port availability check utility function |
| trinity/service/data_juicer/server/utils.py | Add task pipeline config parsing and validation |
| trinity/service/data_juicer/server/session.py | Separate experience and task processing methods |
| trinity/service/data_juicer/server/server.py | Add process_task endpoint |
| trinity/service/data_juicer/client.py | Add task processing client method with improved logging |
| trinity/explorer/explorer.py | Improve shutdown handling with proper resource cleanup |
| trinity/data/utils.py | Remove deprecated data processor utilities |
| trinity/common/config.py | Add TaskPipelineConfig and update data processor config |
| trinity/cli/launcher.py | Replace deprecated data processor activation with task pipeline |
| trinity/buffer/pipelines/task_pipeline.py | Main task pipeline implementation |
| trinity/buffer/pipelines/init.py | Export task pipeline components |
| trinity/buffer/operators/data_juicer_operator.py | Update to specify experience pipeline type |
| tests/service/data_juicer_test.py | Add comprehensive task pipeline tests |
| examples/grpo_gsm8k_task_pipeline/gsm8k.yaml | Update example to use new task pipeline config |
| docs/sphinx_doc/source/tutorial/trinity_programming_guide.md | Update documentation |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
577fddc
into
agentscope-ai:feature/data_processor
Description
TaskPipelinefor taskset pre-processingprocess_taskon data-juicer serviceChecklist
Please check the following items before code is ready to be reviewed.