Skip to main content
Example scripts for running P2P (RDMA) and broadcast (NCCL) weight transfer between Megatron training and sglang rollout engines. See docs/advanced/p2p-weight-transfer.md for full documentation, architecture details, and profiling results.

Quick Start

All examples use a single run.py script with two subcommands (prepare and run) and per-model thin bash wrappers:

Usage

Single-node models (Qwen3-4B)

Single-node models auto-detect networking and don’t require node rank or head IP:

Multi-node models

GLM-5 variants (2/12/32 nodes)

The GLM-5.sh wrapper accepts a VARIANT argument:

Using run.py directly

Environment variables

Notes

* Kimi-K2: The profiling RDMA time for Kimi-K2 includes ~884 ms of GPU-side post_load_weights requantization on the rollout engines, since this model requires weight requantization after RDMA transfer.