Repository navigation
Add concurrent generation and cancellation on the vLLM backends, and a per-request provider mode - #40
Merged
emiehling merged 1 commit intoOct 27, 2026
Conversation
…uest provider mode The offline vLLM backend runs an AsyncLLM engine on an event loop it owns on a daemon thread, and its session submits one engine request per item. Concurrent generate() calls therefore share one running batch, and each request returns when its own generation finishes. The engine is built under the LLM_CLASS usage context, which keeps the offline scheduler defaults. SteeringPipeline gains supports_concurrent_generate and a prompt lock: each call's prompt phase runs under the lock, and the dispatch runs concurrently only when the backend lacks IN_PROCESS_TORCH and no decoding driver is enabled. The reserved cancel_token keyword cancels a call from another thread (the offline engine aborts the request; the in-process and serve sessions stop between items). ProviderOptions.max_concurrency selects per-request mode in the Inspect provider: each request is its own pipeline call, seeded from the base seed and the request, and a cancelled request aborts its generation. The dispatch mode is recorded in run provenance. The version is 0.5.7. Signed-off-by: Erik Miehling <emiehling@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
VLLMBackendruns a vLLMAsyncLLMengine on an event loop that the backend owns on a daemon thread, and its session submits one engine request per itemgenerate()calls share the engine's running batch, and each request returns when its own generation finishesLLM_CLASSusage context, which keeps the scheduler defaults of an offlinevllm.LLMengineengine_kwargsis forwarded toAsyncEngineArgs. Per-request lifecycle logging defaults off, and the periodic stats logging keeps vLLM's default (on)SteeringPipelinehas a newsupports_concurrent_generateproperty and a prompt lock. Each call's prompt phase runs under the lock, and the dispatch runs concurrently only on the vLLM backends without an enabled decoding driversteer(),release_backends(), andcompute_logprobs()run under the prompt lock for their whole durationCancelTokenandGenerationCancelledcancel a generation from another thread through the reservedcancel_tokenkeyword. The offline engine aborts the call's requests, and the in-process and serve sessions stop between itemsSteeringSession.generateandSteeringSession.scoretake a keyword-onlycancel_token, andSteeredSessionforwards it to a driver's rolloutsVLLMBackend.release()cancels the requests in flight before it shuts the engine down, and their calls raiseEngineClosedErrorProviderOptions.max_concurrencyselects per-request mode in the Inspect provider. Each request is its own pipeline call seeded from the base seed and the request, and a cancelled request aborts its generationSteeringEvalrecords the dispatch mode asdispatch_modein the run provenanceAGENTS.md, the steering pipelines concept page, and the evaluation tutorial describe concurrent generation, cancellation, and per-request mode