Skip to content

Support SGLang Inference Engine#533

Open
pan-x-c wants to merge 16 commits intoagentscope-ai:mainfrom
pan-x-c:feature/sglang
Open

Support SGLang Inference Engine#533
pan-x-c wants to merge 16 commits intoagentscope-ai:mainfrom
pan-x-c:feature/sglang

Conversation

@pan-x-c
Copy link
Copy Markdown
Collaborator

@pan-x-c pan-x-c commented May 7, 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

@pan-x-c
Copy link
Copy Markdown
Collaborator Author

pan-x-c commented May 8, 2026

/unittest-module-trainer

1 similar comment
@pan-x-c
Copy link
Copy Markdown
Collaborator Author

pan-x-c commented May 8, 2026

/unittest-module-trainer

@pan-x-c
Copy link
Copy Markdown
Collaborator Author

pan-x-c commented May 8, 2026

/unittest-module-trainer

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 8, 2026

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
27 22 2 3 0 0 1h 11m

Failed Tests

Failed Tests ❌ Fail Message
❌ tests/trainer/trainer_test.py::TestTrainerLoRA::test_trainer The test failed in the call phase due to an assertion error
❌ tests/trainer/trainer_test.py::ColocateModeTest::test_trainer The test failed in the call phase due to an assertion error

Skipped

Tests Status
tests/trainer/trainer_test.py::TestTrainerSFTWarmupGSM8K::test_trainer skipped ⏭️
tests/trainer/trainer_test.py::TestTinkerTrainer::test_trainer skipped ⏭️
tests/trainer/trainer_test.py::TestTinkerTrainer::test_trainer_class skipped ⏭️

Tests

Test Name Status Flaky Duration
tests/trainer/trainer_test.py::TestTrainerCountdown_0_fsdp2::test_trainer 4m 48s
tests/trainer/trainer_test.py::TestTrainerCountdown_1_megatron::test_trainer 5m 20s
tests/trainer/trainer_test.py::TestStepAheadAsyncRL::test_trainer 1m 56s
tests/trainer/trainer_test.py::TestTrainerGSM8K_0_fsdp::test_trainer 1m 10s
tests/trainer/trainer_test.py::TestTrainerGSM8K_1_fsdp2::test_trainer 1m 10s
tests/trainer/trainer_test.py::TestTrainerGSM8K_2_fsdp::test_trainer 1m 6s
tests/trainer/trainer_test.py::TestTrainerGSM8K_3_fsdp2::test_trainer 1m 17s
tests/trainer/trainer_test.py::TestTrainerSFTWarmupGSM8K::test_trainer ⏭️ 1ms
tests/trainer/trainer_test.py::TestTrainerDPO::test_trainer 40.0s
tests/trainer/trainer_test.py::TestTrainerSFT::test_trainer 35.9s
tests/trainer/trainer_test.py::TestTrainerToolsSFT::test_trainer_tools 35.4s
tests/trainer/trainer_test.py::TestFullyAsyncMode_0_fsdp::test_fully_async_mode 1m 49s
tests/trainer/trainer_test.py::TestFullyAsyncMode_1_fsdp2::test_fully_async_mode 1m 45s
tests/trainer/trainer_test.py::TestFullyAsyncMode_2_megatron::test_fully_async_mode 2m 37s
tests/trainer/trainer_test.py::TestTrainerCheckpointSave_0_fsdp::test_trainer 2m 52s
tests/trainer/trainer_test.py::TestTrainerCheckpointSave_1_megatron::test_trainer 5m 52s
tests/trainer/trainer_test.py::TestTrainerMIX::test_trainer 2m 4s
tests/trainer/trainer_test.py::TestServeWithTrainer::test_serve_with_trainer 1m 58s
tests/trainer/trainer_test.py::TestMultiModalGRPO::test_trainer 4m 8s
tests/trainer/trainer_test.py::TestMultiModalSFT::test_trainer 1m 41s
tests/trainer/trainer_test.py::TestTrainerLoRA::test_trainer 2m 7s
tests/trainer/trainer_test.py::TestOverRollout::test_trainer 1m 12s
tests/trainer/trainer_test.py::TestTrainerPromptTruncation::test_trainer 1m 5s
tests/trainer/trainer_test.py::TestTinkerTrainer::test_trainer ⏭️ 1ms
tests/trainer/trainer_test.py::TestTinkerTrainer::test_trainer_class ⏭️ 1ms
tests/trainer/trainer_test.py::AgentScopeTunerTest::test_agentscope_tuner 1m 43s
tests/trainer/trainer_test.py::ColocateModeTest::test_trainer 21m 26s

