Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
228bfd6
sync(slime #2014..#2125): diff3 3-way merge, conflicts preserved
aoshen02 Jun 25, 2026
aa7eec5
sync(slime #2014..#2125): resolve all conflicts (commit 2)
aoshen02 Jun 25, 2026
f9031be
fix(sync): pre-commit lint/format on resolved files
aoshen02 Jun 25, 2026
b54240d
fix(sync): make CPU CI green (engine import, docker build, agent/util…
aoshen02 Jun 25, 2026
0cda11c
fix(sync): unblock GPU run (scipy pin, router arg dup, top-p-replay g…
aoshen02 Jun 25, 2026
fc11810
ci(gpu): drop deleted test_qwen2.5_0.5B_ppo_critic_only_short from sh…
aoshen02 Jun 25, 2026
c745859
fix(sync): restore base_log_probs init in streaming rollout (None+lis…
aoshen02 Jun 25, 2026
8cf65aa
fix(sync): streaming rollout uses append_response_tokens (was renamed…
aoshen02 Jun 25, 2026
9af959a
fix(sync): restore vime unconditional colocate rollout_num_gpus re-de…
aoshen02 Jun 25, 2026
f6cfc31
fix(sync): slime-consistency review pass (docs, rollout routed_expert…
aoshen02 Jun 26, 2026
d62b012
fix(ci): pre-commit green — define base in streaming MM render (F821)…
aoshen02 Jun 26, 2026
5cc2f49
fix(ci): correct two mistranslated CPU tests (colocate rollout-gpu re…
aoshen02 Jun 26, 2026
cf7b6a0
fix(sync): streaming rollout posts to /inference/v1/generate, not sgl…
aoshen02 Jun 26, 2026
430cc95
fix(sync): thread rollout port cursor globally across multi-model eng…
aoshen02 Jun 26, 2026
764e1e1
fix(sync): restore robust pkill pattern so ckpt cleanup kills vLLM ra…
aoshen02 Jun 26, 2026
29f2490
chore(sync): replace all `pkill -9 vllm` with cmdline-match pattern
aoshen02 Jun 26, 2026
46ee8c2
fix(docker): restore vLLM core.py partial-wake sleep-guard (#44483)
aoshen02 Jun 27, 2026
b359b24
fix(docker): drop scipy<1.14 pin, mirror slime numpy<2 only
aoshen02 Jun 27, 2026
fb6564f
fix(docker): keep FlashQLA install gated behind INSTALL_FLASHQLA=0
aoshen02 Jun 27, 2026
84b373d
docs(vllm-config): fix inference-only FAQ — vime launches engines in-…
aoshen02 Jun 27, 2026
37ba9c2
docs(debug): restore INT4 / Compressed-Tensors checkpoint section
aoshen02 Jun 27, 2026
30e4205
docs(vllm-config): use _run_vllm_server for inference-only FAQ
aoshen02 Jun 27, 2026
25788d7
fix(docker): restore scipy pin (scipy<1.18) — vime base needs it
aoshen02 Jun 27, 2026
53ec554
fix(scripts): properly translate sglang args in glm5.2-744B + glm4.7-…
aoshen02 Jun 27, 2026
7bb19e6
fix(args): hard-guard unverified delta weight-sync mode
aoshen02 Jun 27, 2026
9ff2de7
docs,test: correct rollout engine endpoint to /inference/v1/generate
aoshen02 Jun 27, 2026
4fe88b7
style(args): collapse delta-guard message to one line (black)
aoshen02 Jun 27, 2026
6eed804
test(args): assert delta weight-sync is guarded off (not per-condition)
aoshen02 Jun 27, 2026
93d7b3a
fix(sync): restore dropped weight-sync metrics chain + delta dispatch…
aoshen02 Jun 28, 2026
193d2b8
chore(sync): align comments to the mechanical mirror
aoshen02 Jun 28, 2026
85b70c7
docs(delta): note delta weight-sync not yet verified on vime+vLLM (PR…
aoshen02 Jun 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .buildkite/gpu_suites.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
"short": [
("test_qwen3.5_0.8B_gsm8k_async_short.py", 4, "", {}),
("test_qwen3.5_0.8B_gsm8k_short.py", 4, "", {}),
("test_qwen2.5_0.5B_ppo_critic_only_short.py", 4, "", {}),
("test_qwen2.5_0.5B_fully_async_short.py", 4, "", {}),
],
"vllm-config": [
Expand Down
9 changes: 6 additions & 3 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ steps:
python tests/test_metric_report_dist.py
python tests/test_loss_cp_invariance.py
python tests/test_sample.py
python tests/test_cispo_loss.py
python tests/test_logprob_response_spans.py
python tests/utils/test_hf_checkpoint_saver.py
'

Expand All @@ -101,9 +103,10 @@ steps:
pip install -q pytest numpy packaging pyyaml omegaconf tqdm httpx requests ray pybase64 pylatexenc sympy aiohttp pillow safetensors transformers cloudpickle
pip install -q openai openai-agents anthropic
pip install -q -e . --no-deps
python tests/test_agent_trajectory.py
python tests/test_agent_adapters.py
python tests/test_agent_sdk_adapters.py
python tests/test_agent/test_adapters.py
python tests/test_agent/test_harness.py
python tests/test_agent/test_trajectory_manager_branching.py
python tests/test_agent/test_agent_rollout_cpu.py
'

- label: ":pytest: utils tests"
Expand Down
28 changes: 24 additions & 4 deletions .claude/skills/add-tests-and-ci/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,33 @@ if __name__ == "__main__":
- `run-ci-changed` extracts a top-level `NUM_GPUS = <N>` constant from added/modified `tests/test_*.py` and `tests/plugin_contracts/test_*.py`; if missing, it defaults to 8 GPUs. Set `NUM_GPUS = 0` for CPU-only tests.
- For GPU/e2e tests, follow the nearby file pattern (`prepare()`, `execute()`, `NUM_GPUS`, and any model/dataset constants).

### Step 3: Run Local Validation
### Step 3: Register Tests in GitHub CI

Whenever adding, moving, or renaming a test file, update the GitHub workflow template before finishing:

1. Add the test to the appropriate matrix in `.github/workflows/pr-test.yml.j2`.
- CPU-only pytest/unit tests usually belong in `cpu-unittest` with `num_gpus: 0`.
- GPU/e2e tests should be placed beside the nearest similar model/path test with the matching `num_gpus` and environment fields.
2. Regenerate workflows:

```bash
python .github/workflows/generate_github_workflows.py
```

3. Include both `.github/workflows/pr-test.yml.j2` and the generated `.github/workflows/pr-test.yml` in the change set.

Only skip fixed matrix registration when the test is intentionally helper-only or manually invoked; state that reason in the final response.

### Step 4: Run Local Validation

- Run the exact existing test files you changed, if any.
- For new registered tests, run the same shape CI will use, for example `python tests/test_new_file.py`.
- Run repository-wide checks only when they are already part of the task or workflow.
- Avoid documenting placeholder test commands that may not exist in the current tree.

### Step 4: Update Workflow Template Correctly
### Step 5: Keep Workflow Template as Source of Truth

For CI workflow changes:
For CI workflow changes unrelated to a new, moved, or renamed test:

1. Edit `.github/workflows/pr-test.yml.j2`
2. Regenerate workflows:
Expand All @@ -59,18 +77,20 @@ python .github/workflows/generate_github_workflows.py

3. Include both the template and generated workflow file in the change set (`.j2` and `.yml`). If the user asked for a commit, commit both.

### Step 5: Provide Verifiable PR Notes
### Step 6: Provide Verifiable PR Notes

Include:

- Which tests were added/changed
- Where each new/renamed test was registered in `.github/workflows/pr-test.yml.j2`
- Exact commands executed
- GPU assumptions for each test path
- Why this coverage protects against regression

## Common Mistakes

- Editing generated workflow file only
- Relying on `run-ci-changed` discovery for a new test that should run in the regular PR matrix
- Forgetting `NUM_GPUS = 0` on a CPU-only changed test, causing `run-ci-changed` to default to 8 GPUs
- Adding a CPU pytest file that passes under `pytest tests/foo.py` but fails under CI's `python tests/foo.py`
- Adding tests without following existing constants/conventions
Expand Down
29 changes: 29 additions & 0 deletions .claude/skills/vime-code-review-preferences/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: vime-code-review-preferences
description: Use when reviewing or editing vime code, especially refactors around helper APIs, branch selection, argument validation, or recurring reviewer preferences about avoiding unnecessary wrappers and making control flow self-explanatory.
---

# Vime Code Review Preferences

Apply these lightweight review heuristics when changing vime code.

## Prefer Direct APIs Over Thin Wrappers

- Remove helper layers that only rename a call, format one path, or forward arguments without owning meaningful behavior.
- Prefer calling the concrete reusable API directly, for example a `*_to_path` helper when the caller already knows the destination path.
- Keep a wrapper only if it owns a real boundary: compatibility, validation, nontrivial error policy, lifecycle management, metrics/logging semantics, async/retry behavior, or cross-module ownership.
- Avoid moving a redundant wrapper's body into another file just to preserve the wrapper shape. Inline the simple call at the natural ownership site.
- When removing a wrapper, search for sibling wrappers and nearby helpers with `rg` and delete confirmed dead functions in the same pass.
- Treat single-use convenience functions as suspicious when their only job is path formatting plus forwarding. Prefer the caller owning that one line.

## Make Branches Explain Themselves

- Order conditionals by semantic precedence: special transport/lifecycle modes first, then explicit mode choices, then default paths.
- Prefer predicates that fully describe the branch, such as `mode == "full" and transport == "disk"`, over a broad predicate followed by an assert that explains what the branch really meant.
- Use asserts as invariants for impossible states after validation, not as a substitute for clear branch conditions.

## Keep Abstractions Honest

- Add an abstraction only when it removes real duplication, hides fragile mechanics, or clarifies ownership.
- When a review comment points out repeated indirection, look for a smaller public surface rather than adding another alias.
- Preserve existing behavior intentionally. If cleanup changes error handling, logging, or failure visibility, call that out in the final response.
45 changes: 16 additions & 29 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ WORKDIR /root/
# vllm/vllm-openai base is an inference image — add cu12 dev headers + cmake/git
# so TE / apex / flash-attn source builds find cusparse.h etc.
RUN apt-get update && apt-get install -y \
nvtop rsync dnsutils git cmake \
nvtop rsync dnsutils prometheus git cmake \
cuda-nvrtc-dev-12-9 cuda-nvml-dev-12-9 cuda-profiler-api-12-9 cuda-nvtx-12-9 \
libcusparse-dev-12-9 libcusolver-dev-12-9 libcufft-dev-12-9 libcurand-dev-12-9 \
libcudnn9-dev-cuda-12 && \
Expand All @@ -42,6 +42,7 @@ RUN git clone https://github.com/Dao-AILab/flash-attention.git && \
RUN pip install git+https://github.com/ISEEKYAN/mbridge.git@89eb10887887bc74853f89a4de258c0702932a1c --no-deps

RUN pip install flash-linear-attention==0.4.1
# FlashQLA: optional GDN backend for Qwen3.5/Qwen3-Next (--qwen-gdn-backend flashqla; requires SM90+)
ARG INSTALL_FLASHQLA=0
RUN if [ "${INSTALL_FLASHQLA}" = "1" ]; then \
pip install git+https://github.com/QwenLM/FlashQLA.git --no-build-isolation; \
Expand All @@ -64,7 +65,8 @@ RUN git clone https://github.com/NVIDIA/Megatron-LM.git --recursive && \
cd Megatron-LM && git checkout ${MEGATRON_COMMIT}

# torch_memory_saver pinned to a193d9dd (upstream slime #1916).
RUN pip install git+https://github.com/fzyzcjy/torch_memory_saver.git@a193d9dd1b877d33c64a41cfb3db9f867df2d926 --no-cache-dir --force-reinstall
# TMS_CUDA_MAJOR is required by this pin's build backend for CUDA wheels; base is cu129 -> 12.
RUN TMS_CUDA_MAJOR=12 pip install git+https://github.com/fzyzcjy/torch_memory_saver.git@a193d9dd1b877d33c64a41cfb3db9f867df2d926 --no-cache-dir --force-reinstall
RUN pip install git+https://github.com/radixark/Megatron-Bridge.git@bridge --no-deps --no-build-isolation
RUN pip install nvidia-modelopt[torch]>=0.37.0 --no-build-isolation

Expand All @@ -75,21 +77,18 @@ RUN pip install --ignore-installed PyJWT && \
# https://github.com/pytorch/pytorch/issues/168167
RUN pip install nvidia-cudnn-cu12==9.16.0.29

# reinstall numpy 1.x for megatron
RUN pip install "numpy<2"
# reinstall numpy 1.x for megatron; pin scipy<1.18 alongside it. vime's vllm/vllm-openai
# base ships NO scipy, so unpinned it pulls scipy>=1.18, which hard-requires numpy>=2 and
# uses np.long (removed in numpy>=1.24) -> AttributeError against the numpy<2 above ->
# `import scipy/transformers` crash. slime's sglang base resolves scipy to 1.17.1 (numpy-1.x
# compatible) natively, so slime needs no scipy pin -- this is a vime base-image divergence.
# Real boundary is 1.18 (slime runs 1.17.1 fine), not the earlier 1.14 guess.
RUN pip install "numpy<2" "scipy<1.18"

RUN pip install IPython

# Pin vllm-router explicitly so the vllm rollout routing layer is a visible build step
# (also in requirements.txt; pulling it here makes the layer cache-able and fail-fast).
RUN pip install "vllm-router>=0.1.14"

RUN rm -rf /root/.cache/pip
RUN rm -rf /root/.cache/pip /root/flash-attention

# ====================================== Patches ============================================

# Patch megatron BEFORE pip install -e . so any patch hunks that touch setup.py
# or C++/CUDA extensions are picked up by the build.
COPY docker/patch/${PATCH_VERSION}/megatron.patch /root/Megatron-LM/
RUN cd Megatron-LM && \
git update-index --refresh && \
Expand Down Expand Up @@ -123,21 +122,9 @@ RUN git clone https://github.com/vllm-project/vime.git /root/vime && \
RUN cd /root/vime/vime/backends/megatron_utils/kernels/int4_qat && \
pip install . --no-build-isolation

# ====================================== Build-time smoke ============================================

# Fail-fast import smoke + flashinfer version pin check. Catches ABI / version
# regressions at build time instead of first GPU run.
RUN python3 -c "\
import vllm, vime, flashinfer; \
from vime.backends.vllm_utils.vllm_engine import VLLMEngine; \
print('vllm', vllm.__version__); \
print('flashinfer', flashinfer.__version__); \
print('VLLMEngine import ok')"

# Megatron stream serialization. vllm rollout + megatron actor co-located on
# the same GPU need this; default value causes stream-level contention.
ENV CUDA_DEVICE_MAX_CONNECTIONS=1

# Reset ENTRYPOINT inherited from vllm/vllm-openai base (`vllm serve`).
# Reset ENTRYPOINT inherited from the vllm/vllm-openai base (`vllm serve`), so the
# image is a plain bash/ray environment. Without this, `docker run ... bash -c ...`
# and `ray job submit` append to `vllm serve` and break. Base-image-coupled: slime's
# base has no such entrypoint, so slime's Dockerfile doesn't need this.
ENTRYPOINT []
CMD ["/bin/bash"]
32 changes: 32 additions & 0 deletions docker/patch/latest/vllm.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,35 @@
diff --git a/vllm/v1/engine/core.py b/vllm/v1/engine/core.py
--- a/vllm/v1/engine/core.py
+++ b/vllm/v1/engine/core.py
@@ -775,8 +775,10 @@
if tags is None or tags:
self.model_executor.wake_up(tags)

- # Resume scheduling (applies to all levels)
- self.resume_scheduler()
+ # Partial wakes intentionally keep the remaining allocations asleep.
+ # Resume scheduling only once all executor memory is resident again.
+ if not self.model_executor.is_sleeping:
+ self.resume_scheduler()

def is_sleeping(self) -> bool:
"""Check if engine is sleeping at any level."""
@@ -1894,9 +1896,12 @@
continue

# We are in a running state and so must execute a dummy pass
- # if the model didn't execute any ready requests.
- with self.log_iteration_details(None):
- self.execute_dummy_batch()
+ # if the model didn't execute any ready requests -- unless the executor is
+ # asleep (#44483: a decode-shaped dummy batch reads freed KV -> illegal memory
+ # access). The finished-sync all-reduce below still runs (DP lockstep).
+ if not self.is_sleeping():
+ with self.log_iteration_details(None):
+ self.execute_dummy_batch()

# 3) All-reduce operation to determine global unfinished reqs.
self.engines_running = self._has_global_unfinished_reqs(
diff --git a/vllm/model_executor/layers/fused_moe/all2all_utils.py b/vllm/model_executor/layers/fused_moe/all2all_utils.py
--- a/vllm/model_executor/layers/fused_moe/all2all_utils.py
+++ b/vllm/model_executor/layers/fused_moe/all2all_utils.py
Expand Down
2 changes: 1 addition & 1 deletion docker/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
nightly-dev-20260519a
nightly-dev-20260618a
Loading