Update qwen3-4B example(reward converges, colocate + non-colocate.) - #24
Conversation
There was a problem hiding this comment.
Code Review
This pull request migrates the rollout backend from SGLang to vLLM for the Qwen3-4B example, updating the documentation and execution scripts. The changes include renaming configuration variables to VLLM_ARGS, adding memory management parameters, and providing detailed explanations for co-located and decoupled training modes. A review comment pointed out that the Chinese documentation is inconsistent with the English version, as it retains outdated SGLang references and lacks a complete example for decoupled training configuration.
| ⚠️ 在进行训推分离的时候,每个 vllm server 上的并发度太大,超过了 vllm 默认的 cuda graph 的并发度(默认最大 160),影响推理速度。可以用以下 2 种方式进行调整: | ||
|
|
||
| 1. 通过 `--sglang-server-concurrency` 限制发给一个 sglang server 的最大并发量,例如: | ||
| 1. 通过 `--vllm-server-concurrency` 限制发给一个 vllm server 的最大并发量,例如: | ||
|
|
||
| ```bash | ||
| --sglang-server-concurrency 160 | ||
| --vllm-server-concurrency 160 | ||
| ``` | ||
|
|
There was a problem hiding this comment.
The Chinese documentation in this section is inconsistent with the English version and contains outdated information. It incorrectly mentions "2 ways" (2 种方式) to adjust concurrency but only provides one, and it refers to a "160" limit which was specific to SGLang's CUDA graph implementation.
To align with the English version, this section should be updated to provide an example of VLLM_ARGS for decoupled training and inference. For example:
对于训推分离模式,VLLM_ARGS 仅需配置推理后端参数,例如:
VLLM_ARGS=(
--rollout-num-gpus-per-engine 2
--vllm-gpu-memory-utilization 0.9
)There was a problem hiding this comment.
the zh decoupled section now matches en — removed the old SGLang cuda-graph notes and added the Ray resource + VLLM_ARGS example.
|
|
||
| # for rerun the task | ||
| pkill -9 sglang | ||
| pkill -9 vllm |
There was a problem hiding this comment.
pkill -9 vllm likely matches nothing?
There was a problem hiding this comment.
Good catch, removed pkill -9 vllm. vLLM workers are Ray/python processes, so rerun cleanup now uses ray stop --force + pkill ray/python, same as the original script.
| ⚠️ 在进行训推分离的时候,每个 sglang server 上的并发度太大,超过了 sglang 默认的 cuda graph 的并发度(默认最大 160),影响推理速度。可以用以下 2 种方式进行调整: | ||
| 训推分离时,`VLLM_ARGS` 仅需配置推理后端相关参数,例如: | ||
|
|
||
| 1. 通过 `--sglang-server-concurrency` 限制发给一个 sglang server 的最大并发量,例如: |
There was a problem hiding this comment.
We can add some similar things like --vllm-max-num-seqs, --vllm-max-num-batched-tokens, --vllm-enforce-eage
) * update qwen3-4B example * Address PR #24 review: fix rerun cleanup and document vLLM scheduler knobs







docs(qwen3-4B): migrate example to vLLM and report e2e smoke (issue #11)
Summary
Progress toward issue #11 Qwen3-4B PPO (dense, baseline):
scripts/run-qwen3-4B.shin place).docs/zh/examples/qwen3-4B.mdanddocs/en/examples/qwen3-4B.mdto match the vLLM runtime onmain(no--rollout-backend; Ray owns GPU placement via--actor-num-gpus-per-node/--rollout-num-gpus).This PR covers documentation + e2e smoke (load ckpt → rollout → weight sync → train step). Full 3000-rollout reward convergence is tracked separately.
Code changes
scripts/run-qwen3-4B.sh--rollout-num-gpus-per-engine 2,--vllm-gpu-memory-utilization 0.7,--train-memory-margin-bytes,PYTHONPATHincludes repo root for colocate worker extensiondocs/zh/examples/qwen3-4B.mdSGLANG_ARGS→VLLM_ARGS; decoupled/colocate sections updateddocs/en/examples/qwen3-4B.mdTest setup
vimeonA100-server, NFS code at/data/nfs_87/xky/RL/Qwen3-4B,dapo-math-17k,aime-2024main(4c74767) — uses upstreamUpdateWeightFromDistributed+ NCCL in-process weight transfertest/with_ipc— IPC colocate path from #22 is not merged tomainyet; colocate e2e was validated on this branchE2E test scripts (manual smoke, outside this PR diff)
Scripts live in the RL workspace (
run_scripts/), aligned withscripts/run-qwen3-4B.shhyperparameters; defaultNUM_ROLLOUT=5for fast validation.1) Decoupled — 2 train + 6 rollout (
main)Topology:
--actor-num-gpus-per-node 2,--rollout-num-gpus 6,--rollout-num-gpus-per-engine 2(3 vLLM engines).Key log output (2026-05-23,
train_qwen3_4b_vllm_verify_20260523_012819.log):Topology:
--colocate,--actor-num-gpus-per-node 8, 4 engines × TP=2.Key log output (2026-05-23,
verify_colocate_retry.log):Unit test on
test/with_ipc(container):3) Colocate long-run smoke (
test/with_ipc, optional)First rollout completed after cold start from
Qwen3-4B_torch_dist(avoid lr_decay_steps mismatch when resuming short-verify ckpt):Issue #11 checklist mapping
docs/zh/examples/qwen3-4B.md→ vLLMscripts/run-qwen3-4B.sh→ vLLM colocate baselinemaintest/with_ipc(blocked onmainuntil #22)tests/test_qwen3_4B_ppo.pyon vLLM + reward convergenceRelated
main(decoupled),test/with_ipc(colocate)Test plan
main)test/with_ipc)6 passed)tests/test_qwen3_4B_ppo.pyto vLLM in CI