Skip to content

Update Tuner Interface with logger and TuFT support#493

Merged
yanxi-chen merged 8 commits intoagentscope-ai:mainfrom
pan-x-c:feature/tuner_update
Feb 3, 2026
Merged

Update Tuner Interface with logger and TuFT support#493
yanxi-chen merged 8 commits intoagentscope-ai:mainfrom
pan-x-c:feature/tuner_update

Conversation

@pan-x-c
Copy link
Collaborator

@pan-x-c pan-x-c commented Jan 30, 2026

Description

As the title says

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has passed all tests
  • Docstrings have been added/updated in Google Style
  • Documentation has been updated
  • Code is ready for review

@gemini-code-assist
Copy link
Contributor

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 significantly enhances the Tuner Interface by integrating robust logging capabilities and improving support for the Tinker Unified Fine-Tuning (TuFT) service. It introduces a configurable base URL for Tinker service clients, streamlines resource allocation for Tinker-enabled training, and refactors core agentscope.tuner configuration classes for better clarity and maintainability. The changes also include a more flexible mechanism for passing parameters to workflow functions, which facilitates the new logger integration.

Highlights

  • Tinker Base URL Configuration: Introduced a configurable base_url for Tinker service clients across various components, allowing flexible endpoint specification for the Tinker service.
  • Logger Integration in Tuner Workflows: Added Logger support to agentscope workflow and judge functions, enabling detailed logging of interactions and responses during the tuning process.
  • Tinker Resource Allocation Standardization: Standardized GPU resource allocation to a single GPU/node for trainer and explorer when Tinker is enabled, simplifying cluster configuration for Tinker-based operations.
  • Refactoring of Tuner Configuration Classes: Renamed agentscope.tuner classes (e.g., Algorithm, Dataset, TunerChatModel) to their *Config variants (e.g., AlgorithmConfig, DatasetConfig, TunerModelConfig), indicating a shift towards explicit configuration objects.
  • Flexible Workflow Function Calls: Refactored agentscope_workflow to dynamically pass parameters to workflow and judge functions, accommodating new arguments like logger without requiring changes to existing function signatures.
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 by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

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 pull request 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

  1. 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.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request successfully integrates the Logger object into the AgentScopeTunerTest workflow and judge functions, enhancing observability. It also introduces and correctly propagates the base_url for Tinker services across configuration, validation, and model initialization, which is crucial for the new TuFT support. The refactoring of argument passing in AgentScopeWorkflowAdapterV1 improves code clarity and maintainability.

@pan-x-c
Copy link
Collaborator Author

pan-x-c commented Feb 3, 2026

/unittest-module-trainer

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
26 21 0 5 0 0 36m 22s

Skipped

Tests Status
tests/trainer/trainer_test.py::TestMultiModalGRPO::test_trainer skipped ⏭️
tests/trainer/trainer_test.py::TestMultiModalSFT::test_trainer skipped ⏭️
tests/trainer/trainer_test.py::TestTinkerTrainer::test_trainer skipped ⏭️
tests/trainer/trainer_test.py::TestTinkerTrainer::test_trainer_class skipped ⏭️
tests/trainer/trainer_test.py::AgentScopeTunerTest::test_agentscope_tuner skipped ⏭️

Tests

