[BUG] fix sglang veRL GptOSS rollout problem#14099
[BUG] fix sglang veRL GptOSS rollout problem#14099yiakwy-xpu-ml-framework-team wants to merge 3 commits intosgl-project:mainfrom
Conversation
Summary of ChangesHello @yiakwy-xpu-ml-framework-team, 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 critical issues encountered when using SGLang as a rollout backend, particularly in environments like Docker or when integrated with Megatron-LM, which manifest as problems with PyTorch's inter-process communication and CUDA memory sharing. The changes introduce robust handling for multiprocessing and shared CUDA tensor creation, aiming to improve stability and compatibility by circumventing Highlights
Using Gemini Code AssistThe 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
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 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
|
There was a problem hiding this comment.
Code Review
This pull request introduces patches to address multiprocessing issues, particularly in containerized environments, by modifying torch.multiprocessing behavior. The changes in tp_worker.py adjust multiprocessing settings, while patch_torch.py provides a fallback for CUDA tensor sharing to prevent pidfd_getfd errors. While the approach is sound, the implementation includes some debugging code that should be removed and uses overly broad exception handling, which could be improved for better robustness and maintainability.
Motivation
When support GptOSS with Megatron (NVIDIA/Megatron-LM#2383, verl-project/verl#4323)
We found that using SGLang as rollout backend produces many problems :
After digging it out we made pytroch patch to avoid pidfd_getfd from torch and docker security settings.
Modifications
Accuracy Tests
Benchmarking and Profiling
Checklist