Github Test Reporter by CTRF 💚

@pan-x-c
Copy link
Copy Markdown
Collaborator Author

pan-x-c commented May 9, 2026

/unittest-module-trainer

@pan-x-c
Copy link
Copy Markdown
Collaborator Author

pan-x-c commented May 9, 2026

/unittest-pattern-TestTrainerLoRA

@pan-x-c
Copy link
Copy Markdown
Collaborator Author

pan-x-c commented May 9, 2026

/unittest-pattern-ColocateModeTest

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

Summary

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

Tests

Test Name Status Flaky Duration
tests/trainer/trainer_test.py::TestTrainerLoRA::test_trainer 3m 55s

Github Test Reporter by CTRF 💚

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
1 1 0 0 0 0 2m 46s

Tests

Test Name Status Flaky Duration
tests/trainer/trainer_test.py::ColocateModeTest::test_trainer 2m 35s

Github Test Reporter by CTRF 💚

@pan-x-c pan-x-c changed the title [WIP] Support SGLang Inference Engine Support SGLang Inference Engine May 9, 2026
@pan-x-c
Copy link
Copy Markdown
Collaborator Author

pan-x-c commented May 9, 2026

/unittest-diff

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 9, 2026

Summary

Tests 📝 Passed ✅ Failed ❌ Skipped ⏭️ Other ❓ Flaky 🍂 Duration ⏱️
241 236 0 5 0 0 1h 47m

Skipped

Tests Status
tests/common/vllm_test.py::TestAPIServer::test_reasoning_content skipped ⏭️
tests/common/vllm_test.py::TestTinkerAsyncAPIServer::test_api_async skipped ⏭️
tests/trainer/trainer_test.py::TestTrainerSFTWarmupGSM8K::test_trainer skipped ⏭️
tests/trainer/trainer_test.py::TestTinkerTrainer::test_trainer skipped ⏭️
tests/trainer/trainer_test.py::TestTinkerTrainer::test_trainer_class skipped ⏭️

Tests