Test Name Status Flaky Duration
tests/trainer/trainer_test.py::TestTrainerCountdown_0_fsdp::test_trainer 46h 45m
tests/trainer/trainer_test.py::TestTrainerCountdown_1_megatron::test_trainer 66h 2m
tests/trainer/trainer_test.py::TestStepAheadAsyncRL::test_trainer 21h
tests/trainer/trainer_test.py::TestTrainerGSM8K_0_fsdp::test_trainer 15h 48m
tests/trainer/trainer_test.py::TestTrainerGSM8K_1_fsdp2::test_trainer 14h 39m
tests/trainer/trainer_test.py::TestTrainerGSM8K_2_fsdp::test_trainer 15h 12m
tests/trainer/trainer_test.py::TestTrainerGSM8K_3_fsdp2::test_trainer 17h 24m
tests/trainer/trainer_test.py::TestTrainerSFTWarmupGSM8K::test_trainer 34h 32m
tests/trainer/trainer_test.py::TestTrainerDPO::test_trainer 9h 47m
tests/trainer/trainer_test.py::TestTrainerSFT::test_trainer 8h 21m
tests/trainer/trainer_test.py::TestTrainerToolsSFT::test_trainer_tools 8h 28m
tests/trainer/trainer_test.py::TestFullyAsyncMode_0_fsdp::test_fully_async_mode 25h 50m
tests/trainer/trainer_test.py::TestFullyAsyncMode_1_fsdp::test_fully_async_mode 25h 36m
tests/trainer/trainer_test.py::TestFullyAsyncMode_2_megatron::test_fully_async_mode 38h 29m
tests/trainer/trainer_test.py::TestTrainerCheckpointSave_0_fsdp::test_trainer 40h 1m
tests/trainer/trainer_test.py::TestTrainerCheckpointSave_1_megatron::test_trainer 89h 50m
tests/trainer/trainer_test.py::TestTrainerMIX::test_trainer 27h 51m
tests/trainer/trainer_test.py::TestServeWithTrainer::test_serve_with_trainer 30h 38m
tests/trainer/trainer_test.py::TestMultiModalGRPO::test_trainer ⏭️ 14m 31s
tests/trainer/trainer_test.py::TestMultiModalSFT::test_trainer ⏭️ 13m 28s
tests/trainer/trainer_test.py::TestTrainerLoRA::test_trainer 41h 43m
tests/trainer/trainer_test.py::TestOverRollout::test_trainer 14h 5m
tests/trainer/trainer_test.py::TestTrainerPromptTruncation::test_trainer 12h 58m
tests/trainer/trainer_test.py::TestTinkerTrainer::test_trainer ⏭️ 620ms
tests/trainer/trainer_test.py::TestTinkerTrainer::test_trainer_class ⏭️ 335ms
tests/trainer/trainer_test.py::AgentScopeTunerTest::test_agentscope_tuner ⏭️ 317ms

Github Test Reporter by CTRF 💚

@pan-x-c
Copy link
Collaborator Author

pan-x-c commented Feb 3, 2026

/unittest-module-common

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
55 54 0 1 0 0 10m 7s

Skipped

Tests Status
tests/common/vllm_test.py::TestTinkerAsyncAPIServer::test_api_async skipped ⏭️

Tests

