Skip to content

refactor: separate sglang argparse from megatron with two-phase parsing - #1600

Merged
zhuzilin merged 8 commits into
mainfrom
separate-sglang-argparse
Feb 20, 2026
Merged

zhuzilin merged 8 commits into
mainfrom
separate-sglang-argparse

Conversation

@zhuzilin

Copy link
Copy Markdown
Contributor
  • Add sglang_parse_args() for independent sglang arg parsing (Phase 1)
  • Add megatron_parse_args() / fsdp_parse_args() with ignore_unknown_args (Phase 2)
  • Move backend-specific validation and defaults into respective backend modules
  • Unify naming: sglang_parse_args, megatron_parse_args, fsdp_parse_args
  • Pre-parse --train-backend, --debug-* flags in _pre_parse_mode() to avoid duplication
  • Remove dead code parse_args_train_backend()
  • Add test: test_qwen2.5_0.5B_debug_rollout_then_train.py (rollout-only then train-only)
  • Register new test in CI (run-ci-megatron, run-ci-image)

- Add sglang_parse_args() for independent sglang arg parsing (Phase 1)
- Add megatron_parse_args() / fsdp_parse_args() with ignore_unknown_args (Phase 2)
- Move backend-specific validation and defaults into respective backend modules
- Unify naming: sglang_parse_args, megatron_parse_args, fsdp_parse_args
- Pre-parse --train-backend, --debug-* flags in _pre_parse_mode() to avoid duplication
- Remove dead code parse_args_train_backend()
- Add test: test_qwen2.5_0.5B_debug_rollout_then_train.py (rollout-only then train-only)
- Register new test in CI (run-ci-megatron, run-ci-image)
…g args.debug_rollout_only

args.debug_rollout_only is now set by _pre_parse_mode and merged after
megatron_parse_args returns, so it's not available during parsing.
Skip megatron init(args) entirely in debug_rollout_only mode since
megatron_validate_args is not run and attributes like
virtual_pipeline_model_parallel_size are not set.
- actor.train: early return before _get_rollout_data (rollout manager returns None)
- rollout manager: skip _convert_samples_to_train_data in debug_rollout_only
- fix typo: self.debug_rollout_only -> self.args.debug_rollout_only
- move log_rollout_data out of debug_rollout_only branch
- train_actor: skip set_train_parallel_config when debug_rollout_only
  (train_parallel_config is not set since actor.init returns early)
- rollout: skip trim/dynamic-batch-size logic in debug_rollout_only
  (avoids accessing unset train_parallel_config)
@zhuzilin
zhuzilin merged commit 96118d0 into main Feb 20, 2026
20 of 47 checks passed
@zhuzilin
zhuzilin deleted the separate-sglang-argparse branch February 20, 2026 15:49
gxlvera pushed a commit to gxlvera/slime that referenced this pull request Feb 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant