Skip to content

Feat: Support verl release/v0.8.0 and harden NPU vLLM workflows - #41

Merged
crp0128 merged 32 commits into
verl-project:mainfrom
crp0128:main
Jul 24, 2026
Merged

Feat: Support verl release/v0.8.0 and harden NPU vLLM workflows#41
crp0128 merged 32 commits into
verl-project:mainfrom
crp0128:main

Conversation

@crp0128

@crp0128 crp0128 commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR updates SpeCo to track verl release/v0.8.0 and improves runtime stability for vLLM-based NPU workflows, including both drafter-enabled and no-drafter execution.

Key Changes

  • Replace the exact verl commit pin with a release/v0.8.0 version and API compatibility contract.
  • Adapt TaskRunner, AgentLoop, FSDP worker, rollout server, and configuration integration to the release/v0.8.0 APIs.
  • Install NPU vLLM compatibility before verl and vLLM imports in TaskRunner, WorkerDict, rollout server, and drafter worker processes.
  • Handle the newer vLLM FusedMoE factory and Transformers configuration import behavior.
  • Stabilize NPU weight synchronization by:
    • avoiding redundant FSDP2 parameter staging;
    • reusing shared-memory weight-transfer mappings;
    • using reusable NPU staging allocations where applicable;
    • releasing temporary FSDP outputs and transfer references.
  • Preserve rollout initialization and weight publication for both drafter-enabled and no-drafter configurations.
  • Add complete drafter checkpoint resume support for optimizer state, LR scheduler state, optimizer step counters, and validated metadata.
  • Ensure exported drafter checkpoints retain runtime-readable model configuration and parameter names.
  • Add editable package installation through pip install -e . without requiring the SpeCo repository in PYTHONPATH.
  • Update Dockerfiles, CI contracts, compatibility tests, and example scripts for the release/v0.8.0 layout.
  • Apply bounded Ray worker prestart settings to all examples.
  • Add conservative jemalloc and Ray defaults to NPU examples to reduce retained host memory.

Compatibility

The changes cover:

  • EAGLE3, DFlash, and DSpark drafter training paths.
  • vLLM rollout with and without drafter training.
  • GPU and NPU configuration paths.
  • FSDP/FSDP2 training and checkpoint resume.
  • DSpark on NPU with the vLLM and vLLM-Ascend revisions documented in the README.

The latest upstream changes must be retained when rebasing, especially the drafter gradient reduction fix from #29 and the P-EAGLE backend from #18.

@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@crp0128
crp0128 merged commit 17d86cc into verl-project:main Jul 24, 2026
0 of 4 checks passed
tpx818 pushed a commit that referenced this pull request Aug 6, 2026
…43)

* perf(profiler): add opt-in bubble-time metrics for online draft training

SPECO inserts an extra draft-training stage into each RL step on top of the
base rollout -> old_log_prob -> update_actor pipeline. That stage runs serially
after update_actor, so part of every step is spent doing training work that
could in principle overlap the generation window. Today nothing measures how
big that opportunity is, which makes bubble-time optimization hard to justify or
track.

Add a pure, config-gated profiler that turns the per-stage timing_s/* metrics
the trainer already emits into a small set of derived bubble/* metrics:

- bubble/unaccounted_s|ratio: wall-clock not attributed to any instrumented
  stage (pipeline gaps, sync, host overhead).
- bubble/drafter_s|ratio: the serial draft-training add-on relative to the step.
- bubble/overlap_headroom_s|ratio: min(gen, drafter), an upper bound on the
  wall-clock recoverable by overlapping draft training into generation.

The logic lives in a standalone stdlib-only module (bubble_profiler.py) and is
injected at the existing Tracking.log choke point, reusing the metrics dict
after drafter timing has been split out of update_actor. It is off by default
(actor_rollout_ref.rollout.drafter.profile_bubble) and adds no work to a step
when disabled; sub-stage timings are excluded so nothing is double counted, and
timer skew is clamped so ratios stay in [0, 1].

The tracking hook's duplicated per-branch data rewrite is factored into a single
_speco_augment_log_data helper.

Signed-off-by: khazic <khazzz1c@gmail.com>

* fix(ci): repair three CPU test failures shipped by #41

CPU unit tests have been red on main since #41. Three self-contained
failures, one fix each; no behavior change beyond the corrected default.

1. tests/compat/test_verl_release_api.py resolved required modules from
   <root>/verl while the REQUIRED_MODULES keys already begin with the verl
   package segment, so every path doubled to <root>/verl/verl/... and the
   test reported the entire release/v0.8.0 API as missing. Resolve from the
   checkout root instead. Verified green against a real release/v0.8.0
   checkout.

2. verl_speco/config/speco_base.yaml set the default drafter
   lr_scheduler_type to "constant", which is incoherent with the
   lr_decay_steps / min_lr_ratio cosine knobs sitting next to it and with
   the config-overlay test that asserts "global_cosine". #41 introduced both
   the value and the assertion in the same commit; restore the intended
   "global_cosine" default.

3. tests/integration/test_vllm_runtime_contract.py asserted an exact source
   substring for the NPU quant guard that #41's refactor split into an
   assignment plus an "is not None" check (to surface the quant type in the
   reason). Match the current, behavior-equivalent source.

Signed-off-by: khazic <khazzz1c@gmail.com>

* chore(license): use the repo-standard Apache header on the new profiler files

check-license only accepts the header strings listed in tests/special_sanity/check_license.py. The new test file had no header at all, and bubble_profiler.py used a 'SPECO Authors' copyright line that is not on that list, so the hook would have failed again on the next run once it got past the test file.

Signed-off-by: khazic <khazzz1c@gmail.com>

---------

Signed-off-by: khazic <khazzz1c@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants