xuan-luo/kvpath-optimization / KDA-optimization /training /kvpath2_rolling_head64_roll16
5.78 GB
9,654 files
Updated 30 days ago
Name
Size
configs
runs
README.md2.46 kB
xet
__init__.py73 Bytes
xet
attention.py5.55 kB
xet
budget.py1.68 kB
xet
entry_spec.py209 Bytes
xet
run.sh279 Bytes
xet
run_pipeline.sh1.26 kB
xet
run_pipeline_4gpu.sh1.26 kB
xet
spec.py2.48 kB
xet
test_config.py4.51 kB
xet
train.py3.09 kB
xet
README.md

kvpath2-rolling-head64-roll16

Isolated 12-layer rolling experiment with 64-D Q/K/V heads assembled from a four-state FIFO of 16-D raw K/V states. Layer 1 creates four states; each later layer creates one state. Every layer concatenates its four active states, then applies one standard split-half 64-D RoPE to Q/K and one causal softmax scaled by 1/sqrt(64). Values remain unrotated.

Matched budgets

  • 12 layers, hidden 512, 8 query heads, 4 KV heads.
  • FFN widths are 2166 in layers 1-4 and 2165 in layers 5-12.
  • Total parameters are exactly 98,710,016, matching KVPath-Concat.
  • There are 4 + 11 = 15 unique states.
  • Persistent cache is 2 * 4 * 15 * 16 = 1920 elements/token.
  • BF16 cache is 3840 bytes/token: 68.75% below KVPath-Concat's 6144 elements, and equal to the repository's MLA baseline.

The parameter match moves capacity released by the narrower attention heads into the FFNs. This is a matched-parameter/cache comparison, not a matched-attention-FLOP comparison.

Training recipe

The three stages match the existing KVPath-Concat recipe exactly for data, sequence/global/micro batches, optimizer, LR schedule, warmup, evaluation and checkpoint cadence:

Stage Tokens Steps Peak LR Global batch
2K 10,000,269,312 19074 1e-3 256
8K 1,000,341,504 1908 1e-4 64
32K 1,000,341,504 1908 1e-4 16

The 2K stage starts from seed 5000 because KVPath-Concat checkpoints are structurally incompatible. The 8K and 32K stages load the preceding stage with the existing --finetune handoff behavior. TP=PP=CP=1; eight data-parallel GPUs.

Checks and launch

source env/activate_deltakv_env.sh
python -m unittest training.kvpath2_rolling_head64_roll16.test_config
python training/kvpath2_rolling_head64_roll16/budget.py
bash training/kvpath2_rolling_head64_roll16/run.sh \
  --config training/kvpath2_rolling_head64_roll16/configs/train_2k.toml --dry-run

# On an idle 8-GPU host, validate real BF16 forward/backward/save first.
bash training/kvpath2_rolling_head64_roll16/run.sh \
  --config training/kvpath2_rolling_head64_roll16/configs/smoke.toml

# Runs/resumes 2K -> 8K -> 32K and writes one train.log per stage.
bash training/kvpath2_rolling_head64_roll16/run_pipeline.sh

The Python package uses underscores because hyphens are not valid in Python module imports; the experiment name exposed in logs is kvpath2-rolling-head64-roll16.

Total size
5.78 GB
Files
9,654
Last updated
Oct 27
Pre-warmed CDN
US EU US EU

Contributors