Test Name Status Flaky Duration
tests/buffer/experience_pipeline_test.py::TestExperiencePipeline::test_experience_pipeline 11.5s
tests/buffer/experience_pipeline_test.py::TestExperiencePipeline::test_pass_rate_calculation 9.0s
tests/buffer/experience_storage_test.py::ExperienceStorageTest::test_sql_experience_buffer 2.9s
tests/buffer/experience_storage_test.py::ExperienceStorageTest::test_sql_storage_0_sft 5.2s
tests/buffer/experience_storage_test.py::ExperienceStorageTest::test_sql_storage_1_dpo 5.3s
tests/buffer/file_test.py::TestFileBuffer::test_file_reader 411ms
tests/buffer/file_test.py::TestFileBuffer::test_file_writer 1.8s
tests/buffer/formatter_test.py::TestFormatter::test_dpo_messages_formatter 920ms
tests/buffer/formatter_test.py::TestFormatter::test_dpo_plaintext_formatter 860ms
tests/buffer/formatter_test.py::TestFormatter::test_multi_modal_sft_formatter 1.2s
tests/buffer/formatter_test.py::TestFormatter::test_sft_messages_formatter 1.8s
tests/buffer/formatter_test.py::TestFormatter::test_sft_plaintext_formatter 1.7s
tests/buffer/formatter_test.py::TestFormatter::test_task_formatter 319ms
tests/buffer/queue_test.py::TestQueueBuffer::test_priority_queue_buffer_reuse 6.6s
tests/buffer/queue_test.py::TestQueueBuffer::test_priority_queue_capacity 2.2s
tests/buffer/queue_test.py::TestQueueBuffer::test_priority_queue_reuse_count_control 4.0s
tests/buffer/queue_test.py::TestQueueBuffer::test_queue_buffer_0_queue 3.0s
tests/buffer/queue_test.py::TestQueueBuffer::test_queue_buffer_1_priority_queue 3.2s
tests/buffer/queue_test.py::TestQueueBuffer::test_queue_buffer_capacity 4.0s
tests/buffer/reader_test.py::TestBufferReader::test_buffer_reader_registration 1.2s
tests/buffer/reward_shaping_mapper_test.py::TestRewardShapingMapper::test_basic_usage 8ms
tests/buffer/sample_strategy_test.py::ExperienceStorageTest_0::test_default_queue_default_sample_strategy 1.9s
tests/buffer/sample_strategy_test.py::ExperienceStorageTest_0::test_default_queue_staleness_control_sample_strategy 1.5s
tests/buffer/sample_strategy_test.py::ExperienceStorageTest_0::test_priority_queue_default_sample_strategy 1.7s
tests/buffer/sample_strategy_test.py::ExperienceStorageTest_0::test_priority_queue_staleness_control_sample_strategy 1.5s
tests/buffer/sample_strategy_test.py::ExperienceStorageTest_0::test_sql_staleness_control_sample_strategy 4.6s
tests/buffer/sample_strategy_test.py::ExperienceStorageTest_1::test_default_queue_default_sample_strategy 2.2s
tests/buffer/sample_strategy_test.py::ExperienceStorageTest_1::test_default_queue_staleness_control_sample_strategy 1.5s
tests/buffer/sample_strategy_test.py::ExperienceStorageTest_1::test_priority_queue_default_sample_strategy 1.7s
tests/buffer/sample_strategy_test.py::ExperienceStorageTest_1::test_priority_queue_staleness_control_sample_strategy 1.5s
tests/buffer/sample_strategy_test.py::ExperienceStorageTest_1::test_sql_staleness_control_sample_strategy 3.8s
tests/buffer/sql_test.py::TestSQLBuffer::test_sql_exp_buffer_read_write_0 5.8s
tests/buffer/sql_test.py::TestSQLBuffer::test_sql_exp_buffer_read_write_1 2.4s
tests/buffer/sql_test.py::TestSQLBuffer::test_sql_task_buffer_read_write 3.3s
tests/buffer/task_scheduler_test.py::TestTaskScheduler::test_task_scheduler_0 79ms
tests/buffer/task_scheduler_test.py::TestTaskScheduler::test_task_scheduler_1 61ms
tests/buffer/task_scheduler_test.py::TestTaskScheduler::test_task_scheduler_2 95ms
tests/buffer/task_scheduler_test.py::TestTaskScheduler::test_task_scheduler_3 96ms
tests/buffer/task_scheduler_test.py::TestTaskScheduler::test_task_scheduler_4 99ms
tests/buffer/task_scheduler_test.py::TestTaskScheduler::test_task_scheduler_5 106ms
tests/buffer/task_scheduler_test.py::TestTaskScheduler::test_task_scheduler_6 125ms
tests/buffer/task_scheduler_test.py::TestTaskScheduler::test_task_scheduler_simple 56ms
tests/buffer/task_storage_test.py::TaskStorageTest::test_read_task_0_file 379ms
tests/buffer/task_storage_test.py::TaskStorageTest::test_read_task_1_sql 2.9s
tests/buffer/task_storage_test.py::TaskStorageTest::test_read_task_2_file 47ms
tests/buffer/task_storage_test.py::TaskStorageTest::test_read_task_3_sql 3.1s
tests/buffer/task_storage_test.py::TaskStorageTest::test_read_task_4_file 47ms
tests/buffer/task_storage_test.py::TaskStorageTest::test_read_task_5_sql 3.5s
tests/common/config_test.py::TestConfig::test_all_examples_are_valid 13.6s
tests/common/config_test.py::TestConfig::test_chat_template_path 103ms
tests/common/config_test.py::TestConfig::test_config_flatten 37ms
tests/common/config_test.py::TestConfig::test_continue_from_checkpoint_is_valid 216ms
tests/common/config_test.py::TestConfig::test_default_workflow 99ms
tests/common/config_test.py::TestConfig::test_inference_model_base_port_falls_back_when_unavailable 7ms
tests/common/config_test.py::TestConfig::test_inference_model_base_port_uses_engine_id 1ms
tests/common/config_test.py::TestConfig::test_inference_model_without_base_port_uses_ephemeral_port 1ms
tests/common/config_test.py::TestConfig::test_load_default_config 1.2s
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 638ms
tests/common/config_test.py::TestConfig::test_update_config_from_ray_cluster 380ms
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_build_experience_token_view_aligns_prompt_action_mask_and_logprobs 1ms
tests/common/experience_test.py::TestExperience::test_deserialize_legacy_pickle_payload 2ms
tests/common/experience_test.py::TestExperience::test_deserialize_single_rejects_batch_payload 1ms
tests/common/experience_test.py::TestExperience::test_dpo_experience 1ms
tests/common/experience_test.py::TestExperience::test_format_colored_tokens_uses_action_mask 1ms
tests/common/experience_test.py::TestExperience::test_format_colored_tokens_uses_decoded_token_text 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_print_colored_tokens_writes_to_file 1ms
tests/common/experience_test.py::TestExperience::test_serialize_deserialize 1ms
tests/common/experience_test.py::TestExperience::test_serialize_many_deserialize_many 1ms
tests/common/experience_test.py::TestExperience::test_serialize_many_with_shared_multimodal_tensor 1ms
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_experience_model_experience_conversion 1ms
tests/common/external_model_test.py::TestExternalModel::test_external_model 52.4s
tests/common/external_model_test.py::TestExternalModelLoad::test_external_model_load 2.1s
tests/common/models/utils_test.py::TestTokenizeAndMaskMessagesDefault::test_first_message_is_assistant 304ms
tests/common/models/utils_test.py::TestTokenizeAndMaskMessagesDefault::test_messages_empty 593ms
tests/common/models/utils_test.py::TestTokenizeAndMaskMessagesDefault::test_no_assistant_messages 257ms
tests/common/models/utils_test.py::TestTokenizeAndMaskMessagesDefault::test_normal_conversation_data 583ms
tests/common/sudoku_test.py::test_9x9_generator_produces_valid_solution 1ms
tests/common/sudoku_test.py::test_9x9_generator_creates_holes 1ms
tests/common/sudoku_test.py::test_9x9_solution_is_fully_filled 1ms
tests/common/sudoku_test.py::test_judge_allows_incomplete_board 1ms
tests/common/sudoku_test.py::test_judge_detects_row_violation 1ms
tests/common/sudoku_test.py::test_judge_detects_column_violation 1ms
tests/common/sudoku_test.py::test_judge_detects_block_violation 1ms
tests/common/sudoku_test.py::test_4x4_generator_produces_valid_solution 1ms
tests/common/sudoku_test.py::test_4x4_solution_is_fully_filled 1ms
tests/common/sudoku_test.py::test_4x4_judge_detects_row_violation 1ms
tests/common/sudoku_test.py::test_4x4_judge_detects_block_violation 1ms
tests/common/vllm_test.py::ModelWrapperTest_0::test_generate 1m 11s
tests/common/vllm_test.py::ModelWrapperTest_1::test_generate 37.5s
tests/common/vllm_test.py::ModelWrapperTest_2::test_generate 44.3s
tests/common/vllm_test.py::TestModelLen_0::test_model_len 41.5s
tests/common/vllm_test.py::TestModelLen_1::test_model_len 23.9s
tests/common/vllm_test.py::TestModelLen_2::test_model_len 41.7s
tests/common/vllm_test.py::TestModelLenWithoutPromptTruncation::test_model_len 41.5s
tests/common/vllm_test.py::TestMessageProcess::test_no_prompt_truncation 41.2s
tests/common/vllm_test.py::TestMessageProcess::test_truncation_status 41.1s
tests/common/vllm_test.py::TestAPIServer::test_api 24.9s
tests/common/vllm_test.py::TestAPIServer::test_reasoning_content ⏭️ 771ms
tests/common/vllm_test.py::TestLogprobs::test_logprobs_api 22.3s
tests/common/vllm_test.py::TestAsyncAPIServer::test_api_async 24.4s
tests/common/vllm_test.py::TestTinkerAsyncAPIServer::test_api_async ⏭️ 1ms
tests/common/vllm_test.py::TestTokenizer::test_action_mask 291ms
tests/common/vllm_test.py::TestTokenizer::test_action_mask_with_tools 607ms
tests/common/vllm_test.py::TestAPIServerToolCall_0_deepseek_r1::test_api_tool_calls 2m 5s
tests/common/vllm_test.py::TestAPIServerToolCall_1::test_api_tool_calls 1m 37s
tests/common/vllm_test.py::TestSuperLongGeneration::test_generate 1m 19s
tests/common/vllm_test.py::TestTinkerAPI::test_tinker_api 1m 1s
tests/explorer/explorer_test.py::TestExplorerCountdownEval::test_explorer 1m 51s
tests/explorer/explorer_test.py::TestExplorerEvalDetailedStats::test_explorer 1m 23s
tests/explorer/explorer_test.py::TestExplorerGSM8KRULERNoEval::test_explorer 2m 38s
tests/explorer/explorer_test.py::TestExplorerGSM8k::test_explorer 3m 29s
tests/explorer/explorer_test.py::TestExplorerCoordinatorPath::test_explore_step_submits_train_batch_to_rollout_coordinator 2ms
tests/explorer/explorer_test.py::TestExplorerCoordinatorPath::test_finish_current_steps_uses_rollout_coordinator_finalize 1ms
tests/explorer/explorer_test.py::TestExplorerCoordinatorPath::test_finish_eval_step_uses_rollout_coordinator_finalize 2ms
tests/explorer/explorer_test.py::TestExplorerCoordinatorPolicies::test_over_rollout_submits_partial_finalize_policy_to_rollout_coordinator 2ms
tests/explorer/explorer_test.py::ServeTest::test_serve 1m 18s
tests/explorer/proxy_test.py::RecorderTest::test_recorder 111ms
tests/explorer/rollout_coordinator_test.py::TestRolloutCoordinator::test_abort_batch_marks_batch_aborted_and_evicts_it 2ms
tests/explorer/rollout_coordinator_test.py::TestRolloutCoordinator::test_finalize_eval_batch_aggregates_eval_metrics 3ms
tests/explorer/rollout_coordinator_test.py::TestRolloutCoordinator::test_finalize_train_batch_processes_scheduler_payloads 3ms
tests/explorer/rollout_coordinator_test.py::TestRolloutCoordinator::test_finalize_train_batch_rejects_eval_batches_before_waiting 1ms
tests/explorer/rollout_coordinator_test.py::TestRolloutCoordinator::test_finalize_train_batch_supports_partial_finalize 2ms
tests/explorer/rollout_coordinator_test.py::TestRolloutCoordinator::test_finalize_train_batch_times_out_without_any_results 2ms
tests/explorer/rollout_coordinator_test.py::TestRolloutCoordinator::test_shutdown_closes_internal_dependencies 1ms
tests/explorer/rollout_coordinator_test.py::TestRolloutCoordinator::test_terminal_batches_are_not_reusable_after_finalize 3ms
tests/explorer/scheduler_test.py::SchedulerTest::test_async_workflow 5.4s
tests/explorer/scheduler_test.py::SchedulerTest::test_collect_results_reads_payloads_returned_by_workflow_runner 5.3s
tests/explorer/scheduler_test.py::SchedulerTest::test_concurrent_operations 5.6s
tests/explorer/scheduler_test.py::SchedulerTest::test_dynamic_timeout 13.3s
tests/explorer/scheduler_test.py::SchedulerTest::test_dynamic_timeout_warmup_min_steps_uses_completed_steps 7.8s
tests/explorer/scheduler_test.py::SchedulerTest::test_eval_tasks_do_not_return_training_experiences 5.6s
tests/explorer/scheduler_test.py::SchedulerTest::test_get_payload_results 30.8s
tests/explorer/scheduler_test.py::SchedulerTest::test_get_payload_results_keeps_payloads_serialized 5.7s
tests/explorer/scheduler_test.py::SchedulerTest::test_get_statuses_skips_payload_deserialization 5.6s
tests/explorer/scheduler_test.py::SchedulerTest::test_metric_calculation_with_non_repeatable_workflow_0 5.3s
tests/explorer/scheduler_test.py::SchedulerTest::test_metric_calculation_with_non_repeatable_workflow_1 5.2s
tests/explorer/scheduler_test.py::SchedulerTest::test_metric_calculation_with_repeatable_workflow_0 5.4s
tests/explorer/scheduler_test.py::SchedulerTest::test_metric_calculation_with_repeatable_workflow_1 5.7s
tests/explorer/scheduler_test.py::SchedulerTest::test_multi_step_execution 5.8s
tests/explorer/scheduler_test.py::SchedulerTest::test_non_repeatable_workflow 5.5s
tests/explorer/scheduler_test.py::SchedulerTest::test_over_rollout_async_cancelled_runner_accepts_next_batch 5.7s
tests/explorer/scheduler_test.py::SchedulerTest::test_over_rollout_min_wait 9.4s
tests/explorer/scheduler_test.py::SchedulerTest::test_over_rollout_return_partial_tasks 6.1s
tests/explorer/scheduler_test.py::SchedulerTest::test_over_rollout_sync_cancel_does_not_imply_immediate_runner_reuse 7.2s
tests/explorer/scheduler_test.py::SchedulerTest::test_scheduler_all_methods 15.4s
tests/explorer/scheduler_test.py::SchedulerTest::test_scheduler_restart_after_stop 10.4s
tests/explorer/scheduler_test.py::SchedulerTest::test_split_tasks 9.0s
tests/explorer/scheduler_test.py::SchedulerTest::test_stepwise_experience_eid 25.6s
tests/explorer/scheduler_test.py::SchedulerTest::test_timeout_cleanup_keeps_completed_payloads_local 10.8s
tests/explorer/scheduler_test.py::SchedulerTest::test_timeout_cleanup_still_restarts_runner 6.2s
tests/explorer/scheduler_test.py::SchedulerTest::test_unexpected_task_exception_restarts_runner 5.1s
tests/explorer/scheduler_test.py::SchedulerTest::test_wait_all 8.4s
tests/explorer/scheduler_test.py::SchedulerTest::test_wait_all_timeout_with_multi_batch 14.2s
tests/explorer/scheduler_test.py::TestRunnerStateCollection::test_runner_state_collection 10.5s
tests/explorer/step_wise_workflow_test.py::WorkflowTest::test_reward_propagation_workflow_0 2ms
tests/explorer/step_wise_workflow_test.py::WorkflowTest::test_reward_propagation_workflow_1 602ms
tests/explorer/step_wise_workflow_test.py::WorkflowTest::test_step_wise_reward_workflow_0 1ms
tests/explorer/step_wise_workflow_test.py::WorkflowTest::test_step_wise_reward_workflow_1 1.0s
tests/explorer/step_wise_workflow_test.py::WorkflowTest::test_workflows_raise_error 1ms
tests/explorer/step_wise_workflow_test.py::WorkflowTest::test_workflows_stop_at_max_env_steps 1.0s
tests/explorer/workflow_test.py::WorkflowTest::test_gsm8k_workflow 28ms
tests/explorer/workflow_test.py::WorkflowTest::test_math_boxed_workflow 17ms
tests/explorer/workflow_test.py::WorkflowTest::test_math_complex_workflow 134ms
tests/explorer/workflow_test.py::WorkflowTest::test_math_eval_workflow 4ms
tests/explorer/workflow_test.py::WorkflowTest::test_math_fraction_workflow 12ms
tests/explorer/workflow_test.py::WorkflowTest::test_math_workflow 8ms
tests/explorer/workflow_test.py::WorkflowTest::test_workflow_repeatable_0 1ms
tests/explorer/workflow_test.py::WorkflowTest::test_workflow_repeatable_1 101ms
tests/explorer/workflow_test.py::WorkflowTest::test_workflow_resettable_0 1ms
tests/explorer/workflow_test.py::WorkflowTest::test_workflow_resettable_1 202ms
tests/explorer/workflow_test.py::MultiTurnWorkflowTest_0::test_multi_turn_workflow 21.2s
tests/explorer/workflow_test.py::MultiTurnWorkflowTest_1::test_multi_turn_workflow 22.2s
tests/explorer/workflow_test.py::TestWorkflowStateRecording::test_workflow_state_recording 4.0s
tests/explorer/workflow_test.py::TestAgentScopeWorkflowAdapter::test_adapter_v1 3.3s
tests/explorer/workflow_test.py::TestWorkflowRunner::test_workflow_runner 144ms
tests/explorer/workflow_test.py::TestWorkflowRunner::test_workflow_runner_fail_fast_without_partial_collection_0_sequential 70ms
tests/explorer/workflow_test.py::TestWorkflowRunner::test_workflow_runner_fail_fast_without_partial_collection_1_asynchronous 60ms
tests/explorer/workflow_test.py::TestWorkflowRunner::test_workflow_runner_fail_fast_without_partial_collection_2_multi_threading 540ms
tests/explorer/workflow_test.py::TestWorkflowRunner::test_workflow_runner_get_state 8.1s
tests/explorer/workflow_test.py::TestWorkflowRunner::test_workflow_runner_partial_success_non_repeatable_0_sequential 39ms
tests/explorer/workflow_test.py::TestWorkflowRunner::test_workflow_runner_partial_success_non_repeatable_1_asynchronous 40ms
tests/explorer/workflow_test.py::TestWorkflowRunner::test_workflow_runner_partial_success_non_repeatable_2_multi_threading 40ms
tests/explorer/workflow_test.py::TestWorkflowRunner::test_workflow_with_openai 23.6s
tests/explorer/workflow_test.py::TestConcurrentWorkflowRunner::test_concurrent_workflow_runner 46.3s
tests/manager/log_manager_test.py::TestLogManager::test_file_rotation 2ms
tests/manager/log_manager_test.py::TestLogManager::test_init_and_tracking 2ms
tests/manager/log_manager_test.py::TestLogManager::test_keyword_filter_and_search_pattern 1ms
tests/manager/synchronizer_test.py::TestSynchronizerExit_0::test_synchronizer 2m 22s
tests/manager/synchronizer_test.py::TestSynchronizerExit_1::test_synchronizer 2m 34s
tests/manager/synchronizer_test.py::TestStateDictBasedSynchronizer_0::test_synchronizer 2m 11s
tests/manager/synchronizer_test.py::TestStateDictBasedSynchronizer_1::test_synchronizer 1m 53s
tests/manager/synchronizer_test.py::TestStateDictBasedSynchronizer_2::test_synchronizer 2m 7s
tests/manager/synchronizer_test.py::TestStateDictBasedSynchronizer_3::test_synchronizer 2m 38s
tests/manager/synchronizer_test.py::TestStateDictBasedSynchronizer_4::test_synchronizer 2m 23s
tests/manager/synchronizer_test.py::TestStateDictBasedSynchronizer_5::test_synchronizer 2m 41s
tests/manager/synchronizer_test.py::TestNCCLBasedSynchronizer_0::test_synchronizer 1m 14s
tests/manager/synchronizer_test.py::TestNCCLBasedSynchronizer_1::test_synchronizer 1m 9s
tests/manager/synchronizer_test.py::TestNCCLBasedSynchronizer_2::test_synchronizer 1m 9s
tests/manager/synchronizer_test.py::TestPullLatestWeights::test_no_new_version_logs_warning 4ms
tests/manager/synchronizer_test.py::TestPullLatestWeights::test_pull_latest_weights_0 2ms
tests/manager/synchronizer_test.py::TestPullLatestWeights::test_pull_latest_weights_1 4ms
tests/manager/synchronizer_test.py::TestPullLatestWeights::test_pull_latest_weights_2 3ms
tests/manager/synchronizer_test.py::TestPullLatestWeights::test_pull_latest_weights_3 3ms
tests/perf/resource_backends_test.py::SystemResourceBackendTest::test_sample_keeps_peak_gpu_utilization_within_one_outer_sample 2ms
tests/perf/resource_sampler_test.py::ResourceSamplerTest::test_resource_sampler_collects_samples 31ms
tests/perf/resource_sampler_test.py::ResourceSamplerTest::test_resource_samples_serialize_cpu_single_line_and_gpu_per_device 1ms
tests/trainer/trainer_test.py::TestTrainerCountdown_0_fsdp2::test_trainer 4m 23s
tests/trainer/trainer_test.py::TestTrainerCountdown_1_megatron::test_trainer 5m 9s
tests/trainer/trainer_test.py::TestStepAheadAsyncRL::test_trainer 1m 31s
tests/trainer/trainer_test.py::TestTrainerGSM8K_0_fsdp::test_trainer 1m 13s
tests/trainer/trainer_test.py::TestTrainerGSM8K_1_fsdp2::test_trainer 1m 12s
tests/trainer/trainer_test.py::TestTrainerGSM8K_2_fsdp::test_trainer 1m 16s
tests/trainer/trainer_test.py::TestTrainerGSM8K_3_fsdp2::test_trainer 1m 17s
tests/trainer/trainer_test.py::TestTrainerSFTWarmupGSM8K::test_trainer ⏭️ 1ms
tests/trainer/trainer_test.py::TestTrainerDPO::test_trainer 40.2s
tests/trainer/trainer_test.py::TestTrainerSFT::test_trainer 38.2s
tests/trainer/trainer_test.py::TestTrainerToolsSFT::test_trainer_tools 37.9s
tests/trainer/trainer_test.py::TestFullyAsyncMode_0_fsdp::test_fully_async_mode 1m 46s
tests/trainer/trainer_test.py::TestFullyAsyncMode_1_fsdp2::test_fully_async_mode 1m 51s
tests/trainer/trainer_test.py::TestFullyAsyncMode_2_megatron::test_fully_async_mode 2m 38s
tests/trainer/trainer_test.py::TestTrainerCheckpointSave_0_fsdp::test_trainer 2m 56s
tests/trainer/trainer_test.py::TestTrainerCheckpointSave_1_megatron::test_trainer 5m 52s
tests/trainer/trainer_test.py::TestTrainerMIX::test_trainer 2m 9s
tests/trainer/trainer_test.py::TestServeWithTrainer::test_serve_with_trainer 1m 57s
tests/trainer/trainer_test.py::TestMultiModalGRPO::test_trainer 2m 36s
tests/trainer/trainer_test.py::TestMultiModalSFT::test_trainer 1m 41s
tests/trainer/trainer_test.py::TestTrainerLoRA::test_trainer 3m 9s
tests/trainer/trainer_test.py::TestOverRollout::test_trainer 1m 9s
tests/trainer/trainer_test.py::TestTrainerPromptTruncation::test_trainer 49.9s
tests/trainer/trainer_test.py::TestTinkerTrainer::test_trainer ⏭️ 1ms
tests/trainer/trainer_test.py::TestTinkerTrainer::test_trainer_class ⏭️ 1ms
tests/trainer/trainer_test.py::AgentScopeTunerTest::test_agentscope_tuner 1m 45s
tests/trainer/trainer_test.py::ColocateModeTest::test_trainer 2m 7s

