Skip to content

feat: add Fireworks Serverless Training backend - #11

Open
xiaoyifan wants to merge 4 commits into
evolvent-ai:mainfrom
xiaoyifan:codex/fireworks-serverless-training
Open

xiaoyifan wants to merge 4 commits into
evolvent-ai:mainfrom
xiaoyifan:codex/fireworks-serverless-training

Conversation

@xiaoyifan

@xiaoyifan xiaoyifan commented Aug 21, 2026 •

Copy link
Copy Markdown

Summary

  • add TRAINING_BACKEND=fireworks as a Tinker-compatible LoRA training backend
  • keep the existing RSIBench algorithm unchanged: offline LoRA SFT followed by sampler-checkpoint evaluation
  • separate the Hugging Face target/tokenizer name from the Fireworks accounts/.../models/... training resource
  • persist only the Fireworks metadata needed for checkpoint evaluation: training session ID, sampler checkpoint, tokenizer, provider model, and endpoint
  • reconnect the E2B OpenAI-compatible proxy to the Fireworks session for Harbor attempt and official evaluation sampling
  • keep existing Tinker artifact names and budget-state schema unchanged while using provider-neutral artifacts for Fireworks runs
  • validate credentials, account-specific rates, and the Fireworks model-resource format before paid training or evaluation work can start
  • normalize Fireworks checkpoint names to the service DNS-label contract
  • pin compatible Fireworks/Tinker versions in the reusable E2B proxy template

Scope

This PR keeps Fireworks behavior parallel to the existing Tinker integration:
LoRA SFT, sampler checkpoint creation, checkpoint evaluation, and provider
budget accounting. It does not add optimizer-state persistence, an online RL
algorithm, or a new training orchestration layer.

Flow

flowchart LR
  A[Data agent] --> B[train_messages.jsonl]
  B --> C{Training backend}
  C -->|Tinker| D[Tinker LoRA SFT]
  C -->|Fireworks| E[Serverless LoRA SFT]
  D --> F[Sampler checkpoint]
  E --> F
  E --> G[Session ID and tokenizer]
  F --> H[E2B checkpoint proxy]
  G --> H
  H --> I[Harbor evaluation]
  I --> J[Score and provider cost state]
Loading

Review cleanup

  • removed the Fireworks-only save_state call and resumable-checkpoint metadata because no RSIBench runner consumes them and Tinker has no parallel behavior
  • restored the existing Tinker metadata, sampling-cost artifact, preflight artifact, and budget-state field names for new Tinker runs
  • added fail-fast validation that rejects a Hugging Face ID in Fireworks TRAINING_MODEL before constructing the remote service client
  • moved Fireworks sampling-rate validation ahead of E2B sandbox creation and provider sampling

Validation

  • python3 -m unittest discover -s tests -v — 75 tests passed
  • Python compile checks for all changed runtime modules
  • bash -n for runner, pipeline, official-eval, environment, setup, and Docker wrapper scripts
  • credentialed Fireworks multi-step SFT:
    • accounts/fireworks/models/qwen3p5-9b, LoRA rank 8
    • 5 optimizer steps, 2 gradient accumulations per step, batch size 2
    • 20 real forward/backward calls and 1,180 processed training tokens
    • reported loss sum decreased every step from 162.01 to 149.37
    • sampler checkpoint saved with a 24-hour TTL
  • credentialed checkpoint sampling through the Fireworks E2B proxy and Harbor:
    • one SWE-bench Verified task with step_limit=5
    • 5 model/tool turns completed against the saved sampler checkpoint
    • 14,216 prompt tokens and 607 completion tokens
    • zero Harbor infrastructure errors, zero retries, and automatic E2B sandbox cleanup

The credentialed runs exposed and verified fixes for provider model naming,
explicit tokenizer loading, checkpoint DNS-label length, dependency
compatibility, and pricing fail-fast behavior.

@xiaoyifan
xiaoyifan force-pushed the codex/fireworks-serverless-training branch from 5f657e1 to b2bb3d2 Compare August 21, 2026 08:01
@xiaoyifan
xiaoyifan force-pushed the codex/fireworks-serverless-training branch from 231e243 to 472c318 Compare August 21, 2026 08:11
@xiaoyifan
xiaoyifan marked this pull request as ready for review August 21, 2026 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant