Skip to content

ttt: add EPLB and Frontier-CS self-distillation examples#68

Open
Yuchen-95 wants to merge 5 commits intoHuman-Agent-Society:feat/self_distillfrom
Yuchen-95:feat/self_distill
Open

ttt: add EPLB and Frontier-CS self-distillation examples#68
Yuchen-95 wants to merge 5 commits intoHuman-Agent-Society:feat/self_distillfrom
Yuchen-95:feat/self_distill

Conversation

@Yuchen-95
Copy link
Copy Markdown

Add two new TTT example tasks for self-distillation training, plus a generator script to scale Frontier-CS to all 43 CPU-only problems.

New examples:

  • ttt/examples/eplb/: Expert Parallelism Load Balancer (MoE optimization)
  • ttt/examples/frontier_cs/: Frontier-CS cant_be_late scheduling
  • ttt/examples/frontier_cs_tasks/: 43 generated CPU-only Frontier-CS problems

Setup (EPLB):
pip install -e . && pip install -e ttt/slime wget https://huggingface.co/datasets/abmfy/eplb-openevolve/resolve/main/expert-load.json cp expert-load.json ttt/examples/eplb/eval/expert-load.json CORAL_TASK_YAML=ttt/examples/eplb/task.yaml ./ttt/run_coral_distill.sh

Setup (Frontier-CS):
pip install -e . && pip install -e ttt/slime pip install git+https://github.com/FrontierCS/Frontier-CS.git # Docker required for evaluation CORAL_TASK_YAML=ttt/examples/frontier_cs/task.yaml ./ttt/run_coral_distill.sh

Generate all 43 CPU-only Frontier-CS tasks:
python ttt/examples/frontier_cs/generate_tasks.py CORAL_TASK_YAML=ttt/examples/frontier_cs_tasks/cloudcast/task.yaml ./ttt/run_coral_distill.sh

Both examples use opencode runtime with restricted tools (no LSP, no codesearch, no skills) to keep 4B models focused on coding.

Also adds frontier-cs as an optional dependency in pyproject.toml:
pip install -e '.[frontier-cs]'

Add two new TTT example tasks for self-distillation training, plus a
generator script to scale Frontier-CS to all 43 CPU-only problems.

New examples:
- ttt/examples/eplb/: Expert Parallelism Load Balancer (MoE optimization)
- ttt/examples/frontier_cs/: Frontier-CS cant_be_late scheduling
- ttt/examples/frontier_cs_tasks/: 43 generated CPU-only Frontier-CS problems

Setup (EPLB):
  pip install -e . && pip install -e ttt/slime
  wget https://huggingface.co/datasets/abmfy/eplb-openevolve/resolve/main/expert-load.json
  cp expert-load.json ttt/examples/eplb/eval/expert-load.json
  CORAL_TASK_YAML=ttt/examples/eplb/task.yaml ./ttt/run_coral_distill.sh

Setup (Frontier-CS):
  pip install -e . && pip install -e ttt/slime
  pip install git+https://github.com/FrontierCS/Frontier-CS.git
  # Docker required for evaluation
  CORAL_TASK_YAML=ttt/examples/frontier_cs/task.yaml ./ttt/run_coral_distill.sh

Generate all 43 CPU-only Frontier-CS tasks:
  python ttt/examples/frontier_cs/generate_tasks.py
  CORAL_TASK_YAML=ttt/examples/frontier_cs_tasks/cloudcast/task.yaml ./ttt/run_coral_distill.sh

Both examples use opencode runtime with restricted tools (no LSP,
no codesearch, no skills) to keep 4B models focused on coding.

Also adds frontier-cs as an optional dependency in pyproject.toml:
  pip install -e '.[frontier-cs]'
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 25, 2026

@Yuchen-95 is attempting to deploy a commit to the yhy-4770's projects Team on Vercel.

A member of the Team first needs to authorize it.

The pip-installed frontier_cs package can't auto-detect its base directory
since the research/ folder isn't included in the wheel. Pass base_dir
explicitly pointing to the cloned Frontier-CS repo (~/Frontier-CS by default,
configurable via FRONTIER_CS_BASE_DIR env var).
The generic Solution stub didn't have the correct Strategy inheritance
or imports (sky_spot.strategies.strategy.Strategy, ClusterType), causing
NameError at evaluation time. Replace with the actual initial_greedy.py
from the Frontier-CS repo.
The KL entropy computation materializes [batch, seq, vocab] tensors that
OOM on single A100-40G with 4B+ models. KL loss is now disabled by default
and can be enabled via USE_KL_LOSS=1 for multi-GPU setups.
The _compute_log_prob() path was always computing entropy (full vocab
softmax), while _train_step() correctly gated it. This caused OOM on
A100-40G with 4B models because the [seq_len, vocab_size] tensor
couldn't fit alongside model+optimizer states.
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