Skip to content

wire Fireworks distillation smoke test path - #5

Draft
yi-fireworks wants to merge 8 commits into
1stprinciple:firetitan-serverfrom
yi-fireworks:yi/fireworks-distillation-smoke-test
Draft

wire Fireworks distillation smoke test path#5
yi-fireworks wants to merge 8 commits into
1stprinciple:firetitan-serverfrom
yi-fireworks:yi/fireworks-distillation-smoke-test

Conversation

@yi-fireworks

Copy link
Copy Markdown

Summary

  • wire on-policy distillation through a new Fireworks-specific runtime so a CPU-only orchestrator can create the trainer client, attach or create the rollout deployment, hotload weights, and run the recipe against remote Fireworks infrastructure
  • adapt the distillation path to the public Fireworks training SDK surface, including tokenizer resolution for Fireworks model ids and the currently available WeightSyncer API
  • leave focused instrumentation in the first-batch path so the remaining stall is pinned to the trainer forward_backward_async(...) call

Current blocker / help wanted

The smoke test now gets through rollout sampling, minibatch assembly, teacher KL, and deployment hotload, but the actual training RPC still hangs.

What we observed:

  • rollout sampling succeeds
  • minibatch assembly succeeds
  • teacher KL succeeds
  • initial hotload and warmup succeed
  • the run hangs on await training_client.forward_backward_async(...)

What we ruled out:

  • same hang with the original pipelined train step and with a serial Fireworks-specific train step
  • same hang with loss_fn=cross_entropy and kl_penalty_coef=0
  • teacher KL is not the blocker

While the run is stuck, the trainer job still reports:

  • JOB_STATE_RUNNING
  • status OK
  • progress counters remain zero

If anyone familiar with this trainer path can help, the main question is whether this endpoint / SDK path is expected to support forward_backward_async in this configuration, or whether there is a known issue with this shape / model / lora_rank=0 setup.

Repro command

Full distillation-path repro:

source /home/yi/venv/bin/activate && export PYTHONUNBUFFERED=1 && export FIREWORKS_ACCOUNT_ID=pyroworks && python -m tinker_cookbook.recipes.distillation.on_policy_distillation \
  base_url="https://trainer-pyroworks-rlor-kltlnlct82fw9z1d.us-ohio-1.direct.fireworks.ai:30443/" \
  fireworks_base_model_name="accounts/fireworks/models/qwen3-4b-instruct-2507" \
  model_name="accounts/fireworks/models/qwen3-4b-instruct-2507" \
  teacher_model="accounts/fireworks/models/qwen3-4b-instruct-2507" \
  renderer_name=qwen3_instruct \
  lora_rank=0 \
  dataset=deepmath \
  max_steps=1 \
  groups_per_batch=1 \
  group_size=1 \
  max_tokens=64 \
  eval_every=0 \
  save_every=1

Control repro that still hangs even without distillation loss / KL:

source /home/yi/venv/bin/activate && export PYTHONUNBUFFERED=1 && export FIREWORKS_ACCOUNT_ID=pyroworks && python -m tinker_cookbook.recipes.distillation.on_policy_distillation \
  base_url="https://trainer-pyroworks-rlor-kltlnlct82fw9z1d.us-ohio-1.direct.fireworks.ai:30443/" \
  fireworks_base_model_name="accounts/fireworks/models/qwen3-4b-instruct-2507" \
  model_name="accounts/fireworks/models/qwen3-4b-instruct-2507" \
  teacher_model="accounts/fireworks/models/qwen3-4b-instruct-2507" \
  renderer_name=qwen3_instruct \
  lora_rank=0 \
  dataset=deepmath \
  max_steps=1 \
  groups_per_batch=1 \
  group_size=1 \
  max_tokens=64 \
  eval_every=0 \
  save_every=1 \
  loss_fn=cross_entropy \
  kl_penalty_coef=0

Test plan

  • verify imports and py_compile on touched files
  • create trainer / deployment and run real smoke-test attempts against remote Fireworks infra
  • get a successful 1-step forward_backward_async through the remote trainer

Made with Cursor

1stprinciple and others added 8 commits March 31, 2026 00:21
http_timeout=120.0

cursor add retry

hack sampler_path

checkpoint_type="base"

comment out kl_sample_train_metrics

max_concurrency = 8

default 4

cursor added max_concurrency

print

sampling_client = DeploymentSampler( for async

0

['choices']

contents

logprobs=True,

print("sample_result:", sample_result)

remove max_seq_len

max_tokens=19200

field

add back dataclass

FireworksTokenCompleter in metric_util

fix tokenizer

http://localhost:8902

remove dataclass for FireworksTokenCompleter

state_name, sampler_name

FireworksTokenCompleter

eval_semaphore

replace firetitan in rl path

squash

dash

comment compute_mean_nll

print fwd_bwd_result

print(f"fwd_bwd_result.loss_fn_outputs

print(f"len(logprobs) = {len(logprobs)}")

base_url: str = "http://localhost:8099"

import FiretitanTrainingClient

no await on service_client.create_training_client

lora_rank=config.lora_rank

fix FiretitanTrainingClient import

Replace for SFT

Revert "train_unembed=False"

This reverts commit 89c976d.

Revert "rank"

This reverts commit e14eeb4.

Revert "use tinker client temporarily"

This reverts commit 0106c20.

Revert "create_lora_training_client"

This reverts commit e905aa6.

rank

create_lora_training_client

use tinker client temporarily

train_unembed=False

Revert "attach grads as well"

This reverts commit 5ab4387.

attach grads as well

remove last_call_logprobs

base_url = None

write weights as well.

Claude hack

Add custom loss

add log

resume_info

open-research

train_on_what = TrainOnWhat.LAST_ASSISTANT_MESSAGE

unmatch )

Support Qwen3-30B-A3B-Thinking-2507

revert some changes.

delta checkpoint

max_concurrency: int = 2

max_concurrency: int = 4 for 1 GPU

use FireworksTokenCompleter in rollouts.py

path_dict

fireworks_base_model_name

save initially

Revert "try cursor fix (i don't think it's correct)"

This reverts commit b772b9f.

try cursor fix (i don't think it's correct)

sync

Add fireworks_deployment_id

remove api_key in deploymentsampler

fireworks_hot_load_timeout

ordering weight_syncer

add weight_syncer

now setup runs

print with hydra style

remove reference of self.

copy over

ppo

sample_result, _

async_completions_stream

use built-in grpo

use ppo_loss_fn instead

ALL_ASSISTANT_MESSAGES for open researcher

policy_ep

Add custom RL loss

works

use lora

fireworks_deployment_id in CLIConfig

cfg

revert
Refactor on-policy distillation to build Fireworks-specific runtime state and adapt the recipe to the public training SDK so a CPU-only orchestrator can drive remote rollout and training far enough to isolate the remaining forward_backward stall.

Made-with: Cursor
@1stprinciple
1stprinciple force-pushed the firetitan-server branch 2 times, most recently from 48fa4ec to debad83 Compare April 7, 2026 02:12
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.

2 participants