Skip to content

Conversation

@hiyuchang
Copy link
Collaborator

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 @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 introduces a crucial validation step to the system's configuration process. Its primary purpose is to proactively prevent scenarios where the system might attempt to utilize more GPU resources for model rollout than are physically provisioned within the cluster. By performing this check early, the change significantly enhances the overall robustness and reliability of the system, ensuring stable operation particularly when running in 'explore' or 'bench' modes.

Highlights

  • GPU Resource Validation: Implemented a new validation check within the configuration update process to ensure that the total number of GPUs required for explorer rollout models (including auxiliary models) does not exceed the cluster's total available GPUs.
  • Configuration Safety: Introduced a ValueError that is raised if the required GPU resources for rollout exceed the available cluster GPUs, preventing potential runtime errors or resource exhaustion, especially in 'explore' and 'bench' modes.

🧠 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 adds a check to ensure there are enough GPUs for the explorer's rollout models. The logic correctly accounts for different modes ('explore', 'bench', 'both'). My review includes two suggestions: one to improve the performance and readability of the GPU calculation by using a generator expression, and another to refactor the validation logic to provide a more accurate and helpful error message, especially for the 'both' mode. These changes will make the code more robust and easier to debug.

@pan-x-c
Copy link
Collaborator

pan-x-c commented Dec 25, 2025

/unittest-module-common

@github-actions
Copy link

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
40 39 1 0 0 0 13m 50s

Failed Tests

Failed Tests ❌ Fail Message
❌ tests/common/vllm_test.py::TestLogprobs::test_logprobs_api The test failed in the call phase due to an assertion error

Tests

Test Name Status Flaky Duration
tests/common/config_test.py::TestConfig::test_all_examples_are_valid 44.4s
tests/common/config_test.py::TestConfig::test_chat_template_path 96ms
tests/common/config_test.py::TestConfig::test_config_flatten 42ms
tests/common/config_test.py::TestConfig::test_continue_from_checkpoint_is_valid 469ms
tests/common/config_test.py::TestConfig::test_default_workflow 94ms
tests/common/config_test.py::TestConfig::test_load_default_config 3.3s
tests/common/config_test.py::TestConfig::test_max_token_len_per_gpu_set_correctly 95ms
tests/common/config_test.py::TestConfig::test_optimizer_config_propagation 93ms
tests/common/config_test.py::TestConfig::test_update_config_from_ray_cluster 2.0s
tests/common/experience_test.py::TestEID::test_eid_properties 1ms
tests/common/experience_test.py::TestExperience::test_action_mask_and_logprobs_type 1ms
tests/common/experience_test.py::TestExperience::test_assertions 1ms
tests/common/experience_test.py::TestExperience::test_dpo_experience 1ms
tests/common/experience_test.py::TestExperience::test_gather 1ms
tests/common/experience_test.py::TestExperience::test_gather_with_token_level_reward 1ms
tests/common/experience_test.py::TestExperience::test_hf_datasets_conversion 15ms
tests/common/experience_test.py::TestExperience::test_multi_turn_experience 1ms
tests/common/experience_test.py::TestExperience::test_serialize_deserialize 2ms
tests/common/experience_test.py::TestExperience::test_single_turn_experience 1ms
tests/common/experience_test.py::TestExperience::test_to_dict 1ms
tests/common/experience_test.py::TestExperienceConversion::test_batch_conversion 1ms
tests/common/experience_test.py::TestExperienceConversion::test_dpo_experience_batch_conversion 1ms
tests/common/experience_test.py::TestExperienceConversion::test_experience_model_experience_conversion 1ms
tests/common/experience_test.py::TestExperienceConversion::test_gather_experiences_with_custom_fields 1ms
tests/common/experience_test.py::TestExperienceConversion::test_multiturn_experience_batch_converstion 1ms
tests/common/vllm_test.py::ModelWrapperTest_0::test_generate 1m 21s
tests/common/vllm_test.py::ModelWrapperTest_1::test_generate 1m 7s
tests/common/vllm_test.py::ModelWrapperTest_2::test_generate 35.2s
tests/common/vllm_test.py::TestModelLen_0::test_model_len 1m
tests/common/vllm_test.py::TestModelLen_1::test_model_len 22.1s
tests/common/vllm_test.py::TestModelLen_2::test_model_len 54.0s
tests/common/vllm_test.py::TestModelLenWithoutPromptTruncation::test_model_len 53.8s
tests/common/vllm_test.py::TestAPIServer::test_api 56.3s
tests/common/vllm_test.py::TestLogprobs::test_logprobs_api 22.4s
tests/common/vllm_test.py::TestAsyncAPIServer::test_api_async 24.7s
tests/common/vllm_test.py::TestTokenizer::test_action_mask 255ms
tests/common/vllm_test.py::TestTokenizer::test_action_mask_with_tools 244ms
tests/common/vllm_test.py::TestAPIServerToolCall_0_deepseek_r1::test_api_tool_calls 55.3s
tests/common/vllm_test.py::TestAPIServerToolCall_1::test_api_tool_calls 22.8s
tests/common/vllm_test.py::TestSuperLongGeneration::test_generate 3m 35s