Test Name Status Flaky Duration
tests/common/config_test.py::TestConfig::test_all_examples_are_valid 9h 22m
tests/common/config_test.py::TestConfig::test_chat_template_path 5m
tests/common/config_test.py::TestConfig::test_config_flatten 32.8s
tests/common/config_test.py::TestConfig::test_continue_from_checkpoint_is_valid 6m 25s
tests/common/config_test.py::TestConfig::test_default_workflow 5m
tests/common/config_test.py::TestConfig::test_load_default_config 1h 16m
tests/common/config_test.py::TestConfig::test_max_token_len_per_gpu_set_correctly 5m 22s
tests/common/config_test.py::TestConfig::test_optimizer_config_propagation 5m 2s
tests/common/config_test.py::TestConfig::test_update_config_from_ray_cluster 30m 22s
tests/common/experience_test.py::TestEID::test_eid_properties 614ms
tests/common/experience_test.py::TestExperience::test_action_mask_and_logprobs_type 536ms
tests/common/experience_test.py::TestExperience::test_assertions 342ms
tests/common/experience_test.py::TestExperience::test_dpo_experience 398ms
tests/common/experience_test.py::TestExperience::test_gather 1.0s
tests/common/experience_test.py::TestExperience::test_gather_with_token_level_reward 555ms
tests/common/experience_test.py::TestExperience::test_hf_datasets_conversion 15.0s
tests/common/experience_test.py::TestExperience::test_multi_turn_experience 344ms
tests/common/experience_test.py::TestExperience::test_serialize_deserialize 2.0s
tests/common/experience_test.py::TestExperience::test_single_turn_experience 372ms
tests/common/experience_test.py::TestExperience::test_to_dict 312ms
tests/common/experience_test.py::TestExperienceConversion::test_batch_conversion 700ms
tests/common/experience_test.py::TestExperienceConversion::test_dpo_experience_batch_conversion 530ms
tests/common/experience_test.py::TestExperienceConversion::test_experience_model_experience_conversion 808ms
tests/common/experience_test.py::TestExperienceConversion::test_gather_experiences_with_custom_fields 470ms
tests/common/experience_test.py::TestExperienceConversion::test_multiturn_experience_batch_converstion 582ms
tests/common/sudoku_test.py::test_9x9_generator_produces_valid_solution 870ms
tests/common/sudoku_test.py::test_9x9_generator_creates_holes 771ms
tests/common/sudoku_test.py::test_9x9_solution_is_fully_filled 667ms
tests/common/sudoku_test.py::test_judge_allows_incomplete_board 243ms
tests/common/sudoku_test.py::test_judge_detects_row_violation 238ms
tests/common/sudoku_test.py::test_judge_detects_column_violation 242ms
tests/common/sudoku_test.py::test_judge_detects_block_violation 224ms
tests/common/sudoku_test.py::test_4x4_generator_produces_valid_solution 268ms
tests/common/sudoku_test.py::test_4x4_solution_is_fully_filled 251ms
tests/common/sudoku_test.py::test_4x4_judge_detects_row_violation 219ms
tests/common/sudoku_test.py::test_4x4_judge_detects_block_violation 218ms
tests/common/vllm_test.py::ModelWrapperTest_0::test_generate 15h 56m
tests/common/vllm_test.py::ModelWrapperTest_1::test_generate 11h 2m
tests/common/vllm_test.py::ModelWrapperTest_2::test_generate 10h 49m
tests/common/vllm_test.py::TestModelLen_0::test_model_len 7h 36m
tests/common/vllm_test.py::TestModelLen_1::test_model_len 6h 49m
tests/common/vllm_test.py::TestModelLen_2::test_model_len 8h 52m
tests/common/vllm_test.py::TestModelLenWithoutPromptTruncation::test_model_len 7h 43m
tests/common/vllm_test.py::TestMessageProcess::test_no_prompt_truncation 7h 33m
tests/common/vllm_test.py::TestMessageProcess::test_truncation_status 7h 41m
tests/common/vllm_test.py::TestAPIServer::test_api 8h 13m
tests/common/vllm_test.py::TestLogprobs::test_logprobs_api 7h 23m
tests/common/vllm_test.py::TestAsyncAPIServer::test_api_async 8h
tests/common/vllm_test.py::TestTinkerAsyncAPIServer::test_api_async ⏭️ 734ms
tests/common/vllm_test.py::TestTokenizer::test_action_mask 3m 54s
tests/common/vllm_test.py::TestTokenizer::test_action_mask_with_tools 3m 52s
tests/common/vllm_test.py::TestAPIServerToolCall_0_deepseek_r1::test_api_tool_calls 8h 53m
tests/common/vllm_test.py::TestAPIServerToolCall_1::test_api_tool_calls 7h 47m
tests/common/vllm_test.py::TestSuperLongGeneration::test_generate 19h 54m
tests/common/vllm_test.py::TestTinkerAPI::test_tinker_api 11h 29m

Github Test Reporter by CTRF 💚

@yanxi-chen yanxi-chen merged commit ec32246 into agentscope-ai:main Feb 3, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments