页面简介
Integrate an external RL trainer with Fireworks inference: hot-load new checkpoints from your bucket and run rollouts via the OpenAI-compatible API.
正文摘录
Early Access Feature. External-bucket hot-load for RL rollouts is a private preview. Contact Fireworks to enable this path on your account before you use S3, MINIO, NEBIUS, or similar non-FW_HOSTED storage. Using a code agent? Follow sections in order: Prerequisites → Quickstart checklist → Hot-load API. Required env: FIREWORKS_API_KEY. After your first full snapshot is serving, read Incremental snapshots (skill) before production training loops. For active stream, session ID, and reset_prompt_cache semantics, see KV cache behavior for RL rollouts. For ledger and hot-load status debugging, see Ledger & debugging (skill). This guide is for teams already running their own RL trainer (Megatron, TorchTitan, Slime, Verl, etc) who want Fireworks purely for inference during rollouts. It also covers the raw hot-load API, which Training API users can call directly when they need rollout behaviors beyond what WeightSyncer and DeploymentManager expose. Fireworks offers two paths for reinforcement learning, which trade convenience for control: BYOT rollouts — the most hands-on, for teams already running their own trainer who want Fireworks purely for high-scale rollout inference. Training API — the middle ground, for teams who want to own their training logic without managing infrastructure. Where this guide fits PathYou ownFireworks ownsUse this guide?This guide (BYOT rollouts)Trainer, rewards, environment, checkpoint upload cadenceHot-load deployment, distributed weight swap, inference, KV cache across rolloutsYesTraining APITraining logic (recipes or SDK)GPUs, trainer lifecycle, often FW_HOSTED bucketOnly if you need rollout behavior beyond what the SDK exposesCookbook RLDataset rows and a rollout functionScheduling, training, weight publicationNo Why BYOT rollout inference? Disaggregated: Your trainer and rollout cluster can run in different regions or clouds; deployments can span multiple regions to pool capacity. Full-parameter or LoRA: Hot-load full-parameter checkpoints for large models, or hot-load a LoRA adapter on top of a frozen base model—both run on Fireworks inference shapes. See LoRA rollouts. Fast checkpoint transfer: Lossless compressed incremental snapshots (arc_v2, typically 20×+ compression) over standard object storage—no special RDMA networking between trainer and inference. Async / off-policy friendly: Background download during rollouts; configurable swap semantics similar in spirit to PipelineRL—see checkpoint-swap behavior. For Online RL (live user traffic as rollouts with rolling per-replica updates), the same hot-load infrastructure applies; contact Fireworks for production Online RL setup. Supported models BYOT rollout hot-load is enabled for a curated set of base models from our full model library. The following are supported today: ModelBase model IDKimi K2.5kimi-k2p5Kimi K2.6kimi-k2p6Kimi K2.7kimi-k2p7-codeGLM 5.2glm-5p2Qwen3 30B-A3Bqwen3-30b-a3b-instruct-2507 Both full-parameter checkpoints and LoRA adapters can be hot-loaded for these models. Currently, reach out to the Fireworks RL team to get set up. We will help provision the deployment shape (GPU, precision, quantization) for your base model and confirm the snapshot format it expects. Placeholders Reuse these values in every command below: PlaceholderExample<account_id>my-team<model_id>qwen3-30b-a3b<deployment_id>rl-rollout-prod<fireworks_api_key>From API keys<your_bucket> / <your_upload_path>Parent prefix configured on the deployment (no trailing slash)<checkpoint_id>Snapshot directory name, e.g. version_001 (no slashes) Prerequisites Complete this checklist before creating a deployment: Fireworks account and API key — create a key and set export FIREWORKS_API_KEY="<key>". Account ID — In the dashboard, open your account settings or any resource URL; the account slug is the segment after /accounts/ (for example accounts/<account_id>/...). Feature enablement — Request external-bucket hot-load for RL rollouts on account <account_id>, including your bucket provider (S3, GCS/gs://, or NEBIUS). Object storage read access for Fireworks — Fireworks needs read-only access to the bucket prefix you will pass as --hot-load-bucket-url. At enablement, Fireworks shares the IAM principal to grant access. Typical setup: Amazon S3: Grant the Fireworks principal s3:GetObject (and s3:ListBucket on the prefix) on s3://<your_bucket>/<your_upload_path>/*. Google Cloud Storage: Grant roles/storage.objectViewer on the bucket or prefix to the Fireworks service account provided at onboarding. Nebius / MinIO: Equivalent read-only credentials or access key scoped to the upload prefix. firectl installed — See firectl. Base model and deployment shape — An RL-capable shape for your model (GPU count, precision). If you omit --deployment-shape, firectl prompts you to pick one interactively. Architecture You own: trainer, reward shaping, checkpoint cadence, rollout orchestration. Fireworks owns: hot-load logistics, distributed weight swap, inference serving, KV cache across rollouts. End-to-end loop Create a hot-load deployment. Upload and hot-load an initial full snapshot. Run rollouts against that snapshot. For each training step: upload and hot-load the next incremental snapshot (see Incremental snapshots). Run rollouts again. Every 20th or 30th step, publish a full snapshot instead of an incremental one. If the incremental chain fails, fall back to a full snapshot. Quickstart checklist Use this table for your first rollout end-to-end: StepActionDone when1Create hot-load deploymentfirectl deployment get <deployment_id> shows a healthy deployment2Upload full HF snapshotAll files exist under .../<checkpoint_id>/ in object storage3POST signal snapshotHTTP 2004GET poll statusEvery replica has readiness: true and current_snapshot_identity matches your identity5Run rolloutsChat/completions returns tokens 1. Create a hot-load deployment Create the deployment that will serve rollouts. During preview, --enable-hot-load flags may be hidden from CLI help but can still be passed explicitly. firectl create deployment accounts/<account_id>/models/<model_id> \ --deployment-shape <shape_name> \ --deployment-id <deployment_id> \ --enable-hot-load \ --hot-load-bucket-type S3 \ --hot-load-bucket-url s3://<your_bucket>/<your_upload_path> \ --hot-load-transition-type ASYNC \ --region US_OHIO_1 Flags --deployment-shape — Optional. If omitted, firectl prompts you to pick one. --hot-load-bucket-type — MINIO, S3, NEBIUS, or FW_HOSTED. This guide focuses on external buckets (S3, gs://, etc.). FW_HOSTED is for Fireworks-managed trainers. --hot-load-bucket-url — Required when --enable-hot-load is set. Examples: s3://mybucket/path, gs://mybucket/path. No trailing slash. This is the parent prefix; each snapshot is a subdirectory named by identity (see snapshot layout). --hot-load-transition-type — ASYNC (recommended for RL) or SYNC. Defaults to ASYNC when hot load is enabled. See checkpoint-swap behavior. --region — Where the deployment runs (for example US_OHIO_1, US_VIRGINIA_1). Keep the trainer upload path geographically close to the bucket and deployment. Save the account ID, deployment ID, and model ID from the output for hot-load and rollout calls. If you do not set a shape, the CLI shows a shape picker: 2. Upload and hot-load an initial full snapshot Upload a full HuggingFace-format checkpoint, then signal Fireworks to load it. Snapshot layout Place each snapshot under its own subdirectory. The identity you signal in the API must match the directory name (a single path segment—no slashes): s3://<your_bucket>/<your_upload_path>/<checkpoint_id>/ ├── config.json # HF model config (must match the base model) ├── tokenizer.json # tokenizer files (same as the base model) ├── tokenizer_config.json ├── model.safetensors.index.json # weight name → shard file map ├── model.weight.spec.json # weight name → {shape, dtype} for every tensor ├── model-00000.safetensors # weights, one layer per file ├── model-00001.safetensors └── ... Example with the recommended path pattern: s3://<your_bucket>/<account_id>/<account_id>-<deployment_id>/version_001/ identity / <checkpoint_id> — Any opaque string (for example version_001 or step_00100). Format — Same layout as the base model on HuggingFace, plus the two manifest files described below. No tensor-parallel sharding in uploaded files. File size — Split weights into multiple .safetensors files, each under about 5 GB. One layer per file is required (a single shard must not mix weights from more than one layer) and also minimizes load time. Required files (full snapshot) A full (non-LoRA) snapshot is validated at POST time; it must contain all of: FilePurposeValidationconfig.jsonHuggingFace model config.Must be loadable as an AutoConfig and equivalent to the base model’s config (hidden_size, num_hidden_layers, rope_parameters, etc.). A quantization_config key is allowed for quantized snapshots.model.safetensors.index.jsonMaps each tensor name to the shard file that stores it (weight_map).Must be a JSON object with a weight_map; every shard file may contain weights from only one layer.model.weight.spec.jsonDescribes each tensor’s shape and dtype (tensor_map).Must be a JSON object with a tensor_map that covers every weight named in weight_map.model-*.safetensorsThe weights themselves.Tensor coverage must match the index/spec; tensors must cover the base model.tokenizer filestokenizer.json, tokenizer_config.json, etc.Carried over from the base model. model.safetensors.index.json (HuggingFace-standard) maps tensors to shards: { "weight_map": { "model.layers.0.self_attn.q_proj.weight": "model-00001.safetensors", "model.layers.0.self_attn.k_proj.weight": "model-00001.safetensors" } } model.weight.spec.json gives each tensor’s metadata (used to validate transitions and dequantization): { "tensor_map": { "model.layers.0.self_attn.q_proj.weight": { "shape": [2048, 2048], "dtype": "float16" } } } Incremental snapshots and ARC2 An incremental snapshot is an ARC2-compre