Github Test Reporter by CTRF 💚

@hiyuchang
Copy link
Collaborator Author

/unittest-module-common

@github-actions
Copy link

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
40 40 0 0 0 0 13m 39s

Tests

Test Name Status Flaky Duration
tests/common/config_test.py::TestConfig::test_all_examples_are_valid 44.5s
tests/common/config_test.py::TestConfig::test_chat_template_path 96ms
tests/common/config_test.py::TestConfig::test_config_flatten 42ms
tests/common/config_test.py::TestConfig::test_continue_from_checkpoint_is_valid 474ms
tests/common/config_test.py::TestConfig::test_default_workflow 94ms
tests/common/config_test.py::TestConfig::test_load_default_config 3.5s
tests/common/config_test.py::TestConfig::test_max_token_len_per_gpu_set_correctly 97ms
tests/common/config_test.py::TestConfig::test_optimizer_config_propagation 94ms
tests/common/config_test.py::TestConfig::test_update_config_from_ray_cluster 1.8s
tests/common/experience_test.py::TestEID::test_eid_properties 1ms
tests/common/experience_test.py::TestExperience::test_action_mask_and_logprobs_type 1ms
tests/common/experience_test.py::TestExperience::test_assertions 1ms
tests/common/experience_test.py::TestExperience::test_dpo_experience 1ms
tests/common/experience_test.py::TestExperience::test_gather 1ms
tests/common/experience_test.py::TestExperience::test_gather_with_token_level_reward 1ms
tests/common/experience_test.py::TestExperience::test_hf_datasets_conversion 16ms
tests/common/experience_test.py::TestExperience::test_multi_turn_experience 1ms
tests/common/experience_test.py::TestExperience::test_serialize_deserialize 2ms
tests/common/experience_test.py::TestExperience::test_single_turn_experience 1ms
tests/common/experience_test.py::TestExperience::test_to_dict 1ms
tests/common/experience_test.py::TestExperienceConversion::test_batch_conversion 1ms
tests/common/experience_test.py::TestExperienceConversion::test_dpo_experience_batch_conversion 1ms
tests/common/experience_test.py::TestExperienceConversion::test_experience_model_experience_conversion 1ms
tests/common/experience_test.py::TestExperienceConversion::test_gather_experiences_with_custom_fields 1ms
tests/common/experience_test.py::TestExperienceConversion::test_multiturn_experience_batch_converstion 1ms
tests/common/vllm_test.py::ModelWrapperTest_0::test_generate 1m 20s
tests/common/vllm_test.py::ModelWrapperTest_1::test_generate 1m 8s
tests/common/vllm_test.py::ModelWrapperTest_2::test_generate 1m 13s
tests/common/vllm_test.py::TestModelLen_0::test_model_len 54.3s
tests/common/vllm_test.py::TestModelLen_1::test_model_len 1m
tests/common/vllm_test.py::TestModelLen_2::test_model_len 53.6s
tests/common/vllm_test.py::TestModelLenWithoutPromptTruncation::test_model_len 53.8s
tests/common/vllm_test.py::TestAPIServer::test_api 56.6s
tests/common/vllm_test.py::TestLogprobs::test_logprobs_api 22.2s
tests/common/vllm_test.py::TestAsyncAPIServer::test_api_async 25.0s
tests/common/vllm_test.py::TestTokenizer::test_action_mask 245ms
tests/common/vllm_test.py::TestTokenizer::test_action_mask_with_tools 234ms
tests/common/vllm_test.py::TestAPIServerToolCall_0_deepseek_r1::test_api_tool_calls 55.9s
tests/common/vllm_test.py::TestAPIServerToolCall_1::test_api_tool_calls 54.2s
tests/common/vllm_test.py::TestSuperLongGeneration::test_generate 1m 42s

Github Test Reporter by CTRF 💚

@pan-x-c pan-x-c merged commit 5109237 into modelscope:main Dec 25, 2025
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