Skip to content

feat(client): accept native routed expert arrays - #2408

Open
biswapanda wants to merge 9 commits into
PrimeIntellect-ai:mainfrom
biswapanda:feat/native-routed-experts-0820
Open

feat(client): accept native routed expert arrays#2408
biswapanda wants to merge 9 commits into
PrimeIntellect-ai:mainfrom
biswapanda:feat/native-routed-experts-0820

Conversation

@biswapanda

@biswapanda biswapanda commented Aug 20, 2026

Copy link
Copy Markdown

Summary

  • decode vLLM native Base64 .npy routed-expert responses
  • normalize them into the existing compact trajectory envelope
  • preserve legacy compact responses during migration
  • associate the request-local prompt offset without putting it in vLLM output tensors
  • promote cache_salt from sampling extras to the native Generate API field

Validation

  • uv run --frozen pytest tests/v1/test_train_client.py tests/v1/test_graph.py -q: 12 passed locally and 12 passed in the GPU pod
  • uv run --frozen pytest tests/v1/test_train_client.py -q: 7 passed after the cache-salt fix
  • uv run --frozen ruff check verifiers/v1/clients/train.py tests/v1/test_train_client.py
  • live three-step small Qwen3-MoE math-env training completed with router replay, nonzero gradients, policy version 1 consumption, and native routed generation before and after the update

The Dynamo/vLLM public field remains Python-vLLM-compatible Base64 .npy. The compact {data, shape, dtype, start} object exists only after this client-owned normalization boundary.

mikasenghaas and others added 8 commits August 18, 2026 18:08
Cancelling the EnvClient's awaiting task previously orphaned the
server-side rollout: ZMQ multiplexes every request over one socket,
so abandonment is invisible without an explicit message. On
CancelledError for a run, the client now fire-and-forgets a 'cancel'
carrying the run's request_id; the pool broker routes it to the
worker holding that run (answering unknown/finished targets inline),
and the worker cancels the rollout's asyncio task. An aborted run
still replies (error='Cancelled') so broker and client accounting
stay exact. Callers keep implicit semantics: cancelling the client
task is all it takes.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- Shield sandbox creation through the id capture: a cancel that aborts
  the create POST mid-flight left the platform building a sandbox this
  side never learned the id of, so teardown could not delete it and
  the sandbox leaked to the reconciler. Youngest-first overload sheds
  cancel exactly the episodes still provisioning, making this common.
- Hold strong references to fire-and-forget cancel tasks: the loop
  only keeps weak refs, so an unreferenced task could be garbage
  collected before the cancel was ever sent.
close() could tear down the ZMQ socket before a scheduled
fire-and-forget cancel ran, leaving the server-side rollout running.
Also apply repo formatting to the touched files.
- Register run tasks in the dispatch loop, not the handler: a cancel
  scheduled ahead of the run's handler task found no entry and the
  rollout kept running. ZMQ preserves per-client frame order, so the
  run frame always lands first and dispatch-time registration is race
  free.
- Tolerate unparseable cancel payloads in the pool broker: the unpack
  ran on the broker loop with no error handling, so one bad frame tore
  down every in-flight rollout behind it.
- Drain cancel tasks after the receiver stops and loop until empty: a
  run cancelled in the same shutdown wave could schedule its cancel
  after a single early drain and lose it to the socket close.
# Conflicts:
#	verifiers/v1/runtimes/prime.py
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