Skip to content

[rollout] fix: sglang megatron backend missing generate function #2367

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed

Conversation

wuxibin89
Copy link
Collaborator

What does this PR do?

Close #2366

Checklist Before Starting

  • Search for similar PRs. Paste at least one query link here: ...
  • Format the PR title as [{modules}] {type}: {description} (This will be checked by the CI)
    • {modules} include fsdp, megatron, sglang, vllm, rollout, trainer, ci, training_utils, recipe, hardware, deployment, ray, worker, single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data
    • If this PR involves multiple modules, separate them with , like [megatron, fsdp, doc]
    • {type} is in feat, fix, refactor, chore, test
    • If this PR breaks any API (CLI arguments, config, function signature, etc.), add [BREAKING] to the beginning of the title.
    • Example: [BREAKING][fsdp, megatron] feat: dynamic batching

Test

For changes that can not be tested by CI (e.g., algorithm implementation, new model support), validate by experiment(s) and show results like training curve plots, evaluation results, etc.

API and Usage Example

Demonstrate how the API changes if any, and provide usage example(s) if possible.

# Add code snippet or script demonstrating how to use this

High-Level Design

Demonstrate the high-level design if this PR is complex.

Specific Changes

List the specific changes.

Checklist Before Submitting

Important

Please check all the following items before requesting a review, otherwise the reviewer might deprioritize this PR for review.

Copy link

@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 generate function to the sglang megatron backend, addressing issue #2366. It also updates test utilities to support both fsdp and megatron backends.

config.actor_rollout_ref.actor.megatron.pipeline_model_parallel_size = 2

# FIXME: sglang with megatron param_offload got error:
# "CUDA error: an illegal memory access was encountered"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@chenhaiq sglang seems don't work with megatron param_offload=True

Copy link
Collaborator

Choose a reason for hiding this comment

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

@wuxibin89 wuxibin89 force-pushed the wuxibin/fix_megatron_sglang_async branch from 04f2428 to e62ab08 Compare July 4, 2025 15:45
@@ -67,6 +68,7 @@ def are_lists_similar(a, b):
return percentage_difference <= 15


@pytest.mark.skip("https://github.com/vllm-project/vllm/issues/16993")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Skip this test temporary since it's only works with vllm==0.7.3, our ci image is vllm==0.8.5.

@wuxibin89
Copy link
Collaborator Author

Close this PR since #2365 already fixed it.

@wuxibin89 wuxibin89 closed this Jul 7, 2025
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.

Error about the Async sglang
2 participants