Skip to content

Conversation

@pan-x-c
Copy link
Collaborator

@pan-x-c pan-x-c commented Jan 14, 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 addresses the issue of accumulating excessive checkpoints by introducing a configurable mechanism to manage and prune them. It allows users to specify the maximum number of checkpoints to retain, and the system will automatically remove older, intermediate checkpoints that are no longer needed for synchronization, thereby conserving disk space and streamlining checkpoint management.

Highlights

  • Checkpoint Pruning Mechanism: Introduced a new configuration option max_checkpoints_to_keep to limit the number of saved checkpoints, automatically deleting older ones.
  • Distinguishing Checkpoint Types: Implemented a .full_checkpoint flag file to differentiate between full checkpoints and intermediate checkpoints saved solely for synchronization.
  • Automated Cleanup: The synchronizer now automatically removes previous non-full checkpoints after a new model state dict is loaded, optimizing disk space.
  • Documentation and Testing: Updated documentation to reflect the new configuration and added comprehensive tests to verify the checkpoint pruning logic.

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

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

This pull request introduces a mechanism to automatically remove checkpoints that are created for synchronization purposes, in order to save disk space. This is achieved by adding a .full_checkpoint flag file to full checkpoints, and then having the synchronizer clean up previous checkpoint directories that do not contain this flag. The changes are well-implemented across the documentation, configuration, trainers, and tests. I've identified a couple of minor areas for improvement in the documentation and tests to enhance clarity and robustness.

@pan-x-c
Copy link
Collaborator Author

pan-x-c commented Jan 14, 2026

/unittest-module-trainer

@github-actions
Copy link

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
25 13 8 4 0 0 28m 48s

Failed Tests

Failed Tests ❌ Fail Message
❌ tests/trainer/trainer_test.py::TestTrainerCountdown_0_fsdp::test_trainer The test failed in the call phase due to an assertion error
❌ tests/trainer/trainer_test.py::TestTrainerCountdown_1_megatron::test_trainer The test failed in the call phase due to an assertion error
❌ tests/trainer/trainer_test.py::TestStepAheadAsyncRL::test_trainer The test failed in the call phase due to an assertion error
❌ tests/trainer/trainer_test.py::TestTrainerSFTWarmupGSM8K::test_trainer The test failed in the call phase due to an exception
❌ tests/trainer/trainer_test.py::TestFullyAsyncMode_0_fsdp::test_fully_async_mode The test failed in the call phase
❌ tests/trainer/trainer_test.py::TestFullyAsyncMode_1_fsdp::test_fully_async_mode The test failed in the call phase
❌ tests/trainer/trainer_test.py::TestFullyAsyncMode_2_megatron::test_fully_async_mode The test failed in the call phase
❌ tests/trainer/trainer_test.py::TestTrainerMIX::test_trainer The test failed in the call phase

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::AgentScopeTunerTest::test_agentscope_tuner skipped ⏭️

Tests

Test Name Status Flaky Duration
tests/trainer/trainer_test.py::TestTrainerCountdown_0_fsdp::test_trainer 1m 33s
tests/trainer/trainer_test.py::TestTrainerCountdown_1_megatron::test_trainer 46.4s
tests/trainer/trainer_test.py::TestStepAheadAsyncRL::test_trainer 1m 32s
tests/trainer/trainer_test.py::TestTrainerGSM8K_0_fsdp::test_trainer 45.5s
tests/trainer/trainer_test.py::TestTrainerGSM8K_1_fsdp2::test_trainer 45.8s
tests/trainer/trainer_test.py::TestTrainerGSM8K_2_fsdp::test_trainer 50.2s
tests/trainer/trainer_test.py::TestTrainerGSM8K_3_fsdp2::test_trainer 57.6s
tests/trainer/trainer_test.py::TestTrainerSFTWarmupGSM8K::test_trainer 2m 34s
tests/trainer/trainer_test.py::TestTrainerDPO::test_trainer 37.8s
tests/trainer/trainer_test.py::TestTrainerSFT::test_trainer 34.4s
tests/trainer/trainer_test.py::TestTrainerToolsSFT::test_trainer_tools 34.5s
tests/trainer/trainer_test.py::TestFullyAsyncMode_0_fsdp::test_fully_async_mode 1m 28s
tests/trainer/trainer_test.py::TestFullyAsyncMode_1_fsdp::test_fully_async_mode 1m 28s
tests/trainer/trainer_test.py::TestFullyAsyncMode_2_megatron::test_fully_async_mode 1m 23s
tests/trainer/trainer_test.py::TestTrainerCheckpointSave_0_fsdp::test_trainer 1m 52s
tests/trainer/trainer_test.py::TestTrainerCheckpointSave_1_megatron::test_trainer 3m 42s
tests/trainer/trainer_test.py::TestTrainerMIX::test_trainer 37.4s
tests/trainer/trainer_test.py::TestServeWithTrainer::test_serve_with_trainer 1m 58s
tests/trainer/trainer_test.py::TestMultiModalGRPO::test_trainer ⏭️ 531ms
tests/trainer/trainer_test.py::TestMultiModalSFT::test_trainer ⏭️ 529ms
tests/trainer/trainer_test.py::TestTrainerLoRA::test_trainer 2m 47s
tests/trainer/trainer_test.py::TestOverRollout::test_trainer 42.2s
tests/trainer/trainer_test.py::TestTrainerPromptTruncation::test_trainer 1m 9s
tests/trainer/trainer_test.py::TestTinkerTrainer::test_trainer ⏭️ 535ms
tests/trainer/trainer_test.py::AgentScopeTunerTest::test_agentscope_tuner ⏭️ 1ms

Github Test Reporter by CTRF 💚

@pan-x-c
Copy link
Collaborator Author

pan-x-c commented Jan 14, 2026

/unittest-module-trainer

@github-actions
Copy link

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
25 20 1 4 0 0 39m 34s

Failed Tests

Failed Tests ❌ Fail Message
❌ tests/trainer/trainer_test.py::TestTrainerSFTWarmupGSM8K::test_trainer The test failed in the call phase due to an exception

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::AgentScopeTunerTest::test_agentscope_tuner skipped ⏭️

Tests

Test Name Status Flaky Duration
tests/trainer/trainer_test.py::TestTrainerCountdown_0_fsdp::test_trainer 3m 43s
tests/trainer/trainer_test.py::TestTrainerCountdown_1_megatron::test_trainer 3m 42s
tests/trainer/trainer_test.py::TestStepAheadAsyncRL::test_trainer 1m 44s
tests/trainer/trainer_test.py::TestTrainerGSM8K_0_fsdp::test_trainer 49.6s
tests/trainer/trainer_test.py::TestTrainerGSM8K_1_fsdp2::test_trainer 47.4s
tests/trainer/trainer_test.py::TestTrainerGSM8K_2_fsdp::test_trainer 1m 23s
tests/trainer/trainer_test.py::TestTrainerGSM8K_3_fsdp2::test_trainer 59.9s
tests/trainer/trainer_test.py::TestTrainerSFTWarmupGSM8K::test_trainer 2m 8s
tests/trainer/trainer_test.py::TestTrainerDPO::test_trainer 37.7s
tests/trainer/trainer_test.py::TestTrainerSFT::test_trainer 35.0s
tests/trainer/trainer_test.py::TestTrainerToolsSFT::test_trainer_tools 34.9s
tests/trainer/trainer_test.py::TestFullyAsyncMode_0_fsdp::test_fully_async_mode 1m 41s
tests/trainer/trainer_test.py::TestFullyAsyncMode_1_fsdp::test_fully_async_mode 1m 34s
tests/trainer/trainer_test.py::TestFullyAsyncMode_2_megatron::test_fully_async_mode 2m 17s
tests/trainer/trainer_test.py::TestTrainerCheckpointSave_0_fsdp::test_trainer 2m 14s
tests/trainer/trainer_test.py::TestTrainerCheckpointSave_1_megatron::test_trainer 5m 23s
tests/trainer/trainer_test.py::TestTrainerMIX::test_trainer 1m 32s
tests/trainer/trainer_test.py::TestServeWithTrainer::test_serve_with_trainer 1m 52s
tests/trainer/trainer_test.py::TestMultiModalGRPO::test_trainer ⏭️ 532ms
tests/trainer/trainer_test.py::TestMultiModalSFT::test_trainer ⏭️ 1.9s
tests/trainer/trainer_test.py::TestTrainerLoRA::test_trainer 3m 40s
tests/trainer/trainer_test.py::TestOverRollout::test_trainer 47.0s
tests/trainer/trainer_test.py::TestTrainerPromptTruncation::test_trainer 1m 13s
tests/trainer/trainer_test.py::TestTinkerTrainer::test_trainer ⏭️ 787ms
tests/trainer/trainer_test.py::AgentScopeTunerTest::test_agentscope_tuner ⏭️ 1ms

Github Test Reporter by CTRF 💚

@pan-x-c
Copy link
Collaborator Author

pan-x-c commented Jan 14, 2026

/unittest-module-trainer

@github-actions
Copy link

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
25 21 0 4 0 0 38m 20s

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::AgentScopeTunerTest::test_agentscope_tuner skipped ⏭️

Tests

Test Name Status Flaky Duration
tests/trainer/trainer_test.py::TestTrainerCountdown_0_fsdp::test_trainer 3m 5s
tests/trainer/trainer_test.py::TestTrainerCountdown_1_megatron::test_trainer 4m 21s
tests/trainer/trainer_test.py::TestStepAheadAsyncRL::test_trainer 1m 43s
tests/trainer/trainer_test.py::TestTrainerGSM8K_0_fsdp::test_trainer 1m 20s
tests/trainer/trainer_test.py::TestTrainerGSM8K_1_fsdp2::test_trainer 48.7s
tests/trainer/trainer_test.py::TestTrainerGSM8K_2_fsdp::test_trainer 54.9s
tests/trainer/trainer_test.py::TestTrainerGSM8K_3_fsdp2::test_trainer 58.6s
tests/trainer/trainer_test.py::TestTrainerSFTWarmupGSM8K::test_trainer 2m 3s
tests/trainer/trainer_test.py::TestTrainerDPO::test_trainer 39.3s
tests/trainer/trainer_test.py::TestTrainerSFT::test_trainer 35.7s
tests/trainer/trainer_test.py::TestTrainerToolsSFT::test_trainer_tools 33.7s
tests/trainer/trainer_test.py::TestFullyAsyncMode_0_fsdp::test_fully_async_mode 1m 34s
tests/trainer/trainer_test.py::TestFullyAsyncMode_1_fsdp::test_fully_async_mode 1m 33s
tests/trainer/trainer_test.py::TestFullyAsyncMode_2_megatron::test_fully_async_mode 2m 17s
tests/trainer/trainer_test.py::TestTrainerCheckpointSave_0_fsdp::test_trainer 2m 4s
tests/trainer/trainer_test.py::TestTrainerCheckpointSave_1_megatron::test_trainer 5m 23s
tests/trainer/trainer_test.py::TestTrainerMIX::test_trainer 1m 33s
tests/trainer/trainer_test.py::TestServeWithTrainer::test_serve_with_trainer 1m 53s
tests/trainer/trainer_test.py::TestMultiModalGRPO::test_trainer ⏭️ 536ms
tests/trainer/trainer_test.py::TestMultiModalSFT::test_trainer ⏭️ 530ms
tests/trainer/trainer_test.py::TestTrainerLoRA::test_trainer 2m 46s
tests/trainer/trainer_test.py::TestOverRollout::test_trainer 46.4s
tests/trainer/trainer_test.py::TestTrainerPromptTruncation::test_trainer 1m 12s
tests/trainer/trainer_test.py::TestTinkerTrainer::test_trainer ⏭️ 538ms
tests/trainer/trainer_test.py::AgentScopeTunerTest::test_agentscope_tuner ⏭️ 1ms

Github Test Reporter by CTRF 💚

@pan-x-c pan-x-c merged commit 2be8bb6 into modelscope:main Jan 14, 2026
2 checks 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