Views
No views yet
0.17.0.dev01# axolotl SFT — Run 1 (DenseMixer ON) — Qwen3-30B-A3B-Thinking-2507 on opencode traces.
2# Experiment: axolotl-sft-opencode-densemoe (task #16). Paired-init controlled ablation:
3# Run 1 = densemixer ON (this file), Run 2 = byte-identical EXCEPT `dense_mixer: false`.
4# Design/rationale: experiments/active/axolotl-sft-opencode-densemoe/{POLICY,STATE}.md.
5#
6# ⚠ LAUNCH PATH = DIRECT `axolotl.cli.train` (NOT hpc.launch). EmpireAI is NOT registered
7# in hpc.launch; the SFT path is torch.distributed.run -m axolotl.cli.train <this.yaml>
8# (bring-up Stage-3 recipe: ~/scripts/stage3_incontainer.sh, bond0 NCCL). The direct path
9# honors this WHOLE file verbatim — which is REQUIRED here: the hpc.launch translator
10# (hpc/axolotl_config_utils.py) would STRIP `plugins:`, `dense_mixer:` (rebuilds plugins
11# from a fixed whitelist) AND `fp8:` (unhandled key) → densemixer silently off + fp8 auto-on.
12#
13# ⚠ REQUIRES the densemixer-enabled image `mega_final_dm.sqsh` (densemixer==1.0.1 in the SFT
14# system python). The DenseMixerPlugin hard-raises "DenseMixer is not installed" otherwise.
15
16# θ₀ — the SHARED init both runs start from (control discipline). Pinned local snapshot.
17base_model: /mnt/home/bf996/experiments/densemixer/theta0 # Qwen/Qwen3-30B-A3B-Thinking-2507 @ 144afc2f...
18model_type: AutoModelForCausalLM
19trust_remote_code: true
20
21# === THE DenseMoE mechanism = DenseMixer (marin #7088; yaof20/DenseMixer) ===
22# Training-only patch of Qwen3MoeSparseMoeBlock.forward: dense forward through ALL experts +
23# full-softmax router + STE combine (forward value = sparse/identical; backward = dense
24# gradient) + per-expert grad hook (expert params still update sparsely). Net: the ROUTER
25# gets the dense all-experts gradient. Inference untouched. This IS the single Run-1/Run-2
26# differentiator — Run 2 flips ONLY `dense_mixer: false` (plugin becomes a no-op).
27plugins:
28 - axolotl.integrations.densemixer.DenseMixerPlugin
29dense_mixer: true # Run 1 = ON. Run 2 = false (only-flag diff).
30
31# opencode SFT dataset — SERVE-PARITY REBUILD (bug ledger #2 fix). IDENTICAL for both runs.
32# The old `conversations` field was LOSSY (no system, empty turn-0, no <tools>, tool calls as
33# inline text, tool results as role:user) → model never learned the task/tools/read-edit workflow
34# → bash-spammed → swebench ~0. Rebuilt from the literal token columns via
35# scripts/harbor/literal_traces_to_opencode_sft.py: `messages` (list) carries a system turn (the
36# opencode agent prompt), a task-grounded user turn-0, structured assistant `tool_calls` (NOT inline
37# text, args JSON-string → axolotl json.loads → dict), and role:tool observations; `tools` (JSON
38# string) is the 10 opencode function schemas. Source: open-athena/nemotron-code-oracle-opencode-sft-serveparity.
39datasets:
40 - path: /mnt/home/bf996/experiments/densemixer/data_opencode_serveparity
41 ds_type: parquet
42 data_files:
43 - /mnt/home/bf996/experiments/densemixer/data_opencode_serveparity/data/train-*.parquet
44 type: chat_template
45 field_messages: messages
46 field_tools: tools # render the <tools> system block (train==serve)
47 message_property_mappings:
48 role: role
49 content: content
50 split_thinking: false # keep <think> inline on all turns (Qwen3-Thinking parity)
51# TRAIN==SERVE (POLICY §7): tokenizer_default = the base Qwen3-30B-A3B-Thinking tokenizer's own
52# tools-aware template (4049 chars, `{% if tools %}` + `<tool_call>` + `<tool_response>`), byte-
53# identical to what opencode serves at eval; archived as chat_templates/chat_template_v1_base-tools-aware.jinja.
54# Also sidesteps axolotl export-strip bug #1: the saved template == the base tools-aware one (no bare-chatml clobber).
55chat_template: tokenizer_default
56dataset_prepared_path: /mnt/home/bf996/experiments/densemixer/prepared/run1_serveparity # SHARED (multi-node sentinel); NEW path — old cache was the lossy tokenization
57val_set_size: 0.0
58dataset_num_proc: 1
59# Dataloader first-batch fix — the default async path (num_workers:1 + prefetch_factor:256)
60# wedged the multi-node first batch: the worker eagerly prefetched 256 packed 16384-tok batches
61# by mmap-reading the NFS-backed prepared arrow -> rank-0 stuck in folio_wait (mmap page I/O) +
62# an anon_pipe_read thread blocked on the worker, GPUs 0% (forward never started), no NCCL
63# collective in flight (job 31682, killed ~21min pre-step). prefetch_factor:2 kills the storm.
64dataloader_num_workers: 2
65dataloader_prefetch_factor: 2
66
67# === precision — bf16 + flash-attn (coordinator signal 2026-07-17; job 31623 HEALTHY). ===
68bf16: true
69fp16: false
70fp8: false # ⚠ MANDATORY EXPLICIT — axolotl 0.17 auto-enables fp8 on sm_100 → nan.
71tf32: false
72attn_implementation: flash_attention_2 # load-bearing: FA2 avoids the Blackwell cuDNN-SDPA bf16 backward nan
73 # (= the healthy job 31623 path; non-deprecated form of flash_attention:true)
74
75# === memory: 30B MoE + DENSE forward (all 128 experts materialized ≈ 16× expert-FFN FLOPs). ===
76# ZeRO-3 shards params/grads/optimizer; grad-checkpointing recomputes activations; chunked-CE
77# bounds the LM-head logit tensor WITHOUT a model monkeypatch (avoids any liger×densemixer
78# patch-interaction on qwen3_moe — deliberately NOT using enable_liger_kernel here).
79deepspeed: /opt/axolotl/deepspeed_configs/zero3_bf16.json
80gradient_checkpointing: true
81chunked_cross_entropy: true
82sequence_len: 16384 # conservative for the dense forward; raise to 32768 iff smoke shows headroom
83sample_packing: true # OPERATOR: packing ON (cadence)
84
85# === control discipline — IDENTICAL both runs ===
86seed: 42
87micro_batch_size: 1
88gradient_accumulation_steps: 4 # 8 GPUs (2×4) × micro 1 × accum 4 = effective batch 32
89num_epochs: 3.0
90learning_rate: 2.0e-5
91lr_scheduler: cosine
92warmup_ratio: 0.1
93max_grad_norm: 1.0
94optimizer: adamw_torch_fused
95weight_decay: 0.0
96
97# === checkpoint cadence (POLICY §5.5) — θ₀ + intermediate + final for the Δθ trajectory. ===
98# save_steps → ~10-15 intermediate ckpts; FINALIZE once preprocess reveals the packed step-count.
99# θ₀ (step 0) = the pinned prestaged snapshot. Keep ALL ckpts (Δθ analysis) — do NOT prune.
100logging_steps: 1 # instrument first 2-3 steps: grad_norm finite + loss real (nan → STOP→fp32)
101save_steps: 10
102save_total_limit: 100
103output_dir: /mnt/home/bf996/experiments/densemixer/run1_dense_out
104# Omit hub_model_id (offline init_hf_repo crash); push manually at cleanup. enable_db_registration: false.
105special_tokens: {}
106