maxent_grpo.training.rollout.vllm_adapter

vLLM-focused helpers split away from the local generation path.

Functions

_broadcast_object_list(accelerator, payload, *)

Broadcast python objects even when Accelerate lacks the helper.

_env_flag(name[, default])

_env_int(name)

_gather_object_list(accelerator, value)

Gather Python lists across ranks with graceful Accelerate fallbacks.

_import_vllm_client_cls([import_fn])

Return TRL's VLLMClient using the provided import fn (defaults to optional_import).

_is_peft_model_safe(target)

Return True if accelerate.utils reports that the model uses PEFT adapters.

_loopback_host(base_url)

_optional_import(module_name)

Import a module if available without triggering import errors.

_progress_log_enabled()

_resolve_vllm_group_port()

_scatter_object(accelerator, input_list, *)

Scatter python objects from src to all ranks.

_temporary_env(overrides)

_use_vllm_collective()

_vllm_client_nccl_overrides(base_url)

_zero3_gather_factory(accelerator)

broadcast_object_list(accelerator, payload, *)

Public alias for broadcasting Python objects across ranks.

gather_object_list(accelerator, value)

Public alias for gathering Python objects across ranks.

scatter_object(accelerator, input_list, *[, src])

Public alias for scattering Python objects across ranks.

Classes

VLLMGenerationMixin(ctx)

All vLLM-specific plumbing extracted from the main generator.

class maxent_grpo.training.rollout.vllm_adapter.VLLMGenerationMixin(ctx)[source]

Bases: object

All vLLM-specific plumbing extracted from the main generator.

Parameters:

ctx (GenerationContext)

ctx: GenerationContext
generate(prompts, num_samples, per_prompt_counts=None)[source]

Produce completions, preferring vLLM when configured.

Parameters:
Return type:

Tuple[List[List[str]], List[List[VLLMLogprobResult | None]] | None]

maxent_grpo.training.rollout.vllm_adapter.broadcast_object_list(accelerator, payload, *, src=0)[source]

Public alias for broadcasting Python objects across ranks.

Parameters:
Return type:

None

maxent_grpo.training.rollout.vllm_adapter.gather_object_list(accelerator, value)[source]

Public alias for gathering Python objects across ranks.

Parameters:
Return type:

List[List[Any]]

maxent_grpo.training.rollout.vllm_adapter.scatter_object(accelerator, input_list, *, src=0)[source]

Public alias for scattering Python objects across ranks.

Parameters:
Return type:

Any