maxent_grpo.training.runtime.deps

Dependency loading utilities used by the training runtime.

Functions

_allow_stubbed_deps()

Return True when lightweight dependency stubs are allowed.

_install_accelerate_stub(_hint)

Install a lightweight accelerate stub for tests.

_install_torch_stub(hint)

Install a lightweight torch stub so imports can succeed in tests.

_maybe_create_deepspeed_plugin()

Construct a DeepSpeedPlugin from Accelerate env/config when available.

get_trl_prepare_deepspeed()

Return TRL's prepare_deepspeed helper when available.

maybe_create_deepspeed_plugin()

Public wrapper for DeepSpeed plugin creation.

require_accelerator(context)

Return accelerate.Accelerator or raise a helpful RuntimeError.

require_dataloader(context)

Return torch.utils.data.DataLoader with a descriptive error on failure.

require_deepspeed(context[, module])

Return a DeepSpeed module import or raise a contextual RuntimeError.

require_torch(context)

Return the torch module or raise a helpful RuntimeError.

require_transformer_base_classes(context)

Return (PreTrainedModel, PreTrainedTokenizer) with clear failure messages.

maxent_grpo.training.runtime.deps.maybe_create_deepspeed_plugin()[source]

Public wrapper for DeepSpeed plugin creation.

Return type:

Any | None

maxent_grpo.training.runtime.deps.get_trl_prepare_deepspeed()[source]

Return TRL’s prepare_deepspeed helper when available.

Return type:

Any | None

maxent_grpo.training.runtime.deps.require_accelerator(context)[source]

Return accelerate.Accelerator or raise a helpful RuntimeError.

Parameters:

context (str)

Return type:

Any

maxent_grpo.training.runtime.deps.require_dataloader(context)[source]

Return torch.utils.data.DataLoader with a descriptive error on failure.

Parameters:

context (str)

Return type:

Any

maxent_grpo.training.runtime.deps.require_deepspeed(context, module='deepspeed')[source]

Return a DeepSpeed module import or raise a contextual RuntimeError.

Parameters:
Return type:

ModuleType

maxent_grpo.training.runtime.deps.require_torch(context)[source]

Return the torch module or raise a helpful RuntimeError.

Parameters:

context (str)

Return type:

ModuleType

maxent_grpo.training.runtime.deps.require_transformer_base_classes(context)[source]

Return (PreTrainedModel, PreTrainedTokenizer) with clear failure messages.

Parameters:

context (str)

Return type:

Tuple[Any, Any]