maxent_grpo.training.generation.vllm_weight_sync

Weight synchronization helpers split out from the main vLLM helper.

Functions

_env_flag(name, default)

_env_int(name, default)

_import_vllm_client_cls([import_fn])

Return TRL's VLLMClient using the provided import helper.

_is_peft_model_safe(target)

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

_log_sync_info(template, *args)

_log_sync_warning(template, *args)

_loopback_host(base_url)

_mirror_log(message)

_optional_import(module_name)

Import a module using the shared optional import helper.

_resolve_vllm_group_port()

_temporary_env(overrides)

_vllm_client_nccl_overrides(base_url)

_zero3_gather_factory(accelerator)

Return a callable that gathers parameters when ZeRO-3 is active.

Classes

VLLMWeightSyncMixin()

Group weight sync helpers separately from retry/resilience logic.

_ClientCallable(func)

Lightweight callable wrapper to keep static analyzers satisfied.

class maxent_grpo.training.generation.vllm_weight_sync.VLLMWeightSyncMixin[source]

Bases: object

Group weight sync helpers separately from retry/resilience logic.

ctx: Any
maybe_sync_weights(ensure_client=None, sync_model=None)[source]

Synchronize weights to the vLLM server if configured.

Parameters:
  • ensure_client (Callable[[], bool] | None) – Optional callable that prepares the vLLM client.

  • sync_model (Callable[[Any], None] | None) – Optional callable invoked to push model weights.

Return type:

None

push_param_to_vllm(name, param)[source]

Public wrapper forwarding to the protected vLLM param push.

Parameters:
Return type:

None

reset_vllm_cache()[source]

Public wrapper that resets the vLLM prefix cache.

Return type:

None

sync_fsdp_params(module)[source]

Public wrapper to synchronize FSDP parameters to vLLM.

Parameters:

module (Any)

Return type:

None