[2.0] Add new Frontier-CS 2.0 problem: nanoslm_hybrid_arch_design - #170
Merged
Conversation
Hybrid LM architecture-design task (Olmo Hybrid, ~190M): agents submit a model.py scored on held-out val_bpb vs a locked olmo3_190M baseline, trained under a fixed wall-clock budget on a single H100. - Embedding tying + param_cap reconciled: 400M cap in config.yaml and settings.py; baseline_model.py and reference.py both tie embeddings so the arms differ only in the sequence mixer; reference.py analytic/self-check updated to the tied count. - repro/: paper-faithful rig for Olmo Hybrid Table 5 (190M Base-Easy BPB) -- paper-spec pre-norm transformer + GDN-3:1 hybrid, WSD-S schedule, Modal training on the dolma3 mix. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ia Modal - settings.py: batch_size 8 -> 2, grad_accum 4 -> 16 (effective batch 32 unchanged). MEASURED: micro-batch 8 at ctx 8192 OOMs an H100 -- the fp32 CE logits are ~26GB and the baseline arm alone tried to allocate 24.48GiB, so the reference could not run under production settings. micro-batch 2 fits both arms (incl. the GDN hybrid) with margin. A fused/chunked CE would let it grow again (noted as a TODO in-file). - modal_app.py: mount the real FineWeb-Edu corpus (Modal Volume nanoslm-corpus) at the data path so the GPU arms train on real tokens instead of data.py's synthetic fallback; add PYTORCH_CUDA_ALLOC_CONF=expandable_segments to reduce allocator fragmentation for the large CE logits. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… hardened gate Training/eval harness: - Cosine LR now decays over wall-clock fraction (elapsed/train_seconds), not a hardcoded step horizon -- identical schedule for every architecture under the fixed budget; dead max_train_seconds loop check removed. - Modal run_pair_remote honors the agent/final role split: agent role reuses a baseline cached on the corpus Volume (keyed by config fingerprint + train.bin size + CODE_VERSION v8) and trains only the submission (~T); guard rejections return their public reason instead of environment_error. - Baseline SWA layers run FlexAttention's block-sparse kernel, with autocast dtype unification at the flex boundary (SDPA silently unified mixed q/k fp32 vs v bf16; flex refuses -- the old silent mask fallback had been hiding both the bug and a 2x baseline slowdown). - CUDA-only, no fallbacks: reference requires fla or raises; baseline requires flex or raises; FRONTIER_NANOSLM_SMOKE mode removed entirely. - Warmup fast-fails a model that cannot run at the 8192 eval context before spending the 6h budget; training exceptions of any type now classify as guard errors instead of escaping as environment errors. - compile_model added to the config fingerprint. Reference / baseline fidelity (arXiv 2604.03444 + OLMo-core @ fa6c5014): - GDN head_dim 128 kept per the paper's ladder convention ceil_128(0.75*d/h), with the 7B script's divergent int() rule documented; head_dim 48 probed on H100 (works, but slower via Triton autotune). - allow_neg_eigval=True passed explicitly (fla defaults False; paper requires it); GDN o_proj included in the depth-scaled output init. - vocab padded to 100352 (Olmo 3 convention; ids on disk stay < 100278). - reordered_norm documented against the paper's "pre-norm" wording. Data & scoring: - Corpus staged at 2B train tokens for the 6h budget (prep sizing rationale updated); val re-staged with byte-additivity verified. - AST policy gate: strict import allowlist (torch/numpy/fla/einops/triton + pure-stdlib), banned dynamic-access primitives, banned dunder attributes, banned raw-file-reader names; plausibility floor (bpb < 0.4 -> guard) as the runtime backstop. - Docs: problem-structure section in readme, agent README updated (starter is a byte-identical copy of reference.py). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- score IS the submission's held-out val_bpb (lower better), no scale/clip; bpb_score_scale removed; failure paths return sentinel 9999 - train_seconds 21600 -> 1800 for fast iteration; fingerprinted lr_schedule_seconds=21600 keeps the full 6h cosine (a 30-min run is the prefix of a long run, not a compressed anneal) - opt-in wandb logging (operator-only env gate; scored paths byte-identical) incl. pre-clip grad_norm; stop shipping stale .assets into the GPU image - calibrated @30min (CRN pairs, full-horizon LR): baseline 1.33325, reference 1.31208; 6h numbers unchanged (0.98112 / 0.93795) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
sijial430
marked this pull request as draft
July 24, 2026 23:19
sijial430
marked this pull request as ready for review
July 24, 2026 23:19
…guidance - score = 100*2^(-gamma*val_bpb), gamma = log2(100/70)/ref_bpb: smooth tempered per-byte likelihood -- perfect fit = 100, measured reference (1.55484 @15min) = 70, failures 0, no interior clipping - train_seconds 1800 -> 900 for faster agent iteration; LR cosine keeps the full 6h horizon (each run is the prefix of a long schedule); CODE_VERSION -> 15min-likelihood-v9 - agents keep editing while the judge scores: async submission workflow (~20 min/result, 2-slot queue, cancel superseded) now documented in the problem docs, matching the vllm problem's guidance - hardening from claude+codex reviews: spawn+poll Modal dispatch with a fingerprint+version staleness gate, logits-width guard, warm-container env purge, doc fact-fixes Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Mkjzqe7TQbS2QYQAML8Te3
…er-CS-fork into problem/nanoslm
Collaborator
Author
|
Updated (b57c492):
|
…rkflow
Docker Hub org access lapsed; images now live at
ghcr.io/frontiercs/nanoslm-hybrid-arch-design-{agent,judge}:experimental-v0
(pushed from the reviewed b57c492 build, image IDs verified identical).
build_images.sh notes the manual push workflow and the visibility rule:
agent package may be public, judge package must stay PRIVATE (embeds the
held-out val.bin).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Mkjzqe7TQbS2QYQAML8Te3
Collaborator
|
LGTM! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nanoslm_hybrid_arch_designlinear-recurrent sequence mixer) that reaches the lowest held-out
bits-per-byte (
val_bpb) when trained from scratch under a fixedwall-clock budget of 15 minutes on one H100. The agent submits a single
model.py; the hidden judge drops it into a locked dolma2-BPE train+evalharness, trains it for
T= 900 s (the LR cosine spans a full 6-hour horizon,so each run is the prefix of a long schedule), and scores it as
score = 100·2^(−γ·val_bpb), γ = log₂(100/70)/ref_bpb. Perfect fit (0 bpb) = 100, the measured referencesolution = 70 exactly, failures = 0.
olmo3_190Mshape (d=768, L=12,H=12), using dolma2 tokenizer.
Measured calibration
The 15-min column is the scored configuration; earlier budgets are historical
calibration.
Validation
Commands (from repo root):
Judge-side hardening (dual Claude+Codex review): spawn+poll Modal dispatch with
a config-fingerprint + code-version staleness gate, logits-width guard,
warm-container env hygiene, isolation audit (no experiment data or held-out
stream reachable from the agent container).
Validation logs with codex (gpt-5.5 one-shot + gpt-5.6 iterative campaigns)
(access needs to be granted):
wandb: https://api.wandb.ai/links/sijial-ai2/u86xnx57
results (updated, 15-mins interval): https://drive.google.com/drive/folders/1Xcyu0hJSh2p7tmMFNbY5SGkfFQNcovCS?usp=drive_link
results (old, 30-mins interval): https://drive.google.com/drive/folders/157qqq--nHlSpkkur7TT-HkCHBjaAFQdH?usp=drive_link