feat(examples): add Qwen3.5 MoE coding agent with R3 - #597
Siwei Zhang (SiweiPro) wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
🟡 Changes recommended
The pinned commit is unavailable, the documented vLLM version is incompatible with this R3 path, and required Megatron dependencies and regression tests are missing.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds a Qwen3.5 MoE coding-agent workflow using Megatron and R3 router replay.
Changes:
- Adds the MoE launcher, configuration, and documentation.
- Propagates routed-expert data through gateway events into VERL batches.
- Pins a specialized VERL dependency.
File summaries
| File | Description |
|---|---|
scripts/setup_verl.sh |
Pins the R3 VERL stack. |
mkdocs.yml |
Adds MoE guide navigation. |
examples/swe_smith/train_smith_agent_moe.py |
Configures MoE Megatron/R3 training. |
examples/swe_smith/run.sh |
Makes launcher behavior configurable. |
examples/swe_smith/run_moe.sh |
Adds the MoE role wrapper. |
examples/swe_smith/README.md |
Links both coding-agent variants. |
docs/README.md |
Lists the MoE guide. |
docs/76-example-coding-agent-moe.md |
Documents setup and execution. |
docs/00-installation.md |
Describes the pinned VERL installation. |
agentlightning/verl/trainer.py |
Enables R3-aware rollout adaptation. |
agentlightning/verl/rollout_adapter.py |
Builds routed-expert training tensors. |
agentlightning/verl/agl_rollout_manager.py |
Transfers routes into triplets. |
agentlightning/server/routes/events.py |
Stores, compacts, and filters routes. |
agentlightning/server/proxy.py |
Requests and captures routed experts. |
agentlightning/config/server.yaml |
Adds the routed-experts proxy option. |
Review details
- Files reviewed: 15/15 changed files
- Comments generated: 4
- Review effort level: Balanced (auto)
Note
Copilot is running an experiment and ran this review at Balanced.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| ```bash | ||
| uv sync | ||
| source .venv/bin/activate | ||
| bash scripts/setup_verl.sh 0.8.0 cu130 |
| VLLM_VERSION="0.12.0" | ||
| else | ||
| VLLM_VERSION="0.20.2" | ||
| VERL_PACKAGE="verl @ git+https://github.com/volcengine/verl.git@$VERL_R3_COMMIT" |
| def _drop_superseded_routed_experts(events: list[Event], event_type: str, data: dict[str, Any]) -> None: | ||
| """Keep only the last route tensor in each mergeable trajectory.""" | ||
| if event_type != "model_request" or data.get("routed_experts") is None: |
| def _build_routed_experts_batch( | ||
| rows: list[tuple[str, int, int, int]], | ||
| max_prompt_length: int, | ||
| max_response_length: int, | ||
| device: torch.device, | ||
| ) -> torch.Tensor: |
|
Siwei Zhang (@SiweiPro) please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
Add a separate Qwen3.5-35B-A3B Megatron/R3 launcher and preserve routed experts through the Agent Lightning training pipeline while keeping the existing 9B FSDP example. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
dde7456 to
d23e9fe
Compare
|
|
In a multi-turn dialogue, the expert Ids associated with the historical prompt from each turn need be recorded and preserved for the current turn; the method for selecting the historical expert IDs requires verification. |
Summary
Qwen/Qwen3.5-35B-A3BSWE-smith launcher using Megatron and R3Qwen/Qwen3.5-9BFSDP examplerouted_expertsthrough the gateway event, triplet, andDataProtopipelineValidation
ruff checkandruff format --checkpyrighton changed Python files: 0 errorsmkdocs build --strict