Github Test Reporter by CTRF 💚

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds first-class support for running Explorer rollouts on the SGLang inference engine, while extending the weight-sync API to carry an explicit SyncMethod (NCCL vs checkpoint) and enhancing perf reporting.

Changes:

  • Introduce an SGLang rollout model (embedded HTTP server + client) and wiring to create SGLang-based Explorer engines.
  • Extend model weight-sync APIs to include SyncMethod (+ timeout) and propagate through Explorer/proxy/tests.
  • Improve trainer/inference stability & observability (dtype alignment for FSDP2 LoRA, checkpoint state_dict handling, perf throughput metrics, remove problematic distributed barriers).

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
trinity/trainer/verl/verl_trainer.py Add trainer backend initialization log.
trinity/trainer/verl/megatron_workers.py Remove incorrect per-rank barrier usage during weight sync.
trinity/trainer/verl/fsdp_workers.py Improve FSDP2/LoRA dtype handling; adjust weight sync group initialization/logging.
trinity/trainer/verl/fsdp_checkpoint_manager.py Make checkpoint upload robust to tensor wrappers (e.g., full_tensor()).
trinity/perf/stage_perf.py Include global token throughput metrics in perf payload timing.
trinity/perf/report_viewer.py Display additional throughput metrics in UI and tweak layout.
trinity/perf/report_metrics.py New helper to compute global token throughput metrics from step metrics.
trinity/manager/synchronizer.py Track latest checkpoint model path and expose via async getter.
trinity/explorer/proxy/service.py Pass explicit SyncMethod when syncing model weights in service loop.
trinity/explorer/explorer.py Propagate sync_method and timeout into model sync calls.
trinity/common/workflows/workflow.py Change async workflow logging level to INFO for chat start/response details.
trinity/common/models/vllm_worker.py Remove barriers and simplify process group init/update sequencing.
trinity/common/models/vllm_model.py Update sync/init_process_group signatures; add sync logging.
trinity/common/models/tinker_model.py Update sync signature to accept SyncMethod and timeout.
trinity/common/models/sglang_patch/api_patch.py Add embedded SGLang HTTP server bootstrap/cleanup utilities.
trinity/common/models/sglang_patch/init.py Export SGLang embedded server helper.
trinity/common/models/sglang_model.py New SGLang rollout model implementation + sync via NCCL or checkpoint.
trinity/common/models/model.py Extend sync API to include SyncMethod; add deterministic port selection via base_port + engine_id.
trinity/common/models/external_model.py Update sync signature to accept SyncMethod and timeout.
trinity/common/models/init.py Add SGLang engine selection and new Ray actor factories; avoid mutating shared config via deepcopy.
trinity/common/config.py Add enable_multimodal, base_port, and engine_id to inference config.
trinity/buffer/reader/queue_reader.py Add StopAsyncIteration handling for Ray queue reads (sync/async).
tests/trainer/trainer_test.py Update strategy matrix to include fsdp2 and propagate strategy into trainer config.
tests/template/config.yaml Switch template trainer strategy default to fsdp2.
tests/manager/synchronizer_test.py Update mocks/assertions for new sync signature and pipeline usage.
tests/explorer/scheduler_test.py Update dummy model sync signature for new parameters.
tests/common/config_test.py Add tests for deterministic port selection behavior.
scripts/docker/Dockerfile.uv Install protobuf compiler dependency.
pyproject.toml Add optional sglang extra; bump transformers minimum version.
perf/scripts/explorer/perf_workflow.py Add perf workflow that measures OpenAI API-call token throughput.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +37 to +41
except Exception as e:
if "StopAsyncIteration" in traceback.format_exc():
raise StopIteration() from e
else:
raise e
Comment on lines +46 to +54
try:
exp_bytes = await self.queue.get_batch.remote(
batch_size, timeout=self.timeout, **kwargs
)
except Exception as e:
if "StopAsyncIteration" in traceback.format_exc():
raise StopAsyncIteration() from e
else:
raise e
response.eid.run = i + self.run_id_base

self.logger.debug(
self.logger.info(
Comment on lines +494 to +506
elif method == SyncMethod.CHECKPOINT:
model_path = await self.synchronizer.get_latest_model_path.remote()
if model_path is not None:
await self.api_client.update_weights_from_disk(
model_path=model_path,
weight_version=str(model_version),
timeout=timeout,
)
else:
raise ValueError(f"Unsupported sync method for SGLang: {method}")
self.logger.info(f"Synchronized model to version {model_version} using method {method}.")
self.model_version = model_version
return model_version
usage_completion_tokens += float(completion_tokens)

self.logger.info("Received response: %s", responses.choices[0].message)
exps = self.model.extract_experience_from_history()
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