Skip to main content

Overview

TrainerJobManager is a low-level compatibility API. New user code should not create trainer managers directly; use FiretitanServiceClient.from_firetitan_config(...) or cookbook recipes instead. This page remains for existing integrations, migration support, and advanced lifecycle debugging.
TrainerJobManager manages the lifecycle of service-mode trainer jobs — GPU-backed trainer endpoints that your Python loop connects to with a training client. TrainerJobManager extends FireworksClient, so all trainer-free operations (checkpoint promotion, training shape resolution) are also available here.

Constructor

Methods

create(config)

Create a service-mode trainer job and return immediately (without waiting). Returns a CreatedTrainerJob:

wait_for_ready(job_id, job_name=None, poll_interval_s=5.0, timeout_s=900)

Poll until a trainer job reaches RUNNING state and is healthy. Returns a TrainerServiceEndpoint:

create_and_wait(config, poll_interval_s=5.0, timeout_s=900)

Create a service-mode trainer and poll until the endpoint is healthy. Combines create() + wait_for_ready(). Returns a TrainerServiceEndpoint.

wait_for_existing(job_id, poll_interval_s=5.0, timeout_s=900)

Wait for an already-existing trainer job to reach RUNNING state:

resume_and_wait(job_id, poll_interval_s=5.0, timeout_s=900)

Resume a failed/cancelled/paused job and wait until healthy:

reconnect_and_wait(job_id, ...)

Handle pod preemption and transient failures. Waits for the job to reach a resumable state, resumes it, then polls until healthy:
More robust than resume_and_wait() — retries when the job is in a transitional state (e.g. the control plane is still processing a pod death).

get(job_id)

Inspect job status:

delete(job_id)

Delete a trainer job and release GPU resources:

promote_checkpoint(*, name, output_model_id, base_model)

Inherited from FireworksClient. Promote a sampler checkpoint to a deployable Fireworks model. The trainer job does not need to be running — the checkpoint resource name resolves the storage location.
See FireworksClient.promote_checkpoint for full parameter docs.

resolve_training_profile(shape_id)

Inherited from FireworksClient. Resolve a training shape ID into a full configuration profile.
See FireworksClient.resolve_training_profile for full parameter docs.

TrainerJobConfig

TrainerJobManager.create_and_wait(...) accepts a TrainerJobConfig dataclass: Launching through a training shape is the recommended path. In normal user code, you should not hand-author training_shape_ref; pass a training shape ID to resolve_training_profile(...) and use the returned versioned ref. Advanced manual launches can omit training_shape_ref and provide infra fields directly. When training_shape_ref is set (the recommended shape path), the training shape owns the trainer’s hardware and image configuration. The fields below are what you set as a user:
gradient_accumulation_steps is deprecated in TrainerJobConfig. Do not use it to request server-side accumulation. Accumulate gradients in client code by calling forward_backward... multiple times before one optim_step(...); see Loss Functions.
On the recommended shape path, accelerator_type, accelerator_count, node_count, and custom_image_tag are automatically configured by the training shape and cannot be overridden. Advanced manual launches can omit training_shape_ref and set those fields directly.

CreatedTrainerJob

Returned by create():

TrainerServiceEndpoint

Returned by create_and_wait, wait_for_ready, wait_for_existing, resume_and_wait, and reconnect_and_wait:

TrainingShapeProfile

See FireworksClient > TrainingShapeProfile for the full field reference.

Job states