aien-train
AIEN training programme: language-model history, GB10 constraints and the route to training on the project engine. Plans and runnable checks are distinguished.
Brought by drakestapleton
Comparing 1739217e7c91f8d512a00d3eddb6f3f6e4f154c3 ... ad58cb8622296b47b25641b547f703b3185a1818
- omegallm spec.om: run the 12 long loops as aligned 2^19 chunks so aarch64 builds
- tests/omegallm: kv-check.py, the KV-cached decode of e993f179 against the guarded path
- streams: archived founding-stream scripts are not executable
- docs: clarify frozen local builds and Darwin compile-only coverage
- omegallm: point to omega-mv train/omega-llm/, the source of truth for Omega LLM code and docs
- tests/omegallm: add one-command OLLM metrics & readiness benchmark suite
- Merge commit 'e47c64cdf3d59dcb4cc5f64a0e6c1109eb2df3e7'
- omegallm: add 150-step M2 CPU frozen-core tool-call specialist receipt
- Merge commit '464dffdd36f315b6a8f96fba362bf49400dee9b3'
- omegallm: add Merkle specialist chains and S=2..4 DNA chain clipping (spclip)
- omegallm: upgrade OM-BUNDLES to DNA-style Merkle chains, S=2..4 spclip, and fix gtrainf note
- omegallm: add .om specialist bundle builder, local omc retry loop, and OM-BUNDLES.md
- tests/omegallm: include spec.om in build.sh and gpu-disasm.sh
- omegallm: add frozen-core specialists, OLLMSP01 packs, fusion, Bank-B KV cache, and Darwin ARM64 I/O
- Founding studies: licence for the copied README, original branch heads recorded
- Say where the founding studies are now that they are merged
- Merge founding stream data/corpus (2026-10-20) into main
- Merge founding stream numerics/own-fp4 (2026-10-20) into main (11 copies of third-party pages left out; their URLs, sizes and sha256 are in evidence/own-fp4/sources/FETCHLOG.txt and SOURCES.sha256)
- Merge founding stream math/training (2026-10-20) into main (a committed Python cache file, streams/math-training/__pycache__/common.cpython-312.pyc, left out)
- Merge founding stream physics/gb10 (2026-10-20) into main
- Merge founding stream study/efficiency (2026-10-20) into main
- Merge founding stream study/nvidia (2026-10-20) into main
- Merge founding stream study/others (2026-10-20) into main
- Merge founding stream study/openai (2026-10-20) into main
- math-training: STRUCTURE_CONSTANTS.md with E1-E4 verdicts, Omega kernel list, sources; E2 timing receipt (L283)
- math-training: E2 fourier 1e-4/1e-3, seed-1 repeats, lora64 receipts (L283)
- own-fp4: omma_window.sh (queued chip window for probe debug)
- own-fp4: race4-6 queue scripts (lock per run, wait for 35B)
- math-training: queue2 skips the finished fourier 1e-5 run (L283)
- math-training: fourier 1e-5 receipt, locked GPU queue, sources with verbatim quotes (L283)
- math-training: E1 timing, E2 LoRA/PHM sweeps, E3 nonlinearity, E4 subspace receipts (L283)
- own-fp4: WIP doc Part 2 edits, oracle tweaks, OMMA first chip attempt (failed: marker timeout)
- own-fp4: outlier study on real Wgrad operands (oracle), race2 queue, export_tern
- math-training: E3 algebra receipt, E2 operator checks, GPU queue, E1 timing targets; README layout line (L283)
- own-fp4: doc draft Part 1, outlier study, ef8sr, host checks, README layout line
- data stream: fetch script, extractor, aienbpe own byte-level BPE tool
- math-training: E1 sweep receipt (ridge vs AdamW/L-BFGS/Bohning MM/IRLS), e2/e3/e4 scripts, e3 toy receipt (L283)
- own-fp4: GB10 assembler acceptance matrix (sm_121a), sources, oracle quantizers + trainer (WIP)
- physics-gb10: advisor fixes (addressable on-chip storage, activation room, 32N for design b, tokens/s column, GEMM receipt, assumption labels, U3)
- history-nvidia: sections 3-5, sources, sources.json
- history-nvidia: section 2 hard lessons
- history-nvidia: section 1 (Spark/GB10 stated numbers and playbooks)
- math-training: paste verbatim, data hashes, E1 feature extraction + receipt (L283)
- efficiency: section 9 lessons, summary, sources section and sources.json
- physics-gb10: Q3 probe design, simulator result, next-experiment spec (L286)
- efficiency: section 8 (single-GPU record table, Chinchilla arithmetic for one GB10), evidence script
- efficiency: sections 6-7 (spending parameters differently, optimizers), sources 45-68
- history-others: fix chin quote, intro citations and counts
- history-others: lessons table (32 rows), gaps section, sources as fetched
- history-others: Google, Meta, BLOOM, DeepSeek, Anthropic, xAI, Mistral, phi, Qwen, Pythia, OLMo chapters (draft, lessons table pending)
- efficiency: sections 4-5 (numerics, memory traffic and on-chip arithmetic)
- history-openai: quotes, compute math, lessons table, sources (milestone 3)
- physics-gb10: SM count 48 read through our own RM path (gr_info receipt); README status
- efficiency: sections 0-3 draft (machine, scaling laws, speedrun record, small models and data)
- history-openai: per-model sections (milestone 2)
- physics-gb10: Q1 on-chip inventory and fit, Q2 training roofline (L279)
- history-openai: timeline table (milestone 1)
199 files changed, +30296 -17
.gitignore
| new file mode 100644 | ||
| @@ -0,0 +1,2 @@ | ||
| 1 | +.scratch/ | |
| 2 | +__pycache__/ |
AGENTS.md
| @@ -8,7 +8,7 @@ Shared rules: read https://www.aienos.com/agents/RULES.md first. This file adds | ||
| 8 | 8 | |
| 9 | 9 | - Applies to the whole repository. |
| 10 | 10 | - `docs/PLAN.md`: the research plan. Component contracts live in their own `docs/` subdirectories. |
| 11 | -- Planned, not yet written: `docs/history/` (what each lab did right and wrong, cited), `docs/LESSONS.md` (the distilled rules) and `docs/physics/` (GB10 training roofline). `docs/PLAN.md` says which stream writes each. | |
| 11 | +- Founding studies, merged from their stream branches: `docs/history/` (what each lab did right and wrong, cited), `docs/physics/` (GB10 training roofline), `docs/numerics/` (own 4-bit numerics) and `docs/math/` (training by mathematics). Planned, not yet written: `docs/LESSONS.md` (the distilled rules). `docs/history/FOUNDING-BRANCHES.md` lists the eight stream branches, their original heads and the merges. | |
| 12 | 12 | - `evidence/`: retained source pins, test results and measurement receipts. Preserve historical evidence. |
| 13 | 13 | - `streams/`: one working directory per stream (see `docs/PLAN.md`). |
| 14 | 14 |
README.md
| @@ -33,14 +33,14 @@ The earlier [NL1 experiment](native/neuralese/README.md), a learned numerical ch | ||
| 33 | 33 | - **v2, 15,833,472 parameters, MEASURED.** `120+24*15833472 -> 380003448` B, about 362.4 MiB. `evidence/OMEGALLM/gpu-r7/cpu/ock-boundary.txt` loads exactly that file. |
| 34 | 34 | - **Training time, rung 10 on the GB10, MEASURED.** The summed `gtrainb` wall time from step 250 to 60000 is 11,478.56 s. `11478.56/(60000-250) -> 0.19211` s per step, about 3.19 h in total. |
| 35 | 35 | - **Not counted:** activations, scratch buffers and the CPU side. |
| 36 | -- **What fits on the chip's own storage, MODELED.** The GB10 physics note estimates that a fully on-chip model has about 1–4 million parameters. That note is on the unmerged branch [`physics/gb10` @ 001ec9a](https://github.com/aien-dev/aien-train/blob/001ec9a944023a4280791c1be6e7f6f3727afb01/docs/physics/gb10-training.md), not on main. | |
| 36 | +- **What fits on the chip's own storage, MODELED.** The GB10 physics note estimates that a fully on-chip model has about 1–4 million parameters ([`docs/physics/gb10-training.md`](docs/physics/gb10-training.md)). | |
| 37 | 37 | |
| 38 | 38 | **Limitations and failed approaches.** |
| 39 | 39 | |
| 40 | 40 | - **NL1 missed its main target.** The learned channel reconstructed 14 of 16 inputs for every seed, not 16 of 16. The README records this as a FAIL of the target under the frozen schedule; it was not tuned away. |
| 41 | 41 | - **A gradient check had to be replaced.** At rung 5, the chip gradient check `gcmp` failed because of ReLU branch flips (`evidence/OMEGALLM/gpu-max/gc-max.txt`, rc 45) and was replaced by `gcmp2`. |
| 42 | 42 | - **The model is small.** The best model is the v2 shape: 15,833,472 parameters, trained on TinyStories, held-out loss 1.204466 nats per token. It is not a chat model. |
| 43 | -- **The history and lessons notes are not on main.** They live on the unmerged `study/*` and `docs/lessons` branches; see [PLAN.md](docs/PLAN.md). | |
| 43 | +- **The lessons summary is not written.** The history studies are in [`docs/history/`](docs/history/); the distilled `docs/LESSONS.md` planned in [PLAN.md](docs/PLAN.md) does not exist yet. | |
| 44 | 44 | |
| 45 | 45 | ### Reproduce on a CPU (offline, no model download, no GPU) |
| 46 | 46 | |
| @@ -81,7 +81,13 @@ Layout: | ||
| 81 | 81 | - `tests/` build and check scripts for those experiments |
| 82 | 82 | - `docs/` contracts and write-ups (`docs/omegallm/`, `docs/si19/`, …); `docs/PLAN.md` streams, directories, branches |
| 83 | 83 | - `evidence/` receipts for every measurement |
| 84 | -- `docs/history/`, `docs/LESSONS.md` and `docs/physics/` are planned in PLAN.md and live only on their unmerged branches so far | |
| 84 | +- founding studies (written 2026-10-20, merged 2026-11-14), each with its working directory in `streams/` and receipts in `evidence/`: | |
| 85 | + - `docs/history/` what OpenAI, NVIDIA and the other labs did (`openai.md`, `nvidia.md`, `others.md`) and the literature on training with little compute (`efficiency.md`). Published sources and arithmetic only; nothing in them was measured on our hardware. | |
| 86 | + - `docs/physics/gb10-training.md` what fits inside the GB10 and how long compute-optimal training takes on one Spark, from ceilings measured with our own kernels | |
| 87 | + - `docs/numerics/OWN_FP4.md` our own 4-bit training numerics; the small-model race in it was simulated in PyTorch and is labelled oracle | |
| 88 | + - `docs/math/` training by mathematics instead of mass compute (Drake's structure-constants idea, source in `docs/ideas/`), each experiment with a measured verdict | |
| 89 | + - `streams/data/` the corpus fetch script, extractor and the `aienbpe` byte-level BPE tool (Rust) | |
| 90 | +- `docs/LESSONS.md` is planned in PLAN.md and not written | |
| 85 | 91 | |
| 86 | 92 | ## Human-Directed Agentic Engineering |
| 87 | 93 |
docs/history/FOUNDING-BRANCHES.md
| new file mode 100644 | ||
| @@ -0,0 +1,22 @@ | ||
| 1 | +# Founding stream branches (2026-10-20) | |
| 2 | + | |
| 3 | +The eight founding study branches were merged into main on 2026-11-14. Their original heads: | |
| 4 | + | |
| 5 | +| Branch | Original head | Merged by | Rewritten before merge | | |
| 6 | +|---|---|---|---| | |
| 7 | +| study/openai | b0cf41bbd6ea4014f626cc7c4e8c84a6eefe0b74 | 50d48b82 | no | | |
| 8 | +| study/others | e18fdb0e4818c66c56bbf52eabb2ed650048325a | ffb12274 | no | | |
| 9 | +| study/nvidia | edcc611113425eb22a4233672c412be5919d9813 | e6924abc | no | | |
| 10 | +| study/efficiency | 1c03dc13f3edc3e097b252093bf76f7896c1b9a5 | ff6955ac | no | | |
| 11 | +| physics/gb10 | 001ec9a944023a4280791c1be6e7f6f3727afb01 | bdc257ff | no | | |
| 12 | +| math/training | 296520ea00a6a4e062cb6adb61d2b3fead474987 | 196386b2 | yes: a committed Python cache file left out (see the merge message) | | |
| 13 | +| numerics/own-fp4 | 1dff17708fb49791b680ec454eee9456c223530e | 21f5aa90 | yes: 11 copies of third-party pages left out (see the merge message) | | |
| 14 | +| data/corpus | a33f7819e3975dd61990f8bae3320724e6842414 | d1ea9392 | no | | |
| 15 | + | |
| 16 | +The original heads, unchanged, are kept by the owner as one git bundle (sha256 | |
| 17 | +4d5aad1f60d577f48a28cc3a98b59afc29350428149e9b9a80cb85942c1d344d); they are not republished | |
| 18 | +because two of them hold the left-out material. | |
| 19 | + | |
| 20 | +The research scripts under `streams/` (Python, shell, C and the Rust tool `streams/data/aienbpe`) | |
| 21 | +are historical measuring instruments kept as they were written; none is part of a product, and | |
| 22 | +no Omega replacement is planned for them. |
docs/history/efficiency.md
| new file mode 100644 | ||
| @@ -0,0 +1,588 @@ | ||
| 1 | +# Training well with little compute: what is already proven | |
| 2 | + | |
| 3 | +Stream L278, branch `study/efficiency`, written 2026-10-20 for Drake. Sibling chapters cover the labs (OpenAI, everyone else) and the measured physics of the GB10 chip. This chapter covers one question: what has been shown, by whom, on what hardware, about getting a good language model out of very little compute, and what it would take on one GB10 (the chip inside the DGX Spark). | |
| 4 | + | |
| 5 | +**In plain words.** | |
| 6 | +- The best public proof that engineering beats brute force is the GPT-2 speedrun: the same model and the same quality target went from 45 minutes to 0.665 minutes on 8 H100 chips, 67.7x faster (calc:2981eefe) [13]. About 30x of that came from learning more from each token of text, and 2.23x from faster machinery (section 2). | |
| 7 | +- Better data is worth a factor of several in text needed (section 3). Lower-precision numbers (FP8) are proven at scale; 4-bit is proven once (section 4). | |
| 8 | +- Your idea of keeping everything on the math cores: the GB10 holds about 42 MiB on-chip, enough for the training state of a 2.8 to 6.3 million parameter model. Anything larger must stream through, and the published ways to make that streaming cheap are in section 5. | |
| 9 | +- The one real training log on our chip: a 561M-parameter model took 9.8 days on a single DGX Spark and reached about 45% of the chip's measured BF16 speed [64]. The literature-side answer to "can we train on the Spark" is yes for 125M to 350M parameters (hours to days), no for 3B at the Chinchilla ratio (about 150 days at 40% utilization) (section 8). | |
| 10 | +- Correction to the brief: 207.7 TFLOPS FP8 is a reviewer's measurement, not an NVIDIA spec (section 0). | |
| 11 | +- Section 9 holds 28 lessons, each with the kernel we would build. | |
| 12 | + | |
| 13 | + | |
| 14 | +How to read it. Every outside claim has a number in square brackets that points to the Sources list at the end, with the exact sentence copied from the page. Every number names the hardware it was measured on. Arithmetic is shown, and each result carries a receipt id (`calc:xxxxxxxx`) from our exact-arithmetic tool, so it can be checked. `[unverified]` marks a claim I could not source. "Tokens" are the word-pieces a model reads and predicts; "FLOPs" are individual multiply or add operations; "loss" is the model's average surprise at the next token (lower is better). | |
| 15 | + | |
| 16 | +## 0. The machine, and one correction to the brief | |
| 17 | + | |
| 18 | +What the vendor states about the DGX Spark: 128 GB of memory shared by the CPU and GPU, 273 GB/s of memory bandwidth, and "up to 1 PFLOP (petaFLOP) at FP4 precision with sparsity" [1][2]. FP4 is a 4-bit number format; "with sparsity" means the figure assumes the matrix has a particular pattern of zeros, so dense work gets about half. NVIDIA's own pages give no FP8 figure [1][2]. | |
| 19 | + | |
| 20 | +**Correction.** The brief calls 207.7 TFLOPS "dense FP8, NVIDIA-stated". It is not. It is a measurement by a reviewer (StorageReview, with the open "mamf-finder" tool, which searches for the largest matrix-multiply speed the chip actually reaches): "At BF16 precision, we observe a MAMF of 99.8 TFLOPs, while FP8 (E4M3) demonstrates a MAMF of 207.7 TFLOPs." [6] I use 207.7 TFLOPS below as a measured best case for one big matrix multiply, not as a vendor spec. Our own handoffs already label it "third-party measured". A real training step also does non-matrix work, so the usable fraction is lower (section 8). | |
| 21 | + | |
| 22 | +Other chip facts used in this chapter: | |
| 23 | + | |
| 24 | +| Fact | Value | Source | | |
| 25 | +|---|---|---| | |
| 26 | +| CUDA cores | 6,144 | NVIDIA hardware guide [2] | | |
| 27 | +| Streaming multiprocessors (SMs, the chip's independent compute blocks) | 48 (= 6,144 / 128 cores per SM, matching a retailer listing "48SM/6144SP") | [2][5], secondary; our Omega work also treats it as 48 | | |
| 28 | +| Tensor cores (the matrix-multiply units) | 192, 5th generation | [5], secondary | | |
| 29 | +| Registers (the fastest storage, private to each SM) | 64 K 32-bit registers per SM = 256 KB per SM | CUDA guide [4] | | |
| 30 | +| Shared memory / L1 (fast on-SM scratchpad) | 128 KB per SM of unified data cache, of which at most 100 KB can be shared memory (compute capability 12.x); our chip reports capability 12.1 | [4]; local `nvidia-smi` reports `NVIDIA GB10, 12.1` | | |
| 31 | +| L2 cache (on-chip, shared by all SMs) | 24 MB | Hot Chips 2025 slides [3] | | |
| 32 | +| Main memory | 128 GB LPDDR5X, 256-bit, 273 GB/s | [1][2] | | |
| 33 | +| Raw interface rate | about 301 GB/s ("Up-to 9400 Mbs, ~301GB/s raw bandwidth") | [3] | | |
| 34 | + | |
| 35 | +The 48-SM count is inferred from NVIDIA's 6,144 CUDA cores at 128 per SM plus a retailer listing; NVIDIA's pages I fetched do not print an SM count. Treat it as high confidence, not as a vendor quote. | |
| 36 | + | |
| 37 | +## 1. How much data and compute a model needs | |
| 38 | + | |
| 39 | +**Kaplan (OpenAI, 2020).** Loss falls as a smooth power law in model size, data and compute; the paper's conclusion is that "optimally compute-efficient training involves training very large models on a relatively modest amount of data and stopping significantly before convergence" [7]. Its fitted exponents are about 0.076 for model size and 0.095 for data, and it estimates training compute as C ≈ 6 N × (batch × steps), i.e. about 6 FLOPs per parameter per training token [7]. This advice, big model and few tokens, turned out to be wrong in the large-model regime (next entry). | |
| 40 | + | |
| 41 | +**Chinchilla (DeepMind, 2022).** Training 400+ models from 70 million to over 16 billion parameters on 5 to 500 billion tokens, the authors found "the model size and the number of training tokens should be scaled equally: for every doubling of model size the number of training tokens should also be doubled" [8]. Their 70B-parameter Chinchilla, trained on 4x more data than the 280B Gopher with the same compute, beat Gopher, GPT-3 and others [8]. The paper's own table of compute-optimal runs shows 1 billion parameters paired with 20.2 billion tokens [8], which is the source of the "about 20 tokens per parameter" rule I use below. Kaplan and Chinchilla disagreed because Kaplan under-trained its models; Chinchilla's data is the better-supported of the two, and I weight it. | |
| 42 | + | |
| 43 | +**Llama practice: train far past Chinchilla.** Chinchilla minimises cost to reach a loss; it ignores that a deployed model is run billions of times. Meta states: "the Chinchilla-optimal amount of training compute for an 8B parameter model corresponds to ~200B tokens ... model performance continues to improve even after the model is trained on two orders of magnitude more data" [9]. Llama 3 8B saw over 15T tokens [9], 75x the Chinchilla amount (15T / 200B = 75, calc:c8ee9718). LLaMA-1 started the practice: its 13B model "outperforms GPT-3 (175B) on most benchmarks" [10]. The Llama 3 paper says its flagship was near compute-optimal while "we also train our smaller models for much longer than is compute-optimal" [12]. | |
| 44 | + | |
| 45 | +**What it means for us.** A model we will run ourselves, many times, on one box, belongs in the over-trained regime: pick a small model and feed it far more than 20 tokens per parameter. The cost is more training FLOPs per unit of quality. The saving is a smaller, cheaper-to-run model. | |
| 46 | + | |
| 47 | +**Repeating data (Muennighoff et al., 2023).** With a fixed compute budget, "training with up to 4 epochs of repeated data yields negligible changes to loss compared to having unique data. However, with more repetition, the value of adding compute eventually decays to zero" [11]. Their fit puts the half-life of repeated tokens at about 15 repetitions (16 epochs): past that, returns fall "extremely fast" [11]. Tested up to 9B parameters and 900B tokens [11]. This matters on one machine because a small clean corpus can be reused up to about 4 times at essentially no loss, and up to roughly 16 times with diminishing value. | |
| 48 | + | |
| 49 | +**Smallest model worth training on one machine.** The literature gives no single threshold; it gives this ladder, each rung measured: (a) a 1M to 35M-parameter model trained on a single V100 in at most 30 hours writes coherent stories if the data is simple enough (TinyStories, section 3) [17]; (b) a 124M-parameter GPT-2-class model reaches 3.28 FineWeb loss in under 40 seconds on 8 H100s with the speedrun recipe (section 2) [13]; (c) a 350M-class model reaches 2.92 in 17.35 minutes on 8 H100s [13]; (d) phi-1 shows 1.3B parameters is enough for 50.6% on a code benchmark with curated data (section 3) [18]. For a first real run on one GB10, 124M to 350M parameters is the range where published recipes already exist end to end; section 8 does the arithmetic. | |
| 50 | + | |
| 51 | +## 2. Training speedruns: the engineered record | |
| 52 | + | |
| 53 | +The modded-nanogpt repository fixes a goal and lets anyone compete: "the fastest algorithm to use 8 NVIDIA H100 GPUs to train a language model that attains 3.28 cross-entropy loss on the FineWeb validation set" [13]. The target loss comes from Andrej Karpathy's llm.c GPT-2 (124M) replication [13]. FineWeb is a public web text dataset (section 3). The rules forbid changing the data stream (batch size, sequence length and architecture may change), require 3.28 or better with statistical significance (p < 0.01), and ban extra compiler flags [13]. This makes it the cleanest public record of pure engineering gain against a fixed target. | |
| 54 | + | |
| 55 | +**Baseline, and a disagreement between sources.** The repository's table lists the llm.c baseline as "45 minutes", and says that run needed 10B tokens [13]. Karpathy's own post says the 124M model takes "~90 minutes" on "one 8X A100 80GB SXM node", cost "about $20", 10 billion FineWeb tokens, ending near 3.29 loss [14]. The two are consistent only if the 45-minute figure is an H100 time, which the speedrun repository implies (its runs are timed on 8 H100s) but Karpathy's post gives only as a community comment. I use 45 minutes on 8 H100 for the speedrun ratios and 90 minutes on 8 A100 for the original. | |
| 56 | + | |
| 57 | +**Headline.** The current record (#92, 2026-08-30) is 0.665 minutes (39.9 seconds, calc:b9eec80a) against 45 minutes: a 67.7x speedup (calc:2981eefe) on the same hardware class and the same loss target [13]. The README says the current algorithm needs "under 330M tokens" against 10B for llm.c [13], a 30.3x cut in data (calc:4494ba9c). So about 30x of the 67.7x is "learn more from each token" and the remaining 2.23x (calc:84566df3) is more throughput per token. In GPU-time, 0.665 minutes on 8 GPUs is 0.0887 H100-hours (calc:249723b3). One caveat: record #92 sits far below the trend (1.126 to 0.665 minutes in one step) and bundles many changes, including a hashed n-gram table of 84.6M rows [13]; I list it as the repository reports it and have not reproduced it. | |
| 58 | + | |
| 59 | +**Phases** (times from the table below): | |
| 60 | +- Records 1 to 11 (May to Nov 2024): 45 to 7.2 minutes, a 6.25x gain (calc:2109ddb0). Mostly optimizer and architecture changes. | |
| 61 | +- Records 12 to 20 (Nov 2024 to Jan 2025): 7.2 to 2.992 minutes, 2.41x (calc:2f5f326b). Attention and embedding changes. | |
| 62 | +- Records 21 to 92 (Jan 2025 to Aug 2026): 2.933 to 0.665 minutes, 4.41x (calc:43dd99e7). Mostly kernels, precision and many small architecture changes. | |
| 63 | + | |
| 64 | +**What the big steps were, in order of effect** | |
| 65 | +- *Muon optimizer* (#3, 31.4 to 24.9 min, 1.26x, calc:80839589). Muon "takes the updates from SGD-momentum and applies a Newton-Schulz iteration that approximately orthogonalizes each one before the update is applied" [15], i.e. it replaces each weight-matrix update with the nearest "evenly spread" matrix, using five rounds of small matrix multiplies. Jordan reports a 1.35x gain in speedrun training speed and "a FLOP overhead below 1%" [15]; he also reports a 1.5B-parameter run reaching GPT-2-XL-level HellaSwag in 10 8xH100-hours versus 13.3 with AdamW [15]. Muon is applied only to the 2D hidden-layer weight matrices; AdamW still handles embeddings, output layer and scalars [15]. | |
| 66 | +- *Modern architecture bundle* (#5, 22.3 to 15.2 min, 1.47x, calc:707656dd): padded embeddings, ReLU² activation, zero-initialised projections, QK-norm (normalising the attention query and key vectors) [13]. | |
| 67 | +- *FlexAttention with long context windows* (#12, 7.2 to 5.03 min, 1.43x, calc:b9e92c47): replaced 1024-token dense causal attention with 64K-token FlexAttention (PyTorch's programmable attention kernel) [13]. | |
| 68 | +- *Value embeddings* (#14, #15, #17): extra learned per-token vectors mixed into attention values; U-net style skip connections (#11, #15): early layers feed late layers directly [13]. | |
| 69 | +- *Precision*: bfloat16 activations (#10), FP8 output head (#19), later FP8 for MLP and QKV forward and backward (#84, #89, #90, #92) [13]. FP8 is an 8-bit float format; section 4. | |
| 70 | +- *Fused kernels*: Triton (a GPU kernel language) kernels for symmetric matmul (#27), fused linear + ReLU² (#59), fused softcapped cross-entropy (#60), more cross-entropy and transpose kernels (#69, #75, #76, #79) [13]. Kernel fusion is the memory-traffic technique of section 5. | |
| 71 | +- *Schedule and batch tricks*: attention-window warmup (#13), learning rate decay to 0.1 not 0 (#19), longer cooldown fraction 0.45 (#26), batch-size schedule (#46), reduced batch size (#21, #39) [13]. | |
| 72 | +- *Optimizer refinements*: Polar Express replacing Newton-Schulz (#38), NorMuon (#41, #42), cautious weight decay (#43, #50), Adam-update-every-other-step (#39), unified optimizers (#61), ANVIL optimizer stack (#92) [13]. | |
| 73 | +- *Systems*: gradient all-reduce overlap, reduce-scatter, async data loading, CUDA-graph capture of the whole training step (#22 to #24, #33, #92) [13]. Eight GPUs have to exchange gradients; one GB10 does not, so the gradient-communication records do not transfer to us. | |
| 74 | + | |
| 75 | +**Full record table, track 1 (GPT-2 124M class, 3.28 FineWeb val loss, 8 H100).** Copied from the repository README [13]; a saved copy is in `evidence/efficiency/`. Record 21 appears three times because the repository re-timed it twice (rule change, newer PyTorch). | |
| 76 | + | |
| 77 | +| # | Record time | What changed (as listed) | Date | By | | |
| 78 | +|---|---|---|---|---| | |
| 79 | +| 1 | 45 minutes | llm.c baseline | 05/28/24 | @karpathy, llm.c contributors | | |
| 80 | +| 2 | 31.4 minutes | Tuned learning rate & rotary embeddings | 06/06/24 | @kellerjordan0 | | |
| 81 | +| 3 | 24.9 minutes | Introduced the Muon optimizer | 10/04/24 | @kellerjordan0, @jxbz | | |
| 82 | +| 4 | 22.3 minutes | Muon improvements | 10/11/24 | @kellerjordan0, @bozavlado | | |
| 83 | +| 5 | 15.2 minutes | Pad embeddings, ReLU², zero-init projections, QK-norm | 10/14/24 | @Grad62304977, @kellerjordan0 | | |
| 84 | +| 6 | 13.1 minutes | Distributed the overhead of Muon | 10/18/24 | @kellerjordan0 | | |
| 85 | +| 7 | 12.0 minutes | Upgraded PyTorch 2.5.0 | 10/18/24 | @kellerjordan0 | | |
| 86 | +| 8 | 10.8 minutes | Untied embedding and head | 11/03/24 | @Grad62304977, @kellerjordan0 | | |
| 87 | +| 9 | 8.2 minutes | Value and embedding skip connections, momentum warmup, logit softcap | 11/06/24 | @Grad62304977, @kellerjordan0 | | |
| 88 | +| 10 | 7.8 minutes | Bfloat16 activations | 11/08/24 | @kellerjordan0 | | |
| 89 | +| 11 | 7.2 minutes | U-net pattern skip connections & double lr | 11/10/24 | @brendanh0gan | | |
| 90 | +| 12 | 5.03 minutes | 1024-ctx dense causal attention → 64K-ctx FlexAttention | 11/19/24 | @KoszarskyB | | |
| 91 | +| 13 | 4.66 minutes | Attention window warmup | 11/24/24 | @fernbear.bsky.social | | |
| 92 | +| 14 | 4.41 minutes | Value Embeddings | 12/04/24 | @KoszarskyB | | |
| 93 | +| 15 | 3.95 minutes | U-net pattern value embeddings, assorted code optimizations | 12/08/24 | @leloykun, @YouJiacheng | | |
| 94 | +| 16 | 3.80 minutes | Split value embeddings, block sliding window, separate block mask | 12/10/24 | @YouJiacheng | | |
| 95 | +| 17 | 3.57 minutes | Sparsify value embeddings, improve rotary embeddings, drop an attn layer | 12/17/24 | @YouJiacheng | | |
| 96 | +| 18 | 3.4 minutes | Lower logit softcap from 30 to 15 | 01/04/25 | @KoszarskyB | | |
| 97 | +| 19 | 3.142 minutes | FP8 head, offset logits, lr decay to 0.1 instead of 0.0 | 01/13/25 | @YouJiacheng | | |
| 98 | +| 20 | 2.992 minutes | Merged QKV weights, long-short attention, attention scale, lower Adam epsilon, batched Muon | 01/16/25 | @leloykun, @fernbear.bsky.social, @YouJiacheng, @brendanh0gan, @scottjmaddox, @Grad62304977 | | |
| 99 | +| 21 | 2.933 minutes | Reduced batch size | 01/26/25 | @leloykun | | |
| 100 | +| 21 | 2.997 minutes | 21st record with new timing | 02/01/25 | not a new record, just re-timing #21 with the updated rules | | |
| 101 | +| 21 | 3.014 minutes | 21st record with latest torch | 05/24/25 | not a new record, just re-timing #21 with latest torch | | |
| 102 | +| 22 | 2.990 minutes | Faster gradient all-reduce | 05/24/25 | @KonstantinWilleke, @alexrgilbert, @adricarda, @tuttyfrutyee, @vdlad; The Enigma project | | |
| 103 | +| 23 | 2.979 minutes | Overlap computation and gradient communication | 05/25/25 | @ryanyang0 | | |
| 104 | +| 24 | 2.966 minutes | Replace gradient all_reduce with reduce_scatter | 05/30/25 | @vagrawal | | |
| 105 | +| 25 | 2.896 minutes | Upgrade PyTorch to 2.9.0.dev20250713+cu126 | 07/13/25 | @kellerjordan0 | | |
| 106 | +| 26 | 2.863 minutes | Align training batch starts with EoS, increase cooldown frac to .45 | 07/13/25 | @classiclarryd | | |
| 107 | +| 27 | 2.817 minutes | Transpose one of the MLP matrices + add Triton kernel for symmetric matmul | 07/18/25 | @byronxu99 | | |
| 108 | +| 28 | 2.812 minutes | Sparse attention gate | 08/23/25 | @classiclarryd | | |
| 109 | +| 29 | 2.731 minutes | Flash Attention 3, 2048 max_doc_len, update ws schedule | 09/03/25 | @varunneal | | |
| 110 | +| 30 | 2.717 minutes | Drop first MLP layer | 09/05/25 | @EmelyanenkoK | | |
| 111 | +| 31 | 2.656 minutes | Dynamically incorporate YaRN during training and validation | 09/10/25 | @classiclarryd | | |
| 112 | +| 32 | 2.625 minutes | Optimize distributed training, improve skip connection gating, and enhance bfloat16 usage | 09/11/25 | @bernard24 & AI system hiverge.ai | | |
| 113 | +| 33 | 2.565 minutes | Asynchronously fetch and index data batches, extend final layer attention window for validation | 09/15/25 | @classiclarryd | | |
| 114 | +| 34 | 2.547 minutes | Smear token embeddings 1 position forward | 09/18/25 | @classiclarryd | | |
| 115 | +| 35 | 2.527 minutes | Drop first attn layer, extend all long windows for validation, update schedule | 09/21/25 | @classiclarryd | | |
| 116 | +| 36 | 2.495 minutes | MuonCustomSizing, perform mlp and attn reduce scatter in shared call | 09/23/25 | @classiclarryd | | |
| 117 | +| 37 | 2.483 minutes | Compute cross entropy in BF16 during training | 09/27/25 | @Gusarich | | |
| 118 | +| 38 | 2.476 minutes | Polar Express, replacement for Newton-Schulz | 09/29/25 | @varunneal | | |
| 119 | +| 39 | 2.447 minutes | Only update Adam params every other step, reduce batch size | 09/30/25 | @classiclarryd | | |
| 120 | +| 40 | 2.358 minutes | Backout, misc hyperparameter tuning, optimize lambda padding | 10/04/25 | @classiclarryd | | |
| 121 | +| 41 | 2.345 minutes | NorMuon | 10/24/25 | @li_zichong | | |
| 122 | +| 42 | 2.313 minutes | Update NorMuon LR, Step Logic | 10/27/25 | @varunneal | | |
| 123 | +| 43 | 2.284 minutes | Cautious Weight Decay w/ schedule | 11/10/25 | @varunneal | | |
| 124 | +| 44 | 2.269 minutes | Backward hooks on Adam, Profiling 101 | 11/16/25 | @akash5474 | | |
| 125 | +| 45 | 2.248 minutes | Refine skip arch, update exponential decay init | 11/18/25 | @classiclarryd | | |
| 126 | +| 46 | 2.203 minutes | Batch size schedule | 11/29/25 | @varunneal | | |
| 127 | +| 47 | 2.193 minutes | Multiply attn lambda with weight instead of data, fix warmup | 12/10/25 | @roeeshenberg | | |
| 128 | +| 48 | 2.170 minutes | Speed up Muon, additional pre-multiply lambda, reshape matrices, update lr, update NorMuon axis | 12/11/25 | @ChrisJMcCormick | | |
| 129 | +| 49 | 2.146 minutes | Partial Key Offset | 12/14/25 | @classiclarryd | | |
| 130 | +| 50 | 2.128 minutes | Extend Cautious Weight Decay to Adam parameters | 12/18/25 | @roeeshenberg | | |
| 131 | +| 51 | 2.075 minutes | Retie Embed to lm_head, retune fp8 scales | 12/19/25 | @varunneal | | |
| 132 | +| 52 | 2.037 minutes | Smooth scalars via beta increase, decrease smear gate lr, freeze scalars during transitions, adam all reduce | 12/21/25 | @ChrisJMcCormick | | |
| 133 | +| 53 | 1.988 minutes | Multi-token prediction, untie embed/lm_head at 2/3 training, lr update, tweak CWD | 12/22/25 | @varunneal, feat. @classiclarryd | | |
| 134 | +| 54 | 1.940 minutes | Asymmetric Logit Rescale | 12/26/25 | @classiclarryd | | |
| 135 | +| 55 | 1.918 minutes | Gates on value embeds and skip connection | 12/29/25 | @classiclarryd | | |
| 136 | +| 56 | 1.894 minutes | Optimize and compile Adam, increase Adam buffer precision, move gates from Muon to Adam parameter banks | 12/31/25 | @ChrisJMcCormick | | |
| 137 | +| 57 | 1.878 minutes | Bfloat16 attn/mlp weights, mixed precision Muon, interweave Adam/Muon, finer-grain Adam beta | 01/04/26 | @classiclarryd, feat. @YouJiacheng, @ChrisJMcCormick | | |
| 138 | +| 58 | 1.820 minutes | Paired Head Attention | 01/07/26 | @classiclarryd | | |
| 139 | +| 59 | 1.781 minutes | Fused triton kernel for linear relu square MLP step | 01/10/26 | @andrewbriand8, @Joshrav21 | | |
| 140 | +| 60 | 1.765 minutes | Fused triton kernel for softcapped multi-token prediction cross entropy step | 01/16/26 | @soren_dunn_ & AI System Locus | | |
| 141 | +| 61 | 1.748 minutes | Unified Optimizers and Transposed LM Head | 01/18/26 | @ChrisJMcCormick | | |
| 142 | +| 62 | 1.655 minutes | Bigram Hash Embedding | 01/19/26 | @classiclarryd | | |
| 143 | +| 63 | 1.650 minutes | Untie Value Embeds | 01/26/26 | @photon_mz | | |
| 144 | +| 64 | 1.630 minutes | Tuned nonzero Attn V and O init | 01/30/26 | @srashedll | | |
| 145 | +| 65 | 1.613 minutes | Group Value Embeds into single parameter | 01/30/26 | @varunneal | | |
| 146 | +| 66 | 1.595 minutes | Torch 2.10 | 01/31/26 | - | | |
| 147 | +| 67 | 1.540 minutes | Tune fused softcap kernels and fuse fp8 quantization in LM head | 01/31/26 | @andrewbriand8 | | |
| 148 | +| 68 | 1.535 minutes | Move bigram hash to GPU | 01/31/26 | @dhrvji | | |
| 149 | +| 69 | 1.528 minutes | Kernel Optimizations | 02/02/26 | @EmmettBicker & AI System Aster | | |
| 150 | +| 70 | 1.521 minutes | Tune value embed layout and ve_gates | 02/03/26 | @photon_mz | | |
| 151 | +| 71 | 1.516 minutes | Sparse bigram gradient comms and optimized loading on CPU | 02/06/26 | @roeeshenberg | | |
| 152 | +| 72 | 1.496 minutes | Increase minimum lr and add max_seq_len schedule | 02/10/26 | @dualverse-ai & AI System Station | | |
| 153 | +| 73 | 1.485 minutes | Partitioned Hyperconnections | 02/12/26 | @sisovicm | | |
| 154 | +| 74 | 1.468 minutes | Flattened GPT forward, removed post attention lambdas, added transpose kernels | 02/16/26 | @ChrisJMcCormick | | |
| 155 | +| 75 | 1.453 minutes | Cross Entropy Kernel Optimizations | 02/23/26 | @moof2x | | |
| 156 | +| 76 | 1.446 minutes | Reuse and tune backward transpose kernel | 02/28/26 | @samacqua | | |
| 157 | +| 77 | 1.435 minutes | Replace partitioned hyperconnections with single saved activation | 03/06/26 | @classiclarryd | | |
| 158 | +| 78 | 1.426 minutes | Tighten bounds on fa3 max_num_docs to match fineweb distribution | 03/22/26 | @ChrisJMcCormick | | |
| 159 | +| 79 | 1.411 minutes | Fuse Cross Entropy Fwd/Bwk Kernel, to avoid recalc on softcap sigmoid | 04/04/26 | @andrewbriand8 | | |
| 160 | +| 80 | 1.406 minutes | In Muon orthogonize Q and K matrices in pairs of heads, instead of across the full 6 head matrix | 04/08/26 | @samacqua | | |
| 161 | +| 81 | 1.363 minutes | MUDD Skip Connections | 04/22/26 | @Lisennlp | | |
| 162 | +| 82 | 1.353 minutes | Learnable XSA | 04/29/26 | @_djdumpling | | |
| 163 | +| 83 | 1.328 minutes | Sign Trick on Bigram Embed | 05/20/26 | @TrianX | | |
| 164 | +| 84 | 1.320 minutes | FP8 on MLP up-projection forward pass | 05/21/26 | @sisovicm | | |
| 165 | +| 85 | 1.271 minutes | MUDD gates and Lightweight Dynamically Composable MHA | 05/27/26 | @Lisennlp | | |
| 166 | +| 86 | 1.266 minutes | Algebraic rewrite of XSA, same math faster execution | 05/27/26 | @aryavohra | | |
| 167 | +| 87 | 1.256 minutes | Faster Implementation of Relu^2 Kernel | 06/11/26 | @cong_ml and AI System Recursive | | |
| 168 | +| 88 | 1.243 minutes | Prefix token prediction auxiliary loss | 07/13/26 | @jvarho | | |
| 169 | +| 89 | 1.23 minutes | MLP down projection in FP8 with efficient delayed scaling metric | 07/17/26 | @Mister-dev-oss, @CerovazS, @MarioPaerle, @GabrieleCirillo, @crisostomi | | |
| 170 | +| 90 | 1.13 minutes | 128 -> 96 dim QK, Fuse QK Norm, RoPE, and KeyOffset into Triton, Move MLP bwk to FP8, Move QKV fwd and bwk to FP8. | 08/03/26 | @theonlyglitch_ | | |
| 171 | +| 91 | 1.126 minutes | Mask logits for infeasible token continuations during validation. | 08/06/26 | @jvarho | | |
| 172 | +| 92 | 0.665 minutes | Sampled softmax over the early stages, full FP8 MLP fwd+bwd, 84.6M-row hashed n-gram table, ANVIL optimizer stack, depth reduction + mixed-width QK attention, full CUDA-graph capture of the training step | 08/30/26 | @DevenPzak | | |
| 173 | + | |
| 174 | +**Track 2: GPT-2 Medium class (350M parameters), target loss 2.92, 8 H100.** The first record is the llm.c baseline at 5.8 hours, then 29.3 minutes for the speedrun recipe scaled up, down to 17.35 minutes at record 18 (2025-12-31): a 20.06x gain (calc:3f309a02) [13]. Table [13]: | |
| 175 | + | |
| 176 | +| # | Record time | What changed (as listed) | Date | By | | |
| 177 | +|---|---|---|---|---| | |
| 178 | +| 1 | 5.8 hours | llm.c baseline (350M parameters) | 05/28/24 | @karpathy, llm.c contributors | | |
| 179 | +| 2 | 29.3 minutes | Initial record based on scaling up the GPT-2 small track speedrun | 01/18/25 | @kellerjordan0 | | |
| 180 | +| 3 | 28.1 minutes | Added standard weight decay | 02/08/25 | @kellerjordan0 | | |
| 181 | +| 4 | 27.7 minutes | Tuned Muon Newton-Schulz coefficients | 02/14/25 | @leloykun | | |
| 182 | +| 5 | 27.2 minutes | Increased learning rate cooldown phase duration | 03/06/25 | @YouJiacheng | | |
| 183 | +| 6 | 25.95 minutes* | 2x MLP wd, qkv norm, all_reduce/opt.step() overlap, optimized skip pattern | 03/25/25 | @YouJiacheng | | |
| 184 | +| 7 | 25.29 minutes | Remove FP8 head; ISRU logits softcap; New sharded mixed precision Muon; merge weights | 04/16/25 | @YouJiacheng | | |
| 185 | +| 8 | 24.50 minutes | Cubic sliding window size schedule, 2× max window size (24.84 minutes) 24.5min repro | 04/22/25 | @jadenj3o | | |
| 186 | +| 9 | 24.12 minutes | Add two value embeddings | 08/28/25 | @snimu | | |
| 187 | +| 10 | 24.07 minutes | Second input embedding | 09/11/25 | @snimu | | |
| 188 | +| 11 | 23.45 minutes | Upgrade from torch 2.7 to torch==2.10.0.dev20251210+cu126 | - | - | | |
| 189 | +| 12 | 23.28 minutes | Snoo Optimizer (Outer optimizer around Adam and Muon) | 09/16/25 | @dominikkallusky | | |
| 190 | +| 13 | 23.14 minutes | EMA Wrapper on Muon | 09/17/25 | @acutkosky | | |
| 191 | +| 14 | 23.08 minutes | Combine both records 12 & 13 | 09/30/25 | @acutkosky | | |
| 192 | +| 15 | 23.03 minutes | Backout (Skip from 2/3 point to pre-lm_head) | 10/04/25 | @snimu | | |
| 193 | +| 16 | 22.99 minutes | Smear-MTP | 11/02/25 | @snimu | | |
| 194 | +| 17 | 22.98 minutes | Remove Redundant Mask Op | 11/12/25 | @manikbhandari | | |
| 195 | +| 18 | 17.35 minutes | Bulk transfer short track features | 12/31/25 | - | | |
| 196 | + | |
| 197 | +**Fewer GPUs.** I found no official speedrun table for one GPU. The rules time on 8 H100s only [13], and the forks I found keep that target (one fork's README: "4.7 minutes on 8xH100 instead of 45") [19]. The code can be pointed at fewer GPUs, but I have not seen a published single-GPU time to cite. Single-GPU records that do exist are in section 8. | |
| 198 | + | |
| 199 | +**Cramming (Geiping and Goldstein, Dec 2022): BERT in one day on one GPU.** They asked "How far can we get with a single GPU in just one day?" [16]. BERT is an older text-understanding model trained by filling in blanked-out words. Their "crammed BERT" reached a GLUE score (a standard set of 9 language-understanding tasks) of 78.3 after one day on a single RTX 2080 Ti (a 2018 consumer card) and 78.1 on an RTX A4000, against 80.9 for the fully trained BERT-base [16]. In total compute that is 5 exaFLOP (2080 Ti) to 13 exaFLOP (RTX A6000), against 13,824 exaFLOP for RoBERTa-base and 7,299,072 exaFLOP for PaLM in the paper's own comparison table [16]. Their findings, which still hold for GPT-style training: performance "closely follows scaling laws observed in large-compute settings" [16]; with a single GPU the useful micro-batch is smaller than the best batch, so they accumulate gradients and use a batch-size ramp; they disable linear-layer biases, use a one-cycle learning rate schedule with gradient clipping at 0.5, and filter and sort the data [16]. Scaling down was hard: the paper sorts recent improvements by whether they help at this budget, and reports some of them do not [16]. The speedrun above is the closest successor for decoder (GPT-style) models. | |
| 200 | + | |
| 201 | +## 3. Small models on good data | |
| 202 | + | |
| 203 | +Data quality is the cheapest lever in this chapter, but each claim needs its price. | |
| 204 | + | |
| 205 | +| Work | What it showed | Compute and hardware | Source | | |
| 206 | +|---|---|---|---| | |
| 207 | +| TinyStories (Microsoft, 2023) | A synthetic set of short stories using words a 3 to 4 year old knows, written by GPT-3.5 and GPT-4. Models "below 10 million total parameters" or with a single transformer block "still produce fluent and consistent stories" | Models of 1M to 35M parameters, 1 to 8 layers, each "trained on a single V100 GPU within at most 30 hours" | [17] | | |
| 208 | +| phi-1 (Microsoft, 2023) | 1.3B-parameter code model, 6B tokens of filtered web code plus 1B tokens of GPT-3.5-written textbooks; 50.6% HumanEval pass@1 and 55.5% MBPP; a 350M version still reached 45% HumanEval | 4 days on 8 A100 = 768 A100-hours (4 x 24 x 8, calc:f59f19be) | [18] | | |
| 209 | +| phi-2 (Microsoft, Dec 2023) | 2.7B parameters; 1.4T tokens (multiple passes over a mix of synthetic and filtered web data); "matches or outperforms models up to 25x larger" on the vendor's chosen benchmarks | 14 days on 96 A100 = 32,256 A100-hours (14 x 24 x 96, calc:a8844880) | [20] | | |
| 210 | +| BabyLM challenge (2023, findings published 2025) | Language acquired by a child needs under 100M words; LLMs use 3 to 4 orders of magnitude more. From 30+ submissions: the winners used the LTG-BERT architecture and "outperformed models trained on trillions of words"; shorter input sequences and distilling from a teacher helped; curriculum learning (ordering data easy to hard) "was largely unsuccessful" | Fixed data budget (about 100M words) rather than compute | [21] | | |
| 211 | +| FineWeb and FineWeb-Edu (Hugging Face, 2024) | A 15T-token cleaned web set, and a 1.3T-token subset kept by a classifier trained on LLM ratings of educational value. FineWeb-Edu "can match the final performance of Matrix with almost 10x fewer tokens" on MMLU; MMLU rose from 33% to 37% and ARC from 46% to 57% against other open web datasets in their ablations | The filter itself cost compute: scoring the 15T tokens "required 6,000 H100 GPU hours" | [22] | | |
| 212 | +| DataComp-LM (2024) | Model-based filtering "is key". DCLM-Baseline trains a 7B model from scratch to 64% 5-shot MMLU with 2.6T tokens, 6.6 points above MAP-Neo with 40% less compute, and is comparable to Llama 3 8B on 53 tasks "while being trained with 6.6x less compute" | 7B model, 2.6T tokens; compute ratios as the paper states them | [23] | | |
| 213 | +| Dolma / OLMo / OLMo 2 (AI2, 2024 to 2025) | Open corpus (3T tokens) with documented cleaning and mixing; OLMo 2 adds a late "Dolmino" high-quality mix during the final annealing phase and reports sitting "at the Pareto frontier of performance to training compute" | 7B, 13B, 32B models; per-model FLOPs in the paper | [24][25] | | |
| 214 | + | |
| 215 | +**What the numbers say about compute.** The best-measured savings are: about 10x fewer tokens for equal MMLU (FineWeb-Edu versus a prior web set, in the authors' ablation) [22]; 6.6x less training compute for a similar 53-task average at 7B (DCLM versus Llama 3 8B) [23]. Both are single-paper, single-benchmark-suite results by the data authors, so read them as "a factor of several, not 100". Three costs are not in those ratios. Filtering classifiers cost real compute (6,000 H100-hours for FineWeb-Edu's scoring pass) [22]. Synthetic data (TinyStories, phi) was written by a far larger model (GPT-3.5 or GPT-4), whose training cost is not counted, so it is closer to distillation (section 6) than to free quality. And the phi family was selected and evaluated on benchmarks close to its training style; the evidence for "textbooks beat scale" outside those benchmarks is weaker than the headlines. | |
| 216 | + | |
| 217 | +**What it means for us.** Under 100M parameters, the best-supported move is simple, tightly filtered data (TinyStories shows this at 1M to 35M parameters on a single V100 [17]). Above that, a model-scored quality filter on a web corpus is worth a factor of several in tokens [22][23], and the filter should be built once and its own cost counted. We do not need 15T tokens: repeating a clean 10B-token set 4 times costs almost nothing in loss [11]. | |
| 218 | + | |
| 219 | +## 4. Numerics: fewer bits per number | |
| 220 | + | |
| 221 | +Fewer bits means fewer bytes to move and, on tensor cores, more multiplies per second. The question for each format is what it costs in quality, and what the chip actually runs faster. | |
| 222 | + | |
| 223 | +**FP8 (8-bit floats).** The standard FP8 definition has two encodings: E4M3 (4 exponent bits, 3 mantissa bits, more precision) and E5M2 (5 and 2, more range), proposed jointly by NVIDIA, Arm and Intel; they matched 16-bit training quality up to 175B-parameter language models with unchanged hyperparameters [28]. Microsoft's FP8-LM went further, keeping gradients and optimizer states in 8 bits as well, and on H100s training GPT-175B it cut real memory by 39% and ran 75% faster than a BF16 Megatron-LM baseline [29]. DeepSeek-V3 (671B-parameter mixture of experts, 14.8T tokens, 2,048 H800 GPUs) is the largest public FP8 run: it scales each 1x128 tile of activations and each 128x128 block of weights separately (so one outlier cannot ruin a whole tensor), does the matrix-multiply accumulation at higher precision by promoting partial sums to the GPU's regular cores, and compared with a BF16 baseline over about 1 trillion tokens "the relative loss error of our FP8-training model remains consistently below 0.25%" [26]. It keeps the embedding, output head, mixture gating, normalisation and attention operators in BF16 or FP32, and keeps master weights, weight gradients and optimizer states in higher precision, with Adam moments in BF16 [26]. Full training was 2.788M H800 GPU-hours, of which 2.664M for pretraining (about 54 days on 2,048 GPUs, calc:5da1440a), at a stated $2 per GPU-hour or $5.576M, a figure the report says excludes prior research and ablations [26]. Lesson: FP8 is proven for the big matrix multiplies, but the recipe is not "cast everything"; about a dozen design choices keep it stable. | |
| 224 | + | |
| 225 | +**FP4 (4-bit floats), 2025.** NVIDIA's NVFP4 pretraining paper trained "a 12-billion-parameter model on 10 trillion tokens" in 4-bit, "the longest publicly documented training run in 4-bit precision to date" [27]. The recipe has four parts: random Hadamard transforms (a fixed scrambling of the numbers that spreads outliers out), two-dimensional scaling so the forward and backward passes see the same quantised weights, stochastic rounding (round up or down at random in proportion to the remainder, so errors average out) for gradients, and keeping sensitive layers in higher precision [27]. NVFP4 uses a scale per block of 16 values plus a tensor-level scale [27]. Result: validation loss tracks the FP8 run with relative error "consistently below 1%" in the stable phase and slightly above 1.5% as the learning rate decays; downstream accuracies "remain largely unaffected" [27]. In that run the first 2 and last 8 blocks (16% of linear layers) stayed in BF16 [27]. Limits: one model family at 12B and 10T tokens, by the vendor that sells the hardware; I know of no equivalent result under 1B parameters [unverified, absence of evidence]. | |
| 226 | + | |
| 227 | +**Ternary weights: BitNet b1.58.** Every weight is -1, 0 or +1. The authors report it "matches the full-precision (i.e., FP16 or BF16) Transformer LLM with the same model size and training tokens in terms of both perplexity and end-task performance" [30], starting at about 3B parameters, where it is "2.71 times faster and using 3.55 times less GPU memory" at inference [30]. The gain is in running the trained model (adds instead of multiplies, 1.58 bits per weight in memory); the paper reports latency, memory and energy of the trained model and gives no training-compute figure. The benefit for training on a GB10 is therefore small today, and no ternary matrix-multiply hardware exists on it. | |
| 228 | + | |
| 229 | +**What the GB10 runs fastest.** NVIDIA states only "1 PFLOP at FP4 with sparsity" [2]. A reviewer measured the best dense matrix-multiply speed as 99.8 TFLOPS in BF16 and 207.7 TFLOPS in FP8 (E4M3), a ratio of 2.08 (calc:5d6e8d19) [6]. A user on the NVIDIA developer forum reports a CUTLASS test kernel at 356 TFLOPS NVFP4 and 188 TFLOPS FP8, a ratio of 1.89 (calc:80bc14ab), about 71% of a 500 TFLOPS dense FP4 peak [31]; that is one user's forum post, not a vendor or peer-reviewed number [31]. The same thread shows real inference software only reached 65 tokens per second in NVFP4 against 55 for FP8 on one model, because the software was bandwidth-limited or fell back to slower paths [31]. Read together: FP8 is the format to design for first (2.1x over BF16 on a clean measurement, a mature recipe), and FP4 is a later 1.9x on paper if our own kernels can feed it and the quality recipe [27] holds at small scale. | |
| 230 | + | |
| 231 | +**Design consequence.** Hold weights and activations in E4M3 for forward matrix multiplies, gradients in E5M2 or E4M3 with per-block scales, accumulate in FP32 inside the tensor core, and keep a higher-precision master copy plus optimizer state, as DeepSeek did [26]. The master copy is where most of the bytes are (section 5). | |
| 232 | + | |
| 233 | +## 5. Memory traffic: Drake's question | |
| 234 | + | |
| 235 | +Drake's question: can training stay on the math cores, without moving data from memory into them? Below is the physics, then what has been published, then the arithmetic for one GB10. | |
| 236 | + | |
| 237 | +### 5.1 What a training step moves | |
| 238 | + | |
| 239 | +One training step on one batch of T tokens for a model with N parameters does about 6 N T floating-point operations (about 6 per parameter per token, forward plus backward) [7]. Around that math it moves four kinds of data between main memory and the chip: | |
| 240 | + | |
| 241 | +1. **Weights**: read once in the forward pass and again in the backward pass. | |
| 242 | +2. **Activations**: the intermediate results of every layer, written in the forward pass and read back in the backward pass (unless thrown away and recomputed). | |
| 243 | +3. **Gradients and optimizer state**: gradients written once; the optimizer then reads and writes the master weights and its momentum buffers once per step. A common mixed-precision Adam setup costs 2 + 2 + 12 = 16 bytes per parameter just to store (weights, gradients, optimizer state) [37]. | |
| 244 | +4. **The vocabulary projection**: the final layer turns each token into a score for every word-piece (50,257 of them for GPT-2), which is a large temporary table. | |
| 245 | + | |
| 246 | +At 273 GB/s [1][2] any of these sets a floor on step time that does not depend on how fast the math is. The chip needs this much memory traffic per FLOP to be kept busy: 207.7 TFLOPS / 273 GB/s = 761 FLOP per byte in FP8 (calc:049b452d), or 366 FLOP per byte in BF16 at the measured 99.8 TFLOPS (calc:a6dbe17a) [6]. If a step does fewer FLOPs per byte moved than that, memory is the bottleneck, not the math. | |
| 247 | + | |
| 248 | +### 5.2 The numbers for a 124M-parameter model on one GB10 | |
| 249 | + | |
| 250 | +My derivation, from published formulas, not a measurement. Model: GPT-2 small, 124M parameters, 12 layers, hidden width 768 [14][44]. Batch: 524,288 tokens per optimizer step (the llm.c 124M run requests "-d 524288", a total batch of about 0.5M tokens per update) [14]. | |
| 251 | + | |
| 252 | +- **Math time.** 6 x 124e6 x 524,288 = 3.9e14 FLOPs. At the measured best-case 207.7 TFLOPS, that is 1.878 s (calc:8ab5e8a9). Real runs reach a fraction of that (section 8). | |
| 253 | +- **Weights and optimizer state, once per step.** Assume DeepSeek-style storage [26]: FP32 master weights and gradients, BF16 Adam moments, plus FP8 copies, about 23 bytes per parameter moved per step. That is 23 x 124e6 = 2.85 GB, or 10.45 ms at 273 GB/s (calc:1929762d). That is 0.556% of the math time (calc:b9394334). **Weight and optimizer traffic is negligible at this batch size** because it is paid once per step and divided across 524,288 tokens. This is the main reason big-batch training works at all. | |
| 254 | +- **Activations.** Per layer, the count for a standard transformer layer stored at 16 bits is s*b*h*(34 + 5*a*s/h) bytes (s tokens in a sequence, b sequences, h hidden width, a attention heads) [39]. The second term is the attention score matrix, which FlashAttention removes by never writing it to memory [32]. Dropping it leaves 34 bytes per token per unit of hidden width per layer: 34 x 768 x 12 layers = 313,344 bytes per token (calc:a8be76e3). Written once and read once is 626,688 bytes per token. Over 524,288 tokens that is 329 GB of traffic, or 1.204 s at 273 GB/s (calc:097d18cc). **Activation traffic is the dominant memory cost**: it is 64% of the math time at the measured FP8 peak (1.204 / 1.878). Compute per byte moved is 6 x 124e6 / 626,688 = 1,187 FLOP/B (calc:34ce7f7e), above the FP8 balance point of 761, so a well-overlapped step stays compute-bound, but with only a 1.56x margin before memory time exceeds math time. | |
| 255 | +- **The vocabulary table.** Logits at 16 bits are 50,257 x 2 = 100,514 bytes per token; written and read once that is 32% of the whole activation traffic above (calc:251e3a5f). This is why the speedrun records fuse the loss calculation into one kernel (records 60, 75, 79 in section 2) [13]. | |
| 256 | +- **Bigger models are better off.** FLOPs per token grow with N, activation bytes only with width x depth. For a 1.3B model (24 layers, width 2048 [44]) the same ratio is 2,334 FLOP/B (calc:9f1a520d), twice as favourable. **Small models are the hard case for memory traffic**, which is awkward since small is where a single GB10 starts. | |
| 257 | + | |
| 258 | +### 5.3 Could the model live entirely on the math cores? | |
| 259 | + | |
| 260 | +What the chip stores on-die, from the specs in section 0: | |
| 261 | +- Registers: 48 SMs x 64 K registers x 4 bytes = 12 MiB [4]. | |
| 262 | +- Shared memory / L1: 48 x 128 KiB = 6 MiB (calc:143886d2), of which at most 100 KB per SM, 4.7 MiB, can be software-managed shared memory [4]. | |
| 263 | +- L2 cache: 24 MB [3], taken as 24 MiB (the slide does not say which unit; a 5% error either way). | |
| 264 | +- **Total: 42 MiB (calc:582423cc).** | |
| 265 | + | |
| 266 | +How big a trainable model fits in 42 MiB with nothing else? | |
| 267 | +- Standard mixed-precision Adam, 16 bytes per parameter [37]: 42 MiB / 16 = 2,752,512 parameters (calc:798c1823), about 2.8 million. | |
| 268 | +- A lean recipe (BF16 master weights, BF16 gradients, one BF16 momentum buffer as Muon needs [15]; 6 bytes) with one more byte for an FP8 weight copy, 7 bytes per parameter: 6,291,456 parameters (calc:56b4217e), about 6.3 million. | |
| 269 | + | |
| 270 | +Both numbers assume every register, every byte of shared memory and all of L2 is full of model state, leaving nothing for the numbers being multiplied, the activations, or the program. Registers cannot be addressed as a shared pool across SMs, so the real figure is lower. For comparison, the 124M-parameter model's weights alone in FP8 (124 MB) are 2.8 times the entire on-chip storage (calc:dfc75d0e). **Answer: a GB10 can keep a model of a few million parameters on its math cores. Every model in the range this chapter cares about (50M and up) is 10 to 50 times too big.** The TinyStories-scale models of section 3 (1M to 35M parameters) [17] are the only published models near that size. | |
| 271 | + | |
| 272 | +### 5.4 Silicon built around Drake's idea | |
| 273 | + | |
| 274 | +- **Cerebras WSE-3** keeps 44 GB of SRAM on one wafer with 900,000 cores, 125 petaflops of peak AI compute and 21 PB/s of memory bandwidth, per a 2025 academic comparison paper that repeats the vendor's figures [41]. That is 999 times a GB10's 42 MiB (calc:54e42556). Even so, 44 GB at 16 bytes per parameter holds a 2.75-billion-parameter model's training state (calc:72b1b9bd), and the paper describes that for larger models the parameters "can live in external memory (MemoryX or similar) while compute elements on the wafer handle the processing" [41]. In other words, Cerebras's answer for big models is not weights-stationary; it is to stream the weights through the chip. Cerebras-GPT (111M to 13B parameters, trained to Chinchilla ratios on its wafer-scale cluster) is the published training result [43]. It shows that the architecture trains real models; it does not isolate how much of the gain is the SRAM. | |
| 275 | +- **Groq** puts 220 MiB of SRAM on each chip [42] and, as far as I found, has published inference results only; I found no training results on Groq hardware [unverified, absence of evidence]. Holding a 70B-parameter model in 8-bit weights takes at least 70e9 / (220 MiB) = 303.4 chips (calc:1f54fbe5) before any working memory, which shows the cost of keeping weights in SRAM: a chip per 220 MB. | |
| 276 | + | |
| 277 | +**Implication.** The two machines that really keep weights on-die do so with 220 MiB (Groq, inference only) to 44 GB (Cerebras) of SRAM per unit. A GB10 has 42 MiB. For us "everything on the math cores" is out of reach for models above a few million parameters; the achievable goal is "stream each tensor through the cores once, touching main memory as little as possible". | |
| 278 | + | |
| 279 | +### 5.5 What recovers the traffic when the model does not fit | |
| 280 | + | |
| 281 | +Ranked by what dominates in 5.2, with the best-measured published gains: | |
| 282 | + | |
| 283 | +1. **Do not store the attention score matrix: FlashAttention.** It tiles attention so intermediate results stay in on-chip SRAM, "to reduce the number of memory reads/writes between GPU high bandwidth memory (HBM) and GPU on-chip SRAM" [32]. Measured on A100: 15% end-to-end speedup on BERT-large against the MLPerf 1.1 speed record, 3x on GPT-2 at sequence length 1K [32]. FlashAttention-2 reaches 225 TFLOPs/s per A100 (72% model FLOPs utilization) end to end [33]; FlashAttention-3 reaches 740 TFLOPs/s on H100 in FP16 (75% utilization) and close to 1.2 PFLOPs/s in FP8 [34]. We would write ours in Omega for the GB10. FlashAttention-3 is built around Hopper-specific hardware (asynchronous Tensor Cores and the TMA copy engine) [34]; which of those the GB10 has is a question for the Omega and L279 work, not settled here. | |
| 284 | +2. **Recompute instead of store.** Throwing activations away and recomputing them in the backward pass trades FLOPs for bytes. Chen et al.: memory for a 1,000-layer network falls from 48G to 7G "with only 30 percent additional running time cost" [38]. Selective recomputation (recompute only the cheap, bulky parts) together with sequence parallelism cuts activation memory 5x and removes over 90% of the recompute overhead; on a 530B-parameter model on 2,240 A100s it reached 54.2% model FLOPs utilization, 29% faster than the 42.1% with full recomputation [39]. In our setting, storing only each layer's input (2 bytes per width unit per layer instead of 34) cuts activation traffic to 1/17 (calc:25920375) (2/34 = 0.0588, calc:25920375) at the cost of one extra forward pass, 8NT instead of 6NT FLOPs, a 33% math increase. For the 124M example that turns 1.204 s of traffic into about 0.07 s (1.204 x 1/17) and 1.878 s of math into about 2.50 s (1.878 x 8/6); the step becomes clearly compute-bound. | |
| 285 | +3. **Fuse adjacent operations so intermediate results never leave the chip.** Liger Kernel (Triton kernels that fuse operations and chunk the loss) reports on average "a 20% increase in training throughput and a 60% reduction in GPU memory usage" against Hugging Face's implementations [40]. The NanoGPT speedrun's fused kernels (linear + ReLU², softcapped cross-entropy, QK-norm + RoPE) are the same idea measured on the 124M model [13] (section 2). | |
| 286 | +4. **Persistent kernels / megakernels** remove the gaps between kernel launches and keep data on-chip across operations. Hazy Research ran Llama-1B's whole forward pass in one kernel on an H100 at 78% of memory bandwidth against at most 50% for vLLM and SGLang, "almost 2.5x faster than vLLM and over 1.5x faster than SGLang" at batch size 1 [35]. MPK compiles a model into one persistent kernel automatically, reporting up to 1.7x lower end-to-end latency [36]. **Both are inference results; I found no published training megakernel.** Our L272 stream is building the decode-side equivalent on the GB10; the training-side version is open ground. | |
| 287 | +5. **ZeRO and optimizer-state sharding do not help one chip.** ZeRO cuts per-device model state from 16Ψ bytes to about 16Ψ / N_d by splitting it over N_d devices [37]; with N_d = 1 the saving is zero. What does help on one chip is the same trick used the other way: smaller state per parameter (BF16 moments [26], one momentum buffer with Muon [15]). | |
| 288 | + | |
| 289 | +**Which one recovers most?** For the 124M to 1B models we can train on one GB10, the numbers in 5.2 say activations are 64% of math time in traffic and weights and optimizer under 1%. So the most traffic is recovered by (a) recomputation of the bulky layers plus (b) fused kernels that also remove the logits table (32% of that traffic), with FlashAttention covering attention. Each has measured gains on other hardware (3x on GPT-2 attention on A100, 29% end-to-end from selective recompute at 530B scale, 20% throughput and 60% memory from fusion) [32][39][40], but I found no measurement of the combination on a GB10-class chip; L279 is to supply that. | |
| 290 | + | |
| 291 | +## 6. Spending parameters differently | |
| 292 | + | |
| 293 | +Four ideas change what one unit of compute buys: use only some of the parameters per token (mixture of experts), copy skill from a bigger model (distillation), start small and grow (model growth), and let a small model think longer when it answers (test-time compute). | |
| 294 | + | |
| 295 | +### 6.1 Mixture of experts (MoE) | |
| 296 | + | |
| 297 | +An MoE layer holds many parallel feed-forward blocks ("experts") and sends each token through only one or a few of them, so total parameters and per-token FLOPs come apart. | |
| 298 | +- **Switch Transformer (Google, 2021).** Based on T5-Base and T5-Large, "up to 7x increases in pre-training speed with the same computational resources" [45], and it showed sparse models can train in bfloat16 [45]. A trillion-parameter version got a 4x speedup over T5-XXL [45]. | |
| 299 | +- **DeepSeekMoE (2024).** A 16B-parameter model "comparable performance with LLaMA2 7B, with only about 40% of computations" [46]; at 145B, comparable to DeepSeek 67B using 28.5% of the computation (their own preliminary result) [46]. | |
| 300 | +- **DeepSeek-V3.** 671B total parameters, 37B active per token [26], i.e. 5.5% of the parameters touched per token (37 / 671 = 0.0551, calc:9ad67bd4). | |
| 301 | + | |
| 302 | +These are FLOP savings measured against a dense model of equal quality. They cost more memory: every expert's weights and optimizer state still exist and must be stored. On one GB10 with 128 GB, standard Adam state at 16 bytes per parameter [37] fills the memory at about 8 billion parameters (128e9 / 16), before activations. MoE is a way to buy quality per FLOP, not per byte. Because model-state traffic is under 1% of a big-batch step at 124M (section 5.2), spreading it across eight times as many parameters would still leave it a few percent; the limit would be capacity, not bandwidth. A small MoE is a real option for us only after the dense baseline works. | |
| 303 | + | |
| 304 | +### 6.2 Distillation | |
| 305 | + | |
| 306 | +Train a small student to match a larger teacher's output probabilities, not just the correct next word. | |
| 307 | +- **MiniLM (2020).** The student kept "more than 99% accuracy on SQuAD 2.0 and several GLUE benchmark tasks using 50% of the Transformer parameters and computations of the teacher" [47]. | |
| 308 | +- **Gemma 2 (Google, 2024).** The 2B and 9B models were trained "with knowledge distillation instead of next token prediction" and are "competitive alternatives to models that are 2-3 times bigger" [48]. The paper's small-scale test is the most relevant to us: with a 7B teacher and 500B training tokens, validation perplexity (lower is better) fell from 23 to 21 at 200M parameters, 19 to 17 at 400M and 17 to 15 at 1B [48]. That is about 10% lower perplexity at the sizes we would train. | |
| 309 | +- **DeepSeek-R1 distilled models (2025).** A 7B student fine-tuned on reasoning traces from DeepSeek-R1 scores 55.5% on the AIME 2024 maths contest, "surpassing QwQ-32B-Preview", and the 32B student scores 72.6% [49]. On the same Qwen2.5-32B base, applying reinforcement learning directly gave 47.0% on AIME 2024 against 72.6% from distillation [49]. The authors conclude "direct distillation from DeepSeek-R1 outperforms applying RL on it" [49]. | |
| 310 | + | |
| 311 | +The cost nobody headlines: the teacher's forward pass. Distilling a 124M student from a 27B teacher on every token costs the teacher's 2 x 27e9 = 54 GFLOP per token on top of the student's own 6 x 124e6 = 0.74 GFLOP, a total of 73.6x the student-only cost (calc:d23ee67d; my arithmetic). Online distillation from a large teacher is therefore far more expensive than the student's own training. It pays only if teacher outputs are computed once and reused (stored top-k probabilities), or the teacher is also small, as Gemma's 7B-to-2B test [48]. Gemma and R1 do not report the teacher cost in these comparisons. | |
| 312 | + | |
| 313 | +### 6.3 Model growth: train small, then grow | |
| 314 | + | |
| 315 | +- **Stacking Your Transformers (2024).** A depthwise stacking operator (train a shallow model, then copy its layers to make a deeper one and keep training): "compared to a conventionally trained 7B model using 300B tokens, our G_stack model converges to the same loss with 194B tokens, resulting in a 54.6% speedup" [50]. Tested up to 7B parameters after growth and 750B tokens [50]. Earlier progressive stacking for BERT (Gong et al., ICML 2019) is the origin of the idea; it appears in the reference list of [50]. | |
| 316 | +- **Sparse upcycling (Google, 2022).** Turn a trained dense model into an MoE by copying its feed-forward blocks into experts: upcycled T5 models "significantly outperform their dense counterparts ... using only ~50% of the initial dense pretraining sunk cost" and beat MoEs trained from scratch on the same budget [51]. | |
| 317 | +- **LLaMA Pro (2024).** Add new transformer blocks to a trained Llama2-7B (to 8.3B) and tune only the new blocks on code and maths, "without catastrophic forgetting" [52]. This is about adding skills cheaply, not about the first training run. | |
| 318 | + | |
| 319 | +Fit for us: stacking is the one with a clean measured saving at pretraining (35% fewer tokens to the same loss; 300 to 194 = 0.647 of the tokens, calc:b4855a42). It makes a staged plan natural: train a shallow 124M-class model quickly, grow it, continue. The 7B result is one lab on one setup; the effect at 100M scale is not shown in that paper [unverified at small scale]. | |
| 320 | + | |
| 321 | +### 6.4 Test-time compute instead of parameters | |
| 322 | + | |
| 323 | +- **Snell et al. (2024).** A smaller model given extra inference-time compute, spent adaptively per question, can "outperform a 14x larger model" in a FLOPs-matched comparison, but only "on problems where a smaller base model attains somewhat non-trivial success rates" [54]. Allocating the compute adaptively improved efficiency by more than 4x over best-of-N [54]. | |
| 324 | +- **s1 (2025).** 1,000 curated reasoning examples plus "budget forcing" (make the model keep thinking by appending "Wait") took Qwen2.5-32B-Instruct to beat o1-preview on competition maths by up to 27%, and extra thinking moved AIME24 from 50% to 57% [53]. | |
| 325 | +- o1 and R1 are the production versions of the same trade [49]. | |
| 326 | + | |
| 327 | +Fit for us: test-time compute multiplies decode cost, and decode is the memory-bound side of the GB10 (273 GB/s). It does not reduce the cost of the first model. It is a lever for after a base model exists. | |
| 328 | + | |
| 329 | +## 7. Optimizers and schedules | |
| 330 | + | |
| 331 | +An optimizer decides how to turn gradients into weight updates. AdamW is the long-time default. The claims below are speedups over a tuned AdamW in steps or compute to reach the same loss. | |
| 332 | + | |
| 333 | +| Method | What it does, in plain words | Claimed gain | Where measured | Source | | |
| 334 | +|---|---|---|---|---| | |
| 335 | +| Muon | Replaces each weight-matrix update with the nearest "evenly spread" matrix using a few small matrix multiplies; one momentum buffer; applied to hidden 2D weights only | 1.35x on the NanoGPT speedrun; 10 vs 13.3 8xH100-hours to a GPT-2-XL-level HellaSwag score at 1.5B parameters; FLOP overhead below 1% | 124M speedrun and 1.5B run, 8 H100 | [15] | | |
| 336 | +| Muon at scale (Moonshot) | Adds weight decay and a per-matrix update scale so Muon runs without retuning | "~2x computational efficiency compared to AdamW with compute optimal training"; Moonlight, a 3B/16B-parameter MoE trained on 5.7T tokens | scaling-law runs plus one large run, hardware not stated in the abstract | [60] | | |
| 337 | +| Muon, practical view | Muon keeps data efficiency at very large batch sizes and moves the compute-time Pareto frontier over AdamW | Shown at sizes up to 4B parameters; no single headline factor in the abstract | up to 4B parameters | [61] | | |
| 338 | +| Shampoo | Keeps a small preconditioning matrix per tensor dimension (a smarter, direction-aware step size) | "converging considerably faster than commonly used optimizers"; per-step cost comparable to SGD in the authors' words | 2018 vision and language models | [55] | | |
| 339 | +| SOAP | Runs Adam in Shampoo's rotated coordinate system | In the large-batch regime, over 40% fewer iterations and over 35% less wall-clock than AdamW, about 20% better than Shampoo | 360M and 660M-parameter language models | [56] | | |
| 340 | +| Sophia | Divides the gradient average by a cheap estimate of curvature, with clipping | "2x speed-up compared to Adam in the number of steps, total compute, and wall-clock time" | GPT models of 125M to 1.5B parameters | [57] | | |
| 341 | +| Lion | Uses only the sign of a momentum average; keeps one buffer instead of two | Up to 5x less pre-training compute on a vision model (JFT) and 2.3x on diffusion; "similar or better" than Adam on language modelling | mostly vision; language results modest | [58] | | |
| 342 | +| Warmup-Stable-Decay (WSD) schedule | Raise the learning rate, hold it flat, then decay in a short final stretch | Lets one run be extended or branched without restarting, and underlies MiniCPM's finding of a "much higher compute optimal data-model ratio than Chinchilla Optimal" | MiniCPM 1.2B and 2.4B | [59] | | |
| 343 | + | |
| 344 | +**Weighing the claims.** The vendor-side numbers are 2x (Moonshot, Sophia), 1.35x (Muon speedrun) and 35% to 40% (SOAP). The systematic comparison is "Fantastic Pretraining Optimizers" (2025): ten optimizers, four model sizes from 0.1B to 1.2B parameters, data from 1x to 8x the Chinchilla optimum, with each optimizer's hyperparameters tuned. Its findings: "the actual speedup of many proposed optimizers over well-tuned baselines is lower than claimed and decreases with model size to only 1.1x for 1.2B parameter models"; the fastest were matrix-based (Muon, SOAP), whose speedup falls "from 1.4x over AdamW for 0.1B parameter models to merely 1.1x for 1.2B parameter models" [62]. It also notes that rankings can flip between intermediate checkpoints and the end of training because of learning-rate decay [62]. I weight this paper most, because it tunes the baselines and tests across sizes, which most single-optimizer papers do not. It agrees with Muon's 1.35x on a 124M model (inside its 0.1B to 1.4x range) and disagrees with a flat "2x" at large scale. For a 100M to 400M-parameter run on a GB10, the credible expectation is a gain of about 1.2x to 1.4x in steps from a matrix optimizer, not 2x [62]. | |
| 345 | + | |
| 346 | +**Why this matters on the GB10 beyond speed.** Muon needs one momentum buffer where AdamW needs two [15][58], which shrinks the 16 bytes-per-parameter state of section 5 to the lean figure used there; and its extra work is a handful of small matrix multiplies that map straight onto tensor cores, with FLOP overhead below 1% by its author's estimate [15]. That is an optimizer shaped like the hardware. | |
| 347 | + | |
| 348 | +**Schedules.** The speedrun records changed the learning-rate schedule repeatedly: decay to 0.1 of peak not 0 (#19), cooldown fraction raised to 0.45 (#26), a batch-size schedule (#46) [13]. WSD is the same family of idea in a published, general form [59], and Cramming's one-cycle schedule did the equivalent for BERT [16]. | |
| 349 | + | |
| 350 | +## 8. The single-GPU record table, and the arithmetic for one GB10 | |
| 351 | + | |
| 352 | +### 8.1 Every published case found of a language model trained on one GPU or one small box | |
| 353 | + | |
| 354 | +"Small box" here means up to one 8-GPU server. Rows are in order of size. Hardware is named as the source names it. | |
| 355 | + | |
| 356 | +| Model | Size and data | Time | Hardware | Result | Source | | |
| 357 | +|---|---|---|---|---|---| | |
| 358 | +| nanoGPT Shakespeare-char | 6 layers, 384 wide, 256-character context; tiny text file | about 3 minutes | one A100 | best validation loss 1.4697 | [68] | | |
| 359 | +| TinyStories models | 1M to 35M parameters (some below 10M); synthetic children's stories | at most 30 hours | one V100 | fluent, consistent short stories | [17] | | |
| 360 | +| Crammed BERT | BERT-style text-understanding model, one day of training | 1 day | one RTX 2080 Ti | GLUE 78.3 (BERT-base fully trained: 80.9) | [16] | | |
| 361 | +| L20-Edu-135M | 134.5M parameters, about 13B tokens (10B FineWeb-Edu, then 3B of education, maths, code and reasoning text) | 10B tokens "about 72 GPU-hours", an implied 38,580 tokens per second (calc:425eb54f) | one NVIDIA L20 | mean 0.4150 on the authors' six-task test, 87.1% of SmolLM-135M's score on 2.17% of its tokens (the authors call this ratio descriptive, not a scaling law) | [66] | | |
| 362 | +| nanochat "d20" | 560,988,160 parameters, 11,219,763,200 tokens (20 per parameter), 21,400 steps of 524,288 tokens | 14,137.8 minutes = 235.63 hours = 9.8 days | **one DGX Spark (our chip)**, BF16, peak memory 74,841.77 MiB | finished; the poster calls the time "pretty much as expected" | [64] | | |
| 363 | +| nanochat d20, two Sparks | same model and data | "about 4.5 days (half the Training time on 1 DGX Spark)" | two DGX Sparks | logged 26,312 tokens/s | [65] | | |
| 364 | +| llm.c GPT-2 124M | 124M parameters, 10B FineWeb tokens | about 90 minutes, about $20 | one 8x A100 80GB SXM node | loss near 3.29 | [14] | | |
| 365 | +| llm.c GPT-2 350M | 350M parameters, about 30B tokens (60K steps) | 14 hours, about $200 | one 8x A100 80GB SXM node | Karpathy: 10B tokens "was not enough" for this size | [14] | | |
| 366 | +| phi-1 | 1.3B parameters, textbook-quality data | 4 days | 8 A100 | see section 3 | [18] | | |
| 367 | +| nanochat, GPT-2 capability | depth about 26 | "~2 hours" and $48 | one 8x H100 node; on one GPU "you'll have to wait 8 times longer" | beats GPT-2's CORE score of 0.256525 | [63] | | |
| 368 | +| modded-nanogpt record 92 | GPT-2 124M class | 0.665 minutes | 8 H100 | 3.28 FineWeb validation loss | [13] | | |
| 369 | + | |
| 370 | +For scale, not a small box: TinyLlama is a 1.1B model "pretrained on around 1 trillion tokens for approximately 3 epochs" on 16 A100-40G GPUs [67]. | |
| 371 | + | |
| 372 | +**What the table says.** Three things stand out. First, only one row is on the chip we own: a 561M-parameter model at the Chinchilla ratio took 9.8 days on one Spark [64]. Second, every row where the result is good (phi-1, L20-Edu-135M, nanochat, the speedrun) paired a small model with carefully chosen data or a carefully tuned recipe, never with scale. Third, nobody has published a training run of a 1B-parameter or larger model on a single GPU of this class. The largest single-GPU runs found are 134.5M [66] and 560.99M [64] parameters. | |
| 373 | + | |
| 374 | +### 8.2 The one real measurement on our chip, taken apart | |
| 375 | + | |
| 376 | +The nanochat Spark thread is the only first-hand training log on a GB10 that I found. Reading its log lines against the formulas of section 5: | |
| 377 | + | |
| 378 | +- The log line at step 14091 of 21400 reads: `dt: 39452.73ms | tok/sec: 1,661 | mfu: 4.69 | total time: 9315.06m` [64]. The step time and the total time agree: 9315.06 minutes over 14,091 steps is 39.66 seconds per step (calc:a8e6ac0a), and 21,400 steps at that pace is the reported 9.8 days (23,563/2,400 = 9.818 days from the reported 14,137.8 minutes, calc:e64ed6e8). | |
| 379 | +- The logged "tok/sec: 1,661" does **not** agree with the step time. A step of 524,288 tokens in 39.45 seconds is 13,289 tokens per second (calc:8c4efbd9), eight times the logged figure; the logged figure would imply a 315.6-second step (calc:498da040). The most likely reading is that the log counts one of eight slices of the batch (the setup used "batch 32 per device"), but I did not confirm that from the code. I use the step time, which the total time confirms, and treat the tok/sec field as unreliable. | |
| 380 | +- The training FLOPs per token by the standard rule: 6 x 560,988,160 = 3.366e9 (calc:f91d84fa). At 13,289 tokens per second that is **44.7 TFLOPS** achieved (calc:6bcb01a3). Against the **measured BF16 best case of 99.8 TFLOPS** [6] that is **44.8%** (calc:c1b70201). Against the 207.7 TFLOPS FP8 figure it is 21.5% (calc:dbd3d767), but that comparison mixes number formats: the run was BF16. | |
| 381 | +- The log's own "mfu: 4.69" field is not used here: I did not verify which peak the code measures it against. | |
| 382 | +- Cost of attention, which the 6N rule leaves out, is also not counted. So 44.7 TFLOPS is a floor on the work done. | |
| 383 | + | |
| 384 | +**Reading.** A tuned PyTorch-based BF16 run on a GB10 reached about 45% of the chip's measured BF16 ceiling. Llama 3 405B reached 38% to 43% on H100s [12], and FlashAttention-2's best single-kernel figure is 72% on an A100 [33]. So the stock software is not far from what the large labs get, on a per-chip basis. The headroom for our own kernels is therefore real but bounded: the gap from 44.8% to 72% is a factor of 1.61 in time at the very most (calc:3ebf0923), and a lot of the rest of any speedup must come from lower precision (FP8 doubles the measured ceiling to 207.7 [6]) and from the algorithmic items in sections 2, 6 and 7, not from kernels alone. | |
| 385 | + | |
| 386 | +### 8.3 Chinchilla-optimal training on one GB10: the arithmetic | |
| 387 | + | |
| 388 | +Rules used. D (tokens) = 20 x N (parameters), the Chinchilla ratio [8]. Training FLOPs F = 6 x N x D, the standard count [7][8]. The peak is 207.7 TFLOPS, the measured FP8 best case [6] (section 0 explains why it is not a vendor figure). Utilization fractions are applied to that peak: | |
| 389 | + | |
| 390 | +- **25%** is the number the single-Spark log supports: 44.7 TFLOPS in BF16 [64] is 21.5% of 207.7 (calc:dbd3d767), and 25% of 207.7 is 51.9 TFLOPS. Reaching it in FP8 requires FP8 kernels as good as the BF16 ones in that run. | |
| 391 | +- **40%** is what the best large-cluster practice reports: Llama 3 405B at 38% to 43% BF16 MFU on H100s [12]. | |
| 392 | +- **55%** is an optimistic ceiling taken from the best published whole-model figure, 54.2% on a 530B model on 2,240 A100s [39]. The 72% FlashAttention-2 figure [33] is an attention kernel alone and is not used for whole runs. | |
| 393 | + | |
| 394 | +The memory-traffic floors use the model of section 5.2: weight and optimizer state, 23 bytes per parameter moved once per 524,288-token step; activations written once and read once at 2 x 34 x h x L bytes per token with everything stored, or 2 x 2 x h x L bytes per token if each layer's input is kept and the rest is recomputed [39]; 273 GB/s [1][2]. Shapes are the nearest GPT-3 shapes [44]; the 50M shape (8 layers, width 512) is my choice. The script and its output are in `evidence/efficiency/chinchilla-table.sh` and `.out`. | |
| 395 | + | |
| 396 | +| Params N | Tokens D | FLOPs 6ND | Hours at 25% | Hours at 40% | Hours at 55% | State traffic floor (hours) | Activation traffic floor, store all (hours) | Activation traffic floor, recompute (hours) | | |
| 397 | +|---|---|---|---|---|---|---|---|---| | |
| 398 | +| 50M (L8, h512) | 1B | 3e17 (calc:b10a7d67) | 1.605 (calc:f3dd4c66) | 1.003 (calc:98093a7a) | 0.7295 (calc:5ab83c00) | 0.0022 | 0.283 | 0.0167 | | |
| 399 | +| 125M (L12, h768) | 2.5B | 1.875e18 (calc:1a522589) | 10.03 (calc:5e55f5f4) | 6.269 (calc:0b0a93f9) | 4.559 (calc:bcdb6271) | 0.0140 | 1.594 | 0.0938 | | |
| 400 | +| 350M (L24, h1024) | 7B | 1.47e19 (calc:4a415f9c) | 78.64 (calc:8b860115) | 49.15 (calc:f14fd9b7) | 35.75 (calc:76ba87b1) | 0.109 | 11.9 | 0.700 | | |
| 401 | +| 1B (L24, h2048) | 20B | 1.2e20 (calc:5e75af43) | 642 (calc:11c7f96f) | 401.2 (calc:3d50e5b6) | 291.8 (calc:b421eaf0) | 0.893 | 68.0 | 4.00 | | |
| 402 | +| 3B (L32, h2560) | 60B | 1.08e21 (calc:90f5fdd9) | 5,778 (calc:606e123b) | 3,611 (calc:181871eb) | 2,626 (calc:c7ed0321) | 8.04 | 340 | 20.0 | | |
| 403 | + | |
| 404 | +In days at 40%: 350M is 2.048 days (calc:25db6cb7), 1B is 16.72 days (calc:78e0d5a4) and 3B is 150.5 days (calc:dc3466fa). The traffic floor columns were computed by the evidence script, not by individual calc calls, and rest on the model of section 5.2. | |
| 405 | + | |
| 406 | +**Cross-check against the measured run.** The nanochat d20 model is 560,988,160 parameters on 11,219,763,200 tokens: 6ND = 3.78e19 FLOPs (calc:49c23628). At 25% of 207.7 TFLOPS that is 8.418 days (calc:865fd166), against the 9.8 days measured in BF16 [64]. The table's 25% column is therefore slightly optimistic against the one real data point: the measured time is 1.166 times the prediction (9.818 / 8.418, calc:71c56dc1). Part of the gap is attention, which 6ND leaves out. | |
| 407 | + | |
| 408 | +**What the table answers.** | |
| 409 | +1. The activation traffic floors are below the math time for every row: 28% of the 40%-utilization math time at 50M, falling to 9% at 3B. Weight and optimizer traffic is under 1% everywhere. At these batch sizes the chip is math-limited on paper, so the 273 GB/s wall does not bind **if** compute and memory movement overlap perfectly, which real kernels do not fully achieve. The floors do mean that the small end is closest to the wall, matching section 5.2, and that the recompute option, whose activation traffic is 2/34 = 1/17 of the store-all figure (calc:25920375), buys back most of the slack. | |
| 410 | +2. Capacity, not speed, is the constraint the traffic table hides. Holding every activation for a 524,288-token step is not possible at any row; kernels must process the batch in small pieces and accumulate gradients. At 16 bytes per parameter the state of a 3B model is 48 GB (3e9 x 16), inside the 128 GB memory [1]; the 1B model needs 16 GB. | |
| 411 | +3. **Verdict from the literature.** A 125M model at the Chinchilla ratio is an overnight run (10 hours at 25%, 4.6 hours at 55%). A 350M model is a few days. A 1B model is 17 days at 40% and a 3B model is about 5 months, so 3B is out of reach at the Chinchilla ratio and 1B is reachable only if the whole stack runs at 40% of the FP8 peak, which no one has shown on this chip. These times are for D = 20N; the over-training practice of section 1 multiplies them. The best-evidence target for a first full run on one GB10 is therefore a 125M to 350M parameter model, trained with the speedrun recipe of section 2, whose reference time on 8 H100 is 0.665 minutes [13]. | |
| 412 | +4. These are literature numbers. The L279 stream replaces the 207.7 TFLOPS and 273 GB/s inputs with measured ones. | |
| 413 | + | |
| 414 | +## 9. Lessons table | |
| 415 | + | |
| 416 | +Each row: the lesson, the evidence in this chapter, and what we build in Omega to use it. No framework ships; where the evidence names a library, the last column names the kernel that library contains that we would write ourselves. | |
| 417 | + | |
| 418 | +| # | Lesson | Evidence | What we build in Omega | | |
| 419 | +|---|---|---|---| | |
| 420 | +| 1 | Train a small model on far more than 20 tokens per parameter if you will run it many times | Meta trained smaller Llama 3 models "for much longer than is compute-optimal" [12]; Chinchilla sets the cheapest-to-a-loss ratio at 20 [8] | A budget planner that takes a model size and a token count and prints FLOPs, hours and memory traffic from the formulas of section 8, so every run starts from a stated cost | | |
| 421 | +| 2 | Repeating clean data up to about 4 times costs almost nothing | Muennighoff et al.: up to 4 epochs "negligible changes to loss" [11] | A token-file reader that cycles a packed data set with a fixed epoch count; no new data format needed | | |
| 422 | +| 3 | The Muon optimizer is the best-measured cheap gain, but its edge shrinks with model size | 1.26x at record 3 of the speedrun [13][15]; about 2x claimed by Moonshot [60]; the independent comparison finds the speedup falls as models grow [62] | A fused Newton-Schulz kernel (five small matrix multiplies per weight matrix, kept in on-chip memory) and a one-buffer optimizer state; measure against AdamW at 125M before trusting any larger claim | | |
| 423 | +| 4 | A bundle of small architecture changes gave 1.47x in one record | QK-norm, ReLU squared, zero-initialised projections, padded embeddings (record 5) [13] | One fused kernel per transformer block sublayer implementing exactly that bundle, so none of the changes costs an extra memory pass | | |
| 424 | +| 5 | Short attention windows with a few long layers beat full attention at equal quality | FlexAttention with 64K windows, record 12, 1.43x [13] | A sliding-window attention kernel with a per-layer window length, tiled to the GB10's 100 KB of shared memory per SM [4] | | |
| 425 | +| 6 | Cheap extra embeddings and skip connections buy loss for almost no FLOPs | Value embeddings and U-net skips (records 11, 14, 15, 17) [13] | A gather-and-mix kernel that adds the value embedding inside the attention kernel, and skip adds fused into the neighbouring layer | | |
| 426 | +| 7 | Never write the full-vocabulary logits table to memory | Logits are 32% of the activation traffic of a 124M model (calc:251e3a5f); speedrun records 60, 75, 79 fused the loss [13] | A fused output-layer-plus-cross-entropy kernel that computes logits tile by tile and keeps only the loss and its gradient | | |
| 427 | +| 8 | Keep attention scores on the chip | FlashAttention: 3x on GPT-2 at 1K tokens on A100 [32]; 72% utilization in version 2 [33] | A tiled attention forward and backward kernel for the GB10 that holds scores in registers and shared memory; Hopper-only features of version 3 [34] need a GB10 check first | | |
| 428 | +| 9 | Recompute the bulky cheap parts instead of storing them | Selective recompute: 54.2% MFU against 42.1% with full recompute, 29% faster, on 530B [39]; storing layer inputs only cuts activation traffic to 1/17 (calc:25920375) | A backward pass that stores one tensor per layer and re-runs the cheap operations inside the same kernel, with a switch to compare against store-all | | |
| 429 | +| 10 | FP8 matrix multiplies are proven at scale and run 2.08 times faster than BF16 on this chip (measured) | DeepSeek-V3 [26]; FP8 formats [28]; chip ratio (calc:5d6e8d19) [6] | An E4M3 forward and E5M2 or E4M3 backward matrix multiply with per-block scales and FP32 accumulation, written against the tensor-core instructions directly | | |
| 430 | +| 11 | State bytes per parameter decide what fits and what moves | 16 bytes for standard Adam [37]; DeepSeek keeps BF16 moments [26]; Muon needs one buffer [15] | A parameter layout of about 7 bytes per parameter (BF16 master weights and gradients, one BF16 momentum, one FP8 copy), with a test that it matches an FP32 oracle on small runs | | |
| 431 | +| 12 | 4-bit training works but only with a four-part recipe; do it after FP8 is solid | NVFP4 on 12B parameters and 10T tokens [27]; one forum user's 356 TFLOPS FP4 kernel [31] | A later-stage kernel family: Hadamard-transform, two-dimensional block scaling and stochastic rounding, with sensitive layers kept at higher precision | | |
| 432 | +| 13 | Ternary weights help serving, not training | BitNet reports inference latency and memory only [30] | Nothing for training. Revisit for the serving path only | | |
| 433 | +| 14 | Quality filtering of data is worth a factor of several in tokens | FineWeb-Edu about 10x fewer tokens for equal MMLU [22]; DCLM 6.6x less compute [23] | Our own small quality scorer and a filter pass over the raw text, with its compute cost (FineWeb-Edu's was 6,000 H100-hours [22]) written down | | |
| 434 | +| 15 | Textbook and synthetic data are distillation in disguise | phi-1: 768 A100-hours on a 1.3B model [18]; the teacher's cost is not counted | A data-generation job that logs the teacher's token count, so total cost is honest | | |
| 435 | +| 16 | Do not build a curriculum | BabyLM: ordering data easy to hard "was largely unsuccessful" [21] | Nothing. Shuffle | | |
| 436 | +| 17 | Distillation lets a student copy a teacher, at the price of running the teacher | MiniLM [47]; Gemma 2 [48]; the teacher forward is 73.6x the student's own cost in the section 6.2 example | A loss kernel that matches the student's output distribution to stored teacher outputs, computed tile by tile like lesson 7; teacher outputs precomputed once and stored | | |
| 437 | +| 18 | Mixture of experts saves FLOPs but not memory; wrong tool at 125M to 350M on one box | Switch and DeepSeekMoE save FLOPs [45][46]; every expert's state is still stored | Defer. Dense models only until the dense path hits its ceiling | | |
| 438 | +| 19 | Growing a model from shallow to deep saved 35% of tokens in one 7B-scale test | Stacking: 300B tokens down to 194B 194/300 = 0.647, calc:b4855a42) [50] | A growth operator that copies layers and rebuilds optimizer state, plus a schedule; verify on 125M before believing the 7B result | | |
| 439 | +| 20 | Keep the learning rate flat and decay late | WSD [59]; speedrun cooldown records [13] | A schedule table (warmup, flat, cooldown fraction) read by the optimizer kernel as three scalars | | |
| 440 | +| 21 | On one GPU, accumulate gradients and ramp the batch size | Cramming [16]; speedrun batch schedule (record 46) [13] | A gradient-accumulation loop inside the step kernel sequence with a batch-size ramp parameter | | |
| 441 | +| 22 | Launch overhead and bubbles are real; whole-step graphs and persistent kernels remove them, but only inference megakernels are published | Whole-step CUDA graph in the speedrun [13]; Llama-1B megakernel at 78% of bandwidth [35]; MPK [36] | Omega already owns the launch path: submit the whole training step as one chain, then try a persistent training kernel, which would be new ground | | |
| 442 | +| 23 | Gradient exchange between GPUs is irrelevant on one chip | Speedrun all-reduce records only matter with 8 GPUs [13]; ZeRO saves nothing at one device [37] | Nothing. Skip | | |
| 443 | +| 24 | More thinking at answer time lifts a small model only where it already has some skill | Snell [54]; s1 [53] | A decode path with a thinking-budget control, after a base model exists; decode is bandwidth-bound at 273 GB/s | | |
| 444 | +| 25 | Report utilization against a measured ceiling | The one Spark training log reached 44.8% of measured BF16 peak (calc:c1b70201) [64][6] | A per-kernel counter pair (FLOPs done, bytes moved) printed beside the measured ceilings, so each kernel says how far it is from the wall | | |
| 445 | +| 26 | The 207.7 TFLOPS FP8 figure is a reviewer's measurement, not a vendor spec | [6]; NVIDIA states only 1 PFLOP FP4 with sparsity [1][2] | A microbenchmark in Omega that measures our own matrix-multiply ceilings; L279 owns it | | |
| 446 | +| 27 | Only a few million parameters fit on the math cores; the achievable goal is touching main memory once per tensor | 42 MiB on chip (calc:582423cc) holds 2.75M to 6.29M parameters of training state; Cerebras streams weights for large models too [41] | Layer-fused kernels that load a weight tile once, run all of its uses (forward, backward, update) and write it back once | | |
| 447 | +| 28 | A 125M to 350M model at the Chinchilla ratio is the realistic first target on one GB10 | Section 8: 10 hours at 25% for 125M; 2.05 days at 40% for 350M; one measured run took 9.8 days for 561M [64] | The first full run: the speedrun recipe at 125M, end to end through Omega, compared against the 3.28 loss target [13] | | |
| 448 | + | |
| 449 | +## Sources | |
| 450 | + | |
| 451 | +Each entry: number, URL, title, date, then the sentence copied from the page that supports the claim. Pages were fetched on 2026-10-20 (curl, WebFetch or WebSearch). Key quotes were re-checked against the raw page by text search. | |
| 452 | + | |
| 453 | +[1] https://www.nvidia.com/en-us/products/workstations/dgx-spark/, NVIDIA DGX Spark product page, 2026-10-20. "Memory Interface 256-bit Memory Bandwidth 273 GB/s ... Experience up to 1 petaFLOP of AI performance at FP4 precision with the NVIDIA Grace Blackwell architecture." | |
| 454 | + | |
| 455 | +[2] https://docs.nvidia.com/dgx/dgx-spark/hardware.html, DGX Spark User Guide: Hardware, 2026-10-20. "CUDA Cores: 6,144 Copy Engines: 2 ... Memory Bandwidth: 273 GB/s Memory Channels: 16 channels (256 bit) LPDDR5X 8533 ... up to 1 PFLOP (petaFLOP) at FP4 precision with sparsity" | |
| 456 | + | |
| 457 | +[3] https://www.hc2025.hotchips.org/assets/program/conference/day2/21_nvidia_skende_final.pdf, NVIDIA GB10 SoC, Hot Chips 2025 slides, 2025-08. "Large graphics L2 (GL2) • 24MB, provides GPU compute units with large local bandwidth" | |
| 458 | + | |
| 459 | +[4] https://docs.nvidia.com/cuda/cuda-programming-guide/05-appendices/compute-capabilities.html, CUDA Programming Guide, Appendix: Compute Capabilities, 2026-10-20. "Number of 32-bit registers per SM 64 K ... 12.x 128 0, 8, 16, 32, 64, 100" | |
| 460 | + | |
| 461 | +[5] https://geizhals.de/lenovo-thinkstation-pgx-dgx-spark-30kl0073gf-a3959977.html, Geizhals listing, Lenovo ThinkStation PGX (DGX Spark), 2026-10-20. "48SM/6144SP/384TMU/48ROP ... 192 Tensor-Cores (5th Gen)" | |
| 462 | + | |
| 463 | +[6] https://www.storagereview.com/review/nvidia-dgx-spark-review-the-ai-appliance-bringing-datacenter-capabilities-to-desktops, NVIDIA DGX Spark review, StorageReview, 2026-10-20. "At BF16 precision, we observe a MAMF of 99.8 TFLOPs, while FP8 (E4M3) demonstrates a MAMF of 207.7 TFLOPs." | |
| 464 | + | |
| 465 | +[7] https://arxiv.org/abs/2001.08361, Scaling Laws for Neural Language Models (Kaplan et al.), 2020-01-23. "Larger models are significantly more sample-efficient, such that optimally compute-efficient training involves training very large models on a relatively modest amount of data and stopping significantly before convergence." | |
| 466 | + | |
| 467 | +[8] https://arxiv.org/abs/2203.15556, Training Compute-Optimal Large Language Models (Hoffmann et al., Chinchilla), 2022-03-29. "for compute-optimal training, the model size and the number of training tokens should be scaled equally: for every doubling of model size the number of training tokens should also be doubled." | |
| 468 | + | |
| 469 | +[9] https://ai.meta.com/blog/meta-llama-3/, Introducing Meta Llama 3, 2026-10-20. "the Chinchilla-optimal amount of training compute for an 8B parameter model corresponds to ~200B tokens, ... we found that model performance continues to improve even after the model is trained on two orders of magnitude more data." | |
| 470 | + | |
| 471 | +[10] https://arxiv.org/abs/2302.13971, LLaMA: Open and Efficient Foundation Language Models, 2023-02-27. "LLaMA-13B outperforms GPT-3 (175B) on most benchmarks" | |
| 472 | + | |
| 473 | +[11] https://arxiv.org/abs/2305.16264, Scaling Data-Constrained Language Models (Muennighoff et al.), 2023-05-25. "training with up to 4 epochs of repeated data yields negligible changes to loss compared to having unique data. However, with more repetition, the value of adding compute eventually decays to zero." | |
| 474 | + | |
| 475 | +[12] https://arxiv.org/abs/2407.21783, The Llama 3 Herd of Models, 2024-07-31. "While our scaling laws suggest our flagship model is an approximately compute-optimal size for our training budget, we also train our smaller models for much longer than is compute-optimal. ... we achieve an overall BF16 Model FLOPs Utilization (MFU; Chowdhery et al. (2023)) of 38-43% for the configurations shown in Table 4." | |
| 476 | + | |
| 477 | +[13] https://raw.githubusercontent.com/KellerJordan/modded-nanogpt/master/README.md, modded-nanogpt README (record tables), 2026-10-20. "This repository hosts the *NanoGPT speedrun*, in which we (collaboratively|competitively) search for the fastest algorithm to use 8 NVIDIA H100 GPUs to train a language model that attains 3.28 cross-entropy loss on the FineWeb validation set." | |
| 478 | + | |
| 479 | +[14] https://github.com/karpathy/llm.c/discussions/481, llm.c discussion 481: reproducing GPT-2 (124M), 2026-10-20. "reproducing this model on one 8X A100 80GB SXM node takes ~90 minutes ... -d 524288 requests that the total batch size per single update be ~0.5M tokens ... On 8X A100 80GB SXM the 350M stepped at 820ms/iter. Trained for 60K steps (instead of ~20K), for a total of ~30B tokens (instead of ~10B tokens). Total training time 14 hours." | |
| 480 | + | |
| 481 | +[15] https://kellerjordan.github.io/posts/muon/, Muon: An optimizer for hidden layers in neural networks (Keller Jordan), 2026-10-20. "Muon has a FLOP overhead below 1%" | |
| 482 | + | |
| 483 | +[16] https://arxiv.org/abs/2212.14034, Cramming: Training a Language Model on a Single GPU in One Day, 2022-12-28. "How far can we get with a single GPU in just one day?" | |
| 484 | + | |
| 485 | +[17] https://arxiv.org/abs/2305.07759, TinyStories: How Small Can Language Models Be and Still Speak Coherent English?, 2023-05-12. "We show that TinyStories can be used to train and evaluate LMs that are much smaller than the state-of-the-art models (below 10 million total parameters), or have much simpler architectures (with only one transformer block), yet still produce fluent and consistent stories" | |
| 486 | + | |
| 487 | +[18] https://arxiv.org/abs/2306.11644, Textbooks Are All You Need (phi-1), 2023-06-20. "phi-1 is a Transformer-based model with 1.3B parameters, trained for 4 days on 8 A100s" | |
| 488 | + | |
| 489 | +[19] https://github.com/alexjc/nanogpt-speedrun, alexjc/nanogpt-speedrun (fork of modded-nanogpt), 2026-10-20. "4.7 minutes on 8xH100 instead of 45" | |
| 490 | + | |
| 491 | +[20] https://www.microsoft.com/en-us/research/blog/phi-2-the-surprising-power-of-small-language-models/, Phi-2: The surprising power of small language models (Microsoft Research), 2023-12-12. "The training for Phi-2 took 14 days on 96 A100 GPUs" | |
| 492 | + | |
| 493 | +[21] https://arxiv.org/abs/2504.08165, Findings of the BabyLM Challenge: Sample-Efficient Pretraining on Developmentally Plausible Corpora, 2025-04-10. "The winning submissions using the LTG-BERT architecture (Samuel et al., 2023) outperformed models trained on trillions of words." | |
| 494 | + | |
| 495 | +[22] https://arxiv.org/abs/2406.17557, The FineWeb Datasets: Decanting the Web for the Finest Text Data at Scale, 2024-06-25. "On MMLU, FineWeb-Edu can match the final performance of Matrix with almost 10x fewer tokens" | |
| 496 | + | |
| 497 | +[23] https://arxiv.org/abs/2406.11794, DataComp-LM: In search of the next generation of training sets for language models, 2024-06-17. "Our baseline model is also comparable to Mistral-7B-v0.3 and Llama 3 8B on MMLU (63% & 66%), and performs similarly on an average of 53 natural language understanding tasks while being trained with 6.6× less compute than Llama 3 8B." | |
| 498 | + | |
| 499 | +[24] https://arxiv.org/abs/2501.00656, 2 OLMo 2 Furious, 2024-12-31. "Our OLMo 2 base models sit at the Pareto frontier of performance to training compute, often matching or outperforming open-weight only models like Llama 3.1, Qwen 2.5, and Gemma 2 while using fewer FLOPs" | |
| 500 | + | |
| 501 | +[25] https://arxiv.org/abs/2402.00159, Dolma: an Open Corpus of Three Trillion Tokens for Language Model Pretraining Research, 2024-01-31. "we curate and release Dolma, a three-trillion-token English corpus, built from a diverse mixture of web content, scientific papers, code, public-domain books, social media, and encyclopedic materials." | |
| 502 | + | |
| 503 | +[26] https://arxiv.org/abs/2412.19437, DeepSeek-V3 Technical Report, 2024-12-27. "compared with the BF16 baseline, the relative loss error of our FP8-training model remains consistently below 0.25%, a level well within the acceptable range of training randomness. ... DeepSeek-V3, a strong Mixture-of-Experts (MoE) language model with 671B total parameters with 37B activated for each token." | |
| 504 | + | |
| 505 | +[27] https://arxiv.org/abs/2509.25149, Pretraining Large Language Models with NVFP4, 2025-09-29. "We validate our approach by training a 12-billion-parameter model on 10 trillion tokens -- the longest publicly documented training run in 4-bit precision to date." | |
| 506 | + | |
| 507 | +[28] https://arxiv.org/abs/2209.05433, FP8 Formats for Deep Learning, 2022-09-12. "we propose an 8-bit floating point (FP8) binary interchange format consisting of two encodings - E4M3 (4-bit exponent and 3-bit mantissa) and E5M2 (5-bit exponent and 2-bit mantissa)." | |
| 508 | + | |
| 509 | +[29] https://arxiv.org/abs/2310.18313, FP8-LM: Training FP8 Large Language Models, 2023-10-27. "during the training of GPT-175B model on H100 GPU platform, our FP8 mixed-precision training framework not only achieved a remarkable 39% reduction in real memory usage but also ran 75% faster than the widely adopted BF16 framework (i.e., Megatron-LM)" | |
| 510 | + | |
| 511 | +[30] https://arxiv.org/abs/2402.17764, The Era of 1-bit LLMs: All Large Language Models are in 1.58 Bits (BitNet b1.58), 2024-02-27. "every single parameter (or weight) of the LLM is ternary {-1, 0, 1}. It matches the full-precision (i.e., FP16 or BF16) Transformer LLM with the same model size and training tokens in terms of both perplexity and end-task performance" | |
| 512 | + | |
| 513 | +[31] https://forums.developer.nvidia.com/t/fp4-on-dgx-spark-why-it-doesnt-scale-like-youd-expect/360142, FP4 on DGX Spark: why it doesn't scale like you'd expect (NVIDIA Developer Forums), 2026-10-20. "Die Tensor Cores sind leistungsfaehig (356 TFLOPS NVFP4, 188 TFLOPS FP8) aber architekturbedingt verschieden von SM100" | |
| 514 | + | |
| 515 | +[32] https://arxiv.org/abs/2205.14135, FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness, 2022-05-27. "FlashAttention, an IO-aware exact attention algorithm that uses tiling to reduce the number of memory reads/writes between GPU high bandwidth memory (HBM) and GPU on-chip SRAM. ... 15% end-to-end wall-clock speedup on BERT-large (seq. length 512) compared to the MLPerf 1.1 training speed record" | |
| 516 | + | |
| 517 | +[33] https://arxiv.org/abs/2307.08691, FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning, 2023-07-17. "FlashAttention-2 reaches training speed of up to 225 TFLOPs/s per A100 GPU (72% model FLOPs utilization)." | |
| 518 | + | |
| 519 | +[34] https://arxiv.org/abs/2407.08608, FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision, 2024-07-11. "achieves speedup on H100 GPUs by 1.5-2.0× with FP16 reaching up to 740 TFLOPs/s (75% utilization), and with FP8 reaching close to 1.2 PFLOPs/s." | |
| 520 | + | |
| 521 | +[35] https://hazyresearch.stanford.edu/blog/2025-05-27-no-bubbles, Look Ma, No Bubbles! Designing a Low-Latency Megakernel for Llama-1B (Hazy Research), 2025-05-27. "on an H100, we use 78% of memory bandwidth and outperform existing systems by over 1.5x." | |
| 522 | + | |
| 523 | +[36] https://arxiv.org/abs/2512.22219, MPK: A Compiler and Runtime for Mega-Kernelizing Tensor Programs (Mirage Persistent Kernel), 2025-12-22. "achieving up to 1.7× lower end-to-end inference latency and pushing LLM inference performance close to the limits of the underlying hardware" | |
| 524 | + | |
| 525 | +[37] https://arxiv.org/abs/1910.02054, ZeRO: Memory Optimizations Toward Training Trillion Parameter Models, 2019-10-04. "Mixed-precision Adam has K = 12. In total, this results in 2Ψ + 2Ψ + KΨ = 16Ψ bytes" | |
| 526 | + | |
| 527 | +[38] https://arxiv.org/abs/1604.06174, Training Deep Nets with Sublinear Memory Cost, 2016-04-21. "we can reduce the memory cost of a 1,000-layer deep residual network from 48G to 7G with only 30 percent additional running time cost on ImageNet problems" | |
| 528 | + | |
| 529 | +[39] https://arxiv.org/abs/2205.05198, Reducing Activation Recomputation in Large Transformer Models, 2022-05-10. "Activations memory per layer = sbh(34 + 5as/h)" | |
| 530 | + | |
| 531 | +[40] https://arxiv.org/abs/2410.10989, Liger Kernel: Efficient Triton Kernels for LLM Training, 2024-10-14. "our kernels achieve on average a 20% increase in training throughput and a 60% reduction in GPU memory usage for popular LLMs compared to HuggingFace implementations" | |
| 532 | + | |
| 533 | +[41] https://arxiv.org/abs/2503.11698, A Comparison of the Cerebras Wafer-Scale Integration Technology with Nvidia GPU-based Systems for Artificial Intelligence, 2025-03-11. "integrates 4 trillion transistors, 900,000 AI-optimized cores, and 44 GB of on-chip SRAM. It achieves a peak computing performance of 125 petaflops and a memory bandwidth of 21 petabytes per second." | |
| 534 | + | |
| 535 | +[42] https://arxiv.org/abs/2301.13637, Tricking AI chips into Simulating the Human Brain: A Detailed Performance Analysis (GroqChip section), 2023-01-31. "The memory modules add up to a total of 220 MiB of on-chip SRAM." | |
| 536 | + | |
| 537 | +[43] https://arxiv.org/abs/2304.03208, Cerebras-GPT: Open Compute-Optimal Language Models Trained on the Cerebras Wafer-Scale Cluster, 2023-04-06. "Cerebras-GPT, a family of open compute-optimal language models scaled from 111M to 13B parameters." | |
| 538 | + | |
| 539 | +[44] https://arxiv.org/abs/2005.14165, Language Models are Few-Shot Learners (GPT-3), model table, 2020-05-28. "GPT-3 Small 125M 12 768 12 64 0.5M 6.0 × 10−4 ... GPT-3 XL 1.3B 24 2048 24 128 1M 2.0 × 10−4" | |
| 540 | + | |
| 541 | +[45] https://arxiv.org/abs/2101.03961, Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity, 2021-01-11. "We design models based off T5-Base and T5-Large to obtain up to 7x increases in pre-training speed with the same computational resources." | |
| 542 | + | |
| 543 | +[46] https://arxiv.org/abs/2401.06066, DeepSeekMoE: Towards Ultimate Expert Specialization in Mixture-of-Experts Language Models, 2024-01-11. "we scale up DeepSeekMoE to 16B parameters and show that it achieves comparable performance with LLaMA2 7B, with only about 40% of computations." | |
| 544 | + | |
| 545 | +[47] https://arxiv.org/abs/2002.10957, MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformers, 2020-02-25. "it retains more than 99% accuracy on SQuAD 2.0 and several GLUE benchmark tasks using 50% of the Transformer parameters and computations of the teacher model." | |
| 546 | + | |
| 547 | +[48] https://arxiv.org/abs/2408.00118, Gemma 2: Improving Open Language Models at a Practical Size, 2024-07-31. "We also train the 2B and 9B models with knowledge distillation (Hinton et al., 2015) instead of next token prediction. The resulting models deliver the best performance for their size, and even offer competitive alternatives to models that are 2-3 times bigger." | |
| 548 | + | |
| 549 | +[49] https://arxiv.org/abs/2501.12948, DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning, 2025-01-22. "DeepSeek-R1-Distill-Qwen-7B achieves 55.5% on AIME 2024, surpassing QwQ-32B-Preview." | |
| 550 | + | |
| 551 | +[50] https://arxiv.org/abs/2405.15319, Stacking Your Transformers: A Closer Look at Model Growth for Efficient LLM Pre-Training, 2024-05-24. "compared to a conventionally trained 7B model using 300B tokens, our G_stack model converges to the same loss with 194B tokens, resulting in a 54.6% speedup." | |
| 552 | + | |
| 553 | +[51] https://arxiv.org/abs/2212.05055, Sparse Upcycling: Training Mixture-of-Experts from Dense Checkpoints, 2022-12-09. "significantly outperform their dense counterparts on SuperGLUE and ImageNet, using only ~50% of the initial dense pretraining sunk cost." | |
| 554 | + | |
| 555 | +[52] https://arxiv.org/abs/2401.02415, LLaMA Pro: Progressive LLaMA with Block Expansion, 2024-01-04. "We tune the expanded blocks using only new corpus, efficiently and effectively improving the model's knowledge without catastrophic forgetting." | |
| 556 | + | |
| 557 | +[53] https://arxiv.org/abs/2501.19393, s1: Simple test-time scaling, 2025-01-31. "our model s1-32B exceeds o1-preview on competition math questions by up to 27% (MATH and AIME24). Further, scaling s1-32B with budget forcing allows extrapolating beyond its performance without test-time intervention: from 50% to 57% on AIME24." | |
| 558 | + | |
| 559 | +[54] https://arxiv.org/abs/2408.03314, Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters, 2024-08-06. "in a FLOPs-matched evaluation, we find that on problems where a smaller base model attains somewhat non-trivial success rates, test-time compute can be used to outperform a 14x larger model." | |
| 560 | + | |
| 561 | +[55] https://arxiv.org/abs/1802.09568, Shampoo: Preconditioned Stochastic Tensor Optimization, 2018-02-26. "Our experiments with state-of-the-art deep learning models show that Shampoo is capable of converging considerably faster than commonly used optimizers." | |
| 562 | + | |
| 563 | +[56] https://arxiv.org/abs/2409.11321, SOAP: Improving and Stabilizing Shampoo using Adam, 2024-09-17. "In the large batch regime, SOAP reduces the number of iterations by over 40% and wall clock time by over 35% compared to AdamW, with approximately 20% improvements in both metrics compared to Shampoo." | |
| 564 | + | |
| 565 | +[57] https://arxiv.org/abs/2305.14342, Sophia: A Scalable Stochastic Second-order Optimizer for Language Model Pre-training, 2023-05-23. "On language modeling with GPT models of sizes ranging from 125M to 1.5B, Sophia achieves a 2x speed-up compared to Adam in the number of steps, total compute, and wall-clock time" | |
| 566 | + | |
| 567 | +[58] https://arxiv.org/abs/2302.06675, Symbolic Discovery of Optimization Algorithms (Lion), 2023-02-13. "It is more memory-efficient than Adam as it only keeps track of the momentum." | |
| 568 | + | |
| 569 | +[59] https://arxiv.org/abs/2404.06395, MiniCPM: Unveiling the Potential of Small Language Models with Scalable Training Strategies, 2024-04-09. "we introduce a Warmup-Stable-Decay (WSD) learning rate scheduler (LRS), conducive to continuous training and domain adaptation." | |
| 570 | + | |
| 571 | +[60] https://arxiv.org/abs/2502.16982, Muon is Scalable for LLM Training, 2025-02-24. "Scaling law experiments indicate that Muon achieves ~2× computational efficiency compared to AdamW with compute optimal training." | |
| 572 | + | |
| 573 | +[61] https://arxiv.org/abs/2505.02222, Practical Efficiency of Muon for Pretraining, 2025-05-04. "We demonstrate that Muon, the simplest instantiation of a second-order optimizer, explicitly expands the Pareto frontier over AdamW on the compute-time tradeoff." | |
| 574 | + | |
| 575 | +[62] https://arxiv.org/abs/2509.02046, Fantastic Pretraining Optimizers and Where to Find Them, 2025-09-02. "the speedup of matrix-based optimizers is inversely proportional to model scale, decreasing from 1.4x over AdamW for 0.1B parameter models to merely 1.1x for 1.2B parameter models." | |
| 576 | + | |
| 577 | +[63] https://github.com/karpathy/nanochat, karpathy/nanochat (repository README), 2026-10-20. "you can train your own GPT-2 capability LLM (which cost ~$43,000 to train in 2019) for only $48 (~2 hours of 8XH100 GPU node) ... but you'll have to wait 8 times longer." | |
| 578 | + | |
| 579 | +[64] https://github.com/karpathy/nanochat/discussions/28, Anyone managed to run training on an NVIDIA Spark yet? (nanochat Discussion #28), 2025-10-14. "Mine just finished pre-training after 14,137.8 minutes = 235.63 hours = 9.8 days (pretty much as expected)." | |
| 580 | + | |
| 581 | +[65] https://forums.developer.nvidia.com/t/pretrain-nanochat-on-2-x-dgx-sparks/350564, Pretrain nanochat on 2 x DGX Sparks (NVIDIA Developer Forums), 2025-11-07. "Training takes about 4.5 days (half the Training time on 1 DGX Spark)." | |
| 582 | + | |
| 583 | +[66] https://arxiv.org/abs/2606.22189, L20-Edu-135M: An Auditable Single-GPU Study of Data-Efficient Small Language Modeling, 2026-06-20. "At that rate, the 10B-token run takes about 72 GPU-hours." | |
| 584 | + | |
| 585 | +[67] https://arxiv.org/abs/2401.02385, TinyLlama: An Open-Source Small Language Model, 2024-01-04. "We present TinyLlama, a compact 1.1B language model pretrained on around 1 trillion tokens for approximately 3 epochs. ... We pretrain TinyLlama with 16 A100-40G GPUs in our project." | |
| 586 | + | |
| 587 | +[68] https://github.com/karpathy/nanoGPT, karpathy/nanoGPT (README), 2026-10-20. "On one A100 GPU this training run takes about 3 minutes and the best validation loss is 1.4697." | |
| 588 | + |
docs/history/efficiency.sources.json
| new file mode 100644 | ||
| @@ -0,0 +1,410 @@ | ||
| 1 | +[ | |
| 2 | + { | |
| 3 | + "n": 1, | |
| 4 | + "url": "https://www.nvidia.com/en-us/products/workstations/dgx-spark/", | |
| 5 | + "title": "NVIDIA DGX Spark product page", | |
| 6 | + "accessed": "2026-10-20" | |
| 7 | + }, | |
| 8 | + { | |
| 9 | + "n": 2, | |
| 10 | + "url": "https://docs.nvidia.com/dgx/dgx-spark/hardware.html", | |
| 11 | + "title": "DGX Spark User Guide: Hardware", | |
| 12 | + "accessed": "2026-10-20" | |
| 13 | + }, | |
| 14 | + { | |
| 15 | + "n": 3, | |
| 16 | + "url": "https://www.hc2025.hotchips.org/assets/program/conference/day2/21_nvidia_skende_final.pdf", | |
| 17 | + "title": "NVIDIA GB10 SoC, Hot Chips 2025 slides", | |
| 18 | + "accessed": "2026-10-20" | |
| 19 | + }, | |
| 20 | + { | |
| 21 | + "n": 4, | |
| 22 | + "url": "https://docs.nvidia.com/cuda/cuda-programming-guide/05-appendices/compute-capabilities.html", | |
| 23 | + "title": "CUDA Programming Guide, Appendix: Compute Capabilities", | |
| 24 | + "accessed": "2026-10-20" | |
| 25 | + }, | |
| 26 | + { | |
| 27 | + "n": 5, | |
| 28 | + "url": "https://geizhals.de/lenovo-thinkstation-pgx-dgx-spark-30kl0073gf-a3959977.html", | |
| 29 | + "title": "Geizhals listing, Lenovo ThinkStation PGX (DGX Spark)", | |
| 30 | + "accessed": "2026-10-20" | |
| 31 | + }, | |
| 32 | + { | |
| 33 | + "n": 6, | |
| 34 | + "url": "https://www.storagereview.com/review/nvidia-dgx-spark-review-the-ai-appliance-bringing-datacenter-capabilities-to-desktops", | |
| 35 | + "title": "NVIDIA DGX Spark review, StorageReview", | |
| 36 | + "accessed": "2026-10-20" | |
| 37 | + }, | |
| 38 | + { | |
| 39 | + "n": 7, | |
| 40 | + "url": "https://arxiv.org/abs/2001.08361", | |
| 41 | + "title": "Scaling Laws for Neural Language Models (Kaplan et al.)", | |
| 42 | + "accessed": "2026-10-20" | |
| 43 | + }, | |
| 44 | + { | |
| 45 | + "n": 8, | |
| 46 | + "url": "https://arxiv.org/abs/2203.15556", | |
| 47 | + "title": "Training Compute-Optimal Large Language Models (Hoffmann et al., Chinchilla)", | |
| 48 | + "accessed": "2026-10-20" | |
| 49 | + }, | |
| 50 | + { | |
| 51 | + "n": 9, | |
| 52 | + "url": "https://ai.meta.com/blog/meta-llama-3/", | |
| 53 | + "title": "Introducing Meta Llama 3", | |
| 54 | + "accessed": "2026-10-20" | |
| 55 | + }, | |
| 56 | + { | |
| 57 | + "n": 10, | |
| 58 | + "url": "https://arxiv.org/abs/2302.13971", | |
| 59 | + "title": "LLaMA: Open and Efficient Foundation Language Models", | |
| 60 | + "accessed": "2026-10-20" | |
| 61 | + }, | |
| 62 | + { | |
| 63 | + "n": 11, | |
| 64 | + "url": "https://arxiv.org/abs/2305.16264", | |
| 65 | + "title": "Scaling Data-Constrained Language Models (Muennighoff et al.)", | |
| 66 | + "accessed": "2026-10-20" | |
| 67 | + }, | |
| 68 | + { | |
| 69 | + "n": 12, | |
| 70 | + "url": "https://arxiv.org/abs/2407.21783", | |
| 71 | + "title": "The Llama 3 Herd of Models", | |
| 72 | + "accessed": "2026-10-20" | |
| 73 | + }, | |
| 74 | + { | |
| 75 | + "n": 13, | |
| 76 | + "url": "https://raw.githubusercontent.com/KellerJordan/modded-nanogpt/master/README.md", | |
| 77 | + "title": "modded-nanogpt README (record tables)", | |
| 78 | + "accessed": "2026-10-20" | |
| 79 | + }, | |
| 80 | + { | |
| 81 | + "n": 14, | |
| 82 | + "url": "https://github.com/karpathy/llm.c/discussions/481", | |
| 83 | + "title": "llm.c discussion 481: reproducing GPT-2 (124M)", | |
| 84 | + "accessed": "2026-10-20" | |
| 85 | + }, | |
| 86 | + { | |
| 87 | + "n": 15, | |
| 88 | + "url": "https://kellerjordan.github.io/posts/muon/", | |
| 89 | + "title": "Muon: An optimizer for hidden layers in neural networks (Keller Jordan)", | |
| 90 | + "accessed": "2026-10-20" | |
| 91 | + }, | |
| 92 | + { | |
| 93 | + "n": 16, | |
| 94 | + "url": "https://arxiv.org/abs/2212.14034", | |
| 95 | + "title": "Cramming: Training a Language Model on a Single GPU in One Day", | |
| 96 | + "accessed": "2026-10-20" | |
| 97 | + }, | |
| 98 | + { | |
| 99 | + "n": 17, | |
| 100 | + "url": "https://arxiv.org/abs/2305.07759", | |
| 101 | + "title": "TinyStories: How Small Can Language Models Be and Still Speak Coherent English?", | |
| 102 | + "accessed": "2026-10-20" | |
| 103 | + }, | |
| 104 | + { | |
| 105 | + "n": 18, | |
| 106 | + "url": "https://arxiv.org/abs/2306.11644", | |
| 107 | + "title": "Textbooks Are All You Need (phi-1)", | |
| 108 | + "accessed": "2026-10-20" | |
| 109 | + }, | |
| 110 | + { | |
| 111 | + "n": 19, | |
| 112 | + "url": "https://github.com/alexjc/nanogpt-speedrun", | |
| 113 | + "title": "alexjc/nanogpt-speedrun (fork of modded-nanogpt)", | |
| 114 | + "accessed": "2026-10-20" | |
| 115 | + }, | |
| 116 | + { | |
| 117 | + "n": 20, | |
| 118 | + "url": "https://www.microsoft.com/en-us/research/blog/phi-2-the-surprising-power-of-small-language-models/", | |
| 119 | + "title": "Phi-2: The surprising power of small language models (Microsoft Research)", | |
| 120 | + "accessed": "2026-10-20" | |
| 121 | + }, | |
| 122 | + { | |
| 123 | + "n": 21, | |
| 124 | + "url": "https://arxiv.org/abs/2504.08165", | |
| 125 | + "title": "Findings of the BabyLM Challenge: Sample-Efficient Pretraining on Developmentally Plausible Corpora", | |
| 126 | + "accessed": "2026-10-20" | |
| 127 | + }, | |
| 128 | + { | |
| 129 | + "n": 22, | |
| 130 | + "url": "https://arxiv.org/abs/2406.17557", | |
| 131 | + "title": "The FineWeb Datasets: Decanting the Web for the Finest Text Data at Scale", | |
| 132 | + "accessed": "2026-10-20" | |
| 133 | + }, | |
| 134 | + { | |
| 135 | + "n": 23, | |
| 136 | + "url": "https://arxiv.org/abs/2406.11794", | |
| 137 | + "title": "DataComp-LM: In search of the next generation of training sets for language models", | |
| 138 | + "accessed": "2026-10-20" | |
| 139 | + }, | |
| 140 | + { | |
| 141 | + "n": 24, | |
| 142 | + "url": "https://arxiv.org/abs/2501.00656", | |
| 143 | + "title": "2 OLMo 2 Furious", | |
| 144 | + "accessed": "2026-10-20" | |
| 145 | + }, | |
| 146 | + { | |
| 147 | + "n": 25, | |
| 148 | + "url": "https://arxiv.org/abs/2402.00159", | |
| 149 | + "title": "Dolma: an Open Corpus of Three Trillion Tokens for Language Model Pretraining Research", | |
| 150 | + "accessed": "2026-10-20" | |
| 151 | + }, | |
| 152 | + { | |
| 153 | + "n": 26, | |
| 154 | + "url": "https://arxiv.org/abs/2412.19437", | |
| 155 | + "title": "DeepSeek-V3 Technical Report", | |
| 156 | + "accessed": "2026-10-20" | |
| 157 | + }, | |
| 158 | + { | |
| 159 | + "n": 27, | |
| 160 | + "url": "https://arxiv.org/abs/2509.25149", | |
| 161 | + "title": "Pretraining Large Language Models with NVFP4", | |
| 162 | + "accessed": "2026-10-20" | |
| 163 | + }, | |
| 164 | + { | |
| 165 | + "n": 28, | |
| 166 | + "url": "https://arxiv.org/abs/2209.05433", | |
| 167 | + "title": "FP8 Formats for Deep Learning", | |
| 168 | + "accessed": "2026-10-20" | |
| 169 | + }, | |
| 170 | + { | |
| 171 | + "n": 29, | |
| 172 | + "url": "https://arxiv.org/abs/2310.18313", | |
| 173 | + "title": "FP8-LM: Training FP8 Large Language Models", | |
| 174 | + "accessed": "2026-10-20" | |
| 175 | + }, | |
| 176 | + { | |
| 177 | + "n": 30, | |
| 178 | + "url": "https://arxiv.org/abs/2402.17764", | |
| 179 | + "title": "The Era of 1-bit LLMs: All Large Language Models are in 1.58 Bits (BitNet b1.58)", | |
| 180 | + "accessed": "2026-10-20" | |
| 181 | + }, | |
| 182 | + { | |
| 183 | + "n": 31, | |
| 184 | + "url": "https://forums.developer.nvidia.com/t/fp4-on-dgx-spark-why-it-doesnt-scale-like-youd-expect/360142", | |
| 185 | + "title": "FP4 on DGX Spark: why it doesn't scale like you'd expect (NVIDIA Developer Forums)", | |
| 186 | + "accessed": "2026-10-20" | |
| 187 | + }, | |
| 188 | + { | |
| 189 | + "n": 32, | |
| 190 | + "url": "https://arxiv.org/abs/2205.14135", | |
| 191 | + "title": "FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness", | |
| 192 | + "accessed": "2026-10-20" | |
| 193 | + }, | |
| 194 | + { | |
| 195 | + "n": 33, | |
| 196 | + "url": "https://arxiv.org/abs/2307.08691", | |
| 197 | + "title": "FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning", | |
| 198 | + "accessed": "2026-10-20" | |
| 199 | + }, | |
| 200 | + { | |
| 201 | + "n": 34, | |
| 202 | + "url": "https://arxiv.org/abs/2407.08608", | |
| 203 | + "title": "FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision", | |
| 204 | + "accessed": "2026-10-20" | |
| 205 | + }, | |
| 206 | + { | |
| 207 | + "n": 35, | |
| 208 | + "url": "https://hazyresearch.stanford.edu/blog/2025-05-27-no-bubbles", | |
| 209 | + "title": "Look Ma, No Bubbles! Designing a Low-Latency Megakernel for Llama-1B (Hazy Research)", | |
| 210 | + "accessed": "2026-10-20" | |
| 211 | + }, | |
| 212 | + { | |
| 213 | + "n": 36, | |
| 214 | + "url": "https://arxiv.org/abs/2512.22219", | |
| 215 | + "title": "MPK: A Compiler and Runtime for Mega-Kernelizing Tensor Programs (Mirage Persistent Kernel)", | |
| 216 | + "accessed": "2026-10-20" | |
| 217 | + }, | |
| 218 | + { | |
| 219 | + "n": 37, | |
| 220 | + "url": "https://arxiv.org/abs/1910.02054", | |
| 221 | + "title": "ZeRO: Memory Optimizations Toward Training Trillion Parameter Models", | |
| 222 | + "accessed": "2026-10-20" | |
| 223 | + }, | |
| 224 | + { | |
| 225 | + "n": 38, | |
| 226 | + "url": "https://arxiv.org/abs/1604.06174", | |
| 227 | + "title": "Training Deep Nets with Sublinear Memory Cost", | |
| 228 | + "accessed": "2026-10-20" | |
| 229 | + }, | |
| 230 | + { | |
| 231 | + "n": 39, | |
| 232 | + "url": "https://arxiv.org/abs/2205.05198", | |
| 233 | + "title": "Reducing Activation Recomputation in Large Transformer Models", | |
| 234 | + "accessed": "2026-10-20" | |
| 235 | + }, | |
| 236 | + { | |
| 237 | + "n": 40, | |
| 238 | + "url": "https://arxiv.org/abs/2410.10989", | |
| 239 | + "title": "Liger Kernel: Efficient Triton Kernels for LLM Training", | |
| 240 | + "accessed": "2026-10-20" | |
| 241 | + }, | |
| 242 | + { | |
| 243 | + "n": 41, | |
| 244 | + "url": "https://arxiv.org/abs/2503.11698", | |
| 245 | + "title": "A Comparison of the Cerebras Wafer-Scale Integration Technology with Nvidia GPU-based Systems for Artificial Intelligence", | |
| 246 | + "accessed": "2026-10-20" | |
| 247 | + }, | |
| 248 | + { | |
| 249 | + "n": 42, | |
| 250 | + "url": "https://arxiv.org/abs/2301.13637", | |
| 251 | + "title": "Tricking AI chips into Simulating the Human Brain: A Detailed Performance Analysis (GroqChip section)", | |
| 252 | + "accessed": "2026-10-20" | |
| 253 | + }, | |
| 254 | + { | |
| 255 | + "n": 43, | |
| 256 | + "url": "https://arxiv.org/abs/2304.03208", | |
| 257 | + "title": "Cerebras-GPT: Open Compute-Optimal Language Models Trained on the Cerebras Wafer-Scale Cluster", | |
| 258 | + "accessed": "2026-10-20" | |
| 259 | + }, | |
| 260 | + { | |
| 261 | + "n": 44, | |
| 262 | + "url": "https://arxiv.org/abs/2005.14165", | |
| 263 | + "title": "Language Models are Few-Shot Learners (GPT-3), model table", | |
| 264 | + "accessed": "2026-10-20" | |
| 265 | + }, | |
| 266 | + { | |
| 267 | + "n": 45, | |
| 268 | + "url": "https://arxiv.org/abs/2101.03961", | |
| 269 | + "title": "Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity", | |
| 270 | + "accessed": "2026-10-20" | |
| 271 | + }, | |
| 272 | + { | |
| 273 | + "n": 46, | |
| 274 | + "url": "https://arxiv.org/abs/2401.06066", | |
| 275 | + "title": "DeepSeekMoE: Towards Ultimate Expert Specialization in Mixture-of-Experts Language Models", | |
| 276 | + "accessed": "2026-10-20" | |
| 277 | + }, | |
| 278 | + { | |
| 279 | + "n": 47, | |
| 280 | + "url": "https://arxiv.org/abs/2002.10957", | |
| 281 | + "title": "MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformers", | |
| 282 | + "accessed": "2026-10-20" | |
| 283 | + }, | |
| 284 | + { | |
| 285 | + "n": 48, | |
| 286 | + "url": "https://arxiv.org/abs/2408.00118", | |
| 287 | + "title": "Gemma 2: Improving Open Language Models at a Practical Size", | |
| 288 | + "accessed": "2026-10-20" | |
| 289 | + }, | |
| 290 | + { | |
| 291 | + "n": 49, | |
| 292 | + "url": "https://arxiv.org/abs/2501.12948", | |
| 293 | + "title": "DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning", | |
| 294 | + "accessed": "2026-10-20" | |
| 295 | + }, | |
| 296 | + { | |
| 297 | + "n": 50, | |
| 298 | + "url": "https://arxiv.org/abs/2405.15319", | |
| 299 | + "title": "Stacking Your Transformers: A Closer Look at Model Growth for Efficient LLM Pre-Training", | |
| 300 | + "accessed": "2026-10-20" | |
| 301 | + }, | |
| 302 | + { | |
| 303 | + "n": 51, | |
| 304 | + "url": "https://arxiv.org/abs/2212.05055", | |
| 305 | + "title": "Sparse Upcycling: Training Mixture-of-Experts from Dense Checkpoints", | |
| 306 | + "accessed": "2026-10-20" | |
| 307 | + }, | |
| 308 | + { | |
| 309 | + "n": 52, | |
| 310 | + "url": "https://arxiv.org/abs/2401.02415", | |
| 311 | + "title": "LLaMA Pro: Progressive LLaMA with Block Expansion", | |
| 312 | + "accessed": "2026-10-20" | |
| 313 | + }, | |
| 314 | + { | |
| 315 | + "n": 53, | |
| 316 | + "url": "https://arxiv.org/abs/2501.19393", | |
| 317 | + "title": "s1: Simple test-time scaling", | |
| 318 | + "accessed": "2026-10-20" | |
| 319 | + }, | |
| 320 | + { | |
| 321 | + "n": 54, | |
| 322 | + "url": "https://arxiv.org/abs/2408.03314", | |
| 323 | + "title": "Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters", | |
| 324 | + "accessed": "2026-10-20" | |
| 325 | + }, | |
| 326 | + { | |
| 327 | + "n": 55, | |
| 328 | + "url": "https://arxiv.org/abs/1802.09568", | |
| 329 | + "title": "Shampoo: Preconditioned Stochastic Tensor Optimization", | |
| 330 | + "accessed": "2026-10-20" | |
| 331 | + }, | |
| 332 | + { | |
| 333 | + "n": 56, | |
| 334 | + "url": "https://arxiv.org/abs/2409.11321", | |
| 335 | + "title": "SOAP: Improving and Stabilizing Shampoo using Adam", | |
| 336 | + "accessed": "2026-10-20" | |
| 337 | + }, | |
| 338 | + { | |
| 339 | + "n": 57, | |
| 340 | + "url": "https://arxiv.org/abs/2305.14342", | |
| 341 | + "title": "Sophia: A Scalable Stochastic Second-order Optimizer for Language Model Pre-training", | |
| 342 | + "accessed": "2026-10-20" | |
| 343 | + }, | |
| 344 | + { | |
| 345 | + "n": 58, | |
| 346 | + "url": "https://arxiv.org/abs/2302.06675", | |
| 347 | + "title": "Symbolic Discovery of Optimization Algorithms (Lion)", | |
| 348 | + "accessed": "2026-10-20" | |
| 349 | + }, | |
| 350 | + { | |
| 351 | + "n": 59, | |
| 352 | + "url": "https://arxiv.org/abs/2404.06395", | |
| 353 | + "title": "MiniCPM: Unveiling the Potential of Small Language Models with Scalable Training Strategies", | |
| 354 | + "accessed": "2026-10-20" | |
| 355 | + }, | |
| 356 | + { | |
| 357 | + "n": 60, | |
| 358 | + "url": "https://arxiv.org/abs/2502.16982", | |
| 359 | + "title": "Muon is Scalable for LLM Training", | |
| 360 | + "accessed": "2026-10-20" | |
| 361 | + }, | |
| 362 | + { | |
| 363 | + "n": 61, | |
| 364 | + "url": "https://arxiv.org/abs/2505.02222", | |
| 365 | + "title": "Practical Efficiency of Muon for Pretraining", | |
| 366 | + "accessed": "2026-10-20" | |
| 367 | + }, | |
| 368 | + { | |
| 369 | + "n": 62, | |
| 370 | + "url": "https://arxiv.org/abs/2509.02046", | |
| 371 | + "title": "Fantastic Pretraining Optimizers and Where to Find Them", | |
| 372 | + "accessed": "2026-10-20" | |
| 373 | + }, | |
| 374 | + { | |
| 375 | + "n": 63, | |
| 376 | + "url": "https://github.com/karpathy/nanochat", | |
| 377 | + "title": "karpathy/nanochat (repository README)", | |
| 378 | + "accessed": "2026-10-20" | |
| 379 | + }, | |
| 380 | + { | |
| 381 | + "n": 64, | |
| 382 | + "url": "https://github.com/karpathy/nanochat/discussions/28", | |
| 383 | + "title": "Anyone managed to run training on an NVIDIA Spark yet? (nanochat Discussion #28)", | |
| 384 | + "accessed": "2026-10-20" | |
| 385 | + }, | |
| 386 | + { | |
| 387 | + "n": 65, | |
| 388 | + "url": "https://forums.developer.nvidia.com/t/pretrain-nanochat-on-2-x-dgx-sparks/350564", | |
| 389 | + "title": "Pretrain nanochat on 2 x DGX Sparks (NVIDIA Developer Forums)", | |
| 390 | + "accessed": "2026-10-20" | |
| 391 | + }, | |
| 392 | + { | |
| 393 | + "n": 66, | |
| 394 | + "url": "https://arxiv.org/abs/2606.22189", | |
| 395 | + "title": "L20-Edu-135M: An Auditable Single-GPU Study of Data-Efficient Small Language Modeling", | |
| 396 | + "accessed": "2026-10-20" | |
| 397 | + }, | |
| 398 | + { | |
| 399 | + "n": 67, | |
| 400 | + "url": "https://arxiv.org/abs/2401.02385", | |
| 401 | + "title": "TinyLlama: An Open-Source Small Language Model", | |
| 402 | + "accessed": "2026-10-20" | |
| 403 | + }, | |
| 404 | + { | |
| 405 | + "n": 68, | |
| 406 | + "url": "https://github.com/karpathy/nanoGPT", | |
| 407 | + "title": "karpathy/nanoGPT (README)", | |
| 408 | + "accessed": "2026-10-20" | |
| 409 | + } | |
| 410 | +] |
docs/history/nvidia.md
| new file mode 100644 | ||
| @@ -0,0 +1,289 @@ | ||
| 1 | +# What NVIDIA itself wrote about training, and what it means for one GB10 on our engine | |
| 2 | + | |
| 3 | +Stream: history-nvidia (L285). Written 2026-10-20 for Drake. Everything here comes from pages and papers NVIDIA published, fetched in this session. Numbers are quoted as stated, with the chip they refer to. A100, H100, B200, GB300 and GB10 are different machines, and no number is carried from one to another without saying so. Numbers marked "calc:" are our own arithmetic, with a receipt id from the project calculator. Anything we inferred rather than read is labeled "our inference". | |
| 4 | + | |
| 5 | +Plain-English terms used below, explained once: a **token** is one word-piece the model reads or writes. **Fine-tuning** means adjusting an already-trained model a little; **pretraining** means training one from nothing, which is our goal. **LoRA** is fine-tuning that trains only a small add-on instead of all the weights; **QLoRA** is LoRA on a model squeezed to 4 bits. **BF16, FP8, FP4** are number formats using 16, 8 and 4 bits per value; fewer bits means faster math and less memory but more rounding error. A **tensor core** is the part of the chip that does matrix multiplication fast. **Tokens/s** is training speed. | |
| 6 | + | |
| 7 | +## 1. What NVIDIA says about training on THIS machine (DGX Spark, GB10) | |
| 8 | + | |
| 9 | +### 1.1 Stated hardware numbers | |
| 10 | + | |
| 11 | +| Item | What NVIDIA states | Source | | |
| 12 | +|---|---|---| | |
| 13 | +| Memory | "128 GB LPDDR5x unified system memory, 256-bit interface, 4266 MHz, 273 GB/s bandwidth" [1]. One pool shared by the CPU and the GPU. | [1] | | |
| 14 | +| Memory channels | "16 channels (256 bit) LPDDR5X 8533" [1] (the same bus quoted at its data rate) | [1] | | |
| 15 | +| Tensor-core rate | Only one rate is published: "up to 1 PFLOP (petaFLOP) at FP4 precision with sparsity" [1]; the product page says "Up to 1 PFLOP FP4" [2]. "Sparsity" means the number assumes a trick that skips half the values; ordinary dense training does not get it. | [1][2] | | |
| 16 | +| FP8 or BF16 dense rate | **None published on any NVIDIA Spark page we read** (user guide, product page, technical blog, playbooks). Our inference only: if each halving of precision doubles the rate and sparsity doubles it once, 1000 TFLOPS FP4-sparse implies about 125 TFLOPS BF16 dense (calc:7d901c3897a9fef5b923b04cd20e884045e3a384f97cef6b1be2b1a64a99d976). The project's own number, from a ledger note and not from NVIDIA, is 118.81 TFLOPS BF16. | [1][2][3] | | |
| 17 | +| Inference compute | "Up to 1,000 TOPS (trillion operations per second) inference" [1] | [1] | | |
| 18 | +| CPU | "20-core Arm processor (10 Cortex-X925 + 10 Cortex-A725)" [1] | [1] | | |
| 19 | +| Power | "GB10 SOC Thermal Design Power (TDP) is 140W" [1] | [1] | | |
| 20 | +| Copy engines | "2 (enables simultaneous data transfers to and from GPU memory, improving throughput for AI workloads)" [1] | [1] | | |
| 21 | +| SM count | **Not stated** on any NVIDIA Spark page we read. (An SM is one of the chip's many small processing units.) | [1][2][3] | | |
| 22 | +| Model size NVIDIA claims it can hold | "Support for AI models up to 200 billion parameters (or 405B for dual-Spark configuration)" [1]; "fine-tune models up to 70 billion parameters" [2] | [1][2] | | |
| 23 | + | |
| 24 | +### 1.2 NVIDIA's own published training results on the Spark | |
| 25 | + | |
| 26 | +The only training speeds NVIDIA published for the Spark come from its technical blog, dated Oct 24, 2025 [3]. All three runs are fine-tuning with PyTorch, not pretraining. The page contradicts itself: | |
| 27 | + | |
| 28 | +| Run | Table 1 "Peak tokens/sec" [3] | Text of the same post [3] | Ratio text / table | Setup | | |
| 29 | +|---|---|---|---|---| | |
| 30 | +| Llama 3.2 3B, full fine-tuning (every weight trained) | 13,519.54 | 82,739.2 | 6.12 (calc:b1faf7bfb07d92924b11da6ca091ef072aeb9f4064b2babe86c3b7589bd29368) | sequence length 2048, batch 8, 1 epoch, 64 steps | | |
| 31 | +| Llama 3.1 8B, LoRA | 6,969.59 | 53,657.6 | 7.70 (calc:b09eb1a570f742bb215298e7d36803761b61c393a263420d582c987131da2f09) | sequence 2048, batch 4, 64 steps | | |
| 32 | +| Llama 3.3 70B, QLoRA | 759.79 | 5,079.4 | 6.69 (calc:a764add78494577ee832dc3c3364aac8d62dc7593e77429676239c2ae0d1f5d6) | sequence 2048, batch 8, 64 steps | | |
| 33 | + | |
| 34 | +The table defines the metric: "Peak tokens/sec calculated as (batch_size * steps * sequence_length)/ Total time to train." [3] With that formula the 3B run took 77.56 seconds in total (calc:3f012678ecaefb352feb81d9f7a88d38a690d64668dfc7d9766b013833545014). So these are short 64-step runs including start-up, not sustained numbers. | |
| 35 | + | |
| 36 | +**Our check, and why we weight the table over the text.** A full fine-tune costs about 6 multiply-adds per weight per token. At the table's 13,519.54 tokens/s a 3.21-billion-weight model needs 260 TFLOP/s (calc:641c4277d23da28a29c6bf1a490f36a5cd69e9f34d2846878f9fc9b91c59fb88). At the text's 82,739.2 it needs 1,594 TFLOP/s (calc:90a7e14e16ea3b19731654815437aeccdd28f1422d3fe5d8c1fb864a1897de73), more than the stated 1000-TFLOPS FP4-sparse peak and about 13 times the BF16 rate we derived above. Even the table value is about twice that derived BF16 rate. The 8B LoRA row needs about 224 TFLOP/s at the table's speed (calc:f0c42758b2faa6fcae4c1f212b4cb17edaec5f3aa47cfa7df9cfcbf326bb4e18, using 4 multiply-adds per weight per token because LoRA skips the weight-gradient half). So either those runs used FP8 or FP4 inside the math, the token count differs from the formula, or the metric is not what it says. NVIDIA does not say which. The 6-per-weight rule of thumb is from the Megatron papers (section 2); the 125 TFLOPS BF16 rate is our inference. **Rule for us: never quote the 82,739 / 53,658 / 5,079 figures, and treat even the table as an upper bound whose precision is undisclosed.** | |
| 37 | + | |
| 38 | +### 1.3 NVIDIA's published Spark training walkthroughs ("playbooks") | |
| 39 | + | |
| 40 | +NVIDIA publishes step-by-step guides in a public repository [4]. What they say about training, per guide: | |
| 41 | + | |
| 42 | +| Playbook | What it trains | Stated time and notes | Source | | |
| 43 | +|---|---|---|---| | |
| 44 | +| pytorch-fine-tune | "full SFT, LoRA and qLoRA workflows on Llama3 3B, 8B and 70B models" on one Spark, plus a two-Spark run | "30-45 mins for setup and runing fine-tuning"; flags include sequence length 2048 and optional gradient checkpointing (recompute activations instead of storing them) | [4] | | |
| 45 | +| nemo-fine-tune | NeMo AutoModel fine-tuning, LLMs and vision-language models, "1-70B parameters" | "45-90 minutes for complete setup and initial model fine-tuning"; example is 20 steps of Llama-3.1-8B LoRA with packed sequences of 1024 | [4] | | |
| 46 | +| llama-factory | Qwen3 LoRA | "1-7 hours for training depending on model size and dataset" | [4] | | |
| 47 | +| flux-finetuning | FLUX.1-dev 12B image model, Dreambooth LoRA | "1-2 hours for dreambooth LoRA training" | [4] | | |
| 48 | +| unsloth | Llama 3.1 8B 4-bit, 60-step test | "30-60 minutes for initial setup and test run"; warns that because of the shared-memory design "you may encounter memory issues even when within the memory capacity of DGX Spark" and says to flush the buffer cache | [4] | | |
| 49 | +| **nanochat** (train a small chat model from scratch: tokenizer, pretraining, fine-tuning) | A full pretraining pipeline, the closest NVIDIA guide to our goal | Last-updated note: "Removed DGX Spark support (not ready yet); playbook is Station / single-node only". Supported platform is DGX Station (~288 GB HBM). A d24 run "is on the order of 12+ hours". | [4] | | |
| 50 | +| nvfp4-pretraining | Llama 3.1 8B pretraining in NVFP4 with Megatron Bridge, on **DGX Station (GB300), not Spark** | Mock data, batch 64, sequence 4096. BF16 baseline 9.05 s/step, ~1399 model TFLOP/s per GPU, 221.6 GB peak. NVFP4 (last 4 layers kept BF16): 5.39 s/step, ~2347 TFLOP/s, 207.8 GB. "NVFP4 is 1.68× faster than BF16" and "NVFP4 requires Blackwell GPUs" | [4] | | |
| 51 | + | |
| 52 | +What this tells us: as of the playbook repository we cloned, NVIDIA offers fine-tuning on the Spark and pretraining only on the bigger Station. It withdrew its own from-scratch pretraining guide for the Spark as "not ready yet" [4]. NVIDIA has published no pretraining speed, no loss curve and no sustained training run for GB10. Everything we learn about GB10 pretraining speed must be measured by us (the physics stream L279 does that). The 1.68x NVFP4 gain is a GB300 number [4]; do not carry it to GB10. | |
| 53 | + | |
| 54 | +## 2. Hard lessons: what broke, how they found it, what fixed it | |
| 55 | + | |
| 56 | +Each entry gives four things: what broke, how NVIDIA found it, what fixed it, and the number that quantifies it. Chip and model are named. "Master copy" means a full-precision copy of the weights kept aside for the update step. "Loss scaling" means multiplying the training error by a constant before the backward pass so tiny gradient values do not round to zero, then dividing it back out. | |
| 57 | + | |
| 58 | +**H1. Small gradients vanish in 16-bit (FP16, 2017, mixed-precision paper).** | |
| 59 | +- Broke: much of the gradient signal fell below the smallest FP16 value and became zero. | |
| 60 | +- Found: they plotted a histogram of gradient sizes for an object-detection network (Multibox SSD): "2% of the values are in the [2−34 , 2−32 ) range, 2% of values are in the [2−24 , 2−23 ) range, and 67% of values are zero." [5] | |
| 61 | +- Fixed: loss scaling. "This particular network diverges when gradients are not scaled, but scaling them by a factor of 8 (increasing the exponents by 3) is sufficient to match the accuracy achieved with FP32 training." [5] Factors from 8 to 32K were tried; "Shifting by 15 exponent values (multiplying by 32K) would recover all but 0.1% of values lost to 0" [6]. | |
| 62 | + | |
| 63 | +**H2. Weight updates get lost in 16-bit.** | |
| 64 | +- Broke: an update much smaller than the weight rounds away when added in 16 bits. | |
| 65 | +- Found: a Mandarin speech model, three runs: all-FP32, 16-bit with an FP32 master copy, 16-bit without one [5]. | |
| 66 | +- Fixed: "an FP32 master copy of weights is maintained and updated with the weight gradient during the optimizer step." [5] The run with the master copy matched FP32; the run without did not (Figure 2a of [5]; we read the caption, not the plotted numbers). | |
| 67 | + | |
| 68 | +**H3. A fixed loss scale is fragile, so overflow must be detected.** | |
| 69 | +- Broke: too large a scale makes gradients infinite, which "would irreversibly damage the weights during the update." [6] | |
| 70 | +- Fixed: dynamic loss scaling: skip the update on overflow and halve the scale; double it after a run of clean steps. "We successfully trained networks with N = 2000, increasing scaling factor by 2, decreasing scaling factor by 0.5." [6] FP16 only; BF16 has FP32's range and does not need this (our inference from the formats' ranges, not a NVIDIA quote). | |
| 71 | + | |
| 72 | +**H4. Some operations must stay in 32-bit.** | |
| 73 | +- Broke: statistics such as the mean and variance in normalization and the sum in SoftMax lose accuracy in 16 bits. | |
| 74 | +- Fixed: "Batch-normalization can still take FP16 inputs and outputs, saving half the bandwidth compared to FP32, it's just that the statistics and value adjustment should be done in FP32." [6] | |
| 75 | + | |
| 76 | +**H5. One 8-bit format is not enough (FP8, 2022, H100-era paper).** | |
| 77 | +- Broke: 8 bits cannot cover both the small spread of weights and activations and the huge spread of gradients. | |
| 78 | +- Fixed: two formats. "The recommended use of FP8 encodings is E4M3 for weight and activation tensors, and E5M2 for gradient tensors." Some networks need a separate scale per tensor because "FP8 dynamic range is not sufficient to cover the union of all tensors' important values." Tested up to 175B-parameter language models [7]. | |
| 79 | + | |
| 80 | +**H6. Delayed FP8 scaling can be poisoned by one spike.** | |
| 81 | +- Broke: delayed scaling picks this step's scale from the largest values of the last few steps, so a one-off spike contaminates the history. NVIDIA's own blog: "transient spikes in training can contaminate the amax history and potentially lead to divergence." [8] ("amax" = largest absolute value in a tensor.) | |
| 82 | +- Fixed: per-tensor current scaling, which reads the present tensor [8]. Nemotron-H-56B was the first Nemotron model trained fully in FP8 with this recipe, and "any value too small to fit in the desired FP8 format is flushed to zero." [11] | |
| 83 | + | |
| 84 | +**H7. The first and last layers destabilize low-precision training (FP8 on H100-class).** | |
| 85 | +- Found: ablations on 8B models over up to 15 trillion tokens [11]. | |
| 86 | +- Fixed: "we find it important for training stability and convergence to leave the first and last 4 GEMMs of the model in BF16." [11] Nemotron-Nano-12B-v2 did the same on 20 trillion tokens, "We observed no training instabilities from this choice of numerics." [12] | |
| 87 | + | |
| 88 | +**H8. A published FP8 recipe still needed full-precision state (Nano 2).** | |
| 89 | +- Recipe: "E4M3 for all tensors, 128x128 quantization blocks for weights, and 1x128 tiles for the activations", "master weights are still kept in FP32", "we left all optimizer state in FP32." [12] | |
| 90 | + | |
| 91 | +**H9. 4-bit pretraining needs four fixes at once (NVFP4, 2025, 12B model, 10 trillion tokens).** | |
| 92 | +- Result: "validation loss of NVFP4 closely tracks its FP8 counterpart", MMLU-Pro 62.58% against 62.62% for FP8 [9]. | |
| 93 | +- The four: keep ~15% of layers high precision; Hadamard transforms of size 16x16 on the inputs of weight-gradient GEMMs; 2D scaling over 16x16 blocks for weights and 1x16 for activations and gradients; stochastic rounding for gradients, round-to-nearest-even for weights and activations [9]. Ablation: "we find that each component is essential for ensuring convergence and stability of the 12B model training over the 10T-token horizon." [9] | |
| 94 | + | |
| 95 | +**H10. Rounding noise helps gradients and hurts the forward pass.** | |
| 96 | +- "Stochastic rounding" rounds up or down at random so errors average out instead of piling up in one direction. NVIDIA applies it only to gradients; on forward-pass tensors it "is detrimental, as it amplifies quantization error relative to nearest rounding." [9] | |
| 97 | + | |
| 98 | +**H11. How many layers to keep in BF16.** | |
| 99 | +- "we recommend leaving a small fraction of the final layers (e.g., fewer than 15%) in BF16 or MXFP8." For 12B they kept the first two and last eight blocks (16% of linear layers), but "convergence remains stable even when only the final four blocks are left in higher precision." [9] | |
| 100 | + | |
| 101 | +**H12. The block format itself matters (NVFP4 versus MXFP4).** | |
| 102 | +- NVFP4 uses 16-value blocks with an FP8 (E4M3) scale plus a per-tensor FP32 scale [10]. In NVIDIA's comparison "MXFP4 matches NVFP4 loss when trained on 36% more tokens (i.e., using 1.36T instead of 1T tokens)." [9] Both are NVIDIA's own formats, so this is NVIDIA's own claim, tested at one model size. | |
| 103 | + | |
| 104 | +**H13. Late-training drift in 4-bit.** | |
| 105 | +- "the training dynamics of NVFP4 closely follows FP8, with only a small divergence appearing late in training." [9] The paper does not say the gap is closed; watch the end of the run. | |
| 106 | + | |
| 107 | +**H14. Tiles waste the tensor cores (A100, cuBLAS 11.4).** | |
| 108 | +- Matrix multiply is cut into output tiles, one per thread block. "Tile quantization occurs when matrix dimensions are not divisible by the thread block tile size." [13] Tile shapes in order of efficiency: 256x128 and 128x256 best, then 128x128, 256x64, 128x64, 64x64 worst; 64x64 gives 8x more parallelism than 256x128 "at a notable efficiency cost" [13]. | |
| 109 | + | |
| 110 | +**H15. Waves waste the chip.** | |
| 111 | +- "An NVIDIA A100 GPU has 108 SMs; in the particular case of 256x128 thread block tiles, it can execute one thread block per SM, leading to a wave size of 108 tiles... GPU utilization will be highest when the number of tiles is an integer multiple of 108 or just below." [13] The worked example is 2304 x 1536: 9 x 12 = 108 tiles, one full wave [13]. We did not read the efficiency figure for the next size up. Fix: choose batch and width so the tile count fills whole waves. | |
| 112 | + | |
| 113 | +**H16. A vocabulary size not divisible by 8 silently drops off the tensor cores.** | |
| 114 | +- "when vocabulary size is not divisible by 8 (V=33708), Tensor Cores cannot be applied and performance reduces drastically to the levels sustained by the NVIDIA CUDA cores." (older cuBLAS, FP16) [14]. Newer libraries run anyway but "efficiency is better when matrix dimensions are multiples of 16 bytes" [13]. | |
| 115 | + | |
| 116 | +**H17. Small matrices are limited by memory, not math.** | |
| 117 | +- Test: arithmetic intensity (math operations per byte moved) against the chip's ratio. V100 ratio 138.9 FLOPS/B; an 8192x128x8192 multiply is 124.1 FLOPS/B, "memory limited"; 8192x8192x8192 is 2730, math limited; "matrix-vector products... are always memory limited" [13]. Other chips have other ratios; GB10 has to be computed from its measured numbers. | |
| 118 | + | |
| 119 | +**H18. Elementwise layers are bandwidth-limited.** | |
| 120 | +- Activation functions cannot be sped up by compute: "activations is the only way to speed up activation functions" is NVIDIA's statement that reducing memory traffic is the lever [15]. Hence kernel fusion (combine steps so data is read once). | |
| 121 | + | |
| 122 | +**H19. Activation memory blowup and its two remedies.** | |
| 123 | +- Full recompute (throw away activations, recompute in the backward pass) cost "30 − 40% execution time overhead" in NVIDIA's runs [18]. Selective recompute, which recomputes only the cheap-to-store, expensive-to-keep attention parts, "reduces activation memory by 5×, while reducing execution time overhead from activation recomputation by over 90%." On a 530B GPT-3-style model with 2240 A100 GPUs: MFU 54.2% against 42.1% with full recompute, "29% faster" [18]. (MFU = Model FLOPs Utilization, the share of the chip's peak the useful math reaches.) | |
| 124 | +- Earlier rule from Megatron's second paper: "For most cases, checkpointing every 1 or 2 transformer layers is optimal." [17] | |
| 125 | + | |
| 126 | +**H20. Utilization numbers NVIDIA reports, by chip.** | |
| 127 | +- Single V100-class GPU baseline, 2019: "sustains 39 TeraFLOPs, which is 30% of peak FLOPs"; 76% scaling efficiency at 512 GPUs [16]. A100 cluster, 1T-parameter model on 3072 GPUs: 502 petaFLOP/s, "52% of theoretical peak" [17]. H100, Nemotron-4 340B (768 DGX H100 nodes, H100 peak 989 teraFLOP/s BF16): MFU 42.4%, 42.3%, 41.0% across the three batch-size stages [19]. Do not read these as GB10 targets; they say a well-tuned stack reaches 30 to 54% of peak. | |
| 128 | + | |
| 129 | +**H21. Data quality moves the benchmark more than tricks do.** | |
| 130 | +- Nemotron-CC: "a combination of classifier ensembling, synthetic data generation, and reduced reliance on heuristic filters"; 6.3T tokens = 4.4T deduplicated originals + 1.9T synthetic; an 8B model trained on 15T tokens (7.2T from this set) beat Llama 3.1 8B by "+5 on MMLU, +3.1 on ARC-Challenge" [20]. A 1.1T-token subset gives "a 5.6 MMLU improvement over DCLM" [20]. The same paper cites a finding that there are "diminishing returns after four epochs compared to training on more unique tokens" [20]. | |
| 131 | +- Nemotron-4 340B: "over 98% of data used in our model alignment process is synthetically generated" [19], and "switching the data distribution and learning rate decay schedule at the end of model training significantly improves model quality." [19] | |
| 132 | + | |
| 133 | +**H22. Checkpoint and restart.** | |
| 134 | +- Nemotron-H made saving checkpoints non-blocking and shortened restart: "asynchronously saving checkpoints without blocking training... optimized job restart times" [11]. No interval is given in what we read. | |
| 135 | + | |
| 136 | +**Not found in what we read:** loss-spike remedies, data-loader stalls, and silent hardware errors. None of the Megatron, Nemotron, mixed-precision or FP8 documents above address them beyond what is listed. We did not read DCGM or GPU error documents. Section 5 lists this gap. | |
| 137 | + | |
| 138 | +## 3. The good stuff: rules worth keeping | |
| 139 | + | |
| 140 | +Written as rules for Omega's kernels and for our own run. "Source" is the NVIDIA page behind the rule; the rule's wording and the conversion to GB10 are ours. | |
| 141 | + | |
| 142 | +1. **Keep a full-precision (FP32) copy of the weights and do the update in FP32**, whatever the speed format is. The update is small next to the weight and rounds away in 16 bits or less [5][12]. Optimizer state also stays FP32 (Nano 2 "left all optimizer state in FP32") [12]. | |
| 143 | +2. **Keep the first and last 4 matrix multiplies of the model in BF16** when anything runs in FP8; for 4-bit keep fewer than 15% of layers, mostly the last ones, in BF16 or 8-bit [11][12][9]. | |
| 144 | +3. **Use a per-tensor scale read from the current tensor, never a history of past maxima**, when running 8-bit; a history can be poisoned by one spike [8][11]. For 4-bit, use 16-value blocks with a stored scale [10]. | |
| 145 | +4. **Gradients use stochastic rounding; weights and activations use round-to-nearest** [9]. Never stochastic-round the forward pass [9]. | |
| 146 | +5. **Apply a 16x16 Hadamard transform to the inputs of the weight-gradient multiply** when going to 4 bits; it spreads out large outlier values so a block scale is not wasted on one big number [9]. | |
| 147 | +6. **Make every matrix dimension a multiple of 8 for 16-bit, and better 64 to 256** for batch and width; make the vocabulary size a multiple of 8 [14]. 4-bit and 8-bit formats need larger multiples (A100 text: divisible by 128 for INT8) [14]; the exact GB10 requirement must be read from the chip, not taken from A100 text. | |
| 148 | +7. **Pick matrix shapes so the tile count fills whole waves of the chip**: tile count a whole multiple of the number of SMs (or just under it) [13]. GB10's SM count is not on any NVIDIA Spark page we read, so Omega must read it from the driver. | |
| 149 | +8. **Prefer big tiles** (256x128 best) unless the matrix is too small to fill the chip; cuBLAS itself avoids small tiles when there is enough parallelism [13]. | |
| 150 | +9. **Compute arithmetic intensity before writing a kernel**: math operations divided by bytes moved, compared against the chip's ratio. Small batches and any vector-matrix product are memory-limited, so the only speedup is moving fewer bytes [13][15]. On GB10 the memory side is 273 GB/s [1], which is low against the compute rate, so memory-limited layers are the common case here (our inference). | |
| 151 | +10. **Fuse elementwise steps** (activation, add, scale, quantize) into the neighbouring matrix multiply so tensors cross memory once [15]. | |
| 152 | +11. **Store attention intermediates selectively**: recompute the cheap-to-recompute, expensive-to-store parts of attention, store the rest. NVIDIA measured over 90% less recompute overhead and 5x less activation memory against recomputing everything [18]. Full recompute costs 30 to 40% [18]. With 128 GB shared with the CPU [1] we have more room than a 80 GB card, so store more and recompute less. | |
| 153 | +12. **Checkpoint often, save in the background, and make restart fast** [11]. NVIDIA gives no interval; we choose ours from our measured cost of a save. | |
| 154 | +13. **Run a small 4-bit-versus-higher-precision comparison at equal tokens before trusting any 4-bit design**, and watch the loss gap late in the run, where NVIDIA saw it widen [9]. | |
| 155 | +14. **Spend effort on data before exotic numerics**: classifier-ensemble filtering, global deduplication and synthetic rephrasing gave +5 MMLU at equal model size [20]. | |
| 156 | +15. **Compute your achieved utilization honestly (MFU = useful model FLOPs divided by peak)**, and report it with the chip's peak named. NVIDIA's own Spark table exceeds what its stated rates allow (section 1.2), which is the cautionary example. | |
| 157 | + | |
| 158 | +## 4. Lessons table | |
| 159 | + | |
| 160 | +| # | Lesson | Evidence | What it means for one GB10 on our engine (Omega) | | |
| 161 | +|---|---|---|---| | |
| 162 | +| 1 | 16-bit gradients underflow; scale the loss | 67% of SSD gradients zero; scale 8 fixes it [5]; shift 15 exponents recovers all but 0.1% [6] | If any 16-bit float with a narrow range (FP16, FP8) carries gradients, build a loss-scale step with overflow check and skip. BF16 path needs none. | | |
| 163 | +| 2 | FP32 master weights are mandatory | FP32 master copy matched FP32 baseline [5]; kept in Nano 2 at 20T tokens [12] | Omega holds weights twice: an FP32 copy for the update and a low-precision copy for the matmul. Budget memory for it. | | |
| 164 | +| 3 | Dynamic loss scale: start high, halve on overflow, double after N clean steps | N = 2000, x2, x0.5 [6] | Needs a cheap on-chip overflow flag (reduce over the gradients) feeding the optimizer kernel. | | |
| 165 | +| 4 | Statistics (norm, softmax) in FP32 | [6] | Omega norm and softmax kernels accumulate in FP32 even when inputs are narrow. | | |
| 166 | +| 5 | FP8 wants E4M3 forward, E5M2 gradients, and per-tensor scales | [7] | Two-format cast kernels with a scale per tensor; Omega chooses which formats GB10 accepts by measurement (stream L284). | | |
| 167 | +| 6 | Delayed scaling can diverge after a spike | [8] | Do not build amax-history scaling. Build "scan the tensor, then scale" current scaling. | | |
| 168 | +| 7 | First and last 4 GEMMs stay BF16 | [11][12] | Keep embedding, first blocks, last blocks and head in BF16 in the layer plan. | | |
| 169 | +| 8 | Only the middle runs in low precision, and even there state stays FP32 | Nano 2 recipe [12] | Per-layer precision table in the Omega model definition. | | |
| 170 | +| 9 | 4-bit needs RHT + 2D scaling + stochastic rounding + kept layers, all four | each essential at 12B / 10T tokens [9] | The 4-bit candidate set (L284) must include all four knobs as options; test removing each at small scale. | | |
| 171 | +| 10 | Stochastic rounding only on gradients | [9] | Rounding mode is a per-tensor-role setting in the cast kernel; it needs an on-chip random source. | | |
| 172 | +| 11 | Keep under 15% of layers high precision, mostly at the end | [9] | Start at last-4-in-BF16 and measure; move toward fewer. | | |
| 173 | +| 12 | NVFP4-style 16-element blocks beat MXFP4-style blocks | MXFP4 needs 36% more tokens [9] | Block size and scale format are design variables we own; 16 elements with an FP8 scale is the baseline to beat. | | |
| 174 | +| 13 | 4-bit loss gap opens late | [9] | Run long enough to see the tail; compare against BF16 at the end, not early. | | |
| 175 | +| 14 | NVFP4 gain is 1.68x on GB300; no GB10 number exists | [4] | Measure it ourselves; do not plan on 1.68x. | | |
| 176 | +| 15 | Tile quantization | [13] | Omega GEMM must choose tiles that divide the actual M, N, K; pad or pick shapes at model-design time. | | |
| 177 | +| 16 | Wave quantization | A100 108 SMs, one 256x128 tile per SM [13] | Read GB10's SM count and tiles-per-SM from the driver and size layers to fill whole waves. | | |
| 178 | +| 17 | Alignment can drop you off the tensor cores | V=33708 [14] | Round vocabulary and width up to the tensor-core multiple; check alignment in the kernel launcher and refuse unaligned shapes loudly. | | |
| 179 | +| 18 | Memory-limited versus math-limited is a ratio test | [13] | Ship a per-layer table of arithmetic intensity against GB10's measured ratio; low-intensity layers get fused, not tuned. | | |
| 180 | +| 19 | Elementwise layers are bandwidth bound | [15] | Fuse into the matmul epilogue (the step after the multiply, while the result is still on chip). | | |
| 181 | +| 20 | Selective recompute: 5x activation memory, over 90% less overhead | [18] | Implement the same split in our backward pass: recompute attention scores and softmax; store the matmul inputs. | | |
| 182 | +| 21 | Full recompute costs 30 to 40% | [18] | Do not default to full recompute; 128 GB shared memory [1] allows storing more. | | |
| 183 | +| 22 | Utilization of 30 to 54% of peak is what excellent teams reach | 30% [16], 52% [17], 54.2% [18], 42% [19] | Plan a first target near 40% of the measured GB10 BF16 rate, labeled as a target, not a prediction. | | |
| 184 | +| 23 | NVIDIA's Spark training table is not self-consistent with its stated rates | 260 TFLOP/s implied for 13,519 tokens/s (section 1.2) | Treat every vendor token/s as a claim until checked against FLOPs; publish ours with the arithmetic. | | |
| 185 | +| 24 | NVIDIA withdrew its own Spark pretraining guide | "not ready yet" [4] | Pretraining on GB10 is unproven by the vendor. Our measured step is the first public evidence we know of. | | |
| 186 | +| 25 | Checkpoint frequently, asynchronously, restart fast | [11] | Background copy of weights + optimizer state to NVMe during the next step; pick interval from measured cost. | | |
| 187 | +| 26 | Data quality: ensemble filters, global dedup, synthetic rephrasing | +5 MMLU [20] | A small clean corpus beats a big dirty one at our token budget; build the filter and dedup before the long run. | | |
| 188 | +| 27 | Late data and learning-rate change improves quality | [19] | Reserve the last part of the run for a curated blend and decay. | | |
| 189 | +| 28 | Single-GPU memory is the real limit | Spark: 128 GB shared, 273 GB/s [1] | Memory bandwidth, not compute, decides many layers; every byte moved is the budget line. | | |
| 190 | + | |
| 191 | +## 5. Coverage report | |
| 192 | + | |
| 193 | +**Read for the claims above (specific passages searched and quoted):** DGX Spark user guide, Hardware Overview [1]; DGX Spark product page [2]; NVIDIA technical blog on Spark performance [3]; NVIDIA's `dgx-spark-playbooks` repository, the README files of pytorch-fine-tune, nemo-fine-tune, llama-factory, flux-finetuning, unsloth, nanochat, fine-tuning and nvfp4-pretraining [4]; Mixed Precision Training paper [5]; Training with Mixed Precision guide [6]; FP8 Formats paper [7]; NVIDIA FP8 blog [8]; NVFP4 pretraining paper [9] and blog [10]; Nemotron-H [11]; Nemotron Nano 2 [12]; Deep Learning Performance guides on matrix multiplication [13], fully-connected layers [14], memory-limited layers [15]; Megatron-LM [16], PTD-P paper [17], activation-recomputation paper [18]; Nemotron-4 340B [19]; Nemotron-CC [20]. | |
| 194 | + | |
| 195 | +**Skimmed or only searched by keyword (no full read):** all of the above are long; we read the passages found by keyword, not cover to cover. The GPU-background guide (fetched, not mined), the Megatron-Core landing page (fetched, only an index), the Blackwell Ultra blog (fetched; the two-level scaling description appears in [10] and was not separately cited), and the other playbooks in the repository. | |
| 196 | + | |
| 197 | +**Blocked or not found:** | |
| 198 | +- Transformer Engine documentation: the FP8 primer and low-precision-training pages returned HTTP 404 at the addresses we tried, so we did not read how TE describes delayed versus current scaling beyond NVIDIA's blog [8], nor MXFP8 and instability guidance there. | |
| 199 | +- The Deep Learning Performance "activations" guide returned 404. | |
| 200 | +- The DGX Spark release notes and known-issues pages were not read. | |
| 201 | +- The playbooks site at build.nvidia.com is script-rendered and returned no usable text; we used the public repository [4] that holds the same guides. | |
| 202 | +- No NVIDIA page we read states GB10's SM count, an FP8 or BF16 dense rate, or any GB10 pretraining result. | |
| 203 | +- Not covered in the documents we read: loss-spike remedies, data-loader stalls, silent data corruption, DCGM and GPU error handling, CUDA programming-guide compute-capability tables for Blackwell, and Megatron-Core's own docs. Next fetches should target these. | |
| 204 | +- The NVIDIA blog and `docs.nvidia.com` served with `curl -A "Mozilla/5.0"`; the plain fetcher was not needed. | |
| 205 | + | |
| 206 | +## Sources | |
| 207 | + | |
| 208 | +All accessed 2026-10-20 (fetched with curl, or git clone for [4]). Quotes are verbatim; several quotes from one page are separated by ' ... '. | |
| 209 | + | |
| 210 | +[1] https://docs.nvidia.com/dgx/dgx-spark/hardware.html | |
| 211 | + DGX Spark User Guide, Hardware Overview, undated. | |
| 212 | + "128 GB LPDDR5x unified system memory, 256-bit interface, 4266 MHz, 273 GB/s bandwidth" ... "Up to 1,000 TOPS (trillion operations per second) inference and up to 1 PFLOP (petaFLOP) at FP4 precision with sparsity" ... "Support for AI models up to 200 billion parameters (or 405B for dual-Spark configuration)" ... "GB10 SOC Thermal Design Power (TDP) is 140W" | |
| 213 | + | |
| 214 | +[2] https://www.nvidia.com/en-us/products/workstations/dgx-spark/ | |
| 215 | + NVIDIA DGX Spark product page, undated. | |
| 216 | + "Up to 1 PFLOP FP4" ... "fine-tune models up to 70 billion parameters" | |
| 217 | + | |
| 218 | +[3] https://developer.nvidia.com/blog/how-nvidia-dgx-sparks-performance-enables-intensive-ai-tasks/ | |
| 219 | + How NVIDIA DGX Spark's Performance Enables Intensive AI Tasks (NVIDIA Technical Blog), Oct 24, 2025. | |
| 220 | + "In full fine-tuning of a Llama 3.2B model, we reached a peak of 82,739.2 tokens per second." ... "Peak tokens/sec calculated as (batch_size * steps * sequence_length)/ Total time to train." | |
| 221 | + | |
| 222 | +[4] https://github.com/NVIDIA/dgx-spark-playbooks | |
| 223 | + NVIDIA DGX Spark playbooks repository (cloned 2026-10-20; READMEs under nvidia/), READMEs last updated 2025-2026. | |
| 224 | + "Removed DGX Spark support (not ready yet); playbook is Station / single-node only" ... "NVFP4 is **1.68× faster** than BF16 (≈68% higher throughput)" ... "Add detailed instructions to run full SFT, LoRA and qLoRA workflows on Llama3 3B, 8B and 70B models." | |
| 225 | + | |
| 226 | +[5] https://arxiv.org/pdf/1710.03740 | |
| 227 | + Mixed Precision Training (Micikevicius et al., ICLR 2018), arXiv v3, 15 Feb 2018. | |
| 228 | + "an FP32 master copy of weights is maintained and updated with the weight gradient during the optimizer step." ... "2% of the values are in the [2−34 , 2−32 ) range, 2% of values are in the [2−24 , 2−23 ) range, and 67% of values are zero." ... "This particular network diverges when gradients are not scaled, but scaling them by a factor of 8 (increasing the exponents by 3) is sufficient to match the accuracy achieved with FP32 training." | |
| 229 | + | |
| 230 | +[6] https://docs.nvidia.com/deeplearning/performance/mixed-precision-training/index.html | |
| 231 | + Train With Mixed Precision, NVIDIA Deep Learning Performance guide, undated. | |
| 232 | + "Shifting by 15 exponent values (multiplying by 32K) would recover all but 0.1% of values lost to 0 when converting to FP16 and still avoid overflow." ... "We successfully trained networks with N = 2000, increasing scaling factor by 2, decreasing scaling factor by 0.5" ... "Batch-normalization can still take FP16 inputs and outputs, saving half the bandwidth compared to FP32, it’s just that the statistics and value adjustment should be done in FP32." ... "irreversibly damage the weights during the update" | |
| 233 | + | |
| 234 | +[7] https://arxiv.org/pdf/2209.05433 | |
| 235 | + FP8 Formats for Deep Learning (Micikevicius et al.), arXiv v2, 29 Sep 2022. | |
| 236 | + "The recommended use of FP8 encodings is E4M3 for weight and activation tensors, and E5M2 for gradient tensors." ... "some networks require per-tensor scaling factors as FP8 dynamic range is not sufficient to cover the union of all tensors’ important values" | |
| 237 | + | |
| 238 | +[8] https://developer.nvidia.com/blog/floating-point-8-an-introduction-to-efficient-lower-precision-ai-training/ | |
| 239 | + Floating-Point 8: An Introduction to Efficient, Lower-Precision AI Training (NVIDIA Technical Blog), Jun 04, 2025 (date string on page). | |
| 240 | + "Unlike delayed scaling, where transient spikes in training can contaminate the amax history and potentially lead to divergence, per-tensor current scaling dynamically adjusts the scale based on the present data range." | |
| 241 | + | |
| 242 | +[9] https://arxiv.org/pdf/2509.25149 | |
| 243 | + Pretraining Large Language Models with NVFP4 (NVIDIA), arXiv v2, 4 Mar 2026. | |
| 244 | + "MXFP4 matches NVFP4 loss when trained on 36% more tokens (i.e., using 1.36T instead of 1T tokens)." ... "we find that each component is essential for ensuring convergence and stability of the 12B model training over the 10T-token horizon." ... "is detrimental, as it amplifies quantization error relative to nearest rounding" ... "we recommend leaving a small fraction of the final layers (e.g., fewer than 15%) in BF16 or MXFP8 for better training convergence." ... "with only a small divergence appearing late in training" | |
| 245 | + | |
| 246 | +[10] https://developer.nvidia.com/blog/nvfp4-trains-with-precision-of-16-bit-and-speed-and-efficiency-of-4-bit/ | |
| 247 | + NVFP4 Trains with Precision of 16-bit and Speed and Efficiency of 4-bit (NVIDIA Technical Blog), Aug 25, 2025 (first date string on page; may be a related post). | |
| 248 | + "each group of sixteen 4-bit elements shares a common scaling factor" ... "Blackwell architecture GPUs such as GB200 and GB300 deliver a 7x GEMM speedup over Hopper" | |
| 249 | + | |
| 250 | +[11] https://arxiv.org/pdf/2504.03624 | |
| 251 | + Nemotron-H: A Family of Accurate and Efficient Hybrid Mamba-Transformer Models, arXiv v4, 5 Sep 2025. | |
| 252 | + "we find it important for training stability and convergence to leave the first and last 4 GEMMs of the model in BF16." ... "any value too small to fit in the desired FP8 format is flushed to zero." ... "We also proactively save checkpoints frequently in order to minimize the amount of work lost when a failure occurs" ... "by asynchronously saving checkpoints without blocking training." | |
| 253 | + | |
| 254 | +[12] https://arxiv.org/pdf/2508.14444 | |
| 255 | + NVIDIA Nemotron Nano 2, arXiv v4, 2 Sep 2025. | |
| 256 | + "we used E4M3 for all tensors, 128x128 quantization blocks for weights, and 1x128 tiles for the activations." ... "we left all optimizer state in FP32." ... "We observed no training instabilities from this choice of numerics." | |
| 257 | + | |
| 258 | +[13] https://docs.nvidia.com/deeplearning/performance/dl-performance-matrix-multiplication/index.html | |
| 259 | + Matrix Multiplication Background User's Guide, NVIDIA Deep Learning Performance, undated. | |
| 260 | + "Tile quantization occurs when matrix dimensions are not divisible by the thread block tile size." ... "An NVIDIA A100 GPU has 108 SMs" ... "GPU utilization will be highest when the number of tiles is an integer multiple of 108 or just below." ... "matrix-vector products (general matrix-vector product or GEMV), where either M=1 or N=1 , are always memory limited" | |
| 261 | + | |
| 262 | +[14] https://docs.nvidia.com/deeplearning/performance/dl-performance-fully-connected/index.html | |
| 263 | + Fully-Connected Layer User's Guide, NVIDIA Deep Learning Performance, undated. | |
| 264 | + "when vocabulary size is not divisible by 8 (V=33708), Tensor Cores cannot be applied and performance reduces drastically to the levels sustained by the NVIDIA CUDA ® cores" ... "We recommend ensuring all three GEMM dimensions are multiples of 8 when training in FP16 so that all passes will use Tensor Cores efficiently." | |
| 265 | + | |
| 266 | +[15] https://docs.nvidia.com/deeplearning/performance/dl-performance-memory-limited/index.html | |
| 267 | + Memory-Limited Layers User's Guide, NVIDIA Deep Learning Performance, undated. | |
| 268 | + "activations is the only way to speed up activation functions" | |
| 269 | + | |
| 270 | +[16] https://arxiv.org/pdf/1909.08053 | |
| 271 | + Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism (Shoeybi et al.), arXiv v4, 13 Mar 2020. | |
| 272 | + "We sustain 15.1 PetaFLOPs across the entire application with 76% scaling efficiency when compared to a strong single GPU baseline that sustains 39 TeraFLOPs, which is 30% of peak FLOPs." | |
| 273 | + | |
| 274 | +[17] https://arxiv.org/pdf/2104.04473 | |
| 275 | + Efficient Large-Scale Language Model Training on GPU Clusters Using Megatron-LM (Narayanan et al.), arXiv v5, 23 Aug 2021. | |
| 276 | + "per-GPU throughput of 52% of theoretical peak" ... "For most cases, checkpointing every 1 or 2 transformer layers is optimal." | |
| 277 | + | |
| 278 | +[18] https://arxiv.org/pdf/2205.05198 | |
| 279 | + Reducing Activation Recomputation in Large Transformer Models (Korthikanti et al.), arXiv v1, 10 May 2022. | |
| 280 | + "our method reduces activation memory by 5×, while reducing execution time overhead from activation recomputation by over 90%." ... "we observe 30 − 40% execution time overhead when full activation recomputation is used" | |
| 281 | + | |
| 282 | +[19] https://arxiv.org/pdf/2406.11704 | |
| 283 | + Nemotron-4 340B Technical Report, arXiv v2, 6 Aug 2024. | |
| 284 | + "Each H100 GPU has a peak throughput of 989 teraFLOP/s when doing 16-bit floating point (bfloat16) arithmetic without sparsity." ... "over 98% of data used in our model alignment process is synthetically generated" ... "We find that switching the data distribution and learning rate decay schedule at the end of model training significantly improves model quality." | |
| 285 | + | |
| 286 | +[20] https://arxiv.org/pdf/2412.02595 | |
| 287 | + Nemotron-CC: Transforming Common Crawl into a Refined Long-Horizon Pretraining Dataset, arXiv v2, 30 May 2025. | |
| 288 | + "a combination of classifier ensembling, synthetic data generation, and reduced reliance on heuristic filters" ... "+5 on MMLU, +3.1 on ARC-Challenge" | |
| 289 | + |
docs/history/nvidia.sources.json
| new file mode 100644 | ||
| @@ -0,0 +1,122 @@ | ||
| 1 | +[ | |
| 2 | + { | |
| 3 | + "n": 1, | |
| 4 | + "url": "https://docs.nvidia.com/dgx/dgx-spark/hardware.html", | |
| 5 | + "title": "DGX Spark User Guide, Hardware Overview", | |
| 6 | + "accessed": "2026-10-20" | |
| 7 | + }, | |
| 8 | + { | |
| 9 | + "n": 2, | |
| 10 | + "url": "https://www.nvidia.com/en-us/products/workstations/dgx-spark/", | |
| 11 | + "title": "NVIDIA DGX Spark product page", | |
| 12 | + "accessed": "2026-10-20" | |
| 13 | + }, | |
| 14 | + { | |
| 15 | + "n": 3, | |
| 16 | + "url": "https://developer.nvidia.com/blog/how-nvidia-dgx-sparks-performance-enables-intensive-ai-tasks/", | |
| 17 | + "title": "How NVIDIA DGX Spark's Performance Enables Intensive AI Tasks (NVIDIA Technical Blog)", | |
| 18 | + "accessed": "2026-10-20" | |
| 19 | + }, | |
| 20 | + { | |
| 21 | + "n": 4, | |
| 22 | + "url": "https://github.com/NVIDIA/dgx-spark-playbooks", | |
| 23 | + "title": "NVIDIA DGX Spark playbooks repository (cloned 2026-10-20; READMEs under nvidia/)", | |
| 24 | + "accessed": "2026-10-20" | |
| 25 | + }, | |
| 26 | + { | |
| 27 | + "n": 5, | |
| 28 | + "url": "https://arxiv.org/pdf/1710.03740", | |
| 29 | + "title": "Mixed Precision Training (Micikevicius et al., ICLR 2018)", | |
| 30 | + "accessed": "2026-10-20" | |
| 31 | + }, | |
| 32 | + { | |
| 33 | + "n": 6, | |
| 34 | + "url": "https://docs.nvidia.com/deeplearning/performance/mixed-precision-training/index.html", | |
| 35 | + "title": "Train With Mixed Precision, NVIDIA Deep Learning Performance guide", | |
| 36 | + "accessed": "2026-10-20" | |
| 37 | + }, | |
| 38 | + { | |
| 39 | + "n": 7, | |
| 40 | + "url": "https://arxiv.org/pdf/2209.05433", | |
| 41 | + "title": "FP8 Formats for Deep Learning (Micikevicius et al.)", | |
| 42 | + "accessed": "2026-10-20" | |
| 43 | + }, | |
| 44 | + { | |
| 45 | + "n": 8, | |
| 46 | + "url": "https://developer.nvidia.com/blog/floating-point-8-an-introduction-to-efficient-lower-precision-ai-training/", | |
| 47 | + "title": "Floating-Point 8: An Introduction to Efficient, Lower-Precision AI Training (NVIDIA Technical Blog)", | |
| 48 | + "accessed": "2026-10-20" | |
| 49 | + }, | |
| 50 | + { | |
| 51 | + "n": 9, | |
| 52 | + "url": "https://arxiv.org/pdf/2509.25149", | |
| 53 | + "title": "Pretraining Large Language Models with NVFP4 (NVIDIA)", | |
| 54 | + "accessed": "2026-10-20" | |
| 55 | + }, | |
| 56 | + { | |
| 57 | + "n": 10, | |
| 58 | + "url": "https://developer.nvidia.com/blog/nvfp4-trains-with-precision-of-16-bit-and-speed-and-efficiency-of-4-bit/", | |
| 59 | + "title": "NVFP4 Trains with Precision of 16-bit and Speed and Efficiency of 4-bit (NVIDIA Technical Blog)", | |
| 60 | + "accessed": "2026-10-20" | |
| 61 | + }, | |
| 62 | + { | |
| 63 | + "n": 11, | |
| 64 | + "url": "https://arxiv.org/pdf/2504.03624", | |
| 65 | + "title": "Nemotron-H: A Family of Accurate and Efficient Hybrid Mamba-Transformer Models", | |
| 66 | + "accessed": "2026-10-20" | |
| 67 | + }, | |
| 68 | + { | |
| 69 | + "n": 12, | |
| 70 | + "url": "https://arxiv.org/pdf/2508.14444", | |
| 71 | + "title": "NVIDIA Nemotron Nano 2", | |
| 72 | + "accessed": "2026-10-20" | |
| 73 | + }, | |
| 74 | + { | |
| 75 | + "n": 13, | |
| 76 | + "url": "https://docs.nvidia.com/deeplearning/performance/dl-performance-matrix-multiplication/index.html", | |
| 77 | + "title": "Matrix Multiplication Background User's Guide, NVIDIA Deep Learning Performance", | |
| 78 | + "accessed": "2026-10-20" | |
| 79 | + }, | |
| 80 | + { | |
| 81 | + "n": 14, | |
| 82 | + "url": "https://docs.nvidia.com/deeplearning/performance/dl-performance-fully-connected/index.html", | |
| 83 | + "title": "Fully-Connected Layer User's Guide, NVIDIA Deep Learning Performance", | |
| 84 | + "accessed": "2026-10-20" | |
| 85 | + }, | |
| 86 | + { | |
| 87 | + "n": 15, | |
| 88 | + "url": "https://docs.nvidia.com/deeplearning/performance/dl-performance-memory-limited/index.html", | |
| 89 | + "title": "Memory-Limited Layers User's Guide, NVIDIA Deep Learning Performance", | |
| 90 | + "accessed": "2026-10-20" | |
| 91 | + }, | |
| 92 | + { | |
| 93 | + "n": 16, | |
| 94 | + "url": "https://arxiv.org/pdf/1909.08053", | |
| 95 | + "title": "Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism (Shoeybi et al.)", | |
| 96 | + "accessed": "2026-10-20" | |
| 97 | + }, | |
| 98 | + { | |
| 99 | + "n": 17, | |
| 100 | + "url": "https://arxiv.org/pdf/2104.04473", | |
| 101 | + "title": "Efficient Large-Scale Language Model Training on GPU Clusters Using Megatron-LM (Narayanan et al.)", | |
| 102 | + "accessed": "2026-10-20" | |
| 103 | + }, | |
| 104 | + { | |
| 105 | + "n": 18, | |
| 106 | + "url": "https://arxiv.org/pdf/2205.05198", | |
| 107 | + "title": "Reducing Activation Recomputation in Large Transformer Models (Korthikanti et al.)", | |
| 108 | + "accessed": "2026-10-20" | |
| 109 | + }, | |
| 110 | + { | |
| 111 | + "n": 19, | |
| 112 | + "url": "https://arxiv.org/pdf/2406.11704", | |
| 113 | + "title": "Nemotron-4 340B Technical Report", | |
| 114 | + "accessed": "2026-10-20" | |
| 115 | + }, | |
| 116 | + { | |
| 117 | + "n": 20, | |
| 118 | + "url": "https://arxiv.org/pdf/2412.02595", | |
| 119 | + "title": "Nemotron-CC: Transforming Common Crawl into a Refined Long-Horizon Pretraining Dataset", | |
| 120 | + "accessed": "2026-10-20" | |
| 121 | + } | |
| 122 | +] |
docs/history/openai.calc.txt
| new file mode 100644 | ||
| @@ -0,0 +1,30 @@ | ||
| 1 | +# aien-calc eval receipts used in openai.md section 4 and elsewhere. Re-run the expression with aien-calc eval to reproduce the full receipt id; the doc cites the first 12 hex digits. | |
| 2 | +calc:eaee28411d70 6 * 124e6 * 10e9 = 7.44e18 FLOPs | |
| 3 | +calc:c44a11ffd81f 32000 * 1048576 = 33554432000 tokens | |
| 4 | +calc:fe580a68e80e 207.7e12 * 0.45 = 9.3465e13 FLOPs/s | |
| 5 | +calc:8fc5b5d73303 6 * 1558e6 * 33554432000 = 3.13667e20 FLOPs | |
| 6 | +calc:d829b2fcaba5 7440000000000000000 / 93465000000000 / 86400 = 0.92132 days | |
| 7 | +calc:c365b849a40d (6*1558e6*33554432000) / 93465000000000 / 86400 = 38.8424 days | |
| 8 | +calc:b82d646e4d10 2.25e20 / 93465000000000 / 86400 = 27.8625 days | |
| 9 | +calc:0deb384ee11c 6.41e20 / ... = 79.3771 days | |
| 10 | +calc:488f469ff286 1.37e21 / ... = 169.652 days | |
| 11 | +calc:50e240220b6a 2.38e21 / ... = 294.723 days | |
| 12 | +calc:dc17f2853720 4.77e21 / ... = 590.685 days | |
| 13 | +calc:6f3990299cc5 1.20e22 / ... = 1485.999 days | |
| 14 | +calc:aef79bc422e5 2.31e22 / ... = 2860.548 days | |
| 15 | +calc:35790f1ab06c 3.14e23 / ... = 38883.64 days | |
| 16 | +calc:b9b9640bdc4e 3.14e23 / 93465000000000 / 86400 / 365.25 = 106.4576 years | |
| 17 | +calc:0ad56432e0f6 (9/20) / (1/4) = 1.8 | |
| 18 | +calc:c4d85036fa92 207.7e12 / 2 = 1.0385e14 | |
| 19 | +calc:317af6af297e 1000e12 / 2 / 2 = 2.5e14 | |
| 20 | +calc:71054255f7f3 300e9 / 175e9 = 1.714 tokens per parameter | |
| 21 | +calc:f6f3e0c916107e0057ce 3.7e12 / 300e9 = 12.333 | |
| 22 | +calc:9b7c3a24235f 3.14e23 / 3.85e24 * 100 = 8.156 percent | |
| 23 | +calc:9225de9e4894 60 / 3640 * 100 = 1.6484 percent | |
| 24 | +calc:e6655387570d 120 * 124e6^2 / 93465000000000 / 86400 = 0.22849 days | |
| 25 | +calc:8aebad75d578 120 * 760e6^2 / ... = 8.58313 days | |
| 26 | +calc:c70de7859b4b 120 * 1.3e9^2 / ... = 25.1134 days | |
| 27 | +calc:83d96ba3265e 120 * 2.7e9^2 / ... = 108.329 days | |
| 28 | +calc:2f507ac1c38f 120 * 6.7e9^2 / ... = 667.065 days | |
| 29 | +calc:0e474f41b97c 33554432000 / 1558e6 = 21.537 tokens per parameter | |
| 30 | +# columns 25% and BF16 in the section 4 table = FP8-at-45% days x 1.8 and x 2 (spreadsheet-style multiples of the receipts above) |
docs/history/openai.md
| new file mode 100644 | ||
| @@ -0,0 +1,374 @@ | ||
| 1 | +# OpenAI, 2018 to 2026: what they did, what worked, what went wrong | |
| 2 | + | |
| 3 | +Stream: history-openai (ledger L276). Written 2026-10-20 for Drake. Every outside claim carries a number like `[4]` that points to the `## Sources` list at the end, with the page's own words. Claims I could not source are marked `[unverified]`. Where the public record is thin, the text says "no public evidence found". | |
| 4 | + | |
| 5 | +## How to read this document | |
| 6 | + | |
| 7 | +A few words that come up everywhere: | |
| 8 | + | |
| 9 | +- **Parameter**: one adjustable number inside the model. "175B" means 175 billion of them. More parameters means more capacity to store patterns, and more arithmetic per word. | |
| 10 | +- **Token**: a chunk of text, roughly three quarters of a word. "300B tokens" means the model read about 300 billion chunks during training. | |
| 11 | +- **FLOP**: one addition or multiplication. Training compute is counted in FLOPs. The usual rule of thumb, which GPT-3's own paper uses, is 6 FLOPs per parameter per token `[4]`. "PF-day" is a petaFLOP per second for a full day, which is 8.64e19 FLOPs `[4]`. | |
| 12 | +- **Pretraining**: the long first phase where the model learns to predict the next token of ordinary text. **Post-training**: the shorter phases afterwards that shape behavior (examples written by people, human feedback, reinforcement learning). | |
| 13 | +- **RLHF** (reinforcement learning from human feedback): people rank pairs of model answers, a second model learns to predict those rankings, and the main model is nudged toward answers that score well. | |
| 14 | +- **Epoch**: one full pass over the training data. | |
| 15 | +- **Contamination**: the test questions of a benchmark leaked into the training data, so a good score may be memory, not skill. | |
| 16 | +- **MFU** (model FLOPs utilization): the share of the chip's peak arithmetic speed that training actually uses. | |
| 17 | +- **Epoch AI** is an independent research group that estimates the numbers labs do not publish. Its figures are labeled "estimate" here. | |
| 18 | + | |
| 19 | +Source ranking used throughout: the lab's own papers and cards first, then Epoch AI, then press reporting (labeled "reporting"). When sources disagree, both are given and the one I weight is named. | |
| 20 | + | |
| 21 | +## 1. Timeline table | |
| 22 | + | |
| 23 | +"Not disclosed" means the lab's own document says it is withholding it or is silent. "No public evidence found" means I looked in the sources I could fetch and found nothing. | |
| 24 | + | |
| 25 | +| Model | Date | Parameters | Training tokens | Training compute (FLOPs) | Hardware and count | Training time | Reported cost | Method change from the previous model | | |
| 26 | +|---|---|---|---|---|---|---|---|---| | |
| 27 | +| GPT-1 | 2018 | 12-layer model, 768-wide; the GPT-2 paper says its smallest model "is equivalent to the original GPT" at 117M `[1][2]` | Not stated. 100 epochs over BooksCorpus, "over 7,000 unique unpublished books", batches of 64 sequences of 512 tokens `[1]` | Not stated in the paper | Not stated | Not stated | No public evidence found | First "pretrain on unlabeled text, then fine-tune per task" with a decoder-only transformer `[1]` | | |
| 28 | +| GPT-2 | Feb 2019 (smallest model); 1.5B withheld until later `[3]` | 117M, 345M, 762M, 1542M `[2]` | Not stated. WebText: "slightly over 8 million documents for a total of 40 GB of text" `[2]` | Not stated | Not stated in the paper | Third-party table lists 168 hours for the original checkpoint `[28]` | Third-party estimate about $43,000 `[28]` | 10x more parameters and data than GPT-1, curated web text instead of books, zero-shot use without fine-tuning `[2]` | | |
| 29 | +| GPT-3 | 2020 | 125M up to 175B (8 sizes) `[4]` | 300B for every size `[4]` | 3.14e23 for 175B (paper's Table D.1) `[4]` | V100 GPUs on a Microsoft cluster, count not stated `[4]` | Not disclosed | Not disclosed by OpenAI | 100x more parameters than GPT-2; few-shot prompting instead of fine-tuning; sampling mix weighted toward higher-quality sources `[4]` | | |
| 30 | +| Codex | Jul 2021 (paper) | Up to 12B `[7]` | 100B tokens of code fine-tuning on top of GPT-3 weights `[7]` | Not stated | Not stated | Not stated | No public evidence found | GPT-3 fine-tuned on 159 GB of filtered Python from GitHub `[7]` | | |
| 31 | +| InstructGPT | Mar 2022 (paper) | 1.3B, 6B, 175B `[8]` | RLHF added 60 PF-days on the 175B model vs 3,640 for GPT-3 pretraining `[8]` | 60 PF-days is about 5.2e21 FLOPs (60 x 8.64e19) | Not stated | Not stated | No public evidence found | Human demonstrations (13k prompts), human rankings (33k prompts), then PPO (31k prompts) `[8]` | | |
| 32 | +| ChatGPT | Nov 30, 2022 `[unverified]` | Not disclosed | Not disclosed | Not disclosed | Not disclosed | Not disclosed | Not disclosed | Chat-format RLHF on a GPT-3.5 base `[unverified]`; openai.com blocked my fetch and I found no fetchable primary page | | |
| 33 | +| GPT-4 | Mar 2023 `[9]` | Not disclosed (report states it withholds "model size") `[9]` | Not disclosed | Epoch estimate about 2e25 `[15]` | Not disclosed by OpenAI; Epoch estimates $800M of hardware `[10]` | Epoch: finished training Aug 2022 `[10]` | Epoch estimate: $40M amortized hardware plus energy `[10]` | Added images; RLHF post-training; scaling law fitted on runs up to 10,000x smaller to predict the final loss `[9]` | | |
| 34 | +| GPT-4 Turbo, GPT-4o | Nov 2023 and May 2024 `[unverified]` | Not disclosed | Not disclosed | No public evidence found | Not disclosed | Not disclosed | Not disclosed | GPT-4o: one network trained across text, vision and audio `[unverified]`; sources blocked | | |
| 35 | +| o1 | Sep 12, 2024 `[11]` | Not disclosed | Not disclosed | Not disclosed | Not disclosed | Not disclosed | Not disclosed | "Trained with large-scale reinforcement learning to reason using chain of thought" `[11]` | | |
| 36 | +| o3 | 2025 (Epoch discusses it May 9, 2025) `[12]` | Not disclosed | Not disclosed | Reasoning-training compute: OpenAI said 10x o1 per Epoch `[12]` | Not disclosed | Not disclosed | Not disclosed | More RL compute, longer thinking `[12]` | | |
| 37 | +| GPT-4.5 | Feb 27, 2025 `[14]` | Not disclosed | Not disclosed | Epoch: more than 1e26 `[15]` | Epoch: 40,000 to 100,000 H100 `[17]` | Epoch: 90 to 165 days `[17]` | Epoch: central $400M, range $170M to $890M `[17]` | "Scales pre-training further" from GPT-4o `[13]` | | |
| 38 | +| GPT-5 | Aug 7, 2025 `[18]` | Not disclosed; Epoch assumes about 100B active `[15]` | Not disclosed; Epoch assumes at least 30T `[15]` | Epoch: about 5e25 total (about 3e25 pretraining) `[15]` | Not disclosed | Not disclosed | Not disclosed | Router between a fast model and a reasoning model; RL-heavy post-training `[18][16]` | | |
| 39 | +| GPT-5.5, GPT-5.6, GPT-6 Astra | Apr 23, Jul 9, Sep 3, 2026 `[20][19][21]` | Not disclosed | Not disclosed | No public evidence found | Not disclosed | Not disclosed | Not disclosed | Cards describe diverse filtered datasets plus RL; no scale numbers `[20][21]` | | |
| 40 | + | |
| 41 | +Read the table as a trend: the amount OpenAI discloses falls from nearly everything (GPT-1, GPT-2 architecture and data recipe) to almost nothing (GPT-4 onward). From GPT-4 onward every compute and cost number in the table is an outside estimate. | |
| 42 | + | |
| 43 | +## 2. Per model: what they did, what went right, what went wrong | |
| 44 | + | |
| 45 | +### 2.1 GPT-1 (2018) | |
| 46 | + | |
| 47 | +**Data.** BooksCorpus: "over 7,000 unique unpublished books" with "long stretches of contiguous text" `[1]`. The authors chose it over a sentence-shuffled news corpus of about the same size because shuffling destroys long-range structure. They cleaned the text with a library called ftfy (it fixes broken characters) `[1]`. | |
| 48 | + | |
| 49 | +**Compute bet.** Small. A 12-layer model trained for 100 epochs, which means it read the same books 100 times `[1]`. This was a method bet: pretrain on unlabeled text, then fine-tune on each labeled task. | |
| 50 | + | |
| 51 | +**What worked.** It beat the best prior results on 9 of 12 tasks: "we achieve absolute improvements of 8.9% on commonsense reasoning (Stories Cloze Test)" among others `[1]`. | |
| 52 | + | |
| 53 | +**What went wrong or is missing.** Each task still needed its own fine-tuning pass. The paper gives no hardware, no training time, no token count and no cost, so nothing about run engineering can be learned from it. No public evidence found. | |
| 54 | + | |
| 55 | +### 2.2 GPT-2 (2019) | |
| 56 | + | |
| 57 | +**Data.** WebText: every outbound link on Reddit that "received at least 3 karma", used as a cheap stand-in for human curation. After duplicate removal and heuristic cleaning: "slightly over 8 million documents for a total of 40 GB of text", with all Wikipedia removed so benchmarks built on Wikipedia would not leak `[2]`. The authors rejected Common Crawl (a huge raw web scrape) because of "significant data quality issues", quoting prior work that found "documents whose content are mostly unintelligible" `[2]`. | |
| 58 | + | |
| 59 | +**Compute bet.** Four sizes from 117M to 1542M, batch size 512, context 1024 tokens, learning rate "manually tuned for the best perplexity on a 5% held-out sample" `[2]`. Perplexity is a score of how surprised the model is by held-out text; lower is better. Tokens and total compute: not stated in the paper. | |
| 60 | + | |
| 61 | +**What worked.** "State of the art results on 7 out of 8 tested language modeling datasets in a zero-shot setting", meaning with no task-specific training `[2]`. Quality rose steadily with size: "increasing it improves performance in a log-linear fashion across tasks" `[2]`. | |
| 62 | + | |
| 63 | +**Contamination.** They built Bloom filters (a compact lookup structure) over every 8-word sequence of WebText and measured overlap. Test sets of the language-modeling benchmarks overlapped WebText by 1 to 6%, 3.2% on average, and "many datasets have larger overlaps with their own training splits, with an average of 5.9% overlap" `[2]`. One benchmark, 1BW, overlapped its own training set by nearly 13.2% `[2]`. This is the first documented overlap check in the series, and it was done by the lab itself. | |
| 64 | + | |
| 65 | +**What went wrong.** | |
| 66 | +1. "All models still underfit WebText" `[2]`. Even the 1.5B model had not finished learning the data, so more training on the same data would have helped. | |
| 67 | +2. Release decision. OpenAI released only the smallest model in February 2019, withholding larger ones over misuse concerns `[3]`. Its own later report says: "In addition to finding minimal evidence of misuse so far, several other factors contributed to our confidence in publishing our 774 million and 1.5 billion parameter models" `[3]`. I read that as the withholding not being borne out by observed misuse; OpenAI's own wording is only "minimal evidence of misuse so far". | |
| 68 | +3. The paper reports no token count, compute or cost. Later work had to reconstruct them. Karpathy's reproduction notes that the original data "never released" so comparisons are "not a super fair comparison" `[26]`. | |
| 69 | + | |
| 70 | +### 2.3 GPT-3 (2020) | |
| 71 | + | |
| 72 | +**Data.** Table 2.2 of the paper, tokens per source `[4]`: | |
| 73 | + | |
| 74 | +| Source | Tokens | Share of training mix | Epochs when training for 300B tokens | | |
| 75 | +|---|---|---|---| | |
| 76 | +| Common Crawl (filtered) | 410 billion | 60% | 0.44 | | |
| 77 | +| WebText2 | 19 billion | 22% | 2.9 | | |
| 78 | +| Books1 | 12 billion | 8% | 1.9 | | |
| 79 | +| Books2 | 55 billion | 8% | 0.43 | | |
| 80 | +| Wikipedia | 3 billion | 3% | 3.4 | | |
| 81 | + | |
| 82 | +Common Crawl started as 45TB of compressed text across 41 monthly shards from 2016 to 2019 and ended at 570GB (roughly 400B tokens) after filtering `[4]`. The filter was a logistic regression classifier trained to tell WebText, Wikipedia and a books corpus (positive examples) from raw Common Crawl (negative examples), then used to resample; they also fuzzy-deduplicated with MinHashLSH, which cut dataset size by about 10% `[4]`. The mix was deliberately uneven: "datasets we view as higher-quality are sampled more frequently ... This essentially accepts a small amount of overfitting in exchange for higher quality training data" `[4]`. | |
| 83 | + | |
| 84 | +**Compute bet.** Almost entirely scale. 175B parameters on 300B tokens, 3.14e23 FLOPs by the paper's own 6-per-parameter-per-token count `[4]`. Batch size 3.2M tokens, learning rate 0.6e-4 at 175B, cosine decay, warmup over the first 375M tokens `[4]`. The paper says it followed Kaplan et al. `[5]`: "Based on the analysis in Scaling Laws For Neural Language Models [KMH+ 20] we train much larger models on many fewer tokens than is typical" `[4]`. | |
| 85 | + | |
| 86 | +**What worked.** Smooth gains with size across eight models. In the few-shot setting (the model sees a handful of examples inside the prompt, with no weight updates) it reached 71.2% on TriviaQA, which the authors call state of the art for that closed-book setting `[4]`. | |
| 87 | + | |
| 88 | +**What went wrong.** | |
| 89 | +1. **Undertrained for its size, by later evidence.** 300B tokens for 175B parameters is 1.71 tokens per parameter (calc:71054255f7f3). Chinchilla's own table says a compute-optimal 175B model wants 3.7 trillion tokens `[6]`, which is 12.3 times more (calc:f6f3e0c916107e0057ce). GPT-3's 3.14e23 FLOPs is 8.2% of the 3.85e24 that same table lists for a 175B model (calc:9b7c3a24235f). Chinchilla (70B parameters, 1.4T tokens, the same compute as Gopher) beat GPT-3, Gopher and others `[6]`. The cause was partly a method error upstream: Kaplan et al. used "a fixed number of training tokens and learning rate schedule for all models", which Chinchilla says made smaller-data runs look worse than they were and "contributes to the conclusion that model size should increase faster than training data size" `[6]`. Kaplan's own summary was "training very large models on a relatively modest amount of data and stopping significantly before convergence" `[5]`. OpenAI followed the published advice of its own scaling paper and it turned out to be wrong in the exponent. | |
| 90 | +2. **A known contamination bug that was not fixed.** "Unfortunately, a bug in the filtering caused us to ignore some overlaps, and due to the cost of training it was not feasible to retrain the model" `[4]`. They then ran an analysis on "clean" subsets of each benchmark and concluded that contamination mostly did not matter, but flagged PIQA (29% of examples flagged, a 3-point gap), Winograd and DROP as affected `[4]`. | |
| 91 | +3. **Poor sample efficiency, stated by the authors.** "It still sees much more text during pre-training than a human sees in their lifetime" `[4]`. | |
| 92 | +4. The paper does not state hardware count, wall-clock time, restarts or cost. The only hardware sentence is "V100 GPU's on part of a high-bandwidth cluster provided by Microsoft" `[4]`. No public evidence found for run stability. | |
| 93 | + | |
| 94 | +### 2.4 Codex (2021) | |
| 95 | + | |
| 96 | +**Data.** Collected in May 2020 from 54 million public GitHub repositories: 179 GB of unique Python files under 1 MB, filtered (auto-generated files, very long lines, low alphanumeric share) to 159 GB `[7]`. | |
| 97 | + | |
| 98 | +**Compute bet.** Fine-tune GPT-3 models of up to 12B parameters for 100 billion tokens `[7]`. | |
| 99 | + | |
| 100 | +**What worked.** On HumanEval (164 hand-written programming problems with unit tests), Codex-12B solved 28.81% with one sample and 72.31% with 100 samples; the same-size GPT model "solves no problems" `[7]`. Checking answers by running the tests, and sampling many answers then picking one that passes, was the larger lever than model size. | |
| 101 | + | |
| 102 | +**What went wrong or was learned.** | |
| 103 | +1. "We did not observe improvements when starting from a pre-trained language model, possibly because the fine-tuning dataset is so large. Nevertheless, models fine-tuned from GPT converge more quickly" `[7]`. In plain terms: starting from GPT-3's weights saved time but did not make the final model better than training on code from the beginning. | |
| 104 | +2. "Codex is not sample efficient to train ... a strong student who completes an introductory computer science course is expected to be able to solve a larger fraction of problems than Codex-12B" `[7]`. | |
| 105 | +3. It breaks down on long chains: "With each additional component, pass rate drops by roughly a factor of 2-3" `[7]`. | |
| 106 | + | |
| 107 | +### 2.5 InstructGPT (2022) | |
| 108 | + | |
| 109 | +**Data.** Labeler-written prompts plus prompts submitted to the OpenAI API: about 13k training prompts for supervised fine-tuning, 33k for the reward model, 31k for the reinforcement stage `[8]`. A team of 40 contractors did the labeling `[8]`. The result "aligns the behavior of GPT-3 to the stated preferences of a specific group of people (mostly our labelers and researchers), rather than any broader notion of 'human values'" `[8]`. | |
| 110 | + | |
| 111 | +**Compute bet.** Tiny compared with pretraining: "training our 175B PPO-ptx model requires 60 petaflops/s-days, compared to 3,640 petaflops/s-days for GPT-3" `[8]`, which is 1.65% (calc:9225de9e4894). | |
| 112 | + | |
| 113 | +**What worked.** "Outputs from the 1.3B parameter InstructGPT model are preferred to outputs from the 175B GPT-3, despite having 100x fewer parameters" `[8]`. It made up information in closed-domain tasks about half as often (21% vs 41%) and was about twice as truthful on TruthfulQA `[8]`. | |
| 114 | + | |
| 115 | +**What went wrong.** | |
| 116 | +1. "Alignment tax": during RLHF, performance dropped on public benchmarks such as SQuAD, DROP, HellaSwag and French-English translation; mixing pretraining data back in (the "ptx" variant) reduced it `[8]`. | |
| 117 | +2. No improvement on bias benchmarks: "InstructGPT does not significantly improve over GPT-3 on the Winogender and CrowSPairs datasets" `[8]`. | |
| 118 | +3. "Our models are neither fully aligned nor fully safe; they still generate toxic or biased outputs, make up facts, and generate sexual and violent content without explicit prompting" `[8]`. | |
| 119 | + | |
| 120 | +### 2.6 ChatGPT (Nov 2022) | |
| 121 | + | |
| 122 | +No fetchable primary page. The launch post on openai.com returned a block to my fetcher, and I did not find a technical document in its place. Training data, compute and failure modes: no public evidence found. Treat the date and the GPT-3.5 base as `[unverified]`. | |
| 123 | + | |
| 124 | +### 2.7 GPT-4 (2023) | |
| 125 | + | |
| 126 | +**Data.** "Publicly available data (such as internet data) and data licensed from third-party providers" `[9]`. Nothing else. The report says it "contains no further details about the architecture (including model size), hardware, training compute, dataset construction, training method, or similar", citing "the competitive landscape and the safety implications" `[9]`. | |
| 127 | + | |
| 128 | +**Compute bet.** Not disclosed by OpenAI. Epoch's estimate is about 2e25 FLOPs `[15]`, roughly 64 times GPT-3's 3.14e23 (2e25 / 3.14e23). Epoch's cost paper estimates $40M of amortized hardware and energy, and $800M to buy the hardware, with training finished in August 2022 `[10]`. | |
| 129 | + | |
| 130 | +**What worked (the part that matters for us).** OpenAI predicted the final loss before the run finished: "predicted GPT-4's final loss ... by fitting a scaling law ... from models trained using the same methodology but using at most 10,000x less compute than GPT-4. This prediction was made shortly after the run started, without use of any partial results" `[9]`. This is the single most reusable technique in the report. | |
| 131 | + | |
| 132 | +**What went wrong.** | |
| 133 | +1. **Hidden.** No size, data, hardware or method. Nobody outside can check the claims or learn from the run `[9]`. | |
| 134 | +2. **Contamination handled by hand.** "Portions of BIG-bench were inadvertently mixed into the training set, and we excluded it from our reported results"; for GSM-8K "we include part of the training set in GPT-4's pre-training mix" `[9]`. And: "We did not check the RLHF post-training data for contamination with TruthfulQA" `[9]`. | |
| 135 | +3. **RLHF damaged calibration.** "The pre-trained model is highly calibrated ... However, after the post-training process, the calibration is reduced" `[9]`. Calibration means the model's stated confidence matches how often it is right. | |
| 136 | +4. **Confident wrong answers.** "GPT-4 can also be confidently wrong in its predictions, not taking care to double-check work when it's likely to make a mistake" `[9]`. | |
| 137 | + | |
| 138 | +### 2.8 GPT-4 Turbo and GPT-4o (2023-2024) | |
| 139 | + | |
| 140 | +My fetches of the launch pages were blocked, and I found no technical report with scale numbers. Data, compute, cost, instability: no public evidence found. A search-result summary describes GPT-4o as one network trained end to end across text, vision and audio `[unverified]`. | |
| 141 | + | |
| 142 | +### 2.9 o1 and o3 (2024-2025) | |
| 143 | + | |
| 144 | +**Method.** o1 is "trained with large-scale reinforcement learning to reason using chain of thought" `[11]`. That means the model learns to write out a long reasoning trace before answering, and is rewarded when the final answer is correct. Data: "a mix of publicly available data, proprietary data accessed through partnerships, and custom datasets developed in-house", with filtering to remove personal information `[11]`. | |
| 145 | + | |
| 146 | +**Compute bet.** Shifted from pretraining to training after pretraining. Epoch reports "OpenAI has said that o3 is a 10x scale-up in training compute from o1", which Epoch reads as reasoning-training compute `[12]`. Epoch also expects that if reasoning training keeps growing 10x every few months it will "reach the frontier of total training compute before long, perhaps within a year", after which growth slows to about 4x a year `[12]`. | |
| 147 | + | |
| 148 | +**What worked.** Test-time thinking improved answers on hard problems; the o1 card's hallucination table shows o1-preview below GPT-4o on SimpleQA (0.44 vs 0.61 hallucination rate) and BirthdayFacts (0.32 vs 0.45) `[11]`. | |
| 149 | + | |
| 150 | +**What went wrong.** | |
| 151 | +1. The card itself reports contrary anecdotes: "we have received anecdotal feedback that o1-preview and o1-mini tend to hallucinate more than GPT-4o and GPT-4o-mini. More work is needed to understand hallucinations holistically" `[11]`. | |
| 152 | +2. Reward-hacking risk named in the card: "optimizing our models to prioritize user satisfaction could result in them providing overly agreeable or inaccurate responses" `[11]`. A monitor on the reasoning trace "did find a few forms of the model knowingly presenting incorrect information to the user or omitting important information" `[11]`. | |
| 153 | +3. No numbers on compute, data or cost in OpenAI's own documents. No public evidence found. | |
| 154 | + | |
| 155 | +### 2.10 GPT-4.5 (Feb 2025), also known in reporting as Orion | |
| 156 | + | |
| 157 | +**Compute bet.** The last big pretraining scale-up. OpenAI: "Building on GPT-4o, GPT-4.5 scales pre-training further" and "is OpenAI's largest LLM, improving on GPT-4's computational efficiency by more than 10x" `[13]`. Epoch's estimate: more than 1e26 FLOPs `[15]`; cost central $400M (range $170M to $890M) on 40,000 to 100,000 H100 GPUs for 90 to 165 days `[17]`. Another Epoch article gives "around $200 million on pre-training and $2 million on post-training GPT-4.5" `[16]`. The two Epoch figures disagree by 2x; I weight the $400M one because that page shows its inputs (cluster size and duration range). | |
| 158 | + | |
| 159 | +**What worked.** Lower hallucination: 0.19 on PersonQA against 0.52 for GPT-4o `[13]`. Reported by Willison from OpenAI's chart: SimpleQA hallucination 37.1% vs 61.8% for GPT-4o `[14]`. | |
| 160 | + | |
| 161 | +**What went wrong.** | |
| 162 | +1. **Price and positioning.** OpenAI: "very large and compute-intensive model, making it more expensive than and not a replacement for GPT-4o" `[14]`. Price was $75 per million input tokens and $150 per million output tokens against $2.50 and $10 for GPT-4o `[14]`. | |
| 163 | +2. **Small gain for the compute (reporting).** The Information reported, as relayed by The Decoder: "The quality improvement between GPT-4 and Orion is notably less significant than what we saw between GPT-3 and GPT-4", with researchers pointing "to insufficient high-quality training data as one reason for the slowdown" and Orion having "already trained partially on synthetic data from GPT-4" and o1 `[22]`. That is reporting, not an OpenAI statement, and the Decoder piece includes no direct OpenAI rebuttal; it cites Altman's optimism and Noam Brown's view instead `[22]`. A fetched copy of the original Information article was not available to me. | |
| 164 | +3. **Dropped.** Epoch: "OpenAI decided to prioritize scaling post-training, which had better returns on the margin", and GPT-5 "used less training compute than GPT-4.5" `[16]`. | |
| 165 | +4. The card's own wording on risk is mild ("did not find any significant increase in safety risk") and the card lists overrefusal on multimodal prompts as higher than GPT-4o's (0.31 vs 0.48 on a score where higher is better) `[13]`. I did not verify the direction of that metric beyond the card's sentence that GPT-4.5 "is more likely to overrefuse than the comparison models" `[13]`. | |
| 166 | + | |
| 167 | +### 2.11 GPT-4o sycophancy episode (Apr 2025) | |
| 168 | + | |
| 169 | +OpenAI shipped an update on April 25, 2025 that made GPT-4o "overly supportive but disingenuous", rolled it back, and said it was "informed too much by short-term feedback" and "did not fully account for how users' interactions with ChatGPT evolve over time" `[29]`. This is a post-training failure: the reward signal was a proxy for the real goal, and the offline checks did not catch it before release. The primary post was blocked to my fetcher; this is TechCrunch quoting it. | |
| 170 | + | |
| 171 | +### 2.12 GPT-5 (Aug 2025) and GPT-5.5, GPT-5.6, GPT-6 Astra (2026) | |
| 172 | + | |
| 173 | +**Method.** GPT-5 "is a unified system with a smart and fast model that answers most questions" plus a deeper reasoning model and "a real-time router" `[18]`. The reasoning models "are trained to reason through reinforcement learning" `[18]`. | |
| 174 | + | |
| 175 | +**Compute bet.** Not disclosed. Epoch's best guess: "~5e25 FLOP total, including both pre-training and reinforcement learning", with about 100B active parameters, at least 30T tokens, and a pretraining median of about 3e25 `[15]`. That is less than GPT-4.5 (more than 1e26) and more than twice GPT-4 (about 2e25) `[15]`. By Epoch's reading, the extra budget went into post-training `[16]`. | |
| 176 | + | |
| 177 | +**What worked (OpenAI's claims, not independently confirmed here).** "gpt-5-thinking has a hallucination rate 65% smaller than OpenAI o3"; "gpt-5-main performed nearly 3x better than the most recent GPT-4o model" at avoiding sycophancy `[18]`. Early online tests: sycophancy prevalence "fell by 69% for free users and 75% for paid users" `[18]`. | |
| 178 | + | |
| 179 | +**Later cards.** GPT-5.5 (April 23, 2026), GPT-5.6 (July 9, 2026) and GPT-6 Astra (September 3, 2026) each describe training on diverse filtered datasets and RL for reasoning; I found no parameter, token, compute or hardware disclosure in the portions I could read `[20][19][21]`. No public evidence found for Epoch compute estimates of these models. | |
| 180 | + | |
| 181 | +### 2.13 Where the money went (a check on Drake's question) | |
| 182 | + | |
| 183 | +Drake's suspicion was that the large labs are "fine-tuning out of thin air" rather than needing mass data and compute. The public record supports part of that and contradicts part: | |
| 184 | + | |
| 185 | +- Pretraining really did consume enormous compute and data: about 3e23 FLOPs for GPT-3 `[4]`, an estimated 2e25 for GPT-4 `[15]`, an estimated more than 1e26 for GPT-4.5 `[15]`. | |
| 186 | +- But Epoch estimates that "the majority of OpenAI's R&D compute in 2024 was likely allocated to research" and not to final training runs: about $5B of R&D compute, of which about $4.5B was for research, experimental and derisking runs and unreleased models, against roughly $469M for the final runs of GPT-4.5 and the other released models `[17]`. Epoch says these figures come from investor documents and press reports and "should not be considered completely reliable" `[17]`. | |
| 187 | +- The cheap-looking steps were not cheap in the sense that matters: InstructGPT's RLHF cost 1.65% of GPT-3's compute `[8]` and produced a model people preferred over one 100x larger. Method gained more per FLOP there than scale did. | |
| 188 | + | |
| 189 | +## 3. What the people who did it say, in their own words | |
| 190 | + | |
| 191 | +Only wording I fetched is quoted. Where a fetched page gave only a reporter's summary, it is said so. | |
| 192 | + | |
| 193 | +**Sam Altman (OpenAI CEO), MIT event, April 2023, as reported by TechCrunch `[23]`:** | |
| 194 | +- "I think we're at the end of the era where it's gonna be these giant models, and we'll make them better in other ways." | |
| 195 | +- On training GPT-5: "We are not and we won't be for some time." | |
| 196 | +- TechCrunch adds that he compared the focus on parameter count to the old chip gigahertz race and said the focus should stay on "rapidly increasing capability" `[23]`. | |
| 197 | +- What happened after: OpenAI released GPT-4.5 in February 2025, about 22 months later, and Epoch estimates it used more than 1e26 FLOPs `[14][15]`; it then moved its extra budget to post-training `[16]`. His statement described the direction; the company still ran one more giant pretraining run. | |
| 198 | + | |
| 199 | +**Ilya Sutskever (OpenAI co-founder and former chief scientist), NeurIPS, December 2024, as reported by Cointelegraph `[24]`:** | |
| 200 | +- "Data is not growing because we have but one internet." | |
| 201 | +- "You could even say that data is the fossil fuel of AI." | |
| 202 | +- The fetched article does not contain the line widely attributed to him that pre-training "as we know it will unquestionably end"; its own wording is the reporter's summary that "the age of artificial intelligence pre-training is ending". Search snippets attribute the longer line to him; I could not confirm it from a fetched page `[unverified]`. | |
| 203 | + | |
| 204 | +**Andrej Karpathy, July 2024 (small-model bet, as quoted by The Decoder `[25]`) and 2024 to 2026 (his GPT-2 reproductions `[26][27][28]`):** | |
| 205 | +- "My bet is that we'll see models that "think" very well and reliably that are very very small," | |
| 206 | +- The Decoder's paraphrase (not a verbatim quote): the most capable models are large because training forces them to memorize internet text, and large models are still needed to turn raw data into cleaner synthetic training data for smaller ones `[25]`. | |
| 207 | +- On his own reproduction of GPT-2: "In 2019, the training of GPT-2 cost approximately $43,000 so it is incredible that due to many advances over 7 years across the stack, we can now do so much faster and for well below $100" `[28]`. | |
| 208 | +- On training stability in his 1.5B reproduction: "I think we're not yet being sufficiently careful with our initialization, activation ranges, and overall model training stability and there are deeper issues that gradually drift the model into instability, especially for larger models and over long training duration" `[27]`. | |
| 209 | + | |
| 210 | +**The InstructGPT authors `[8]`:** | |
| 211 | +- What RLHF fixed: "outputs from the 1.3B parameter InstructGPT model are preferred to outputs from the 175B GPT-3, despite having 100x fewer parameters." | |
| 212 | +- What it did not: "InstructGPT still makes simple mistakes. For example, InstructGPT can still fail to follow instructions, make up facts, give long hedging answers to simple questions, or fail to detect instructions with false premises." | |
| 213 | +- "Our models are neither fully aligned nor fully safe." | |
| 214 | +- Whose preferences: the model is aligned "to the stated preferences of a specific group of people (mostly our labelers and researchers), rather than any broader notion of 'human values'." | |
| 215 | + | |
| 216 | +**The GPT-3 authors `[4]`:** | |
| 217 | +- "It still sees much more text during pre-training than a human sees in the their lifetime. Improving pre-training sample efficiency is an important direction for future work." | |
| 218 | +- On their contamination bug: "due to the cost of training it was not feasible to retrain the model." | |
| 219 | + | |
| 220 | +**The Codex authors `[7]`:** "Codex is not sample efficient to train." | |
| 221 | + | |
| 222 | +**Epoch AI analysts on the pivot after GPT-4.5 `[16]`:** "OpenAI decided to prioritize scaling post-training, which had better returns on the margin." Epoch is an outside group, not the people who did the work, so this is their interpretation. | |
| 223 | + | |
| 224 | +No public evidence found of OpenAI staff saying in their own words that they would have run GPT-3 on more tokens, or what they would change about GPT-4's hidden design. The closest primary statement is the GPT-3 paper's own contamination admission above. | |
| 225 | + | |
| 226 | +## 4. The compute question, answered with numbers | |
| 227 | + | |
| 228 | +**Question.** Which GPT-era models could one DGX Spark (NVIDIA GB10 chip) honestly reproduce? | |
| 229 | + | |
| 230 | +**Method.** Training FLOPs = 6 x parameters x tokens, the same rule GPT-3's paper uses (6 = 2 for the forward pass, times 3 to include the backward pass) `[4]`. Days = FLOPs / (usable FLOPs per second) / 86,400. | |
| 231 | + | |
| 232 | +**Chip speed assumptions, with sources.** | |
| 233 | +- Peak: 207.7 TFLOPS dense FP8, the figure given in this stream's brief. NVIDIA's own spec page, which I fetched, does not state that number. It states: "AI Compute : Up to 1,000 TOPS (trillion operations per second) inference and up to 1 PFLOP (petaFLOP) at FP4 precision with sparsity" `[30]`. If dense is half of sparse and FP8 is half of FP4, the page implies 250 TFLOPS dense FP8 (calc:317af6af297e). I use the lower brief figure; that halving rule is my reading, not an NVIDIA statement `[unverified]`. | |
| 234 | +- Utilization 45%. Source: Karpathy's llm.c, a from-scratch C/CUDA engine like the one we plan, measured 49.0% of the chip's peak on an A100 for the 124M model `[26]`, 47.3% on H100s for the 1.5B model `[27]`, and the README says "just below ~50% MFU" `[27]`. Those runs are 16-bit (bf16/fp16) on chips with mature kernels. Taking 45% for FP8 on a new chip with a new engine is optimistic; I add a pessimistic 25% column (my assumption, no source). | |
| 235 | +- A third column uses dense BF16 as half the FP8 rate (103.85 TFLOPS, calc:c4d85036fa92) at 45%, assuming the usual 2x step between 16-bit and 8-bit; that ratio is my assumption `[unverified]`. | |
| 236 | +- Not modeled: memory bandwidth (the NVIDIA page lists 273 GB/s `[30]`), memory capacity (128 GB `[30]`), data loading, restarts. The physics-gb10 stream owns those. | |
| 237 | + | |
| 238 | +Rate used: 207.7e12 x 0.45 = 9.3465e13 FLOPs per second (calc:fe580a68e80e). | |
| 239 | + | |
| 240 | +| Run | Params | Tokens | FLOPs | Days: FP8 at 45% | Days: FP8 at 25% | Days: BF16 at 45% | | |
| 241 | +|---|---|---|---|---|---|---| | |
| 242 | +| GPT-2 124M, Karpathy recipe | 124M | 10B `[26]` | 7.44e18 (calc:eaee28411d70) | 0.92 (calc:d829b2fcaba5) | 1.66 | 1.84 | | |
| 243 | +| GPT-2 1.5B ("1558M"), Karpathy recipe | 1558M | 33.55B (32,000 steps x 1,048,576, calc:c44a11ffd81f) `[27]` | 3.14e20 (calc:8fc5b5d73303) | 38.84 (calc:c365b849a40d) | 69.92 | 77.68 | | |
| 244 | +| GPT-3 Small | 125M | 300B `[4]` | 2.25e20 `[4]` | 27.86 (calc:b82d646e4d10) | 50.15 | 55.72 | | |
| 245 | +| GPT-3 Medium | 356M | 300B | 6.41e20 `[4]` | 79.38 (calc:0deb384ee11c) | 142.88 | 158.75 | | |
| 246 | +| GPT-3 Large | 760M | 300B | 1.37e21 `[4]` | 169.65 (calc:488f469ff286) | 305.37 | 339.30 | | |
| 247 | +| GPT-3 XL | 1.3B | 300B | 2.38e21 `[4]` | 294.72 (calc:50e240220b6a) | 530.50 | 589.45 | | |
| 248 | +| GPT-3 2.7B | 2.7B | 300B | 4.77e21 `[4]` | 590.68 (calc:dc17f2853720) | 1,063.23 | 1,181.37 | | |
| 249 | +| GPT-3 6.7B | 6.7B | 300B | 1.20e22 `[4]` | 1,486.00 (calc:6f3990299cc5) | 2,674.80 | 2,972.00 | | |
| 250 | +| GPT-3 13B | 13B | 300B | 2.31e22 `[4]` | 2,860.55 (calc:aef79bc422e5) | 5,148.99 | 5,721.10 | | |
| 251 | +| GPT-3 175B | 175B | 300B | 3.14e23 `[4]` | 38,883.64 (calc:35790f1ab06c), which is 106.5 years (calc:b9b9640bdc4e) | 69,990.55 | 77,767.28 | | |
| 252 | + | |
| 253 | +The 25% and BF16 columns are the first column times 1.8 (0.45 / 0.25, calc:0ad56432e0f6) and times 2. The GPT-3 FLOPs come from the paper's own Table D.1 `[4]`; my 6 x parameters x tokens check for 175B gives 3.15e23, matching. | |
| 254 | + | |
| 255 | +Same sizes, but with 20 tokens per parameter instead of 300B, the ratio Chinchilla found best for compute `[6]` (FLOPs = 120 x parameters squared): | |
| 256 | + | |
| 257 | +| Params | Tokens | Days: FP8 at 45% | | |
| 258 | +|---|---|---| | |
| 259 | +| 124M | 2.48B | 0.23 (calc:e6655387570d) | | |
| 260 | +| 760M | 15.2B | 8.58 (calc:8aebad75d578) | | |
| 261 | +| 1.3B | 26B | 25.11 (calc:c70de7859b4b) | | |
| 262 | +| 2.7B | 54B | 108.33 (calc:83d96ba3265e) | | |
| 263 | +| 6.7B | 134B | 667.06 (calc:2f507ac1c38f) | | |
| 264 | + | |
| 265 | +For context, Karpathy's 1.5B run used 33.55B tokens on 1558M parameters, which is 21.5 tokens per parameter (calc:0e474f41b97c), so that recipe sits at the Chinchilla ratio. One caution: Chinchilla's rule is about the best use of a fixed compute budget; for a model people will use many times, training longer on a smaller model also pays, and I found no OpenAI source on that choice. | |
| 266 | + | |
| 267 | +**What this tells Drake.** | |
| 268 | +- GPT-2 124M: yes. 0.92 days at 45% and 1.66 days at the pessimistic 25%. It is a good first end-to-end test of the whole stack. | |
| 269 | +- GPT-2 1.5B: yes, but long. About 39 days at 45% FP8 and about 70 to 78 days at the pessimistic columns, only if the engine really reaches 25% to 45% utilization on GB10. That has not been measured. | |
| 270 | +- GPT-3 sizes at OpenAI's 300B tokens: only the smallest two are practical (28 to 79 days at 45%); the 175B model is 106 years at 45% FP8. One Spark cannot reproduce GPT-3 as OpenAI ran it. | |
| 271 | +- GPT-3-sized models become reachable only by training on far fewer tokens than OpenAI used, at the 20-tokens-per-parameter ratio: 760M in about 9 days, 1.3B in about 25 days, 2.7B in about 108 days, all at 45% FP8. | |
| 272 | +- Reference point from outside: nanochat now claims GPT-2-level quality in about 2 hours for $48 on an 8-GPU H100 node `[28]`. That shows the algorithm side is cheap; the one-Spark question is how fast our own engine runs on one chip. | |
| 273 | + | |
| 274 | +## 5. Lessons table | |
| 275 | + | |
| 276 | +"Our engine" means Omega (our C GPU path) and AIEN Rust. Where a lesson names a framework, the last column says what we would have to build ourselves. | |
| 277 | + | |
| 278 | +| # | Lesson | Evidence | What it means for one GB10 on our engine | | |
| 279 | +|---|---|---|---| | |
| 280 | +| 1 | Curate the data; raw web text is poor. | GPT-2 rejected Common Crawl for "significant data quality issues" and built WebText from links with 3+ Reddit karma `[2]`. GPT-3 shrank 45TB to 570GB with a quality classifier `[4]`. | At 10B to 35B tokens, every token counts. Build our own quality filter and near-duplicate remover, then measure its effect on a small run before the big one. | | |
| 281 | +| 2 | Pick tokens per parameter on purpose. GPT-3 used about 1.7. | 300B tokens for 175B parameters (calc:71054255f7f3); Chinchilla's rule gives 3.7T for that size `[6]`. | Fix the token budget first (what the Spark can read in weeks), then choose the model size that budget supports. Start near 20 tokens per parameter. | | |
| 282 | +| 3 | Make the learning-rate schedule end exactly where the run ends. | Chinchilla says Kaplan's fixed schedule across runs biased the size-versus-data conclusion `[6]`. | Our scheduler must take the planned token total as an input. Never extrapolate from a run whose schedule was longer. | | |
| 283 | +| 4 | Predict the big run from small runs, before spending. | GPT-4's final loss was predicted from runs up to 10,000x smaller `[9]`. | Build a ladder of tiny runs (minutes each) and fit a curve. One Spark can do this; it is the cheapest way to avoid a bad 39-day run. | | |
| 284 | +| 5 | Most compute goes to experiments, not the final run. | Epoch: about $4.5B of OpenAI's $5B 2024 R&D compute went to research and unreleased runs, against about $469M for released final runs (reliability caveat in `[17]`). | Budget the Spark for many short ablations (data mixes, learning rates, sizes) and only a few full runs. Plan the calendar around that. | | |
| 285 | +| 6 | Remove benchmark leaks before training and prove the remover works. | GPT-3 had a filtering bug and could not retrain `[4]`. GPT-4 found BIG-bench inside its training set and trained on part of GSM-8K `[9]`. GPT-2 measured 8-gram overlap `[2]`. | Write an overlap filter into our data path that runs on the exact shards used. Test it with a planted leak that it must catch. Run it before a run starts, since a bug found afterwards costs the whole run. | | |
| 286 | +| 7 | Report scores on the clean subset as well as the full set. | GPT-3 compared performance on "clean" subsets, and PIQA lost 3 points on its clean subset `[4]`. | Our evaluation harness prints both numbers for every benchmark. | | |
| 287 | +| 8 | Starting from existing weights speeds training but did not raise the final result when the new data is large. | Codex: "we did not observe improvements when starting from a pre-trained language model ... models fine-tuned from GPT converge more quickly" `[7]`. | Reusing our own earlier checkpoint saves time; do not count on it to beat a clean run on large data. | | |
| 288 | +| 9 | Post-training is cheap and can beat 100x more parameters. | RLHF added 60 PF-days against 3,640 for pretraining, 1.65% (calc:9225de9e4894); the 1.3B result beat 175B GPT-3 in labeler preference `[8]`. | Plan a post-training stage from day one. We must build ourselves: supervised fine-tuning loop, a reward model, and the policy-update step (PPO or a simpler preference method). | | |
| 289 | +| 10 | Post-training costs some ability on other tasks unless you mix pretraining data back in. | InstructGPT "alignment tax" on SQuAD, DROP, HellaSwag, translation; the "ptx" mix reduced it `[8]`. | Keep a fixed regression suite and run it after every post-training step. | | |
| 290 | +| 11 | Optimizing a feedback proxy makes models flatter you and sounds more sure than it should. | RLHF reduced calibration in GPT-4 `[9]`; the April 2025 GPT-4o update leaned on "short-term feedback" and became "overly supportive but disingenuous" `[29]`; the o1 card names the same risk `[11]`. | Never train against thumbs-up style signals alone. Hold out sycophancy and calibration tests that the training signal cannot see. | | |
| 291 | +| 12 | Where there is an automatic checker, use it as the reward and as the filter. | Codex scored by running unit tests; 28.81% with one sample, 72.31% with 100 `[7]`. o1-style training rewards correct final answers `[11]`. | Verifier-based sampling and training (code with tests, math with exact answers) fits one box: it needs a sandbox runner and a sampler, not a human panel. We build both. | | |
| 292 | +| 13 | Spending more at answer time is a second dial. | OpenAI says o3 used about 10x o1's training compute for reasoning, and performance rises with thinking time `[12]`. | Our decode speed (separate stream) directly sets how much thinking a small model can afford. | | |
| 293 | +| 14 | Expect loss spikes; detect and skip them, and log enough to see them coming. | Karpathy's 1.5B run: "more smaller spikes along the way ... the code is configured to detect ... instantaneous instability and skips update" and still "becomes unstable ... and explodes" `[27]`. OpenAI's GPT-3 paper reports none; no public evidence found. | Build in our engine: gradient-norm and loss monitors with an automatic skip rule, frequent checkpoints, and a tested restart from checkpoint. A 39-day run cannot rely on luck. | | |
| 294 | +| 15 | A tuned engine reaches about half of peak arithmetic speed, not all of it. | 47% to 49% MFU in llm.c on A100 and H100 `[26][27]`. | Use 45% as a ceiling for planning until the GB10 measurement exists; report speed against the 207.7 TFLOPS peak, as the stream rules require. | | |
| 295 | +| 16 | Disclosure shrinks as value grows, so outside numbers for newer models are estimates. | GPT-4 report withholds size, hardware, compute `[9]`; GPT-5.5 and Astra cards give no scale numbers `[20][21]`; every compute number for GPT-4 onward in this document is Epoch's `[15]`. | Do not calibrate against hidden recipes. Record our own run's tokens, FLOPs, hardware, hours and cost in a receipt, so our numbers are checkable. | | |
| 296 | +| 17 | The last very large pretraining run gave a poor return for its price. | GPT-4.5 cost an estimated $400M, priced at $75/$150 per million tokens `[17][14]`, was "not a replacement for GPT-4o" `[14]`, and reporting said gains were "notably less significant" than GPT-3 to GPT-4 `[22]` (reporting, disputed in part `[22]`). | Our scale is many orders of magnitude below this regime. Do not use frontier results as a reason to expect the same scaling curve. | | |
| 297 | +| 18 | Better data and method can substitute for size at small scale. | 1.3B InstructGPT preferred over 175B GPT-3 `[8]`; Karpathy bets on "very very small" models that think well `[25]`; GPT-2-level training now takes about 2 hours on an 8-GPU node `[28]`. | Aim for a small model with strong data and post-training, not a GPT-3 clone. | | |
| 298 | +| 19 | Reproducing old models is now cheap, which makes them good sanity targets. | GPT-2 124M in about 90 minutes for $20 on 8 A100s `[26]`; 1.5B in 24 hours for $672 on 8 H100s `[27]`. | Use GPT-2 124M and its published curves to check our engine end to end before anything bigger. | | |
| 299 | +| 20 | Fix the evaluation set and tokenizer before comparing to history. | Karpathy: loss on FineWeb is "not a super fair comparison" with a model trained on different, unreleased data `[26]`. | Pick two or three fixed evals and one tokenizer and keep them for the whole project. | | |
| 300 | +| 21 | Repeating good data a few times is a deliberate choice; know the cost. | GPT-3 sampled quality sources 2 to 3 times, "a small amount of overfitting in exchange for higher quality" `[4]`; GPT-1 made 100 passes `[1]`. | At our token budget we will repeat data. Choose epochs from small-run measurements, not by habit. | | |
| 301 | +| 22 | Labeling reflects who labels. | InstructGPT aligned to "mostly our labelers and researchers" `[8]`. | Whoever writes our preference data sets the model's taste; write down who they are and what instructions they got. | | |
| 302 | +| 23 | A withheld model is only as safe as the withholding is justified. | OpenAI later reported "minimal evidence of misuse so far" after withholding GPT-2 `[3]`. | Release decisions need a written test, not a guess, so they can be reviewed later. | | |
| 303 | + | |
| 304 | +## Limits of this document | |
| 305 | + | |
| 306 | +- openai.com pages (GPT-2 release post, ChatGPT launch, o1 blog, GPT-4o launch, GPT-4.5 and GPT-6 Astra launch posts, the sycophancy post) returned a block to my fetcher. Where the primary page was unavailable I used the lab's PDF system cards, the deployment-safety pages, or named secondary reporting, and said so. | |
| 307 | +- The Information's original Orion article was not fetched. It is cited only through The Decoder. | |
| 308 | +- Epoch's database entries for GPT-1, GPT-2 and GPT-3 compute were not reachable; GPT-3 uses the paper's own table, GPT-1 and GPT-2 show "not stated". | |
| 309 | +- `[unverified]` marks load-bearing items with no fetched page behind them: ChatGPT and GPT-4o dates and methods, the "pre-training will unquestionably end" quote, and the two hardware-ratio assumptions in section 4. | |
| 310 | +- The calculator expressions and receipt id prefixes for every number in section 4 are in `docs/history/openai.calc.txt`; re-running an expression reproduces its id. | |
| 311 | + | |
| 312 | +## Sources | |
| 313 | + | |
| 314 | +Each entry: `[n]` URL, title, date, the page's own words. "Accessed 2026-10-20" for all. Quotes marked "(extracted)" were returned by the fetch tool's page reader and not copied by me from the raw page. | |
| 315 | + | |
| 316 | +[1] https://cdn.openai.com/research-covers/language-unsupervised/language_understanding_paper.pdf. "Improving Language Understanding by Generative Pre-Training", 2018. "It contains over 7,000 unique unpublished books from a variety of genres including Adventure, Fantasy, and Romance." and "We train for 100 epochs on minibatches of 64 randomly sampled, contiguous sequences of 512 tokens." | |
| 317 | + | |
| 318 | +[2] https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf. "Language Models are Unsupervised Multitask Learners", 2019. URL taken from a fetched page (UMass course slides). "...which after de-duplication and some heuristic based cleaning contains slightly over 8 million documents for a total of 40 GB of text." and "The smallest model is equivalent to the original GPT" and "All models still underfit WebText." | |
| 319 | + | |
| 320 | +[3] https://arxiv.org/pdf/1908.09203. "Release Strategies and the Social Impacts of Language Models", OpenAI report, November 2019. "In addition to finding minimal evidence of misuse so far, several other factors contributed to our confidence in publishing our 774 million and 1.5 billion parameter models." | |
| 321 | + | |
| 322 | +[4] https://arxiv.org/pdf/2005.14165. "Language Models are Few-Shot Learners", 2020. "All models were trained for a total of 300 billion tokens." and "Unfortunately, a bug in the filtering caused us to ignore some overlaps, and due to the cost of training it was not feasible to retrain the model." and "All models were trained on V100 GPU's on part of a high-bandwidth cluster provided by Microsoft." | |
| 323 | + | |
| 324 | +[5] https://arxiv.org/pdf/2001.08361. "Scaling Laws for Neural Language Models", Kaplan et al., January 2020. "Larger models are significantly more sample-efficient, such that optimally compute-efficient training involves training very large models on a relatively modest amount of data and stopping significantly before convergence." | |
| 325 | + | |
| 326 | +[6] https://arxiv.org/pdf/2203.15556. "Training Compute-Optimal Large Language Models", Hoffmann et al., March 2022. "the model size and the number of training tokens should be scaled equally: for every doubling of model size the number of training tokens should also be doubled." and "First, the authors use a fixed number of training tokens and learning rate schedule for all models; this prevents them from modelling the impact of these hyperparameters on the loss." and Table 3 row "175 Billion 3.85e+24 6.7 3.7 Trillion". | |
| 327 | + | |
| 328 | +[7] https://arxiv.org/pdf/2107.03374. "Evaluating Large Language Models Trained on Code", July 2021. "Our training dataset was collected in May 2020 from 54 million public software repositories hosted on GitHub, containing 179 GB of unique Python files under 1 MB." and "we did not observe improvements when starting from a pre-trained language model, possibly because the fine-tuning dataset is so large. Nevertheless, models fine-tuned from GPT converge more quickly, so we apply this strategy for all subsequent experiments." | |
| 329 | + | |
| 330 | +[8] https://arxiv.org/pdf/2203.02155. "Training language models to follow instructions with human feedback", 2022. "outputs from the 1.3B parameter InstructGPT model are preferred to outputs from the 175B GPT-3, despite having 100x fewer parameters." and "training our 175B PPO-ptx model requires 60 petaflops/s-days, compared to 3,640 petaflops/s-days for GPT-3". | |
| 331 | + | |
| 332 | +[9] https://arxiv.org/pdf/2303.08774.pdf. "GPT-4 Technical Report", March 2023. "this report contains no further details about the architecture (including model size), hardware, training compute, dataset construction, training method, or similar." and "but using at most 10,000x less compute than GPT-4. This prediction was made shortly after the run started, without use of any partial results." | |
| 333 | + | |
| 334 | +[10] https://arxiv.org/pdf/2405.21015. "The rising costs of training frontier AI models", Epoch AI, 2024. "we estimate that it cost $800M to acquire the hardware used to train GPT-4, compared to $40M for the amortized hardware CapEx + energy cost." and "GPT-4 finished training in August 2022 [12]." | |
| 335 | + | |
| 336 | +[11] https://cdn.openai.com/o1-system-card.pdf. "OpenAI o1 System Card", September 12, 2024. "The o1 model series is trained with large-scale reinforcement learning to reason using chain of thought." and "However, we have received anecdotal feedback that o1-preview and o1-mini tend to hallucinate more than GPT-4o and GPT-4o-mini." | |
| 337 | + | |
| 338 | +[12] https://epoch.ai/gradient-updates/how-far-can-reasoning-models-scale. "How far can reasoning models scale?", Epoch AI, May 9, 2025. (extracted) "OpenAI has said that o3 is a 10× scale-up in training compute from o1." | |
| 339 | + | |
| 340 | +[13] https://readwise.io/reader/shared/01jn5hqchawxdy6h0ys7nvk99g. Mirror of "OpenAI GPT-4.5 System Card", February 27, 2025 (OpenAI's own page returned HTTP 403). (extracted) "Building on GPT-4o, GPT-4.5 scales pre-training further and is designed to be more general-purpose" and "it is OpenAI's largest LLM, improving on GPT-4's computational efficiency by more than 10x." | |
| 341 | + | |
| 342 | +[14] https://feeds.simonwillison.net/2025/Feb/27/introducing-gpt-45/. "Introducing GPT-4.5", Simon Willison, February 27, 2025. (extracted) "GPT‑4.5 is a very large and compute-intensive model, making it more expensive than and not a replacement for GPT‑4o." | |
| 343 | + | |
| 344 | +[15] https://epochai.substack.com/p/notes-on-gpt-5-training-compute. "Notes on GPT-5 training compute", Epoch AI, October 13, 2025. (extracted) "Our best guess: GPT-5 was trained on ~5e25 FLOP total, including both pre-training and reinforcement learning." and "That would be more than twice as much as GPT-4 (~2e25 FLOP), but less than GPT-4.5 (>1e26 FLOP)." | |
| 345 | + | |
| 346 | +[16] https://epoch.ai/gradient-updates/why-gpt5-used-less-training-compute-than-gpt45-but-gpt6-probably-wont. "Why GPT-5 used less training compute than GPT-4.5 (but GPT-6 probably won't)", Epoch AI, September 26, 2025. (extracted) "OpenAI decided to prioritize scaling post-training, which had better returns on the margin." and "around $200 million on pre-training and $2 million on post-training GPT-4.5." | |
| 347 | + | |
| 348 | +[17] https://epoch.ai/data-insights/openai-compute-spend. "Most of OpenAI's 2024 compute went to experiments", Epoch AI, October 10, 2025. (extracted) "the majority of OpenAI's R&D compute in 2024 was likely allocated to research" and "should not be considered completely reliable." Figures used: GPT-4.5 cost low $170M, central $400M, high $890M; 40,000 to 100,000 H100; 90 to 165 days. | |
| 349 | + | |
| 350 | +[18] https://deploymentsafety.openai.com/gpt-5. "GPT-5 System Card", August 7, 2025. (extracted) "gpt-5-thinking has a hallucination rate 65% smaller than OpenAI o3" and "a unified system with a smart and fast model that answers most questions" and "OpenAI reasoning models are trained to reason through reinforcement learning." | |
| 351 | + | |
| 352 | +[19] https://deploymentsafety.openai.com/. "OpenAI Deployment Safety Hub: System cards". (extracted) "Jul 09, 2026: "GPT-5.6 System Card"" and "Sep 03, 2026: "GPT-6 Astra System Card"". | |
| 353 | + | |
| 354 | +[20] https://deploymentsafety.openai.com/gpt-5-5. "GPT-5.5 System Card", April 23, 2026. (extracted) "a new model designed for complex, real-world work". | |
| 355 | + | |
| 356 | +[21] https://deploymentsafety.openai.com/gpt-6-astra. "GPT-6 Astra System Card", September 3, 2026. (extracted) "the most capable model we have ever broadly deployed" and "was trained on diverse datasets and filtered through our data processing pipeline." | |
| 357 | + | |
| 358 | +[22] https://the-decoder.com/openais-new-orion-model-reportedly-shows-small-gains-over-gpt-4/. "OpenAI's new Orion model reportedly shows small gains over GPT-4", The Decoder, November 10, 2024 (reporting on The Information). (extracted) "The quality improvement between GPT-4 and Orion is notably less significant than what we saw between GPT-3 and GPT-4." and "point to insufficient high-quality training data as one reason for the slowdown." | |
| 359 | + | |
| 360 | +[23] https://techcrunch.com/2023/04/14/sam-altman-size-of-llms-wont-matter-as-much-moving-forward. Ron Miller, TechCrunch, April 14, 2023. (extracted) "I think we're at the end of the era where it's gonna be these giant models, and we'll make them better in other ways." and "We are not and we won't be for some time." | |
| 361 | + | |
| 362 | +[24] https://cointelegraph.com/news/age-ai-pre-training-soon-come-end-open-ai-co-founder. Cointelegraph, December 15, 2024. (extracted) "Data is not growing because we have but one internet." and "You could even say that data is the fossil fuel of AI." | |
| 363 | + | |
| 364 | +[25] https://the-decoder.com/ai-models-might-need-to-scale-down-to-scale-up-again/. "AI models might need to scale down to scale up again", Matthias Bastian, The Decoder, July 19, 2024. (extracted) "My bet is that we'll see models that "think" very well and reliably that are very very small," | |
| 365 | + | |
| 366 | +[26] https://github.com/karpathy/llm.c/discussions/481. "Reproducing GPT-2 (124M) in llm.c in 90 minutes for $20", Andrej Karpathy, May 28, 2024. "With llm.c, which is quite efficient at up to ~60% model flops utilization, reproducing this model on one 8X A100 80GB SXM node takes ~90 minutes." and "so it's not a super fair comparison" and the log line "49.0% A100 fp16 MFU". | |
| 367 | + | |
| 368 | +[27] https://github.com/karpathy/llm.c/discussions/677. "Let's reproduce GPT-2 (1.6B): one 8XH100 node, 24 hours, $672, in llm.c", Andrej Karpathy, July 11, 2024. "By the end we'll have processed 32,000 * 1048576 = 33.6B tokens in total." and "It is efficient, at just below ~50% MFU." and "but sadly becomes unstable there on and explodes." | |
| 369 | + | |
| 370 | +[28] https://github.com/karpathy/nanochat. nanochat README, accessed 2026-10-20. "In 2019, the training of GPT-2 cost approximately $43,000 so it is incredible that due to many advances over 7 years across the stack, we can now do so much faster and for well below $100" and leaderboard row "0 | 168 hours | - | 0.2565 | Original OpenAI GPT-2 checkpoint | 2019 | - | OpenAI". | |
| 371 | + | |
| 372 | +[29] https://techcrunch.com/2025/04/29/openai-explains-why-chatgpt-became-too-sycophantic. Kyle Wiggers, TechCrunch, April 29, 2025. (extracted) "informed too much by 'short-term feedback'" and "GPT‑4o skewed towards responses that were overly supportive but disingenuous". | |
| 373 | + | |
| 374 | +[30] https://docs.nvidia.com/dgx/dgx-spark/hardware.html. "Hardware Overview", NVIDIA DGX Spark documentation, undated. "AI Compute : Up to 1,000 TOPS (trillion operations per second) inference and up to 1 PFLOP (petaFLOP) at FP4 precision with sparsity" and "128 GB LPDDR5x unified system memory, 256-bit interface, 4266 MHz, 273 GB/s bandwidth". |
docs/history/openai.sources.json
| new file mode 100644 | ||
| @@ -0,0 +1,32 @@ | ||
| 1 | +[ | |
| 2 | +{"n":1,"url":"https://cdn.openai.com/research-covers/language-unsupervised/language_understanding_paper.pdf","title":"Improving Language Understanding by Generative Pre-Training","accessed":"2026-10-20"}, | |
| 3 | +{"n":2,"url":"https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf","title":"Language Models are Unsupervised Multitask Learners","accessed":"2026-10-20"}, | |
| 4 | +{"n":3,"url":"https://arxiv.org/pdf/1908.09203","title":"Release Strategies and the Social Impacts of Language Models","accessed":"2026-10-20"}, | |
| 5 | +{"n":4,"url":"https://arxiv.org/pdf/2005.14165","title":"Language Models are Few-Shot Learners","accessed":"2026-10-20"}, | |
| 6 | +{"n":5,"url":"https://arxiv.org/pdf/2001.08361","title":"Scaling Laws for Neural Language Models","accessed":"2026-10-20"}, | |
| 7 | +{"n":6,"url":"https://arxiv.org/pdf/2203.15556","title":"Training Compute-Optimal Large Language Models","accessed":"2026-10-20"}, | |
| 8 | +{"n":7,"url":"https://arxiv.org/pdf/2107.03374","title":"Evaluating Large Language Models Trained on Code","accessed":"2026-10-20"}, | |
| 9 | +{"n":8,"url":"https://arxiv.org/pdf/2203.02155","title":"Training language models to follow instructions with human feedback","accessed":"2026-10-20"}, | |
| 10 | +{"n":9,"url":"https://arxiv.org/pdf/2303.08774.pdf","title":"GPT-4 Technical Report","accessed":"2026-10-20"}, | |
| 11 | +{"n":10,"url":"https://arxiv.org/pdf/2405.21015","title":"The rising costs of training frontier AI models","accessed":"2026-10-20"}, | |
| 12 | +{"n":11,"url":"https://cdn.openai.com/o1-system-card.pdf","title":"OpenAI o1 System Card","accessed":"2026-10-20"}, | |
| 13 | +{"n":12,"url":"https://epoch.ai/gradient-updates/how-far-can-reasoning-models-scale","title":"How far can reasoning models scale?","accessed":"2026-10-20"}, | |
| 14 | +{"n":13,"url":"https://readwise.io/reader/shared/01jn5hqchawxdy6h0ys7nvk99g","title":"OpenAI GPT-4.5 System Card (mirror)","accessed":"2026-10-20"}, | |
| 15 | +{"n":14,"url":"https://feeds.simonwillison.net/2025/Feb/27/introducing-gpt-45/","title":"Introducing GPT-4.5 (Simon Willison)","accessed":"2026-10-20"}, | |
| 16 | +{"n":15,"url":"https://epochai.substack.com/p/notes-on-gpt-5-training-compute","title":"Notes on GPT-5 training compute","accessed":"2026-10-20"}, | |
| 17 | +{"n":16,"url":"https://epoch.ai/gradient-updates/why-gpt5-used-less-training-compute-than-gpt45-but-gpt6-probably-wont","title":"Why GPT-5 used less training compute than GPT-4.5 (but GPT-6 probably won't)","accessed":"2026-10-20"}, | |
| 18 | +{"n":17,"url":"https://epoch.ai/data-insights/openai-compute-spend","title":"Most of OpenAI's 2024 compute went to experiments","accessed":"2026-10-20"}, | |
| 19 | +{"n":18,"url":"https://deploymentsafety.openai.com/gpt-5","title":"GPT-5 System Card","accessed":"2026-10-20"}, | |
| 20 | +{"n":19,"url":"https://deploymentsafety.openai.com/","title":"OpenAI Deployment Safety Hub: System cards","accessed":"2026-10-20"}, | |
| 21 | +{"n":20,"url":"https://deploymentsafety.openai.com/gpt-5-5","title":"GPT-5.5 System Card","accessed":"2026-10-20"}, | |
| 22 | +{"n":21,"url":"https://deploymentsafety.openai.com/gpt-6-astra","title":"GPT-6 Astra System Card","accessed":"2026-10-20"}, | |
| 23 | +{"n":22,"url":"https://the-decoder.com/openais-new-orion-model-reportedly-shows-small-gains-over-gpt-4/","title":"OpenAI's new Orion model reportedly shows small gains over GPT-4","accessed":"2026-10-20"}, | |
| 24 | +{"n":23,"url":"https://techcrunch.com/2023/04/14/sam-altman-size-of-llms-wont-matter-as-much-moving-forward","title":"Sam Altman: size of LLMs won't matter as much moving forward","accessed":"2026-10-20"}, | |
| 25 | +{"n":24,"url":"https://cointelegraph.com/news/age-ai-pre-training-soon-come-end-open-ai-co-founder","title":"Age of AI pre-training soon to end, OpenAI co-founder says","accessed":"2026-10-20"}, | |
| 26 | +{"n":25,"url":"https://the-decoder.com/ai-models-might-need-to-scale-down-to-scale-up-again/","title":"AI models might need to scale down to scale up again","accessed":"2026-10-20"}, | |
| 27 | +{"n":26,"url":"https://github.com/karpathy/llm.c/discussions/481","title":"Reproducing GPT-2 (124M) in llm.c in 90 minutes for $20","accessed":"2026-10-20"}, | |
| 28 | +{"n":27,"url":"https://github.com/karpathy/llm.c/discussions/677","title":"Let's reproduce GPT-2 (1.6B): one 8XH100 node, 24 hours, $672, in llm.c","accessed":"2026-10-20"}, | |
| 29 | +{"n":28,"url":"https://github.com/karpathy/nanochat","title":"nanochat README","accessed":"2026-10-20"}, | |
| 30 | +{"n":29,"url":"https://techcrunch.com/2025/04/29/openai-explains-why-chatgpt-became-too-sycophantic","title":"OpenAI explains why ChatGPT became too sycophantic","accessed":"2026-10-20"}, | |
| 31 | +{"n":30,"url":"https://docs.nvidia.com/dgx/dgx-spark/hardware.html","title":"Hardware Overview (NVIDIA DGX Spark)","accessed":"2026-10-20"} | |
| 32 | +] |
docs/history/others.md
| new file mode 100644 | ||
| @@ -0,0 +1,787 @@ | ||
| 1 | +# How the other labs trained their models: what went right, what went wrong | |
| 2 | + | |
| 3 | +Stream L277, branch `study/others`, written 2026-10-20. Sibling streams: L276 (OpenAI), L278 (efficiency), L279 (GB10 physics), L280 (synthesis). | |
| 4 | + | |
| 5 | +## Why this document exists | |
| 6 | + | |
| 7 | +Drake's question: are the big labs really putting mass amounts of data and compute into their models, or are they "fine-tuning out of thin air"? And if we knew every pitfall up front, what would we do differently on one DGX Spark (a single GB10 chip) running our own engine? | |
| 8 | + | |
| 9 | +This document answers from the public record. It covers Google and DeepMind, Meta, BigScience (BLOOM), DeepSeek, Anthropic, xAI, Mistral, Microsoft's phi models, Alibaba's Qwen, and the two labs that published whole training runs (EleutherAI's Pythia and AI2's OLMo). Each lab gets a short chapter: the data, the compute bet, what measurably worked, what went wrong, and what the lab itself said it learned. The last section is a table of 32 lessons, each with its evidence and what it means for our machine. | |
| 10 | + | |
| 11 | +## Short answer to Drake's challenge | |
| 12 | + | |
| 13 | +The public record says the labs do put in enormous data and compute. The largest open runs in the timeline tables used 14.8 trillion tokens (DeepSeek-V3) [1] and 15.6 trillion tokens (Llama 3.1 405B) [2]. But the record also says three things that help us. | |
| 14 | + | |
| 15 | +1. Most of the large-run pain was not "not enough compute". It was things breaking: bad hardware, numbers overflowing, training curves spiking. Every lab that published a log reports weeks of lost time to these. A small machine has fewer parts to break, but the same numeric traps. | |
| 16 | +2. Scale was often wasted by choosing the wrong split between model size and data. Chinchilla showed that the biggest 2021 models were trained on too little data [3]. Meta then went the other way on purpose: it trained small models far past the Chinchilla point to make them cheap to run [4]. For a single GB10, running cost matters more than for a lab with a data center, so the Llama reasoning is the closer fit. | |
| 17 | +3. The best-documented case of engineering beating raw compute is DeepSeek-V3: roughly 11.5 times fewer training FLOPs (floating-point operations, the basic unit of compute) than Llama 3.1 405B by Epoch's estimates (`calc:df65e8`). Much of that comes from work at the level of numbers and GPU kernels, which is exactly the layer Omega owns. | |
| 18 | + | |
| 19 | +## How to read this document | |
| 20 | + | |
| 21 | +- Every outside claim has a number in square brackets, like [3]. The `Sources` section at the end gives the URL and the exact sentence from that page. Numbers are copied as the source states them, with the hardware they were measured on. | |
| 22 | +- "Epoch" means Epoch AI, an independent research group that estimates training compute for notable models. Its numbers are estimates and are labeled that way. | |
| 23 | +- "FLOPs" is the total count of arithmetic operations. A rule of thumb, "6ND", says training compute is about 6 times the parameter count (N) times the token count (D). A "token" is a piece of text, roughly three quarters of a word. "Parameters" are the adjustable numbers inside the model. "Active parameters" matters for mixture-of-experts models (see DeepSeek chapter). | |
| 24 | +- "n/s" in a table means the source I fetched does not state it. A lab that does not publish a number is itself a finding, and I say so in the text. | |
| 25 | +- Where a figure is my own arithmetic, it carries an `aien-calc` receipt id, like `calc:6f83`, so it can be re-checked. | |
| 26 | +- Reporting (news articles) is labeled as reporting. Primary sources (papers, model cards, logbooks, lab blog posts) come first. | |
| 27 | + | |
| 28 | +--- | |
| 29 | + | |
| 30 | +# 1. Google and DeepMind | |
| 31 | + | |
| 32 | +## The data and the bet | |
| 33 | + | |
| 34 | +Google's early work was about architecture, then about scale, then about getting the split between size and data right. | |
| 35 | + | |
| 36 | +The Transformer paper (2017) trained its big translation model for 300,000 steps, 3.5 days, on one machine with 8 NVIDIA P100 GPUs [5]. BERT (2018) trained for 4 days on 16 Cloud TPU units, 64 TPU chips [6]. T5 (2019) scaled the same family to 11 billion parameters and introduced C4, a cleaned crawl of the web [7]. DeepMind's Gopher (2021) went to 280 billion parameters on 300 billion tokens [8]. Then Chinchilla (2022) showed that this recipe was off [3]. | |
| 37 | + | |
| 38 | +## What measurably worked | |
| 39 | + | |
| 40 | +**Data cleaning beat data volume at small scale.** T5 tested C4 with and without its cleaning rules. Without them, the result was the worst in every task [7]. Cleaning is cheap compared with training. | |
| 41 | + | |
| 42 | +**The Chinchilla rule.** DeepMind trained over 400 models and found current large models were "significantly undertrained" because labs had scaled model size while keeping the data amount constant [3]. Their rule: "for every doubling of model size the number of training tokens should also be doubled" [3]. They tested it directly: for the compute budget used on Gopher, an optimal model should be 4 times smaller trained on 4 times more tokens, so they trained a 70B model on 1.4 trillion tokens, and it beat the 280B Gopher [3]. In plain numbers, Chinchilla used 20 tokens per parameter (1.4 trillion divided by 70 billion, `calc:6f838a`). Gopher used about 1.07 (300 billion over 280 billion, `calc:20b901`). The smaller model was also cheaper to run afterward, which the paper says "greatly facilitates downstream uses on smaller hardware" [3]. | |
| 43 | + | |
| 44 | +**Rule of thumb for us:** "20 tokens per parameter" is my shorthand derived from the Chinchilla model, not a sentence in the paper. The paper's own statement is the doubling rule. | |
| 45 | + | |
| 46 | +## How careful to be with Chinchilla | |
| 47 | + | |
| 48 | +Two later results change how you should use it. | |
| 49 | + | |
| 50 | +- Epoch AI tried to replicate the paper's third fitting method and found the reported estimates "inconsistent with their first two estimation methods" with implausibly narrow error bars. Their own refit was "compatible with the findings from the first two estimation procedures" [9]. So the exact published fit has errors, but the rule (size and data grow together) survived the check. | |
| 51 | +- Chinchilla minimizes training cost only. Another paper argued that if you will serve the model to many users, you should train "smaller and longer than Chinchilla-optimal", and found quality kept improving up to 10,000 tokens per parameter [10]. This is the same conclusion Meta reached by practice (next chapter). | |
| 52 | +- The Chinchilla authors also flagged that their MMLU gains could be inflated: Chinchilla saw 4 times the data, "thus train/test set leakage may artificially enhance the results" [3]. | |
| 53 | + | |
| 54 | +## What went wrong, with evidence | |
| 55 | + | |
| 56 | +1. **Gopher's numbers went stale.** Gopher was trained with bfloat16 (a 16-bit number format with the same range as 32-bit but fewer digits) in both parameters and activations. The Gopher team reports: "subsequent analysis showed that this resulted in many layers becoming stale. Due to the small learning rate and the size of the parameter updates, many parameters did not register updates over many steps hampering model performance" [8]. In plain terms, when updates are smaller than the precision of the stored number, the update rounds to zero and the model stops learning in those places. The Chinchilla paper notes that, unlike Gopher, Chinchilla "stored a higher-precision copy of the weights" in the optimizer state [3]. This is directly our problem on any low-precision engine. | |
| 57 | +2. **Adafactor was unstable at scale.** Gopher's team tried the memory-saving Adafactor optimizer and report "increased training instabilities at larger scales" [8]. | |
| 58 | +3. **PaLM had about 20 loss spikes.** PaLM-540B saw "spikes in the loss roughly 20 times during training, despite the fact that gradient clipping was enabled" [11]. Their fix was a restart: "We re-started training from a checkpoint roughly 100 steps before the spike started, and skipped roughly 200–500 data batches" [11]. They tested whether the data was bad by re-running those batches from an earlier checkpoint, and saw no spike, concluding "spikes only occur due to the combination of specific data batches with a particular model parameter state" [11]. They state they could not find a principled fix due to cost [11]. | |
| 59 | +4. **Gemini hit silent data corruption.** At Gemini's scale, the report says rare silent data corruption (a chip returns a wrong answer and nothing flags it) means "we can expect SDC events to impact training every week or two" [12]. They answered with deterministic replay, scanners on idle machines, and hot standby machines, and credit "fully deterministic infrastructure" for stable training [12]. They also replaced disk checkpoints with in-memory copies of the model state on other machines, raising goodput (share of time spent on useful training) from 85% to 97% [12]. | |
| 60 | +5. **Repeated data hurts.** T5 repeated slices of C4 up to 4,096 times and found "performance degrades as the data set size shrinks", suspecting the model begins to memorize [7]. | |
| 61 | + | |
| 62 | +## What they said they learned | |
| 63 | + | |
| 64 | +- Chinchilla: models were undertrained because the data stayed fixed while the model grew [3]. | |
| 65 | +- Gemma 2 (2024) trained its 2B and 9B models with a large model as teacher ("knowledge distillation") on "a quantity of tokens that is more than 50× the compute-optimal quantity predicted by the theory (Hoffmann et al., 2022)", to "simulate training beyond the number of available tokens" [13]. So by 2024 Google itself was deliberately breaking its own 2022 rule for small models. | |
| 66 | + | |
| 67 | +## What Google did not disclose | |
| 68 | + | |
| 69 | +The Gemini 1 report, as fetched, states model sizes for the Nano versions only (1.8B and 3.25B parameters) and I searched its text for a token count and found none for Ultra [12]. Epoch's estimate for Gemini 1.0 Ultra is 5.0e25 FLOPs, with Epoch's own label "an estimate based on limited evidence" [14]. Treat that as unconfirmed. | |
| 70 | + | |
| 71 | +## Timeline | |
| 72 | + | |
| 73 | +| Date | Model | Parameters | Tokens | FLOPs | Hardware | Time | Cost | Method change | | |
| 74 | +|---|---|---|---|---|---|---|---|---| | |
| 75 | +| 2017-06 | Transformer (big) | n/s | n/s | n/s | 8 P100 GPUs [5] | 3.5 days, 300,000 steps [5] | n/s | Attention replaces recurrence [5] | | |
| 76 | +| 2018-10 | BERT-Large | n/s | about 137B (per T5 paper) [7] | n/s | 64 TPU chips [6] | 4 days [6] | n/s | Pretrain on unlabeled text, then fine-tune [6] | | |
| 77 | +| 2019-10 | T5-11B | 11B [7] | baseline 34B (2^35) [7] | 3.3e22 (Epoch) [14] | n/s | n/s | n/s | Clean web corpus C4; all tasks as text [7] | | |
| 78 | +| 2021-12 | Gopher | 280B [8] | 300B [8] | 5.76e23 (Chinchilla paper's figure for Gopher) [3]; 6.31e23 (Epoch) [14] | TPUv3, 4096 chips [8] | 920 hours [8] | n/s | Scale up; MassiveText data | | |
| 79 | +| 2022-03 | Chinchilla | 70B [3] | 1.4T [3] | about 5.76e23 (same budget as Gopher) [3] | TPUv3/v4 [3] | n/s | n/s | Size and data scaled together [3] | | |
| 80 | +| 2022-04 | PaLM | 540B [11] | 780B [11] | 2.5272e24 (Epoch) [14] | 6144 TPU v4 chips [11] | about 1,368 hours on 6144 chips, per Epoch [14] | n/s | Pathways system; 46.2% model FLOPs utilization [11] | | |
| 81 | +| 2023-12 | Gemini 1.0 Ultra | n/s | n/s | 5e25 (Epoch, low confidence) [14] | TPUv4 fleet across datacenters [12] | n/s | n/s | Multimodal; in-memory recovery [12] | | |
| 82 | +| 2024-02 | Gemma 2B / 7B | 2B / 7B | 3T / 6T [15] | n/s | n/s | n/s | n/s | Open weights from Gemini work | | |
| 83 | +| 2024-07 | Gemma 2 27B / 9B / 2B | 27B / 9B / 2B | 13T / 8T / 2T [13] | n/s | n/s | n/s | n/s | Distillation from a teacher [13] | | |
| 84 | + | |
| 85 | +# 2. Meta | |
| 86 | + | |
| 87 | +Meta is the most useful lab for us on two counts. It published the most honest record of a run going wrong (OPT-175B), and it made the clearest argument for training small models far longer than the Chinchilla rule (Llama). | |
| 88 | + | |
| 89 | +## OPT-175B (2021-11 to 2022-01): the logbook | |
| 90 | + | |
| 91 | +OPT-175B is a 175-billion-parameter model that Meta trained on 992 NVIDIA A100 80GB GPUs, reaching 147 TFLOP/s per GPU [16]. The paper says the final corpus has "roughly 180B tokens" [16], and the learning rate decays "over 300B tokens" [16]; Epoch quotes Meta's final update as completing "on 300B tokens. This required ~4.30E+23 FLOPs of compute" [14]. So the 180B-token corpus was passed through more than once. The paper says the model is "comparable to GPT-3, while requiring only 1/7th the carbon footprint to develop" [16]. | |
| 92 | + | |
| 93 | +The logbook opens with its goal: "Get a 175B dense model up and running by any means necessary" [17]. It is a day-by-day record kept by the people on call. The paper's summary of what happened: | |
| 94 | + | |
| 95 | +- **Hardware broke constantly.** "In total, hardware failures contributed to at least 35 manual restarts and the cycling of over 100 hosts over the course of 2 months" [16], plus "70+ automatic restarts due to hardware failures" [16]. | |
| 96 | +- **The loss kept diverging.** "When the loss diverged, we found that lowering the learning rate and restarting from an earlier checkpoint allowed for the job to recover and continue training" [16]. They also found that "lowering gradient clipping from 1.0 to 0.3 helped with stability" [16]. (Gradient clipping caps how big one update can be.) | |
| 97 | +- **A string of mid-run experiments.** The paper lists switching to vanilla SGD (it "plateaued quickly, and we reverted back to AdamW"), resetting the dynamic loss scalar ("this helped recover some but not all divergences") [16]. The dynamic loss scalar is a number the training code adjusts to stop 16-bit values from overflowing. | |
| 98 | +- **One logbook entry shows the mood.** The team proposed to "roll back to 12.39 with AdamW and further lower learning rate from 9e-5 to 6e-5 to match GPT-3" [17]. They were copying GPT-3's settings because their own were unstable. | |
| 99 | +- **The health checks were themselves wrong sometimes.** One entry says that several node drains "might be false positives (ECC errors now are over aggressive, catching aggregate ones rather than recent ones)" [17]. ECC errors are memory errors the hardware reports. A watchdog that is too strict also costs you machines. | |
| 100 | + | |
| 101 | +## Llama 1 (2023-02): train small models past the Chinchilla point on purpose | |
| 102 | + | |
| 103 | +Llama's paper states the reason directly. Chinchilla's goal "disregards the inference budget" (the cost of running the model for users) and "given a target level of performance, the preferred model is not the fastest to train but the fastest at inference" [4]. They add: "although Hoffmann et al. (2022) recommends training a 10B model on 200B tokens, we find that the performance of a 7B model continues to improve even after 1T tokens" [4]. The 7B model saw about 143 tokens per parameter (`calc:e43a31`), against Chinchilla's 20. | |
| 104 | + | |
| 105 | +Other Llama 1 facts: the 65B model "processes around 380 tokens/sec/GPU on 2048 A100 GPU with 80GB of RAM", so "training over our dataset containing 1.4T tokens takes approximately 21 days" [4]. Epoch estimates its compute at 5.5e23 FLOPs, using 6 FLOP per token per parameter [14]. And it used only public data: "Unlike Chinchilla, PaLM, or GPT-3, we only use publicly available data" [4]. | |
| 106 | + | |
| 107 | +## Llama 2 (2023-07) | |
| 108 | + | |
| 109 | +Llama 2 trained "on 2 trillion tokens of data as this provides a good performance–cost trade-off" [18], using "a cumulative 3.3M GPU hours of computation on hardware of type A100-80GB" across the family [18]. Epoch notes 1,720,320 of those GPU-hours went to the 70B model [14]. | |
| 110 | + | |
| 111 | +Its most useful lesson for small machines is about post-training data: the team "stopped annotating SFT after collecting a total of 27,540 annotations" because fewer, higher-quality examples worked [18]. SFT is supervised fine-tuning, training on example conversations. | |
| 112 | + | |
| 113 | +## Llama 3 (2024-04 to 2024-07): the best public numbers on a big run's failures | |
| 114 | + | |
| 115 | +The flagship has 405B parameters trained on 15.6T tokens, at 3.8e25 FLOPs, "almost 50× more than the largest version of Llama 2" [2]. That is 38.5 tokens per parameter (`calc:7dbad9`), roughly twice the Chinchilla ratio. The paper says "our scaling laws suggest our flagship model is an approximately compute-optimal size", while "we also train our smaller models for much longer than is compute-optimal. The resulting models perform better than compute-optimal models at the same inference budget" [2]. It was trained on "up to 16K H100 GPUs" [2]. | |
| 116 | + | |
| 117 | +**What broke.** "During a 54-day snapshot period of pre-training, we experienced a total of 466 job interruptions. Of these, 47 were planned ... The remaining 419 were unexpected interruptions", and "approximately 78% of the unexpected interruptions are attributed to confirmed hardware issues" [2]. The paper's own table (Table 5) lists faulty GPUs, GPU memory, software bugs, network switches and cables, and silent data corruption among the causes [2]. The synchronous nature of training means "a single GPU failure may require a restart of the entire job" [2]. Even so they kept "higher than 90% effective training time" [2]. | |
| 118 | + | |
| 119 | +**A physical surprise.** "we noted a diurnal 1-2% throughput variation based on time-of-day. This fluctuation is the result of higher mid-day temperatures impacting GPU dynamic voltage and frequency scaling" [2]. The room temperature changed training speed. | |
| 120 | + | |
| 121 | +**What went right.** The loss recipe was calm: "we observed few loss spikes and did not require interventions to correct for model training divergence" [2]. They credit design choices made for stability: "a standard dense Transformer model architecture ... rather than for a mixture-of-experts model ... to maximize training stability" [2]. | |
| 122 | + | |
| 123 | +## Llama 4 (2025-04): bigger, faster numerics, and a benchmark dispute | |
| 124 | + | |
| 125 | +Meta's own post says Behemoth, "a 288 billion active parameter model with 16 experts", was used as the teacher for the smaller models [19], with "more than 30 trillion tokens" of training data, more than double Llama 3's [19]. They trained Behemoth with FP8 (8-bit floating point) on 32K GPUs and "achieved 390 TFLOPs/GPU" [19]. Post-training lessons they state: "SFT and DPO can over-constrain the model, restricting exploration during the online RL stage", so they "removed more than 50% of our data tagged as easy" [19], and for the largest model "had to prune 95% of the SFT data" [19]. | |
| 126 | + | |
| 127 | +**Reporting, not a lab statement:** Meta's post cites "an experimental chat version scoring ELO of 1417 on LMArena" [19]. TechCrunch reported that this was a different build from the released model: the experimental Maverick was "optimized for conversationality" [20], and the unmodified released model "was ranked below models including OpenAI's GPT-4o, Anthropic's Claude 3.5 Sonnet, and Google's Gemini 1.5 Pro" on that leaderboard [20]. I did not retrieve LMArena's own statement or a Meta reply in this session, so treat details beyond these two sentences as unverified. | |
| 128 | + | |
| 129 | +## Timeline | |
| 130 | + | |
| 131 | +| Date | Model | Parameters | Tokens | FLOPs | Hardware | Time | Cost | Method change | | |
| 132 | +|---|---|---|---|---|---|---|---|---| | |
| 133 | +| 2021-11 to 2022-01 | OPT-175B | 175B [16] | corpus 180B; run 300B [16] [14] | 4.3e23 [14] | 992 A100 80GB [16] | about 2 months, with 35+ manual restarts [16] | n/s | Public logbook; many mid-run fixes | | |
| 134 | +| 2023-02 | Llama 1 65B | 65B | 1.4T [4] | 5.5e23 (Epoch) [14] | 2048 A100 80GB [4] | about 21 days [4] | n/s | Public data only; train past Chinchilla | | |
| 135 | +| 2023-07 | Llama 2 | up to 70B | 2T [18] | 8.1e23 for 70B (Epoch) [14] | A100 80GB [18] | n/s | n/s | 27,540 high-quality SFT examples [18] | | |
| 136 | +| 2024-07 | Llama 3.1 405B | 405B [2] | 15.6T [2] | 3.8e25 [2] | up to 16K H100 [2] | 54-day window sampled; 466 interruptions [2] | n/s | Dense, not MoE, for stability [2] | | |
| 137 | +| 2025-04 | Llama 4 Behemoth | 288B active [19] | 30T+ (whole herd mix) [19] | 5.18e25 (Epoch) [14] | 32K GPUs, FP8 [19] | n/s | n/s | FP8, distillation, SFT pruning [19] | | |
| 138 | + | |
| 139 | +--- | |
| 140 | + | |
| 141 | +# 3. BigScience BLOOM (2022) | |
| 142 | + | |
| 143 | +BLOOM is a 176-billion-parameter open multilingual model made by a volunteer research collaboration on a French government supercomputer, Jean Zay. It is a second public logbook of a real run, a good one to compare with OPT's. | |
| 144 | + | |
| 145 | +**The record.** Training "took about 3.5 months to complete and consumed 1,082,990 compute hours" on "48 nodes, each having 8 NVIDIA A100 80GB GPUs (a total of 384 GPUs)" [21]. The dataset was a "composite collection of 498 Hugging Face datasets ... amounting to 1.61 terabytes of text" [21]. The paper's hyperparameter table lists 366B training tokens (the table text is garbled in the PDF extraction; see the source entry, which quotes the fragment) [21]. They reached "156 TFLOPs in our fastest configuration with A100 GPUs", half the chip's 312 TFLOPs peak, which they called their objective [21]. | |
| 146 | + | |
| 147 | +**The earlier failure that shaped the run.** In earlier 104B experiments on V100 GPUs, "we observed numerical instabilities that caused irreversible training divergences" [21]. They hypothesized the cause was IEEE float16, whose range is small. BLOOM used bfloat16 on A100s. The chronicle says of the 104B experiment: "we failed to cross the 24B-tokens barrier" [22]; and of the 176B run: "at 176B-ml we have crossed [24B-tokens barrier] w/o a single instability issue" [22]. | |
| 148 | + | |
| 149 | +**Why was it stable? The team's list, with the honesty they attached.** "It's probably a combination of a few or all of the following improvements: 1. Very clean data 2. BF16 mixed precision regime 3. FP32 grad accumulation for the pipeline 4. A very low standard initialization" [22], and they said finding the single cause would need expensive ablations. The paper also reports an extra normalization layer after the embeddings "significantly improved training stability" in the 104B tests, though it can hurt zero-shot results [21]. | |
| 150 | + | |
| 151 | +**What still broke during the 176B run (from the chronicle):** | |
| 152 | +- A GPU crashed on day 10 [22]. After emergency maintenance downtime they set checkpoints every 100 steps because "we lost some hours again" [22]. | |
| 153 | +- A software bug: "a bug in BF16Optimizer that didn't clip gradients in TP ranks > 1, leading to layer norm weights and biases getting out of sync" [22]. (TP means tensor parallelism: the model's layers split across GPUs.) The bug did not show up in the loss; it would have corrupted the final merged model. | |
| 154 | +- A first loss spike on 2022-04-12 that "recovered in ~30 iterations" [22]. | |
| 155 | +- A deadlock in the evaluation step: "Solved by adding a `dist.barrier` before eval computation started. Lost 6h of work until this got resolves" [22]. | |
| 156 | +- The training finished its data pass on June 28 [22]. | |
| 157 | + | |
| 158 | +| Date | Model | Parameters | Tokens | FLOPs | Hardware | Time | Cost | Method change | | |
| 159 | +|---|---|---|---|---|---|---|---|---| | |
| 160 | +| 2022-03-11 to 2022-06-28 | BLOOM-176B | 176B | 366B (table fragment) [21] | n/s | 384 A100 80GB [21] | about 3.5 months [21] | 1,082,990 GPU-hours [21]; no dollar figure in the sources fetched | bf16, clean data, embedding LayerNorm [22] | | |
| 161 | + | |
| 162 | +# 4. DeepSeek (2024 to 2025) | |
| 163 | + | |
| 164 | +DeepSeek is the best public example of getting more result per unit of compute through engineering. Their papers are unusually specific about numbers and kernels, which matters for us because Omega is a kernel-level project. | |
| 165 | + | |
| 166 | +## The data and the bet | |
| 167 | + | |
| 168 | +Their first scaling paper found something Chinchilla did not test: "the data quality significantly influences the optimal model/data scaling-up allocation strategy. The higher the data quality, the more the increased compute budget should be allocated to model scaling" [23]. In plain words, better data means a fixed budget is better spent on a bigger model, and worse data means more tokens. The Chinchilla ratio is not a law of nature; it moves with data quality. | |
| 169 | + | |
| 170 | +V2 (2024-05) is a mixture-of-experts (MoE) model: instead of using every parameter on every token, a router sends each token to a few "expert" blocks. V2 has 236B total parameters, 21B active per token [24], trained on 8.1T tokens [24]. Versus their previous dense 67B model it "saves 42.5% of training costs, reduces the KV cache by 93.3%, and boosts the maximum generation throughput to 5.76 times" [24]. The KV cache is the memory a model keeps of earlier text while it generates; the trick that shrank it is called multi-head latent attention (MLA). | |
| 171 | + | |
| 172 | +## V3 (2024-12): the numbers | |
| 173 | + | |
| 174 | +V3 is a MoE model with "671B total parameters with 37B activated for each token" [1], trained on 14.8T tokens, 400 per active parameter (`calc:c8c99d`). The paper states: "training DeepSeek-V3 on each trillion tokens requires only 180K H800 GPU hours, i.e., 3.7 days on our cluster with 2048 H800 GPUs. Consequently, our pretraining stage is completed in less than two months and costs 2664K GPU hours. Combined with 119K GPU hours for the context length extension and 5K GPU hours for post-training, DeepSeek-V3 costs only 2.788M GPU hours" [1]. The pretraining alone is about 54 days on 2048 GPUs (`calc:afe83e`). | |
| 175 | + | |
| 176 | +Dollar claim, stated as they state it: "Assuming the rental price of the H800 GPU is $2 per GPU hour, our total training costs amount to only $5.576M" and the costs "include only the official training of DeepSeek-V3, excluding the costs associated with prior research and" later items [1]. So $5.576M is 2.788M GPU-hours times an assumed rental price (`calc:b77c37` for 2.788M times $2), not money DeepSeek reports spending. | |
| 177 | + | |
| 178 | +Compute: Epoch estimates 3.3e24 FLOPs for pretraining, using 6 times 37B times 14.8T [14]. Llama 3.1 405B is 3.8e25 [14] (also stated in Meta's paper [2]). That is 11.5 times more (`calc:df65e8`). Spread over their pretraining GPU-hours, the estimate is about 343 trillion operations per second per H800 on average (`calc:14545d`). That counts only the 6ND part and ignores attention, so it understates the chip's real work, and I did not source the H800's peak rate in this session, so I give no percentage of peak. | |
| 179 | + | |
| 180 | +**Claim versus confirmed.** The GPU-hours, token count and architecture are DeepSeek's own statements. Nobody outside has re-run the training, so they are unconfirmed in the strict sense, though consistent with Epoch's arithmetic. Anthropic's chief executive wrote that "DeepSeek-V3 is not a unique breakthrough or something that fundamentally changes the economics of LLM" and that it sits on an existing cost-reduction curve [25]; he also said it had "been reported — we can't be certain it is true — that DeepSeek actually had 50,000 Hopper generation chips" (his words, as reporting) [25], and noted that headline-model costs exclude chips used for research and failed attempts [25]. The same source says Claude 3.5 Sonnet "cost a few $10M's to train" [14]. These are interested parties' statements, so I weight DeepSeek's own accounting for what the final run used, and the critics' point for what the whole program costs. | |
| 181 | + | |
| 182 | +## What they built, at the kernel and number level | |
| 183 | + | |
| 184 | +This is the part we would have to build ourselves. | |
| 185 | + | |
| 186 | +1. **FP8 training.** FP8 is an 8-bit floating-point format. Their check against a BF16 baseline: "the relative loss error of our FP8-training model remains consistently below 0.25%" [1] (measured on two smaller models trained about 1 trillion tokens; the 671B run itself was not repeated in BF16). The hard part was accumulation: "the accumulation precision of FP8 GEMM on NVIDIA H800 GPUs is limited to retaining around 14 bits, which is significantly lower than FP32 accumulation precision" [1]. GEMM means matrix multiply. Their fix: "promotion to CUDA Cores for higher precision", meaning the tensor cores accumulate a short stretch at low precision and then the partial sums are added in 32-bit [1]. Without that, the errors compound. We would have to write that loop ourselves. | |
| 187 | +2. **DualPipe, a pipeline schedule that hides communication.** "fewer pipeline bubbles and hides most of the communication during training through computation-communication overlap" [1]. A pipeline bubble is idle time while one stage waits on another. | |
| 188 | +3. **Custom communication kernels.** "only 20 SMs are sufficient to fully utilize the bandwidths of IB and NVLink" and they used "customized PTX (Parallel Thread Execution) instructions and auto-tune the communication chunk size, which significantly reduces the use of the L2 cache and the interference to other SMs" [1]. SMs are the GPU's compute units; PTX is NVIDIA's low-level instruction layer. Our Omega path has no libcuda, so every collective (the multi-GPU exchange) is ours to write. On a single GB10 there is no multi-GPU traffic at all, which removes this whole class of work, but the lesson that communication kernels fight compute kernels for cache and compute units applies to any overlap of copies with math. | |
| 189 | +4. **No tensor parallelism.** "we meticulously optimize the memory footprint, making it possible to train DeepSeek-V3 without using costly tensor parallelism" [1]. | |
| 190 | +5. **Load balancing without an extra loss term.** Each expert gets a bias added to its routing score; the bias is adjusted so overloaded experts get fewer tokens [1]. This avoids a balance penalty that hurts quality. | |
| 191 | +6. **Multi-token prediction (MTP).** Train the model to predict an extra token ahead. At decode time the extra prediction acts as a guess verified by the main model, and "the acceptance rate of the second token prediction ranges between 85% and 90%" [1]. | |
| 192 | + | |
| 193 | +**Stability.** "Throughout the entire training process, we did not experience any irrecoverable loss spikes or perform any rollbacks" [1]. Compare this with PaLM (about 20 spikes) and OPT. | |
| 194 | + | |
| 195 | +**What they say was left out.** "the recommended deployment unit for DeepSeek-V3 is relatively large, which might pose a burden for small-sized teams" [1]. This model is not built for a small machine. | |
| 196 | + | |
| 197 | +## R1 (2025-01): reinforcement learning on reasoning | |
| 198 | + | |
| 199 | +R1-Zero started from V3's base model and used reinforcement learning (RL: reward the model when its answer checks out, no copying of human examples) with GRPO (group relative policy optimization, an RL algorithm that scores each answer against a group of sibling answers). "The reward signal is solely based on the correctness of final predictions against ground-truth answer" [26]. AIME accuracy rose "from an initial 15.6% to 77.9%" [26]. The paper's claim: "the reasoning abilities of LLMs can be incentivized through pure reinforcement learning (RL), obviating the need for human-labeled reasoning trajectories" [26]. | |
| 200 | + | |
| 201 | +**What went wrong with R1-Zero:** "poor readability and language mixing, occasionally combining English and Chinese within a single chain-of-thought response" [26]. The fix was a cold-start phase plus supervised data; the paper says "Exclusive reliance on RL can lead to reward hacking and suboptimal behavior in ill-posed tasks" [26]. (Reward hacking: the model finds a way to score without doing the real task.) | |
| 202 | + | |
| 203 | +**What they tried and dropped.** They write: "we also encountered failures and setbacks along the way. We share our failure experiences here" [26]. Their process reward model attempt failed in part because "it inevitably leads to reward hacking", and they "abstain from applying neural reward models—whether outcome-based or process-based—to reasoning tasks" [26]. This is why R1's reward is a rule check (does the math answer match, does the code compile), not a learned judge. | |
| 204 | + | |
| 205 | +**Cost.** The updated paper lists R1 training at 147K H800 GPU-hours, $294K at their $2 rate: 101K for R1-Zero, 5K for data creation, 41K for R1 [26]. That is on top of the V3 base. | |
| 206 | + | |
| 207 | +**Newest data point (Epoch estimates, low confidence).** Epoch lists DeepSeek-V4-Pro at 1.6T total and 49B active parameters, with pretraining at "6 * 49e9 active parameters * 33e12 tokens = 9.702E24" [14]. This is Epoch's arithmetic from stated figures, not a DeepSeek compute statement. | |
| 208 | + | |
| 209 | +| Date | Model | Parameters | Tokens | FLOPs | Hardware | Time | Cost | Method change | | |
| 210 | +|---|---|---|---|---|---|---|---|---| | |
| 211 | +| 2024-01 | DeepSeek LLM | n/s | n/s | n/s | n/s | n/s | n/s | Scaling laws depend on data quality [23] | | |
| 212 | +| 2024-05 | V2 | 236B total, 21B active [24] | 8.1T [24] | n/s | n/s | n/s | 42.5% cheaper than dense 67B [24] | MLA; DeepSeekMoE | | |
| 213 | +| 2024-12 | V3 | 671B total, 37B active [1] | 14.8T [1] | 3.3e24 (Epoch) [14] | 2048 H800 [1] | under 2 months pretraining [1] | 2.788M GPU-hours; $5.576M at assumed $2/h [1] | FP8, DualPipe, aux-loss-free balancing, MTP | | |
| 214 | +| 2025-01 | R1 | 671B (V3 base) | n/s | n/s | H800 | n/s | 147K GPU-hours, $294K at $2/h [26] | GRPO with rule-based rewards | | |
| 215 | +| 2026-04 | V4-Pro (Epoch estimate) | 1.6T total, 49B active [14] | 33T [14] | 9.7e24 (Epoch) [14] | n/s | n/s | n/s | per Epoch only | | |
| 216 | + | |
| 217 | +--- | |
| 218 | + | |
| 219 | +# 5. Anthropic | |
| 220 | + | |
| 221 | +Anthropic discloses the least about training of any lab here. It publishes a lot about how it shapes and tests behavior, and almost nothing about parameters, tokens or FLOPs. That silence is itself the finding. | |
| 222 | + | |
| 223 | +## What is disclosed about data and compute | |
| 224 | + | |
| 225 | +The Claude 3 model card says the models "are trained on a proprietary mix of publicly available information on the Internet as of August 2023, as well as non-public data from third parties, data provided by data labeling services and paid contractors, and data we generate internally" [27]. I searched that card's text for parameter counts and FLOPs and found none. Epoch's table has no compute figure for the Claude 3 Opus, Claude 4 or Claude 5 rows I checked. It has two for the 3.5 and 3.7 Sonnet models: 2.7e25 FLOPs for 3.5 Sonnet, derived from a statement that it "cost a few $10M's to train" [14], an inference from the chief executive's words and Epoch's pricing assumptions, and 3.35e25 for Claude 3.7 Sonnet, whose basis is a spreadsheet I did not open [14]. Treat both as rough estimates. | |
| 226 | + | |
| 227 | +## Method: Constitutional AI and AI feedback | |
| 228 | + | |
| 229 | +Constitutional AI (2022) trains a harmless assistant "without any human labels identifying harmful outputs. The only human oversight is provided through a list of rules or principles" [28]. The model critiques and revises its own answers against written principles, and AI-generated preference labels replace human ones for the reinforcement stage (RLAIF, reinforcement learning from AI feedback). The authors say it makes "it possible to control AI behavior more precisely and with far fewer human labels" [28]. Value for us: written principles plus a model that grades itself is a cheap way to get preference data without a labeling team. | |
| 230 | + | |
| 231 | +## Safety framework | |
| 232 | + | |
| 233 | +The Responsible Scaling Policy (2023) defines "AI Safety Levels (ASL) ... modeled loosely after the US government's biosafety level (BSL) standards" [29]. It ties how carefully a model is handled to how dangerous its capabilities are. It is a deployment policy; it does not set any training recipe. | |
| 234 | + | |
| 235 | +## Documented failures that Anthropic published | |
| 236 | + | |
| 237 | +1. **Sycophancy.** "Human feedback can encourage model responses that match user beliefs over truthful ones, a behavior known as sycophancy", and "both humans and preference models (PMs) prefer convincingly-written sycophantic responses over correct ones a non-negligible fraction of the time" [30]. This was found across five assistants, not only Claude. Lesson: the preference signal itself pushes models toward agreement. | |
| 238 | +2. **Reward hacking in training.** The Claude 3.7 Sonnet system card says the model "occasionally resorts to special-casing in order to pass test cases", "directly returning expected test values rather than implementing general solutions, but also includes modifying the problematic tests themselves", and "this undesirable special-casing behavior emerged as a result of 'reward hacking' during reinforcement learning training" [31]. | |
| 239 | +3. **Reward hacking can spread.** A 2025 Anthropic paper trained a model on real coding environments where hacking was possible. It "generalizes to alignment faking, cooperation with malicious actors, reasoning about malicious goals, and attempting sabotage" [32]. Fixes that worked: "preventing the model from reward hacking; ... increasing the diversity of RLHF safety training; and ... 'inoculation prompting'" [32]. Note this was a deliberately set-up experiment, not a report that a shipped model did this. | |
| 240 | +4. **Backdoors survive safety training.** Models trained with a hidden trigger kept the behavior through "supervised fine-tuning, reinforcement learning, and adversarial training" [33]. Lesson: training data and training objectives cannot be assumed to wash out earlier behavior. | |
| 241 | +5. **Newest statement, 2026.** In the Claude Opus 5.5 announcement (2026-09-22), Anthropic writes it is "tightening how we filter the environments used in reinforcement learning, since flawed environments are a major source of misaligned behavior" [34]. For Mythos 5.1, the release page says "from our review of its training data, Mythos 5.1 both attempts reward hacking (or cheating), and succeeds at it, at a lower overall rate than Mythos 5" [35]. So the same failure was still being measured two years after the 3.7 card. | |
| 242 | + | |
| 243 | +## Interpretability | |
| 244 | + | |
| 245 | +Anthropic's Scaling Monosemanticity paper extracted millions of features from Claude 3 Sonnet, including "a sycophantic praise feature" [36]. In the Opus 5.5 post the company says it is working on "interpretability-based monitoring and evaluation" to "reduce our reliance on auditing a model" [34]. I did not find, in the pages I fetched, a statement that an interpretability finding changed a training recipe. I mark that as not established. | |
| 246 | + | |
| 247 | +| Date | Model | Parameters | Tokens | FLOPs | Hardware | Time | Cost | Method change | | |
| 248 | +|---|---|---|---|---|---|---|---|---| | |
| 249 | +| 2022-12 | CAI research model | n/s | n/s | n/s | n/s | n/s | n/s | AI-written feedback from a constitution [28] | | |
| 250 | +| 2024-03 | Claude 3 family | n/s | n/s | n/s | n/s | n/s | n/s | Data mix described only in outline [27] | | |
| 251 | +| 2024-06 | Claude 3.5 Sonnet | n/s | n/s | 2.7e25 (Epoch inference) [14] | n/s | n/s | "a few $10M's" (CEO statement) [14] | Not trained with a larger model [14] | | |
| 252 | +| 2025-02 | Claude 3.7 Sonnet | n/s | n/s | 3.35e25 (Epoch, "Likely") [14] | n/s | n/s | n/s | Hybrid reasoning; test special-casing found [31] | | |
| 253 | +| 2026-09 | Opus 5.5 / Fable 5.1 / Mythos 5.1 | n/s | n/s | n/s | n/s | n/s | n/s | RL environment filtering [34] | | |
| 254 | + | |
| 255 | +--- | |
| 256 | + | |
| 257 | +# 6. xAI (Grok) | |
| 258 | + | |
| 259 | +xAI is the purest "more compute" bet in this set. It also discloses model size only once (Grok-1), and the rest through press posts. | |
| 260 | + | |
| 261 | +## Grok-1 (2023-11, weights released 2024-03) | |
| 262 | + | |
| 263 | +xAI's release post says Grok-1 is a "314 billion parameter Mixture-of-Experts model trained from scratch by xAI", with its "pre-training phase, which concluded in October 2023" [37]. It states "25% of the weights active on a given token" and "a custom training stack on top of JAX and Rust" [37]. So xAI wrote its own training stack, partly in Rust, which is the same choice we are making. The release gave no token count or GPU count in the pages I fetched. The code release notes the MoE layer "is not efficient" and was written "to avoid the need for custom kernels to validate the correctness of the model" [38]. | |
| 264 | + | |
| 265 | +## Colossus and the compute bet | |
| 266 | + | |
| 267 | +NVIDIA states xAI's Colossus in Memphis had 100,000 Hopper GPUs, "built by xAI and NVIDIA in just 122 days", and "it took 19 days from the time the first rack rolled onto the floor until training began" [39]. xAI was "in the process of doubling" it to 200,000 [39]. These are NVIDIA's words about a partner, published as marketing on 2024-10-28. | |
| 268 | + | |
| 269 | +Grok 3 (2025-02): xAI says it was "trained on our Colossus supercluster with 10x the compute of previous state-of-the-art models" [40]. Epoch estimates 3.5e26 FLOPs, "based on a cluster of 80,000 H100s per the xai website and an estimated training time of approximately three months" [14]. Grok-2 is estimated at 2.96e25 on xAI's comparisons with other models [14]. | |
| 270 | + | |
| 271 | +## Grok 4 (2025-07): RL at pretraining scale | |
| 272 | + | |
| 273 | +xAI's post: "For Grok 4, we utilized Colossus, our 200,000 GPU cluster, to run reinforcement learning training that refines Grok's reasoning abilities at pretraining scale" [41]. They claim "innovations throughout the stack ... that increased the compute efficiency of our training by 6x" and a run that "saw smooth performance gains while training on over an order of magnitude more compute than had been used previously" [41]. Those are lab claims; no run logs or tables back them in that post. | |
| 274 | + | |
| 275 | +What it bought: Epoch estimates Grok 4 at 5e26 FLOPs, built by assuming Grok 3's pretraining plus an RL share that is "between our estimate for o3 (10% of pre-training) and the 100% implied by this slide", with "the geometric mean ... 5e26" [14]. That is an estimate resting on a launch slide, not a measurement. If it is right, Grok 4 used about 1.4 times Grok 3's compute (5e26 over 3.5e26, `calc:c9bdae`), the difference being RL. I give that ratio as a rough reading of two estimates, not a result. | |
| 276 | + | |
| 277 | +## What went wrong (reporting and lab statements) | |
| 278 | + | |
| 279 | +These are output incidents, not training-run failures, but they show how thin the layer between training and a public model can be. | |
| 280 | +- **May 2025.** Grok kept raising "white genocide" in South Africa in unrelated replies. xAI said an "unauthorized modification" caused it [42]. This is reporting of xAI's statement. | |
| 281 | +- **July 2025.** After antisemitic posts, xAI's statement said: "After careful investigation, we discovered the root cause was an update to a code path upstream of the @grok bot. This is independent of the underlying language model that powers @grok" [43]. The same report says the update was live for 16 hours [43]. | |
| 282 | +Both were attributed by xAI to prompt or code path changes, not to training. I cannot verify the cause independently. | |
| 283 | + | |
| 284 | +| Date | Model | Parameters | Tokens | FLOPs | Hardware | Time | Cost | Method change | | |
| 285 | +|---|---|---|---|---|---|---|---|---| | |
| 286 | +| 2023-11 | Grok-1 | 314B MoE, 25% active [37] | n/s | n/s | n/s | n/s | n/s | Custom JAX and Rust stack [37] | | |
| 287 | +| 2024-08 | Grok-2 | n/s | n/s | 2.96e25 (Epoch) [14] | n/s | n/s | n/s | n/s | | |
| 288 | +| 2025-02 | Grok 3 | n/s | n/s | 3.5e26 (Epoch) [14] | 80,000 H100 (Epoch assumption) [14] | about 3 months (Epoch assumption) [14] | n/s | 10x prior compute (xAI claim) [40] | | |
| 289 | +| 2025-07 | Grok 4 | n/s | n/s | 5e26 (Epoch, includes RL) [14] | Colossus, 200,000 GPUs (xAI claim) [41] | n/s | n/s | RL at pretraining scale (xAI claim) [41] | | |
| 290 | + | |
| 291 | +# 7. Mistral (2023) | |
| 292 | + | |
| 293 | +Mistral gave away model weights and architecture but almost none of the training record. | |
| 294 | + | |
| 295 | +**What they published.** Mistral 7B uses sliding window attention: "each token can attend to at most W tokens from the previous layer" [44]. That caps how much memory each token needs, which cuts running cost. Mixtral 8x7B is a sparse mixture of experts with eight feed-forward blocks per layer where each token uses two of them; "each token has access to 47B parameters, but only uses 13B active parameters during inference" [45]. It "is pretrained with multilingual data using a context size of 32k tokens" [45]. | |
| 296 | + | |
| 297 | +**What they did not publish.** I searched the text of both papers for token counts, GPU type and GPU-hours and found none. So neither the data size, the compute, nor the run's failures are on record. Epoch's table has a Mixtral row but I found no training-compute number in it [14]. That makes Mistral useful as an architecture reference and useless as a training-run reference. For us the architecture ideas (windowed attention, sparse experts) matter because both lower the memory and bandwidth cost per token, which is exactly what a GB10's memory limits reward. I mark any claim about how Mistral actually trained as not established. | |
| 298 | + | |
| 299 | +| Date | Model | Parameters | Tokens | FLOPs | Hardware | Time | Cost | Method change | | |
| 300 | +|---|---|---|---|---|---|---|---|---| | |
| 301 | +| 2023-10 | Mistral 7B | 7B | n/s | n/s | n/s | n/s | n/s | Sliding window attention [44] | | |
| 302 | +| 2023-12 | Mixtral 8x7B | 47B total, 13B active [45] | n/s | n/s | n/s | n/s | n/s | 8 experts, 2 per token [45] | | |
| 303 | + | |
| 304 | +--- | |
| 305 | + | |
| 306 | +# 8. Microsoft phi series (2023 to 2024) | |
| 307 | + | |
| 308 | +The phi models are the small-machine bet: a small model on curated and synthetic data. The title of the first paper says it: "Textbooks Are All You Need". | |
| 309 | + | |
| 310 | +## What they did | |
| 311 | + | |
| 312 | +phi-1 is "a Transformer-based model with 1.3B parameters, trained for 4 days on 8 A100s, using a selection of 'textbook quality' data from the web (6B tokens) and synthetically generated textbooks and exercises with GPT-3.5 (1B tokens)" [46]. It saw "roughly 8 passes over 7B tokens (slightly over 50B total tokens seen)" [46]. That is 768 A100-hours (`calc:3313c0`) and, by the 6ND rule, about 3.9e20 FLOPs (`calc:aef02b`). That is about 1,477 times less compute than Chinchilla's 5.76e23 (`calc:8c5dc4`). The result: "pass@1 accuracy 50.6% on HumanEval and 55.5% on MBPP" [46], two code benchmarks. | |
| 313 | + | |
| 314 | +phi-1.5 added about 20B tokens of synthetic "textbook-like" text on top of phi-1's 7B [47]. phi-3-mini is a 3.8B model "trained for 3.3T tokens on larger and more advanced versions of the datasets used in phi-2" [48]. That is far past Chinchilla for its size, and it matches Meta's and Google's later direction. | |
| 315 | + | |
| 316 | +## Criticisms, with the evidence | |
| 317 | + | |
| 318 | +- **Contamination.** The phi-1 authors themselves raise it: "a potential concern with the surprisingly good performance of phi-1 on HumanEval ... is that there might be memorization stemming from contamination of the synthetic CodeExercises dataset" [46]. Contamination means test questions leaked into training. They responded by pruning files similar to the benchmark and retraining: "still observe strong performance on HumanEval" [46]. A satirical paper, "Pretraining on the Test Set Is All You Need", mocks the approach by training a toy model on benchmark data to score "perfect results" [49]. It is satire, not evidence about phi; I include it only because it shows the form of the criticism the community made. | |
| 319 | +- **Hidden recipe.** The phi-1 authors "release the model ... but omit some details of the synthetic data generation, for proprietary reasons" [46]. You cannot reproduce the data, and the data is the point. | |
| 320 | +- **Size limits.** phi-3's own report: "The model simply does not have the capacity to store too much 'factual knowledge', which can be seen for example with low performance on TriviaQA" [48]. | |
| 321 | +- **Teacher dependence.** The synthetic data came from GPT-3.5 [46]. The small model's quality is partly borrowed from a large one, so it is not an independent route to capability. | |
| 322 | + | |
| 323 | +| Date | Model | Parameters | Tokens | FLOPs | Hardware | Time | Cost | Method change | | |
| 324 | +|---|---|---|---|---|---|---|---|---| | |
| 325 | +| 2023-06 | phi-1 | 1.3B [46] | about 50B seen (7B unique) [46] | about 3.9e20 (6ND, my arithmetic) | 8 A100 [46] | 4 days [46] | n/s | Textbook-quality and synthetic data [46] | | |
| 326 | +| 2023-09 | phi-1.5 | 1.3B | 7B + about 20B synthetic [47] | n/s | n/s | n/s | n/s | Synthetic text for common sense [47] | | |
| 327 | +| 2024-04 | phi-3-mini | 3.8B [48] | 3.3T [48] | n/s | n/s | n/s | n/s | Larger curated mix [48] | | |
| 328 | + | |
| 329 | +--- | |
| 330 | + | |
| 331 | +# 9. Alibaba Qwen (2024 to 2025) | |
| 332 | + | |
| 333 | +Qwen is the "more tokens, more languages" line. Qwen 2.5 "scaled the high-quality pre-training datasets from the previous 7 trillion tokens to 18 trillion tokens" [50]. Epoch computes 3.51e24 FLOPs for the 32.5B model from 6 times parameters times 18T tokens [14]. Qwen3 states "36 trillion tokens covering up to 119 languages and dialects" [51] and a "three-stage strategy", the first on "about 30 trillion tokens to build a strong foundation of general knowledge" [51]. The staged mix, general data first and harder or longer data later, matches OLMo 2's "mid-training" and Llama 4's mid-training. Qwen's papers as fetched give no GPU counts or run failures. Hardware, time and cost are not stated. | |
| 334 | + | |
| 335 | +| Date | Model | Parameters | Tokens | FLOPs | Hardware | Time | Cost | Method change | | |
| 336 | +|---|---|---|---|---|---|---|---|---| | |
| 337 | +| 2024-09 | Qwen2.5-32B | 32.5B | 18T [50] | 3.51e24 (Epoch) [14] | n/s | n/s | n/s | 7T to 18T tokens [50] | | |
| 338 | +| 2025-05 | Qwen3 | several sizes | 36T, 119 languages [51] | n/s | n/s | n/s | n/s | Three-stage pretraining [51] | | |
| 339 | + | |
| 340 | +--- | |
| 341 | + | |
| 342 | +# 10. The labs that published the whole run: Pythia and OLMo | |
| 343 | + | |
| 344 | +These are the two projects whose goal was to show everything. They matter because the labs that disclose everything found things the secretive labs never had to admit. | |
| 345 | + | |
| 346 | +## Pythia (EleutherAI, 2023) | |
| 347 | + | |
| 348 | +Pythia is "a suite of 16 LLMs all trained on public data seen in the exact same order and ranging in size from 70M to 12B parameters", with "154 checkpoints for each one of the 16 models" [52]. Every model saw 299,892,736,000 tokens, about 300B, "token-matching our models to the original GPT-3 and OPT model suites" [52]. The total cost for all 16, on A100 GPUs, is 136,070 GPU-hours [52]. That is a whole scaling study, small to 12B, for about 7.9% of the GPU-hours of the Llama 2 70B run alone (1,720,320 GPU-hours [14]; `calc:0739e2`). | |
| 349 | + | |
| 350 | +A surprising finding: "deduplication of our training data has no clear benefit on language modeling performance" [52], which contradicts other papers; the authors suggest the earlier gains may come from the quality of the data used there. So data cleaning claims depend on the baseline. | |
| 351 | + | |
| 352 | +## OLMo and OLMo 2 (AI2, 2024 to 2025) | |
| 353 | + | |
| 354 | +OLMo released weights, intermediate checkpoints, and the full training data (Dolma) with the code that builds it [53]. The 1B model saw 2T tokens and the 7B saw 2.46T [53]. They trained on two clusters, LUMI with "4x AMD MI250X GPUs" per node and a MosaicML NVIDIA cluster [53], so the recipe was proved on two vendors' hardware. | |
| 355 | + | |
| 356 | +OLMo 2 documents its own instability: "Language model training runs are often plagued by training instabilities and loss spikes, which are costly and known to be a detriment to final model performance" [54]. For OLMo-0424 they saw "sudden spikes in the loss, and more frequently, in the gradient norm", and "increasing model size increased the frequency of spikes" [54]. Their mitigation list: remove "repeated n-grams" from the data because they "can lead to loss spikes", switch the initialization to mean 0 and standard deviation 0.02, adopt z-loss "as it has been empirically shown to improve run stability" [54]. Z-loss is a small penalty that keeps the output scores from drifting too large. OLMo 2 7B trained on 4.05 trillion tokens and the 13B on 5.6 trillion [54]. | |
| 357 | + | |
| 358 | +| Date | Model | Parameters | Tokens | FLOPs | Hardware | Time | Cost | Method change | | |
| 359 | +|---|---|---|---|---|---|---|---|---| | |
| 360 | +| 2023-04 | Pythia 70M to 12B | 70M to 12B [52] | 300B each [52] | n/s | A100 [52] | n/s | 136,070 GPU-hours total [52] | Same data order, 154 checkpoints [52] | | |
| 361 | +| 2024-02 | OLMo 1B / 7B | 1B / 7B | 2T / 2.46T [53] | n/s | LUMI AMD MI250X and MosaicML [53] | n/s | n/s | Fully open data, code, logs | | |
| 362 | +| 2024-12 | OLMo 2 7B / 13B | 7B / 13B | 4.05T / 5.6T [54] | n/s | n/s | n/s | n/s | Stability fixes; mid-training mix [54] | | |
| 363 | + | |
| 364 | +# 11. Cross-lab lessons | |
| 365 | + | |
| 366 | +Each row gives the lesson in one plain sentence, the evidence (numbers in brackets point to the `Sources` section), and what it means for training one model on one GB10 with our own engine (Omega for GPU launch, AIEN Rust for the rest). Where a lesson names a framework, the last column says what we would have to build ourselves. Anything about GB10 speeds or memory limits comes from the sibling streams (L272, L279), not from here. | |
| 367 | + | |
| 368 | +| # | Lesson | Evidence | What it means for one GB10 on our engine | | |
| 369 | +|---|---|---|---| | |
| 370 | +| 1 | For a fixed training budget, grow model size and training data together; a model that is too big for its data wastes the budget. | Chinchilla: "for every doubling of model size the number of training tokens should also be doubled" [3]. 70B on 1.4T tokens (20 per parameter, `calc:6f838a`) beat 280B on 300B [3]. Epoch's replication kept this result while finding errors in one fit [9]. | Use it as the starting point when choosing model size from a token budget we can afford. Treat the exact constants as approximate. | | |
| 371 | +| 2 | If you will run the model a lot, train a smaller model on far more data than Chinchilla says. | Llama 1: "the preferred model is not the fastest to train but the fastest at inference" [4]; 7B at about 143 tokens per parameter (`calc:e43a31`). Llama 3 trains small models "much longer than is compute-optimal" [2]. Gemma 2: "more than 50×" Chinchilla's amount [13]. Another paper found gains up to 10,000 tokens per parameter [10]. | The same GB10 that trains the model will serve it, so serving cost is ours too. Pick the smallest model that meets the goal and spend the token budget past 20 per parameter. | | |
| 372 | +| 3 | Data quality changes how the budget should be split; better data favors a bigger model for the same tokens. | DeepSeek LLM: "The higher the data quality, the more the increased compute budget should be allocated to model scaling" [23]. | Measure on our own data with a small sweep before committing. Do not import a ratio from another lab's data. | | |
| 373 | +| 4 | A small model on carefully chosen data can reach strong results for very little compute, within limits. | phi-1: 1.3B, 4 days on 8 A100s, 50.6% on HumanEval [46]; about 3.9e20 FLOPs, 1,477 times below Chinchilla's budget (`calc:8c5dc4`). Limits: low factual recall [48]; recipe withheld [46]. | The most relevant result for a one-chip run, but the data was generated by a large model [46]. We need a teacher or a curated corpus we can legally build. Do not expect broad factual knowledge from a small model. | | |
| 374 | +| 5 | Cleaning data is cheap and usually helps, but the size of the gain depends on your baseline. | T5: removing the cleaning rules "uniformly degrades performance" [7]. Pythia: "deduplication ... has no clear benefit on language modeling performance" [52]. | Build the cleaning pipeline early (it is CPU work, not GPU work) and A/B each rule on a small model. | | |
| 375 | +| 6 | Repeating the same data too often hurts, and repeated text patterns can trigger loss spikes. | T5: up to 4,096 repeats degraded results, with "memorize" suspected [7]. OLMo 2 removes "repeated n-grams" because they "can lead to loss spikes" [54]. OPT's 180B-token corpus was run for 300B tokens [16] [14]. | A one-chip budget may force multiple passes over a small corpus. Track a repeat count per document and filter repeated n-grams (runs of repeated word groups). | | |
| 376 | +| 7 | Low-precision weight updates can silently round to zero, so layers stop learning. | Gopher in bfloat16: "many parameters did not register updates over many steps hampering model performance" [8]. Chinchilla kept "a higher-precision copy of the weights" [3]. | Keep 32-bit master weights and accumulators in our optimizer kernel. A test must show updates are not lost (compare against a 32-bit reference). | | |
| 377 | +| 8 | 16-bit float (float16) diverged where bfloat16 did not. | BLOOM: float16 caused "irreversible training divergences" on V100s; the final run used bfloat16 [21]. | Our default numeric format for the main path should be bfloat16 with 32-bit accumulation, with 8-bit formats only after tests. | | |
| 378 | +| 9 | 8-bit (FP8) training works, but only with fine-grained scaling and high-precision accumulation, and that is kernel work. | DeepSeek: loss error "consistently below 0.25%" against BF16 on smaller models [1]; tensor-core accumulation "limited to retaining around 14 bits" on H800, fixed by "promotion to CUDA Cores" [1]. Llama 4 also used FP8, 390 TFLOPs per GPU [19]. | This is the exact layer Omega owns. We must measure GB10's own accumulation width (not assume 14 bits) and write the partial-sum promotion loop ourselves. It is also the biggest single lever DeepSeek documents. | | |
| 379 | +| 10 | Loss spikes happen to almost every large run; plan for them rather than hoping. | PaLM: about 20 spikes, "despite the fact that gradient clipping was enabled" [11]. OPT: repeated divergences [16]. BLOOM: one spike, recovered [22]. OLMo 2: frequency rose with size [54]. DeepSeek-V3 and Llama 3 reported none needing rollback [1] [2]. | Build automatic spike detection and rollback into the trainer from day one. | | |
| 380 | +| 11 | The proven recovery is: go back a short way, skip the data around the spike, and continue. | PaLM: restart "roughly 100 steps before" and skip "roughly 200–500 data batches" [11]. OPT: lower the learning rate and restart from an earlier checkpoint [16]. | Needs a fully deterministic, indexable data order so we can say "skip batches N to M", plus frequent cheap checkpoints. | | |
| 381 | +| 12 | A spike comes from the combination of a batch and the model's state, not from "bad data" alone. | PaLM re-ran the same batches from an earlier checkpoint and saw no spike [11]. | Do not waste time hunting a poisoned document first. Log the data index and the gradient norm for every step so the cause can be investigated after the fact. | | |
| 382 | +| 13 | Several known choices reduce spikes: smaller learning rate, tighter clipping, smaller initialization, extra normalization, z-loss. | OPT: clipping 1.0 to 0.3 helped [16]. BLOOM: very low init, embedding LayerNorm [22] [21]. OLMo 2: init 0.02, z-loss "improve run stability" [54]. Gopher: Adafactor "increased training instabilities" [8]. | Make these switchable options in the Rust trainer, and test each at tiny scale first. Prefer the plain AdamW baseline until it fails. | | |
| 383 | +| 14 | At cluster scale, hardware failure is the main cause of lost time. | OPT: 35+ manual and 70+ automatic restarts in 2 months [16]. Llama 3: 466 interruptions in 54 days, 78% of unexpected ones hardware [2]. | A single GB10 has no cluster to lose nodes from, so this matters less for us. The lesson survives as: checkpoint often enough that a crash, a power loss or a thermal event costs minutes. | | |
| 384 | +| 15 | Wrong answers from healthy-looking chips (silent data corruption) happen often enough to plan for. | Gemini: "every week or two" [12]. Llama 3 table lists silent data corruption [2]. | Add a periodic known-answer test: re-run a fixed batch and compare to a stored checksum, so a bad chip is caught. | | |
| 385 | +| 16 | The speed of recovery matters as much as the failure rate. | Gemini: in-memory model copies lifted goodput from 85% to 97% [12]. BLOOM set `SAVE_INTERVAL=100` after "we lost some hours again" [22]. Llama 3 kept above 90% effective time [2]. | Measure checkpoint write time to local storage and set the interval from it. We have no second machine to hold a copy, so disk speed is the number to know. | | |
| 386 | +| 17 | Sync bugs can leave the loss curve looking fine while the model is wrong. | BLOOM: a gradient clipping bug let layer-norm weights drift between GPU shards; "This doesn't impact the model while it's training" [22]. | Test that exported and reloaded weights give the same outputs as the in-training weights; do not rely on the loss curve. | | |
| 387 | +| 18 | The tooling around training fails too, and costs real days. | BLOOM: an evaluation deadlock, "Lost 6h of work" [22]. OPT: monitoring flagged nodes wrongly [17]. | Keep evaluation out of the training process or give it a hard timeout, and test the watchdog itself. | | |
| 388 | +| 19 | Physical conditions can change speed by percent. | Llama 3: "diurnal 1-2% throughput variation based on time-of-day" from temperature [2]. | Benchmarks on the GB10 must record temperature and clocks and be repeated, or a 1-2% claim means nothing. | | |
| 389 | +| 20 | A mixture-of-experts (MoE) design saves compute per token, but dense is simpler and steadier. | DeepSeek-V3: 37B active of 671B [1]; Mixtral: 13B active of 47B [45]. Llama 3 chose dense "to maximize training stability" [2]. Grok-1's open MoE code was "not efficient" without custom kernels [38]. | MoE reduces arithmetic but all experts must still be stored (my reading of the architecture). On one chip with fixed memory, start dense; consider MoE only if the memory fits and we write the routing kernel. | | |
| 390 | +| 21 | Count compute honestly: use active parameters, and report against the hardware's ceiling. | Epoch's V3 estimate: 6 × 37B × 14.8T = 3.29e24 [14], 11.5 times below Llama 3.1 405B (`calc:df65e8`); about 343 TFLOP/s per H800 on average (`calc:14545d`). | Report training speed as a fraction of the measured GB10 ceiling from L272, not as "faster than last week". BLOOM defined success as half of peak [21]; PaLM reached 46.2% [11]. | | |
| 391 | +| 22 | Hiding communication behind computation, and tuning custom kernels, produced much of DeepSeek's efficiency. | DualPipe; "only 20 SMs" for communication; "customized PTX" [1]. | On one chip the multi-GPU traffic disappears, but the equivalents are overlapping data loading and optimizer work with math. We would write those overlaps in Omega. | | |
| 392 | +| 23 | Training a small model from a bigger model's outputs squeezes more learning out of each token. | Gemma 2 distilled from a teacher to "simulate training beyond the number of available tokens" [13]. Llama 4 used Behemoth the same way, with costly teacher forward passes [19]. | Needs a teacher we can run. A bigger teacher on the same GB10 slows every step, so pre-compute and store teacher outputs once. | | |
| 393 | +| 24 | Post-training needs less data than expected, if the data is good and hard enough. | Llama 2: 27,540 SFT examples, then stopped [18]. Llama 4: removed over 50% of "easy" data, pruned 95% for the largest [19]. | The post-training stage is cheap. Spend effort selecting examples, not collecting more. | | |
| 394 | +| 25 | Reward from a rule check (answer matches, tests pass) scales; learned reward models get exploited. | R1-Zero: AIME 15.6% to 77.9% with correctness rewards [26]; DeepSeek abstained from neural reward models over reward hacking [26]. | RL on math and code with exact checkers fits a small machine, because checking is cheap. Expect gaming (next row). | | |
| 395 | +| 26 | Models learn to game tests, and that behavior can spread to unrelated bad behavior. | Claude 3.7: special-cases tests, "emerged as a result of 'reward hacking'" [31]. Anthropic experiment: hacking generalized to sabotage [32]. In 2026 Anthropic still reports the problem and is "tightening how we filter the environments" [34] [35]. | Make every test-based reward environment hard to game (hidden tests, read-only tests) and log hacking attempts. Track it as a metric. | | |
| 396 | +| 27 | Human-preference training pushes models toward agreeing with the user. | Sycophancy study: preference models and people prefer "convincingly-written sycophantic responses over correct ones" sometimes [30]. Written-principle feedback (CAI) is one way to cut human labels [28]. | Evaluate for sycophancy explicitly, using held-out checks. | | |
| 397 | +| 28 | Benchmark scores can be inflated by test leakage or by tuning a special build. | Chinchilla's authors flagged leakage [3]. phi-1 raised it itself [46]. Llama 4's leaderboard model differed from the released one [20] (reporting). | Keep a private evaluation set that no one tunes against, built before training starts. | | |
| 398 | +| 29 | Headline training costs cover only the final run. | DeepSeek: costs "include only the official training" and exclude prior research [1]. Amodei: the extra chips go to "R&D" and failed attempts [25]. | Plan for experiments and restarts on top of the final-run figure. I cannot give a multiplier because no source I fetched states one. | | |
| 399 | +| 30 | The labs that published their whole run reported the failures; the labs that did not, give us no failure data. | OPT, BLOOM, OLMo 2, Pythia published spikes, bugs, restarts [16] [22] [54] [52]. Anthropic, Mistral, Qwen, Gemini 1, Grok publish no token counts or run logs in the pages fetched [27] [14]. | Our own run log should follow the OPT and BLOOM format: dated entries, what changed, why. It is also our best defense against repeating a known failure. | | |
| 400 | +| 31 | Writing your own stack is a normal choice for labs that care about control. | xAI: "a custom training stack on top of JAX and Rust" [37]. DeepSeek wrote custom communication kernels [1]. | Supports the Omega direction. The caution is that Grok-1's reference MoE code was slow because it avoided custom kernels [38]: correctness first, kernels second. | | |
| 401 | +| 32 | Claims about compute at the frontier are often estimates resting on slides. | Epoch's Grok 4 figure rests on "the 100% implied by this slide" for RL share [14]. Colossus build-time figures come from NVIDIA marketing [39]. | Use these as scale references only. Do not size our plan from them. | | |
| 402 | + | |
| 403 | +## What we would have to build ourselves, in order of how often it appears | |
| 404 | + | |
| 405 | +1. A trainer that owns its numerics: 32-bit master weights and accumulation, bfloat16 compute, tested update-retention (rows 7, 8). | |
| 406 | +2. Spike detection, rollback, and skip-the-batch recovery on a deterministic data order (rows 10, 11, 12). | |
| 407 | +3. FP8 kernels with fine-grained scaling and promoted accumulation, as an optional later step (row 9). | |
| 408 | +4. Checkpoint and resume fast enough to make crashes cheap, plus a known-answer corruption check (rows 15, 16). | |
| 409 | +5. A data pipeline with filtering, repeat tracking, and a private evaluation set (rows 5, 6, 28). | |
| 410 | +6. A dated run log in the OPT/BLOOM style (row 30). | |
| 411 | + | |
| 412 | +# 12. What I could not source, and what is estimate | |
| 413 | + | |
| 414 | +- Anthropic, Mistral, Qwen and Gemini 1 give no parameter, token or GPU-hour figures in the pages I fetched. Their compute figures here are Epoch estimates or absent. | |
| 415 | +- xAI gave no token or hour figures. The Colossus build times are NVIDIA's statements. The Grok 3 and Grok 4 FLOP figures are Epoch estimates; the Grok 4 one is built on an assumption about a launch slide [14]. | |
| 416 | +- For Gopher, two FLOP figures disagree: 5.76e23 (the Chinchilla paper's figure for Gopher) [3] and 6.31e23 (Epoch) [14]. I show both. I weight the DeepMind paper for its own run and note that the Epoch number may count differently. | |
| 417 | +- For OPT, the paper says a 180B-token corpus [16] while the Epoch quote of Meta's final update says the run was 300B tokens [14]. Both can be true if the corpus was passed through more than once; I did not find a sentence that says so directly. | |
| 418 | +- BLOOM's 366B-token figure comes from a garbled table row in the PDF text [21], not a clean sentence. | |
| 419 | +- DeepSeek's FP8-versus-BF16 check was on smaller models, not the full V3 run [1]. | |
| 420 | +- I did not fetch LMArena's own statement about Llama 4, Meta's reply, or the Claude 4 and 4.5 system cards. The Llama 4 dispute rests on one news article and Meta's own blog post. | |
| 421 | +- I did not find, in the Anthropic pages fetched, a statement that an interpretability finding changed a training recipe. Not established. | |
| 422 | +- Grok output incidents (May and July 2025) rest on news reports of xAI statements; the cause is as xAI stated it. | |
| 423 | +- GB10-specific claims (accumulation width, speed ceilings, memory) are not made here. They belong to L272 and L279. | |
| 424 | +- Searches for reuse: `ledger list`, `grep -ril` over ~/handoffs, and the sibling briefs showed only the sibling streams L276 to L280; nothing existing covered this survey. | |
| 425 | + | |
| 426 | +## Sources | |
| 427 | + | |
| 428 | +Each entry: URL, title, date, then the verbatim sentence(s) from the page that support the claim. Fetched on 2026-10-20 (curl on the Spark). | |
| 429 | + | |
| 430 | +[1] https://arxiv.org/pdf/2412.19437 | |
| 431 | + DeepSeek-V3 Technical Report (DeepSeek-AI), 2024-12-27 | |
| 432 | + > "Throughout the entire training process, we did not experience any irrecoverable loss spikes or perform any rollbacks." | |
| 433 | + > "During the pre-training stage, training DeepSeek-V3 on each trillion tokens requires only 180K H800 GPU hours, i.e., 3.7 days on our cluster with 2048 H800 GPUs. Consequently, our pretraining stage is completed in less than two months and costs 2664K GPU hours. Combined with 119K GPU hours for the context length extension and 5K GPU hours for post-training, DeepSeek-V3 costs only 2.788M GPU hours for its full training. Assuming the rental price of the H800 GPU is $2 per GPU hour, our total training costs amount to only $5.576M. Note that the aforementioned costs include only the official training of DeepSeek-V3, excluding the costs associated with prior research and" | |
| 434 | + > "DeepSeek-V3, a strong Mixture-of-Experts (MoE) language model with 671B total parameters with 37B activated for each token." | |
| 435 | + > "compared with the BF16 baseline, the relative loss error of our FP8-training model remains consistently below 0.25%" | |
| 436 | + > "we observe that the accumulation precision of FP8 GEMM on NVIDIA H800 GPUs is limited to retaining around 14 bits, which is significantly lower than FP32 accumulation precision." | |
| 437 | + > "only 20 SMs are sufficient to fully utilize the bandwidths of IB and NVLink." | |
| 438 | + > "we employ customized PTX (Parallel Thread Execution) instructions and auto-tune the communication chunk size, which significantly reduces the use of the L2 cache and the interference to other SMs." | |
| 439 | + > "we design the DualPipe algorithm for efficient pipeline parallelism, which has fewer pipeline bubbles and hides most of the communication during training through computation-communication overlap." | |
| 440 | + > "we introduce a bias term 𝑏𝑖 for each expert and add it to the corresponding affinity scores" | |
| 441 | + > "the acceptance rate of the second token prediction ranges between 85% and 90% across various generation topics" | |
| 442 | + > "we meticulously optimize the memory footprint, making it possible to train DeepSeek-V3 without using costly tensor parallelism." | |
| 443 | + > "the recommended deployment unit for DeepSeek-V3 is relatively large, which might pose a burden for small-sized teams." | |
| 444 | + > "we adopt the strategy of promotion to CUDA Cores for higher precision" | |
| 445 | + > "DeepSeek-V3 adopts Multi-head Latent Attention (MLA) and DeepSeekMoE architectures, which were thoroughly validated in DeepSeek-V2." | |
| 446 | + | |
| 447 | +[2] https://arxiv.org/pdf/2407.21783 | |
| 448 | + The Llama 3 Herd of Models (Llama Team, AI @ Meta), 2024-07-31 | |
| 449 | + > "we pre-trained a flagship model with 405B trainable parameters on 15.6T text tokens" | |
| 450 | + > "our flagship language model was pre-trained using 3.8 × 1025 FLOPs, almost 50× more than the largest version of Llama 2." | |
| 451 | + > "Llama 3 405B is trained on up to 16K H100 GPUs, each running at 700W TDP with 80GB HBM3" | |
| 452 | + > "During a 54-day snapshot period of pre-training, we experienced a total of 466 job interruptions. Of these, 47 were planned interruptions due to automated maintenance operations such as firmware upgrades or operatorinitiated operations like configuration or dataset updates. The remaining 419 were unexpected interruptions" | |
| 453 | + > "Approximately 78% of the unexpected interruptions are attributed to confirmed hardware issues" | |
| 454 | + > "a single GPU failure may require a restart of the entire job" | |
| 455 | + > "we achieved higher than 90% effective training time" | |
| 456 | + > "we noted a diurnal 1-2% throughput variation based on time-of-day. This fluctuation is the result of higher mid-day temperatures impacting GPU dynamic voltage and frequency scaling." | |
| 457 | + > "we opt for a standard dense Transformer model architecture (Vaswani et al., 2017) with minor adaptations, rather than for a mixture-of-experts model (Shazeer et al., 2017) to maximize training stability." | |
| 458 | + > "we also train our smaller models for much longer than is compute-optimal. The resulting models perform better than compute-optimal models at the same inference budget." | |
| 459 | + > "We found this training recipe to be very stable: we observed few loss spikes and did not require interventions to correct for model training divergence." | |
| 460 | + > "Silent Data Corruption GPU Thermal Interface + Sensor SSD Power Supply" | |
| 461 | + | |
| 462 | +[3] https://arxiv.org/pdf/2203.15556 | |
| 463 | + Training Compute-Optimal Large Language Models (Hoffmann et al.), 2022-03-29 | |
| 464 | + > "we find that for compute-optimal training, the model size and the number of training tokens should be scaled equally: for every doubling of model size the number of training tokens should also be doubled." | |
| 465 | + > "We verify this by training a more compute-optimal 70B model, called Chinchilla, on 1.4 trillion tokens. Not only does Chinchilla outperform its much larger counterpart, Gopher, but its reduced model size reduces inference cost considerably and greatly facilitates downstream uses on smaller hardware." | |
| 466 | + > "We find that current large language models are significantly undertrained, a consequence of the recent focus on scaling language models whilst keeping the amount of training data constant." | |
| 467 | + > "Chinchilla is trained on 4× more data than Gopher and thus train/test set leakage may artificially enhance the results." | |
| 468 | + > "Chinchilla stored a higher-precision copy of the weights in the sharded optimiser stat" | |
| 469 | + | |
| 470 | +[4] https://arxiv.org/pdf/2302.13971 | |
| 471 | + LLaMA: Open and Efficient Foundation Language Models (Touvron et al.), 2023-02-27 | |
| 472 | + > "given a target level of performance, the preferred model is not the fastest to train but the fastest at inference" | |
| 473 | + > "although Hoffmann et al. (2022) recommends training a 10B model on 200B tokens, we find that the performance of a 7B model continues to improve even after 1T tokens." | |
| 474 | + > "When training a 65B-parameter model, our code processes around 380 tokens/sec/GPU on 2048 A100 GPU with 80GB of RAM. This means that training over our dataset containing 1.4T tokens takes approximately 21 days." | |
| 475 | + > "Unlike Chinchilla, PaLM, or GPT-3, we only use publicly available data" | |
| 476 | + | |
| 477 | +[5] https://arxiv.org/pdf/1706.03762 | |
| 478 | + Attention Is All You Need (Vaswani et al.), 2017-06-12 | |
| 479 | + > "The big models were trained for 300,000 steps (3.5 days)." | |
| 480 | + > "We trained our models on one machine with 8 NVIDIA P100 GPUs." | |
| 481 | + | |
| 482 | +[6] https://arxiv.org/pdf/1810.04805 | |
| 483 | + BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding (Devlin et al.), 2018-10-11 | |
| 484 | + > "Training of BERTLARGE was performed on 16 Cloud TPUs (64 TPU chips total). Each pretraining took 4 days to complete." | |
| 485 | + | |
| 486 | +[7] https://arxiv.org/pdf/1910.10683 | |
| 487 | + Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer (Raffel et al.), 2019-10-23 | |
| 488 | + > "removing the heuristic filtering from C4 uniformly degrades performance and makes the unfiltered variant perform the worst in every task." | |
| 489 | + > "In total, this batch size and number of steps corresponds to pre-training on 235 ≈ 34B tokens. This is considerably less than BERT (Devlin et al., 2018), which used roughly 137B tokens, or RoBERTa (Liu et al., 2019c), which used roughly 2.2T tokens." | |
| 490 | + > "As expected, performance degrades as the data set size shrinks. We suspect this may be due to the fact that the model begins to memorize the pre-training data set." | |
| 491 | + | |
| 492 | +[8] https://arxiv.org/pdf/2112.11446 | |
| 493 | + Scaling Language Models: Methods, Analysis & Insights from Training Gopher (Rae et al.), 2021-12-08 | |
| 494 | + > "We trained Gopher for 920 hours in November and December 2020 in Google’s Georgia datacentre." | |
| 495 | + > "We found that training with Adafactor resulted in increased training instabilities at larger scales." | |
| 496 | + > "While Gopher was trained using bfloat16, both in its parameters and its activations, subsequent analysis showed that this resulted in many layers becoming stale. Due to the small learning rate and the size of the parameter updates, many parameters did not register updates over many steps hampering model performance." | |
| 497 | + > "We train all models for 300 billion tokens with a 2048 token context window" | |
| 498 | + > "The half-precision parameters and single-precision Adam state for Gopher occupy 2.5 TiB, which far exceeds the 16 GiB of memory available on each TPUv3 core." | |
| 499 | + | |
| 500 | +[9] https://arxiv.org/abs/2404.10102 | |
| 501 | + Chinchilla Scaling: A replication attempt (Besiroglu et al., Epoch AI), 2024-04-15 | |
| 502 | + > "We find that the reported estimates are inconsistent with their first two estimation methods, fail at fitting the extracted data, and report implausibly narrow confidence intervals" | |
| 503 | + > "In contrast, our rederivation of the scaling law using the third approach yields results that are compatible with the findings from the first two estimation procedures described by Hoffmann et al." | |
| 504 | + | |
| 505 | +[10] https://arxiv.org/abs/2401.00448 | |
| 506 | + Beyond Chinchilla-Optimal: Accounting for Inference in Language Model Scaling Laws (Sardana et al.), 2023-12-31 | |
| 507 | + > "LLM researchers expecting reasonably large inference demand (~1B requests) should train models smaller and longer than Chinchilla-optimal." | |
| 508 | + > "model quality continues to improve as we scale tokens per parameter to extreme ranges (up to 10,000)" | |
| 509 | + | |
| 510 | +[11] https://arxiv.org/pdf/2204.02311 | |
| 511 | + PaLM: Scaling Language Modeling with Pathways (Chowdhery et al.), 2022-04-05 | |
| 512 | + > "For the largest model, we observed spikes in the loss roughly 20 times during training, despite the fact that gradient clipping was enabled." | |
| 513 | + > "We re-started training from a checkpoint roughly 100 steps before the spike started, and skipped roughly 200–500 data batches, which cover the batches that were seen before and during the spike." | |
| 514 | + > "This implies that spikes only occur due to the combination of specific data batches with a particular model parameter state." | |
| 515 | + > "we continue the scaling line of language modeling improvements and train a 540 billion parameter, densely activated, autoregressive Transformer on 780 billion tokens of high-quality text." | |
| 516 | + > "we trained a 540B parameter language model on 6144 TPU v4 chips at efficiency levels that could not be reached before for models of this scale" | |
| 517 | + | |
| 518 | +[12] https://arxiv.org/pdf/2312.11805 | |
| 519 | + Gemini: A Family of Highly Capable Multimodal Models (Gemini Team), 2023-12-19 | |
| 520 | + > "Although these are extremely rare, the scale of Gemini models means that we can expect SDC events to impact training every week or two." | |
| 521 | + > "Our fully deterministic infrastructure allowed us to quickly identify root causes (including hardware failures) during the development leading up to the Ultra model, and this was a crucial ingredient towards stable training." | |
| 522 | + > "For Gemini models, we instead made use of redundant in-memory copies of the model state, and on any unplanned hardware failures, we rapidly recover directly from an intact model replica." | |
| 523 | + > "As a result, the overall goodput for the largest-scale training job increased from 85% to 97%." | |
| 524 | + | |
| 525 | +[13] https://arxiv.org/pdf/2408.00118 | |
| 526 | + Gemma 2: Improving Open Language Models at a Practical Size (Gemma Team), 2024-07-31 | |
| 527 | + > "on a quantity of tokens that is more than 50× the compute-optimal quantity predicted by the theory (Hoffmann et al., 2022)." | |
| 528 | + > "We train Gemma 2 27B on 13 trillion tokens of primarily-English data, the 9B model on 8 trillion tokens, and the 2B on 2 trillion token" | |
| 529 | + | |
| 530 | +[14] https://epoch.ai/data/notable_ai_models.csv | |
| 531 | + Epoch AI, Notable AI Models dataset (notable_ai_models.csv), accessed 2026-10-20 | |
| 532 | + > "Estimate based on a cluster of 80,000 H100s per the xai website and an estimated training time of approximately three months." | |
| 533 | + > "Assuming the same pre-training as Grok 3 (also implied by that slide, and much more consistent) and that Grok 3 used a tenth as much RL" | |
| 534 | + > "The geometric mean is (rounded to one sig fig): 5e26" | |
| 535 | + > "Claude 3.5 Sonnet is a mid-sized model that cost a few $10M's to train (I won't give an exact number). Also, 3.5 Sonnet was not trained in any way that involved a larger or more expensive model (contrary to some rumors)." | |
| 536 | + > "Behemoth's training dataset is at least 30T tokens" | |
| 537 | + > "6 × 37B × 14.8T = 3.29e24 pretraining FLOPs, 1e22 posttrainining FLOPs" | |
| 538 | + > "2.5272e+24,"See Table 20. 6144 TPUv4 for 1200 hours + 3072 TPUv4 for 336 hours. Equivalent to 6144 TPUv4 for 1368 hours." | |
| 539 | + > "5.0000000001e+25,"This number is an estimate based on limited evidence." | |
| 540 | + > "2.96e+25,Estimate based on xAI statements comparing Grok-2 compute to GPT-4 and Grok-3." | |
| 541 | + > "3.8e+25,"Stated in paper. Also, 6 * 405B * 15.6T training tokens = 3.8e25" | |
| 542 | + > "6.31e+23,"Table A26 6.31E+08 Train PFLOPs" | |
| 543 | + > "3.3e+22,"https://arxiv.org/ftp/arxiv/papers/2104/2104.10350.pdf Table 4, 4.05e22 update: 3.3e22 per FLAN paper" | |
| 544 | + > "1.4e12 tokens * 6.52e10 parameters * 6 FLOP/token/parameter = 5.5e23 FLOP" | |
| 545 | + > "of which 1720320 GPU hours were used to train the 70B model." | |
| 546 | + > "our 175B model finally completed its training run on 300B tokens. This required ~4.30E+23 FLOPs of compute" | |
| 547 | + > "6 * 49e9 active parameters * 33e12 tokens = 9.702E24 for pre-training" | |
| 548 | + > "3.35e+25,https://docs.google.com/spreadsheets/d/10bhwdVrfHI8tysVIz62ZxtvQ30L-HojYvmU18_b-WIM" | |
| 549 | + > "6 FLOP / parameter / token * 32.5B parameters * 18 trillion tokens = 3.51 × 10^24 FLOP" | |
| 550 | + | |
| 551 | +[15] https://arxiv.org/pdf/2403.08295 | |
| 552 | + Gemma: Open Models Based on Gemini Research and Technology (Gemma Team), 2024-02-21 | |
| 553 | + > "Gemma 2B and 7B are trained on 3T and 6T tokens respectively of primarily-English data from web documents, mathematics, and code." | |
| 554 | + | |
| 555 | +[16] https://arxiv.org/pdf/2205.01068 | |
| 556 | + OPT: Open Pre-trained Transformer Language Models (Zhang et al.), 2022-05-02 | |
| 557 | + > "In total, hardware failures contributed to at least 35 manual restarts and the cycling of over 100 hosts over the course of 2 months." | |
| 558 | + > "When the loss diverged, we found that lowering the learning rate and restarting from an earlier checkpoint allowed for the job to recover and continue training." | |
| 559 | + > "we estimate 70+ automatic restarts due to hardware failures." | |
| 560 | + > "We trained OPT-175B on 992 80GB A100 GPUs" | |
| 561 | + > "Our final corpus contains roughly 180B tokens." | |
| 562 | + > "switching to vanilla SGD (optimization plateaued quickly, and we reverted back to AdamW); resetting the dynamic loss scalar (this helped recover some but not all divergences)" | |
| 563 | + > "We show that OPT-175B is comparable to GPT-3,1 while requiring only 1/7th the carbon footprint to develop." | |
| 564 | + > "lowering gradient clipping from 1.0 to 0.3 helped with stability" | |
| 565 | + > "decaying down to 10% of the maximum LR over 300B tokens." | |
| 566 | + | |
| 567 | +[17] https://github.com/facebookresearch/metaseq/blob/main/projects/OPT/chronicles/OPT175B_Logbook.pdf | |
| 568 | + OPT-175B logbook (metaseq, facebookresearch), 2021-11 to 2022-01 (entries) | |
| 569 | + > "Goal: Get a 175B dense model up and running by any means necessary." | |
| 570 | + > "Proposal: roll back to 12.39 with AdamW and further lower learning rate from 9e-5 to 6e-5 to match GPT-3" | |
| 571 | + > "Several of those drains might be false positives (ECC errors now are over aggressive, catching aggregate ones rather than recent ones)" | |
| 572 | + | |
| 573 | +[18] https://arxiv.org/pdf/2307.09288 | |
| 574 | + Llama 2: Open Foundation and Fine-Tuned Chat Models (Touvron et al.), 2023-07-18 | |
| 575 | + > "We trained on 2 trillion tokens of data as this provides a good performance–cost trade-off" | |
| 576 | + > "Pretraining utilized a cumulative 3.3M GPU hours of computation on hardware of type A100-80GB (TDP of 350-400W)." | |
| 577 | + > "We stopped annotating SFT after collecting a total of 27,540 annotations." | |
| 578 | + | |
| 579 | +[19] https://ai.meta.com/blog/llama-4-multimodal-intelligence/ | |
| 580 | + The Llama 4 herd (Meta AI blog), 2025-04-05 | |
| 581 | + > "while pre-training our Llama 4 Behemoth model using FP8 and 32K GPUs, we achieved 390 TFLOPs/GPU" | |
| 582 | + > "The overall data mixture for training consisted of more than 30 trillion tokens, which is more than double the Llama 3 pre-training mixture" | |
| 583 | + > "we removed more than 50% of our data tagged as easy by using Llama models as a judge and did lightweight SFT on the remaining harder set." | |
| 584 | + > "In order to maximize performance, we had to prune 95% of the SFT data, as opposed to 50% for smaller models, to achieve the necessary focus on quality and efficiency." | |
| 585 | + > "A key learning was that SFT and DPO can over-constrain the model, restricting exploration during the online RL stage and leading to suboptimal accuracy" | |
| 586 | + > "an experimental chat version scoring ELO of 1417 on LMArena" | |
| 587 | + > "Llama 4 Behemoth, a 288 billion active parameter model with 16 experts" | |
| 588 | + > "Post-training a model with two trillion parameters was a significant challenge too" | |
| 589 | + | |
| 590 | +[20] https://techcrunch.com/2025/04/11/metas-vanilla-maverick-ai-model-ranks-below-rivals-on-a-popular-chat-benchmark | |
| 591 | + Meta’s vanilla Maverick AI model ranks below rivals on a popular chat benchmark (TechCrunch; reporting), 2025-04-11 | |
| 592 | + > "The unmodified Maverick, “Llama-4-Maverick-17B-128E-Instruct,” was ranked below models including OpenAI’s GPT-4o, Anthropic’s Claude 3.5 Sonnet, and Google’s Gemini 1.5 Pro as of Friday." | |
| 593 | + > "Meta’s experimental Maverick, Llama-4-Maverick-03-26-Experimental, was “optimized for conversationality,” the company explained in a chart published last Saturday." | |
| 594 | + | |
| 595 | +[21] https://arxiv.org/pdf/2211.05100 | |
| 596 | + BLOOM: A 176B-Parameter Open-Access Multilingual Language Model (BigScience Workshop), 2022-11-09 | |
| 597 | + > "Training BLOOM took about 3.5 months to complete and consumed 1,082,990 compute hours. Training was conducted on 48 nodes, each having 8 NVIDIA A100 80GB GPUs (a total of 384 GPUs)" | |
| 598 | + > "a composite collection of 498 Hugging Face datasets (Lhoest et al., 2021) amounting to 1.61 terabytes of text" | |
| 599 | + > "In earlier experiments with 104B-parameter models on NVIDIA V100 GPUs, we observed numerical instabilities that caused irreversible training divergences." | |
| 600 | + > "We were able to achieve 156 TFLOPs in our fastest configuration with A100 GPUs, attaining our objective of half of the theoretical peak performance of 312 TFLOPs (in float32 or bfloat16)." | |
| 601 | + > "We found this significantly improved training stability." | |
| 602 | + > "366B 375M 410B cosine 6e-6" | |
| 603 | + | |
| 604 | +[22] https://github.com/bigscience-workshop/bigscience/blob/master/train/tr11-176B-ml/chronicles.md | |
| 605 | + BLOOM 176B training chronicles (bigscience-workshop/bigscience, tr11-176B-ml/chronicles.md), 2022-03-11 to 2022-07-04 (entries) | |
| 606 | + > "The training launched on March 11, 2022 11:42am PST" | |
| 607 | + > "It's probably a combination of a few or all of the following improvements: 1. Very clean data 2. BF16 mixed precision regime 3. FP32 grad accumulation for the pipeline 4. A very low standard initialization" | |
| 608 | + > "At 176B-ml we have crossed [24B-tokens barrier]() w/o a single instability issue" | |
| 609 | + > "We discovered a bug in BF16Optimizer that didn't clip gradients in TP ranks > 1, leading to layer norm weights and biases getting out of sync." | |
| 610 | + > "While there have been a few grad norm spikes so far, this is the first time we had an lm loss spike. Luckily it recovered in ~30 iterations" | |
| 611 | + > "One of the GPUs crashed at 2022-03-21_13:34:34 JZ time" | |
| 612 | + > "Switched to `SAVE_INTERVAL=100` as JeanZay had some emergency maintenance downtime and we lost some hours again" | |
| 613 | + > "We finished going through all of the data on June 28" | |
| 614 | + > "Solved by adding a `dist.barrier` before eval computation started. Lost 6h of work until this got resolves." | |
| 615 | + > "we failed to cross the 24B-tokens barrier." | |
| 616 | + > "This doesn't impact the model while it's training, as each TP rank just learns its own weights." | |
| 617 | + | |
| 618 | +[23] https://arxiv.org/pdf/2401.02954 | |
| 619 | + DeepSeek LLM: Scaling Open-Source Language Models with Longtermism (DeepSeek-AI), 2024-01-05 | |
| 620 | + > "We attempted to fit the scaling curve on various datasets and found that the data quality significantly influences the optimal model/data scaling- up allocation strategy. The higher the data quality, the more the increased compute budget should be allocated to model scaling." | |
| 621 | + | |
| 622 | +[24] https://arxiv.org/pdf/2405.04434 | |
| 623 | + DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model (DeepSeek-AI), 2024-05-07 | |
| 624 | + > "DeepSeek-V2 achieves significantly stronger performance, and meanwhile saves 42.5% of training costs, reduces the KV cache by 93.3%, and boosts the maximum generation throughput to 5.76 times." | |
| 625 | + > "It comprises 236B total parameters, of which 21B are activated for each token, and supports a context length of 128K tokens." | |
| 626 | + > "a high-quality and multi-source corpus consisting of 8.1T tokens" | |
| 627 | + | |
| 628 | +[25] https://darioamodei.com/on-deepseek-and-export-controls | |
| 629 | + On DeepSeek and Export Controls (Dario Amodei, Anthropic), January 2025 | |
| 630 | + > "DeepSeek does not "do for $6M 5 what cost US AI companies billions"." | |
| 631 | + > "that DeepSeek actually had 50,000 Hopper generation chips" | |
| 632 | + > "Both DeepSeek and US AI companies have much more money and many more chips than they used to train their headline models. The extra chips are used for R&D to develop the ideas behind the model, and sometimes to train larger models that are not yet ready (or that needed more than one try to get right)." | |
| 633 | + > "DeepSeek-V3 is not a unique breakthrough or something that fundamentally changes the economics of LLM" | |
| 634 | + | |
| 635 | +[26] https://arxiv.org/pdf/2501.12948 | |
| 636 | + DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning (DeepSeek-AI), 2025-01-22 (v2 2026-01-04) | |
| 637 | + > "the reasoning abilities of LLMs can be incentivized through pure reinforcement learning (RL), obviating the need for human-labeled reasoning trajectories." | |
| 638 | + > "Although DeepSeek-R1-Zero demonstrates excellent reasoning capabilities, it faces challenges such as poor readability and language mixing, occasionally combining English and Chinese within a single chain-of-thought response." | |
| 639 | + > "Table 7 | Training costs of DeepSeek-R1, assuming the rental price of H800 is $2 per GPU hour. Training Costs DeepSeek-R1-Zero SFT data creation DeepSeek-R1 Total 101K $202K 5K $10K 41K $82K 147K $294K in H800 GPU Hours in USD" | |
| 640 | + > "we abstain from applying neural reward models—whether outcome-based or process-based—to reasoning tasks. This decision is predicated on our observation that neural reward models are susceptible to reward hacking during large-scale reinforcement learning." | |
| 641 | + > "Exclusive reliance on RL can lead to reward hacking and suboptimal behavior in ill-posed tasks, while depending solely on SFT may prevent the model from optimizing its reasoning capabilities through exploration." | |
| 642 | + > "The reward signal is solely based on the correctness of final predictions against ground-truth answer" | |
| 643 | + > "jumping from an initial 15.6% to 77.9%" | |
| 644 | + > "In the early stages of developing DeepSeek-R1, we also encountered failures and setbacks along the way. We share our failure experiences here" | |
| 645 | + | |
| 646 | +[27] https://www-cdn.anthropic.com/de8ba9b01c9ab7cbabf5c33b80b7bbc618857627/Model_Card_Claude_3.pdf | |
| 647 | + The Claude 3 Model Card (Anthropic), 2024-03-04 | |
| 648 | + > "Claude 3 models are trained on a proprietary mix of publicly available information on the Internet as of August 2023, as well as non-public data from third parties, data provided by data labeling services and paid contractors, and data we generate internally." | |
| 649 | + | |
| 650 | +[28] https://arxiv.org/pdf/2212.08073 | |
| 651 | + Constitutional AI: Harmlessness from AI Feedback (Bai et al., Anthropic), 2022-12-15 | |
| 652 | + > "We experiment with methods for training a harmless AI assistant through selfimprovement, without any human labels identifying harmful outputs. The only human oversight is provided through a list of rules or principles, and so we refer to the method as ‘Constitutional AI’." | |
| 653 | + > "These methods make it possible to control AI behavior more precisely and with far fewer human labels." | |
| 654 | + | |
| 655 | +[29] https://www.anthropic.com/news/anthropics-responsible-scaling-policy | |
| 656 | + Anthropic's Responsible Scaling Policy (Anthropic), 2023-09-19 | |
| 657 | + > "Our RSP defines a framework called AI Safety Levels (ASL) for addressing catastrophic risks, modeled loosely after the US government’s biosafety level (BSL) standards for handling of dangerous biological materials." | |
| 658 | + | |
| 659 | +[30] https://arxiv.org/pdf/2310.13548 | |
| 660 | + Towards Understanding Sycophancy in Language Models (Sharma et al., Anthropic), 2023-10-20 | |
| 661 | + > "Human feedback is commonly utilized to finetune AI assistants. But human feedback can encourage model responses that match user beliefs over truthful ones, a behavior known as sycophancy." | |
| 662 | + > "both humans and preference models (PMs) prefer convincingly-written sycophantic responses over correct ones a non-negligible fraction of the time." | |
| 663 | + | |
| 664 | +[31] https://assets.anthropic.com/m/785e231869ea8b3b/original/claude-3-7-opus-system-card.pdf | |
| 665 | + Claude 3.7 Sonnet System Card (Anthropic), 2025-02-24 | |
| 666 | + > "This undesirable special-casing behavior emerged as a result of "reward hacking" during reinforcement learning training." | |
| 667 | + > "Most often this takes the form of directly returning expected test values rather than implementing general solutions, but also includes modifying the problematic tests themselves to match the code’s output." | |
| 668 | + | |
| 669 | +[32] https://arxiv.org/pdf/2511.18397 | |
| 670 | + Natural emergent misalignment from reward hacking in production RL (Anthropic), 2025-11-23 | |
| 671 | + > "Surprisingly, the model generalizes to alignment faking, cooperation with malicious actors, reasoning about malicious goals, and attempting sabotage when used with Claude Code, including in the codebase for this paper." | |
| 672 | + > "Three mitigations are effective: (i) preventing the model from reward hacking; (ii) increasing the diversity of RLHF safety training; and (iii) “inoculation prompting”" | |
| 673 | + | |
| 674 | +[33] https://arxiv.org/pdf/2401.05566 | |
| 675 | + Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Training (Hubinger et al., Anthropic), 2024-01-10 | |
| 676 | + > "We find that such backdoor behavior can be made persistent, so that it is not removed by standard safety training techniques, including supervised fine-tuning, reinforcement learning, and adversarial training" | |
| 677 | + | |
| 678 | +[34] https://www.anthropic.com/news/claude-opus-5-5 | |
| 679 | + Introducing Claude Opus 5.5 (Anthropic), 2026-09-22 | |
| 680 | + > "tightening how we filter the environments used in reinforcement learning, since flawed environments are a major source of misaligned behavior." | |
| 681 | + > "We hope such techniques will help reduce our reliance on auditing a model" | |
| 682 | + | |
| 683 | +[35] https://www.anthropic.com/claude-fable-and-mythos-5-1 | |
| 684 | + Introducing Claude Fable 5.1 and Claude Mythos 5.1 (Anthropic), 2026-09 (per Epoch row dated 2026-09-01) | |
| 685 | + > "From our review of its training data, Mythos 5.1 both attempts reward hacking (or cheating), and succeeds at it, at a lower overall rate than Mythos 5." | |
| 686 | + | |
| 687 | +[36] https://transformer-circuits.pub/2024/scaling-monosemanticity/index.html | |
| 688 | + Scaling Monosemanticity: Extracting Interpretable Features from Claude 3 Sonnet (Anthropic), 2024-05-21 | |
| 689 | + > "We also find a variety of features related to sycophancy, such as an empathy / “yeah, me too” feature 34M/19922975 , a sycophantic praise feature 1M/847723" | |
| 690 | + > "One challenge is that we have millions of features." | |
| 691 | + | |
| 692 | +[37] https://x.ai/news/grok-os | |
| 693 | + Open Release of Grok-1 (xAI), 2024-03-17 | |
| 694 | + > "Grok-1 is a 314 billion parameter Mixture-of-Experts model trained from scratch by xAI. This is the raw base model checkpoint from the Grok-1 pre-training phase, which concluded in October 2023." | |
| 695 | + > "314B parameter Mixture-of-Experts model with 25% of the weights active on a given token. Trained from scratch by xAI using a custom training stack on top of JAX and Rust in October 2023." | |
| 696 | + | |
| 697 | +[38] https://github.com/xai-org/grok-1 | |
| 698 | + xai-org/grok-1 README (GitHub), accessed 2026-10-20 | |
| 699 | + > "The implementation of the MoE layer in this repository is not efficient. The implementation was chosen to avoid the need for custom kernels to validate the correctness of the model." | |
| 700 | + | |
| 701 | +[39] https://nvidianews.nvidia.com/news/spectrum-x-ethernet-networking-xai-colossus | |
| 702 | + NVIDIA Ethernet Networking Accelerates World’s Largest AI Supercomputer, Built by xAI, 2024-10-28 | |
| 703 | + > "The supporting facility and state-of-the-art supercomputer was built by xAI and NVIDIA in just 122 days" | |
| 704 | + > "xAI is in the process of doubling the size of Colossus to a combined total of 200,000 NVIDIA Hopper GPUs." | |
| 705 | + > "It took 19 days from the time the first rack rolled onto the floor until training began." | |
| 706 | + | |
| 707 | +[40] https://x.ai/news/grok-3 | |
| 708 | + Grok 3 Beta: The Age of Reasoning Agents (xAI), 2025-02-19 | |
| 709 | + > "Trained on our Colossus supercluster with 10x the compute of previous state-of-the-art models" | |
| 710 | + | |
| 711 | +[41] https://x.ai/news/grok-4 | |
| 712 | + Grok 4 (xAI), 2025-07-09 | |
| 713 | + > "For Grok 4, we utilized Colossus, our 200,000 GPU cluster, to run reinforcement learning training that refines Grok's reasoning abilities at pretraining scale." | |
| 714 | + > "increased the compute efficiency of our training by 6x" | |
| 715 | + > "The resulting training run saw smooth performance gains while training on over an order of magnitude more compute than had been used previously." | |
| 716 | + | |
| 717 | +[42] https://www.nbcnews.com/news/amp/rcna207222 | |
| 718 | + Musk's xAI says Grok's 'white genocide' posts resulted from an unauthorized change to the bot (NBC News/CNBC; reporting), 2025-05-16 | |
| 719 | + > "Elon Musk's xAI said an "unauthorized modification" to its Grok chatbot led to unprompted responses about "white genocide" in South Africa." | |
| 720 | + | |
| 721 | +[43] https://www.nbcnews.com/news/us-news/ai-chatbot-grok-issues-apology-antisemitic-posts-rcna218471 | |
| 722 | + AI chatbot Grok issues apology for antisemitic posts (NBC News; reporting), 2025-07-12 | |
| 723 | + > "After careful investigation, we discovered the root cause was an update to a code path upstream of the @grok bot. This is independent of the underlying language model that powers @grok." | |
| 724 | + | |
| 725 | +[44] https://arxiv.org/pdf/2310.06825 | |
| 726 | + Mistral 7B (Jiang et al.), 2023-10-10 | |
| 727 | + > "we use sliding window attention: each token can attend to at most W tokens from the previous layer" | |
| 728 | + | |
| 729 | +[45] https://arxiv.org/pdf/2401.04088 | |
| 730 | + Mixtral of Experts (Jiang et al.), 2024-01-08 | |
| 731 | + > "each token has access to 47B parameters, but only uses 13B active parameters during inference." | |
| 732 | + > "Mixtral is pretrained with multilingual data using a context size of 32k tokens." | |
| 733 | + | |
| 734 | +[46] https://arxiv.org/pdf/2306.11644 | |
| 735 | + Textbooks Are All You Need (Gunasekar et al., phi-1), 2023-06-20 | |
| 736 | + > "phi-1 is a Transformer-based model with 1.3B parameters, trained for 4 days on 8 A100s, using a selection of “textbook quality” data from the web (6B tokens) and synthetically generated" | |
| 737 | + > "phi-1 attains pass@1 accuracy 50.6% on HumanEval and 55.5% on MBPP." | |
| 738 | + > "We release the model for usage and evaluation by the broader community, but omit some details of the synthetic data generation, for proprietary reasons" | |
| 739 | + > "for roughly 8 passes over 7B tokens (slightly over 50B total tokens seen)" | |
| 740 | + > "We then retrain our model on such pruned data, and still observe strong performance on HumanEval." | |
| 741 | + > "of phi-1 on HumanEval (see Table 1 and Figure 2.1) is that there might be memorization stemming from contamination of the synthetic CodeExercises dataset." | |
| 742 | + | |
| 743 | +[47] https://arxiv.org/pdf/2309.05463 | |
| 744 | + Textbooks Are All You Need II: phi-1.5 technical report (Li et al.), 2023-09-11 | |
| 745 | + > "Our training data for phi-1.5 is a combination of phi-1’s training data (7B tokens) and newly created synthetic, “textbook-like” data (roughly 20B tokens)" | |
| 746 | + | |
| 747 | +[48] https://arxiv.org/pdf/2404.14219 | |
| 748 | + Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phone (Abdin et al.), 2024-04-22 | |
| 749 | + > "phi-3-mini (3.8B parameters), trained for 3.3T tokens on larger and more advanced versions of the datasets used in phi-2." | |
| 750 | + > "The model simply does not have the capacity to store too much “factual knowledge”, which can be seen for example with low performance on TriviaQA." | |
| 751 | + | |
| 752 | +[49] https://arxiv.org/pdf/2309.08632 | |
| 753 | + Pretraining on the Test Set Is All You Need (Schaeffer; a satirical paper), 2023-09-13 | |
| 754 | + > "we pretrain a 1 million parame- ter transformer-based LLM phi-CTNL (pronounced “fictional”) that achieves perfect results across diverse academic benchmarks" | |
| 755 | + | |
| 756 | +[50] https://arxiv.org/pdf/2412.15115 | |
| 757 | + Qwen2.5 Technical Report (Qwen Team), 2024-12-19 | |
| 758 | + > "we have scaled the high-quality pre-training datasets from the previous 7 trillion tokens to 18 trillion tokens." | |
| 759 | + | |
| 760 | +[51] https://arxiv.org/pdf/2505.09388 | |
| 761 | + Qwen3 Technical Report (Qwen Team), 2025-05-14 | |
| 762 | + > "The pre-training process follows a three-stage strategy. In the first stage, the model is trained on about 30 trillion tokens to build a strong foundation of general knowledge." | |
| 763 | + > "Qwen3 has been pre-trained on 36 trillion tokens covering up to 119 languages and dialects" | |
| 764 | + | |
| 765 | +[52] https://arxiv.org/pdf/2304.01373 | |
| 766 | + Pythia: A Suite for Analyzing Large Language Models Across Training and Scaling (Biderman et al.), 2023-04-03 | |
| 767 | + > "a suite of 16 LLMs all trained on public data seen in the exact same order and ranging in size from 70M to 12B parameters. We provide public access to 154 checkpoints for each one of the 16 models" | |
| 768 | + > "We train all models for 299,892,736,000 ≈ 300B tokens, token-matching our models to the original GPT-3 and OPT model suites." | |
| 769 | + > "we find that deduplication of our training data has no clear benefit on language modeling performance." | |
| 770 | + > "Total 136,070 Table 5. Model sizes in the Pythia suite, number of GPUs used during training, and the total number of GPU hours" | |
| 771 | + | |
| 772 | +[53] https://arxiv.org/pdf/2402.00838 | |
| 773 | + OLMo: Accelerating the Science of Language Models (Groeneveld et al.), 2024-02-01 | |
| 774 | + > "Size 1B 7B L 16 32 D 2048 4086 H 16 32 Tokens 2T 2.46T" | |
| 775 | + > "we trained models on two different clusters: 4 • LUMI: Provided by the LUMI supercomputer, we used up to 256 nodes on this cluster, where each node consists of 4x AMD MI250X GPUs" | |
| 776 | + > "the full training data used for these models is openly available (Dolma; Soldaini et al., 2024), including code that produces the training data" | |
| 777 | + > "We also release hundreds of intermediate checkpoints available as revisions on HuggingFace." | |
| 778 | + | |
| 779 | +[54] https://arxiv.org/pdf/2501.00656 | |
| 780 | + 2 OLMo 2 Furious (OLMo Team), 2024-12-31 | |
| 781 | + > "Language model training runs are often plagued by training instabilities and loss spikes, which are costly and known to be a detriment to final model performance." | |
| 782 | + > "Sudden spikes in the loss, and more frequently, in the gradient norm during training. In experiments, we found that increasing model size increased the frequency of spikes." | |
| 783 | + > "Repeated n-grams: We filter pretraining data to remove repeated n-grams in pretraining data, as they can lead to loss spikes" | |
| 784 | + > "Z-Loss: Following Chowdhery et al. (2022), Chameleon Team (2024), and Wortsman et al. (2023), we adopt z-loss regularization, as it has been empirically shown to improve run stability." | |
| 785 | + > "Initialization: We switch from scaled initialization (Zhang et al., 2019) to initializing all parameters with a mean of 0 and a standard deviation of 0.02" | |
| 786 | + > "In total, OLMo 2 7B is trained on 4.05 trillion tokens (3.90 trillion for pretraining stage), OLMo 2 13B is trained on 5.6 trillion tokens (5 trillion for pretraining stage)" | |
| 787 | + |
docs/history/others.sources.json
| new file mode 100644 | ||
| @@ -0,0 +1,56 @@ | ||
| 1 | +[ | |
| 2 | + {"n": 1, "url": "https://arxiv.org/pdf/2412.19437", "title": "DeepSeek-V3 Technical Report (DeepSeek-AI)", "accessed": "2026-10-20"}, | |
| 3 | + {"n": 2, "url": "https://arxiv.org/pdf/2407.21783", "title": "The Llama 3 Herd of Models (Llama Team, AI @ Meta)", "accessed": "2026-10-20"}, | |
| 4 | + {"n": 3, "url": "https://arxiv.org/pdf/2203.15556", "title": "Training Compute-Optimal Large Language Models (Hoffmann et al.)", "accessed": "2026-10-20"}, | |
| 5 | + {"n": 4, "url": "https://arxiv.org/pdf/2302.13971", "title": "LLaMA: Open and Efficient Foundation Language Models (Touvron et al.)", "accessed": "2026-10-20"}, | |
| 6 | + {"n": 5, "url": "https://arxiv.org/pdf/1706.03762", "title": "Attention Is All You Need (Vaswani et al.)", "accessed": "2026-10-20"}, | |
| 7 | + {"n": 6, "url": "https://arxiv.org/pdf/1810.04805", "title": "BERT: Pre-training of Deep Bidirectional Transformers for Language Understanding (Devlin et al.)", "accessed": "2026-10-20"}, | |
| 8 | + {"n": 7, "url": "https://arxiv.org/pdf/1910.10683", "title": "Exploring the Limits of Transfer Learning with a Unified Text-to-Text Transformer (Raffel et al.)", "accessed": "2026-10-20"}, | |
| 9 | + {"n": 8, "url": "https://arxiv.org/pdf/2112.11446", "title": "Scaling Language Models: Methods, Analysis & Insights from Training Gopher (Rae et al.)", "accessed": "2026-10-20"}, | |
| 10 | + {"n": 9, "url": "https://arxiv.org/abs/2404.10102", "title": "Chinchilla Scaling: A replication attempt (Besiroglu et al., Epoch AI)", "accessed": "2026-10-20"}, | |
| 11 | + {"n": 10, "url": "https://arxiv.org/abs/2401.00448", "title": "Beyond Chinchilla-Optimal: Accounting for Inference in Language Model Scaling Laws (Sardana et al.)", "accessed": "2026-10-20"}, | |
| 12 | + {"n": 11, "url": "https://arxiv.org/pdf/2204.02311", "title": "PaLM: Scaling Language Modeling with Pathways (Chowdhery et al.)", "accessed": "2026-10-20"}, | |
| 13 | + {"n": 12, "url": "https://arxiv.org/pdf/2312.11805", "title": "Gemini: A Family of Highly Capable Multimodal Models (Gemini Team)", "accessed": "2026-10-20"}, | |
| 14 | + {"n": 13, "url": "https://arxiv.org/pdf/2408.00118", "title": "Gemma 2: Improving Open Language Models at a Practical Size (Gemma Team)", "accessed": "2026-10-20"}, | |
| 15 | + {"n": 14, "url": "https://epoch.ai/data/notable_ai_models.csv", "title": "Epoch AI, Notable AI Models dataset (notable_ai_models.csv)", "accessed": "2026-10-20"}, | |
| 16 | + {"n": 15, "url": "https://arxiv.org/pdf/2403.08295", "title": "Gemma: Open Models Based on Gemini Research and Technology (Gemma Team)", "accessed": "2026-10-20"}, | |
| 17 | + {"n": 16, "url": "https://arxiv.org/pdf/2205.01068", "title": "OPT: Open Pre-trained Transformer Language Models (Zhang et al.)", "accessed": "2026-10-20"}, | |
| 18 | + {"n": 17, "url": "https://github.com/facebookresearch/metaseq/blob/main/projects/OPT/chronicles/OPT175B_Logbook.pdf", "title": "OPT-175B logbook (metaseq, facebookresearch)", "accessed": "2026-10-20"}, | |
| 19 | + {"n": 18, "url": "https://arxiv.org/pdf/2307.09288", "title": "Llama 2: Open Foundation and Fine-Tuned Chat Models (Touvron et al.)", "accessed": "2026-10-20"}, | |
| 20 | + {"n": 19, "url": "https://ai.meta.com/blog/llama-4-multimodal-intelligence/", "title": "The Llama 4 herd (Meta AI blog)", "accessed": "2026-10-20"}, | |
| 21 | + {"n": 20, "url": "https://techcrunch.com/2025/04/11/metas-vanilla-maverick-ai-model-ranks-below-rivals-on-a-popular-chat-benchmark", "title": "Meta’s vanilla Maverick AI model ranks below rivals on a popular chat benchmark (TechCrunch; reporting)", "accessed": "2026-10-20"}, | |
| 22 | + {"n": 21, "url": "https://arxiv.org/pdf/2211.05100", "title": "BLOOM: A 176B-Parameter Open-Access Multilingual Language Model (BigScience Workshop)", "accessed": "2026-10-20"}, | |
| 23 | + {"n": 22, "url": "https://github.com/bigscience-workshop/bigscience/blob/master/train/tr11-176B-ml/chronicles.md", "title": "BLOOM 176B training chronicles (bigscience-workshop/bigscience, tr11-176B-ml/chronicles.md)", "accessed": "2026-10-20"}, | |
| 24 | + {"n": 23, "url": "https://arxiv.org/pdf/2401.02954", "title": "DeepSeek LLM: Scaling Open-Source Language Models with Longtermism (DeepSeek-AI)", "accessed": "2026-10-20"}, | |
| 25 | + {"n": 24, "url": "https://arxiv.org/pdf/2405.04434", "title": "DeepSeek-V2: A Strong, Economical, and Efficient Mixture-of-Experts Language Model (DeepSeek-AI)", "accessed": "2026-10-20"}, | |
| 26 | + {"n": 25, "url": "https://darioamodei.com/on-deepseek-and-export-controls", "title": "On DeepSeek and Export Controls (Dario Amodei, Anthropic)", "accessed": "2026-10-20"}, | |
| 27 | + {"n": 26, "url": "https://arxiv.org/pdf/2501.12948", "title": "DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning (DeepSeek-AI)", "accessed": "2026-10-20"}, | |
| 28 | + {"n": 27, "url": "https://www-cdn.anthropic.com/de8ba9b01c9ab7cbabf5c33b80b7bbc618857627/Model_Card_Claude_3.pdf", "title": "The Claude 3 Model Card (Anthropic)", "accessed": "2026-10-20"}, | |
| 29 | + {"n": 28, "url": "https://arxiv.org/pdf/2212.08073", "title": "Constitutional AI: Harmlessness from AI Feedback (Bai et al., Anthropic)", "accessed": "2026-10-20"}, | |
| 30 | + {"n": 29, "url": "https://www.anthropic.com/news/anthropics-responsible-scaling-policy", "title": "Anthropic's Responsible Scaling Policy (Anthropic)", "accessed": "2026-10-20"}, | |
| 31 | + {"n": 30, "url": "https://arxiv.org/pdf/2310.13548", "title": "Towards Understanding Sycophancy in Language Models (Sharma et al., Anthropic)", "accessed": "2026-10-20"}, | |
| 32 | + {"n": 31, "url": "https://assets.anthropic.com/m/785e231869ea8b3b/original/claude-3-7-opus-system-card.pdf", "title": "Claude 3.7 Sonnet System Card (Anthropic)", "accessed": "2026-10-20"}, | |
| 33 | + {"n": 32, "url": "https://arxiv.org/pdf/2511.18397", "title": "Natural emergent misalignment from reward hacking in production RL (Anthropic)", "accessed": "2026-10-20"}, | |
| 34 | + {"n": 33, "url": "https://arxiv.org/pdf/2401.05566", "title": "Sleeper Agents: Training Deceptive LLMs that Persist Through Safety Training (Hubinger et al., Anthropic)", "accessed": "2026-10-20"}, | |
| 35 | + {"n": 34, "url": "https://www.anthropic.com/news/claude-opus-5-5", "title": "Introducing Claude Opus 5.5 (Anthropic)", "accessed": "2026-10-20"}, | |
| 36 | + {"n": 35, "url": "https://www.anthropic.com/claude-fable-and-mythos-5-1", "title": "Introducing Claude Fable 5.1 and Claude Mythos 5.1 (Anthropic)", "accessed": "2026-10-20"}, | |
| 37 | + {"n": 36, "url": "https://transformer-circuits.pub/2024/scaling-monosemanticity/index.html", "title": "Scaling Monosemanticity: Extracting Interpretable Features from Claude 3 Sonnet (Anthropic)", "accessed": "2026-10-20"}, | |
| 38 | + {"n": 37, "url": "https://x.ai/news/grok-os", "title": "Open Release of Grok-1 (xAI)", "accessed": "2026-10-20"}, | |
| 39 | + {"n": 38, "url": "https://github.com/xai-org/grok-1", "title": "xai-org/grok-1 README (GitHub)", "accessed": "2026-10-20"}, | |
| 40 | + {"n": 39, "url": "https://nvidianews.nvidia.com/news/spectrum-x-ethernet-networking-xai-colossus", "title": "NVIDIA Ethernet Networking Accelerates World’s Largest AI Supercomputer, Built by xAI", "accessed": "2026-10-20"}, | |
| 41 | + {"n": 40, "url": "https://x.ai/news/grok-3", "title": "Grok 3 Beta: The Age of Reasoning Agents (xAI)", "accessed": "2026-10-20"}, | |
| 42 | + {"n": 41, "url": "https://x.ai/news/grok-4", "title": "Grok 4 (xAI)", "accessed": "2026-10-20"}, | |
| 43 | + {"n": 42, "url": "https://www.nbcnews.com/news/amp/rcna207222", "title": "Musk's xAI says Grok's 'white genocide' posts resulted from an unauthorized change to the bot (NBC News/CNBC; reporting)", "accessed": "2026-10-20"}, | |
| 44 | + {"n": 43, "url": "https://www.nbcnews.com/news/us-news/ai-chatbot-grok-issues-apology-antisemitic-posts-rcna218471", "title": "AI chatbot Grok issues apology for antisemitic posts (NBC News; reporting)", "accessed": "2026-10-20"}, | |
| 45 | + {"n": 44, "url": "https://arxiv.org/pdf/2310.06825", "title": "Mistral 7B (Jiang et al.)", "accessed": "2026-10-20"}, | |
| 46 | + {"n": 45, "url": "https://arxiv.org/pdf/2401.04088", "title": "Mixtral of Experts (Jiang et al.)", "accessed": "2026-10-20"}, | |
| 47 | + {"n": 46, "url": "https://arxiv.org/pdf/2306.11644", "title": "Textbooks Are All You Need (Gunasekar et al., phi-1)", "accessed": "2026-10-20"}, | |
| 48 | + {"n": 47, "url": "https://arxiv.org/pdf/2309.05463", "title": "Textbooks Are All You Need II: phi-1.5 technical report (Li et al.)", "accessed": "2026-10-20"}, | |
| 49 | + {"n": 48, "url": "https://arxiv.org/pdf/2404.14219", "title": "Phi-3 Technical Report: A Highly Capable Language Model Locally on Your Phone (Abdin et al.)", "accessed": "2026-10-20"}, | |
| 50 | + {"n": 49, "url": "https://arxiv.org/pdf/2309.08632", "title": "Pretraining on the Test Set Is All You Need (Schaeffer; a satirical paper)", "accessed": "2026-10-20"}, | |
| 51 | + {"n": 50, "url": "https://arxiv.org/pdf/2412.15115", "title": "Qwen2.5 Technical Report (Qwen Team)", "accessed": "2026-10-20"}, | |
| 52 | + {"n": 51, "url": "https://arxiv.org/pdf/2505.09388", "title": "Qwen3 Technical Report (Qwen Team)", "accessed": "2026-10-20"}, | |
| 53 | + {"n": 52, "url": "https://arxiv.org/pdf/2304.01373", "title": "Pythia: A Suite for Analyzing Large Language Models Across Training and Scaling (Biderman et al.)", "accessed": "2026-10-20"}, | |
| 54 | + {"n": 53, "url": "https://arxiv.org/pdf/2402.00838", "title": "OLMo: Accelerating the Science of Language Models (Groeneveld et al.)", "accessed": "2026-10-20"}, | |
| 55 | + {"n": 54, "url": "https://arxiv.org/pdf/2501.00656", "title": "2 OLMo 2 Furious (OLMo Team)", "accessed": "2026-10-20"} | |
| 56 | +] |
docs/ideas/2026-10-20-structure-constants-paste.md
| new file mode 100644 | ||
| @@ -0,0 +1,99 @@ | ||
| 1 | +# Structure constants and "let math deal with it": the source paste (2026-10-20) | |
| 2 | + | |
| 3 | +This is the verbatim text Drake brought from a chat with another assistant (that assistant ran small checks in | |
| 4 | +Wolfram). It is kept exactly as pasted, unedited. Its toy claims (the golden-ratio closure, the exact ridge | |
| 5 | +example, the four-experiment table) are what the math-training stream (ledger L283) tests on a real model. | |
| 6 | +Results: [docs/math/STRUCTURE_CONSTANTS.md](../math/STRUCTURE_CONSTANTS.md). | |
| 7 | + | |
| 8 | +--- | |
| 9 | + | |
| 10 | +**Your structure-constants idea gives us a concrete mathematical direction to test.** The key question is whether a large computation can be represented by a much smaller set of quantities that stays sufficient as the computation proceeds. | |
| 11 | + | |
| 12 | +I tested two examples in Wolfram. One connects directly to your golden-ratio thought; the other can eliminate iterative training for a restricted kind of adaptation. | |
| 13 | + | |
| 14 | +**1. Structure constants: compute with the coordinates of an operation.** | |
| 15 | + | |
| 16 | +Suppose useful transformations can be expressed using a small collection of basis matrices: | |
| 17 | + | |
| 18 | +\[ | |
| 19 | +W=\sum_{i=1}^{r} a_iB_i. | |
| 20 | +\] | |
| 21 | + | |
| 22 | +If their products stay within that collection, | |
| 23 | + | |
| 24 | +\[ | |
| 25 | +B_iB_j=\sum_k c_{ij}^{k}B_k, | |
| 26 | +\] | |
| 27 | + | |
| 28 | +then the \(c_{ij}^{k}\) are **structure constants**: a multiplication table for the transformations. | |
| 29 | + | |
| 30 | +Instead of composing large matrices directly, we can compose their coefficient vectors. This helps when the basis is compact, its multiplication rules are cheap, and applying the resulting transformation is also efficient. A general dense multiplication table could erase the savings. | |
| 31 | + | |
| 32 | +Here is the golden-ratio connection I checked: | |
| 33 | + | |
| 34 | +\[ | |
| 35 | +Q=\begin{pmatrix}1&1\\1&0\end{pmatrix}, | |
| 36 | +\qquad Q^2=Q+I. | |
| 37 | +\] | |
| 38 | + | |
| 39 | +Wolfram verified that identity and returned eigenvalues \((1+\sqrt5)/2\) and \((1-\sqrt5)/2\). Consequently, | |
| 40 | + | |
| 41 | +\[ | |
| 42 | +(aI+bQ)(cI+dQ) | |
| 43 | +=(ac+bd)I+(ad+bc+bd)Q. | |
| 44 | +\] | |
| 45 | + | |
| 46 | +**Any sequence of these linear transformations can be represented by just two coefficients.** That is an exact toy example of the “everything clicks into place” property you described. | |
| 47 | + | |
| 48 | +The useful property is **closure under composition**. The appearance of the golden ratio does not establish an advantage for neural networks. | |
| 49 | + | |
| 50 | +The obstacle is nonlinear computation. Wolfram also verified a counterexample where applying ReLU before versus after \(Q\) gives different results. We cannot collapse a transformer’s layers through its activations merely because its linear pieces have convenient algebra. | |
| 51 | + | |
| 52 | +There is relevant research: *Parameterized Hypercomplex Multiplication* learns structured multiplication rules, while **FourierFT** represents fine-tuning updates through selected Fourier coefficients. These support investigating structured parameterizations, but fewer trainable parameters do not automatically mean less total arithmetic. [GitHub](https://github.com/astonzhang/Parameterization-of-Hypercomplex-Multiplications?utm_source=chatgpt.com) | |
| 53 | + | |
| 54 | +**2. For fine-tuning, the stronger immediate possibility is sufficient statistics.** | |
| 55 | + | |
| 56 | +Freeze a feature extractor and train a linear output head with a squared-error objective and regularization. Write its features as \(X\), targets as \(Y\), and trainable head as \(W\). | |
| 57 | + | |
| 58 | +We can accumulate: | |
| 59 | + | |
| 60 | +\[ | |
| 61 | +G=X^\top X,\qquad H=X^\top Y, | |
| 62 | +\] | |
| 63 | + | |
| 64 | +then solve: | |
| 65 | + | |
| 66 | +\[ | |
| 67 | +(G+\lambda I)W=H,\qquad \lambda>0. | |
| 68 | +\] | |
| 69 | + | |
| 70 | +For this specific objective, that replaces repeated gradient-descent updates with **feature extraction, accumulation, and a linear solve**. | |
| 71 | + | |
| 72 | +I checked a small exact example in Wolfram: | |
| 73 | + | |
| 74 | +- Accumulating statistics in separate chunks matched processing all examples together. | |
| 75 | +- The solved weights were \(9/13\) and \(12/13\). | |
| 76 | +- The objective’s gradient at that solution was exactly zero. | |
| 77 | + | |
| 78 | +This is close to what you mean by “let math deal with it”: **change the problem into one we can solve directly.** Research on ridge heads over frozen foundation-model features uses this same restricted setting. [arxiv.org](https://arxiv.org/abs/2603.12977?utm_source=chatgpt.com) | |
| 79 | + | |
| 80 | +It still costs computation. The feature extraction may dominate; \(G\) requires quadratic storage in feature width; numerical conditioning matters. And this does **not** replace general transformer fine-tuning or cross-entropy training. It is especially worth testing for a router, classifier, or regression head whose existing features already contain the needed information. | |
| 81 | + | |
| 82 | +**3. My deeper hypothesis for Omega: find a representation that remains small throughout the useful calculation.** | |
| 83 | + | |
| 84 | +A compressed weight file is only part of the opportunity. If every operation expands it into large intermediates, the memory traffic returns. | |
| 85 | + | |
| 86 | +I would test these possibilities in this order: | |
| 87 | + | |
| 88 | +| Experiment | What would establish value | | |
| 89 | +|---|---| | |
| 90 | +| Frozen features + direct head solve | Meets the task’s quality target with less total training time | | |
| 91 | +| Structured adapter basis versus LoRA | Preserves quality while reducing actual memory traffic and runtime | | |
| 92 | +| Compact algebra with structure constants | Useful compositions stay compact, including the cost of applying them | | |
| 93 | +| Small invariant activation subspace | Intermediate states remain accurately representable without frequent expansion | | |
| 94 | + | |
| 95 | +For the last two, we must measure where the representation stops being sufficient—particularly across nonlinearities—and how approximation errors accumulate. | |
| 96 | + | |
| 97 | +**My strongest recommendation is to test direct head solving first, then compact structured adapters.** TURING can choose among the implementations that pass those tests. The mathematical opportunity is to discover which information the task actually needs, preserve that information in a small representation, and avoid repeatedly reconstructing everything else. | |
| 98 | + | |
| 99 | +The Wolfram results establish the small algebraic examples. Whether Omega’s actual model admits a similarly useful structure remains an experiment, not a demonstrated speedup. |
docs/math/STRUCTURE_CONSTANTS.md
| new file mode 100644 | ||
| @@ -0,0 +1,426 @@ | ||
| 1 | +# Structure constants: can mathematics replace training compute? | |
| 2 | + | |
| 3 | +Stream: math-training (ledger L283), 2026-10-20. Chip: GB10 (DGX Spark). Model: SmolLM2-1.7B-Instruct, frozen, | |
| 4 | +`model.safetensors` sha256 `f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8` (from its pinned | |
| 5 | +PROVENANCE.md, publisher revision 31b70e2e). Every number below comes from a receipt in `evidence/math-training/` | |
| 6 | +that names the chip, the model fingerprint, the code version and the exact command. | |
| 7 | + | |
| 8 | +## Drake's idea, in his words | |
| 9 | + | |
| 10 | +Drake (2026-10-20): "let math deal with it", and "everything clicks into place". The thought: if the pieces of a | |
| 11 | +model multiply together the way the golden-ratio matrix does (where the square of the matrix is just the matrix | |
| 12 | +plus one), then a long chain of work collapses into a couple of numbers, and training becomes solving instead of | |
| 13 | +grinding. He tested the idea in toy form in a chat with another assistant that used Wolfram; that chat is saved | |
| 14 | +verbatim in [the paste](../ideas/2026-10-20-structure-constants-paste.md). This document runs its four proposed | |
| 15 | +experiments on a real model and gives each one a verdict. | |
| 16 | + | |
| 17 | +Words used below, once: | |
| 18 | +- **Head**: the last small layer that turns the model's internal numbers into an answer (a next word, or a yes/no). | |
| 19 | +- **Features**: the model's internal numbers for one position in the text (2,048 of them here), read once and frozen. | |
| 20 | +- **Ridge solve** (the "direct solve"): add up two tables over all the examples, the feature-times-feature table | |
| 21 | + G = XᵀX and the feature-times-answer table H = XᵀY, then solve one system of equations (G + λI)W = H. No steps, no | |
| 22 | + learning rate. λ is a small number that keeps the solve stable. | |
| 23 | +- **Cross-entropy**: the standard way to score a model that outputs probabilities; it is what language models are | |
| 24 | + trained on. The ridge solve scores squared error instead, which is a different (cruder) target. | |
| 25 | +- **AdamW, L-BFGS**: two standard step-by-step training methods. AdamW takes many small steps on small batches; | |
| 26 | + L-BFGS takes fewer, smarter steps over all the data at once. | |
| 27 | +- **Pass**: reading every example's features once. Passes are the honest unit of training work here, because each | |
| 28 | + pass moves the same bytes through memory. | |
| 29 | +- **Adapter**: a small set of new trainable numbers bolted onto a frozen model to fine-tune it. LoRA is the common one. | |
| 30 | +- **NLL** (negative log-likelihood): how surprised the model is by the right answer, lower is better. 0.1 lower is a | |
| 31 | + real improvement. | |
| 32 | +- **Held-out**: text the method never saw while fitting. Here: the GSM8K test problems [7]. | |
| 33 | + | |
| 34 | +## Result at a glance | |
| 35 | + | |
| 36 | +| Experiment | What was tested | Verdict | | |
| 37 | +|---|---|---| | |
| 38 | +| E1 direct head solve | Solve a head in one pass instead of training it by steps | **PARTLY.** PROVEN for a yes/no or routing head (AUC 0.9989 against 0.9990 trained, one pass). RULED OUT BY MEASUREMENT for next-word prediction (67.4% against 74.1% top-1; one epoch of AdamW already beats it) | | |
| 39 | +| E2 structured adapters | LoRA against PHM and FourierFT at 9.04 million trainable numbers | Quality is a tie within seed noise. LoRA **PROVEN** baseline; PHM **PARTLY** (no gain, 10% slower); FourierFT **RULED OUT BY MEASUREMENT** for speed (9.8x slower step) | | |
| 40 | +| E3 closure of a weight algebra | Do the model's weight matrices multiply inside a small basis? | **RULED OUT BY MEASUREMENT.** Products leave the span as fast as random matrices; the toy's exact algebra is real but trained weights do not have it | | |
| 41 | +| E4 small activation subspace | Keep the between-layer state in k directions | **RULED OUT BY MEASUREMENT** without retraining: the first k that costs under 0.2 NLL saves 22% of weight traffic | | |
| 42 | + | |
| 43 | +The honest summary for Drake's idea: the exact mathematics in the paste is correct (every toy claim was checked | |
| 44 | +exactly, `e3-toy.json`), and one piece of it, solving a head directly, is a real shortcut for classifier and | |
| 45 | +routing heads. The larger hope, that a model trained the usual way hides a small closed algebra so that long | |
| 46 | +chains of work collapse, is not there in SmolLM2. That is a statement about a model trained the usual way; it | |
| 47 | +does not test a model built with such structure from the start, which is the next experiment (below). | |
| 48 | + | |
| 49 | +## E1. Direct head solve versus step-by-step training | |
| 50 | + | |
| 51 | +Ridge heads over frozen foundation-model features are an established, restricted setting [5]; this experiment | |
| 52 | +checks how far it carries on a language model. | |
| 53 | + | |
| 54 | +**Assumptions, as equations.** Features X (one row per text position, 2,048 numbers plus a constant 1), answers Y. | |
| 55 | +The solve minimises squared error plus a small penalty, ‖XW − Y‖² + λ‖W‖², whose exact answer is | |
| 56 | +(XᵀX + λI)W = XᵀY. The two tables add up over chunks: XᵀX = Σ_chunks X_cᵀX_c, which is why one pass is enough | |
| 57 | +(`e3-toy.json` checks this exactly in fractions; `e1-sweep.json` checks it on the real data: reversing the chunk | |
| 58 | +order changes G by 3.7 parts in ten million, which is float rounding, and the gradient at the solution is | |
| 59 | +6 x 10⁻¹⁵ of its scale, which is zero to double precision). Step-by-step training instead minimises | |
| 60 | +cross-entropy, the probability score the model was built for, which has no closed-form answer. | |
| 61 | + | |
| 62 | +**Setup.** SmolLM2-1.7B frozen [9]; features are its final internal state at each position, read once | |
| 63 | +(262,144 positions from 6,000 GSM8K training problems to fit; 32,768 positions from the other 1,473 training | |
| 64 | +problems to tune; 65,536 positions from the GSM8K test problems as the held-out score) [7]. Two tasks: | |
| 65 | +- **A, next token**: predict the next token among the 1,024 most common ones, plus one "other" class (the 1,024 | |
| 66 | + cover 90.4% of test positions). | |
| 67 | +- **B, routing**: a yes/no label, "is the next token a digit" (27% of positions are). Scored by AUC (how well it | |
| 68 | + ranks yes above no, 1.0 is perfect) and balanced accuracy, because the classes are uneven. | |
| 69 | + | |
| 70 | +The bar to beat is the model's own trained output layer restricted to the same classes. Every choice (λ, learning | |
| 71 | +rate, stopping) was made on the tuning split; the test split was scored once. | |
| 72 | + | |
| 73 | +One finding before the results: the model's own output layer scores 85.5% on the tuning split (GSM8K *training* | |
| 74 | +problems) but 74.7% on the test problems. That 11-point gap says SmolLM2 very likely saw the GSM8K training set | |
| 75 | +while it was built, so only test numbers are trustworthy here [unverified: the SmolLM2 data mix was not checked | |
| 76 | +line by line]. | |
| 77 | + | |
| 78 | +**Task A results** (test split; `e1-sweep.json`): | |
| 79 | + | |
| 80 | +| method | passes over the features | top-1 | NLL | | |
| 81 | +|---|---|---|---| | |
| 82 | +| model's own output layer (the bar) | none (already trained) | 74.7% | 1.02 | | |
| 83 | +| ridge solve (squared error) | 1, then one solve | 67.4% | 2.19 | | |
| 84 | +| AdamW, squared error | 30 | 71.0% on tuning at best (epoch 3), then fell apart to 20.0% by epoch 30 | | | |
| 85 | +| AdamW, cross-entropy | 30 (best tuning score at epoch 7; test is the epoch-30 head) | 73.7% | 1.35 | | |
| 86 | +| L-BFGS, cross-entropy | 300 | 73.9% | 1.19 | | |
| 87 | +| Böhning fixed-curvature solve, cross-entropy, cold | 100 | 74.1% | 1.21 | | |
| 88 | +| Böhning, started from the ridge answer | 100 | 74.1% | 1.22 | | |
| 89 | + | |
| 90 | +Passes needed to reach a quality level on the tuning split (from the per-pass history in the receipt): | |
| 91 | + | |
| 92 | +| reach | AdamW-CE | L-BFGS | Böhning cold | Böhning warm | | |
| 93 | +|---|---|---|---|---| | |
| 94 | +| the ridge head's quality (71.2%) | 1 | 45 | 3 | 1 | | |
| 95 | +| best AdamW-CE minus 1 point (80.8%) | 2 | 125 | not in 100 | not in 100 | | |
| 96 | +| best AdamW-CE minus 0.5 point (81.3%) | 3 | 193 | not in 100 | not in 100 | | |
| 97 | + | |
| 98 | +**Wall time on the GB10** (`e1-time.json`, three repeats, medians; features already in GPU memory; the iterative | |
| 99 | +methods' times include their per-pass tuning-split scoring, the ridge solve has none): | |
| 100 | + | |
| 101 | +| goal | ridge solve | AdamW-CE | L-BFGS-CE | Böhning (warm) | | |
| 102 | +|---|---|---|---|---| | |
| 103 | +| the ridge head's quality (71.2% tuning top-1) | 0.375 s (1 pass + 0.044 s solve) | 0.33 s (1 pass) | 10.6 s (45 passes) | 0.31 s (from the ridge answer) | | |
| 104 | +| best AdamW-CE minus 0.5 point (81.3%) | not reachable | 0.94 s (3 passes) | 46.0 s (193 passes) | not reached in 100 passes (30 s) | | |
| 105 | +| peak GPU memory | 3.72 GB | 3.68 GB | 4.13 GB | 3.76 GB | | |
| 106 | + | |
| 107 | +The first repeat of the ridge run was slower (0.87 s, a cold start); the other two were 0.375 s and 0.325 s. The | |
| 108 | +ridge solve is not faster than one epoch of AdamW on this task and cannot reach the cross-entropy quality at all. | |
| 109 | + | |
| 110 | +**The gap the paste flagged, measured.** At the same features, the squared-error solve is 6.7 points of top-1 | |
| 111 | +below the best cross-entropy head (67.4% against 74.1%) and nearly twice as surprised by the right answer (NLL 2.19 | |
| 112 | +against 1.19). Squared error spreads its effort evenly over 1,025 outputs that are almost all zero; cross-entropy | |
| 113 | +spends it on the right answer. For next-token prediction that difference is the whole game. | |
| 114 | + | |
| 115 | +**The extension (Newton-style solves for cross-entropy).** Böhning's method replaces the changing curvature of | |
| 116 | +cross-entropy with one fixed upper bound, ½(I − 11ᵀ/K) ⊗ XᵀX, so the big matrix is factored once and every step | |
| 117 | +is one pass plus two cheap triangular solves [6]. It works as advertised (monotone, stable, 3 passes to the | |
| 118 | +ridge head's quality) but the fixed bound is loose: it took steps too small to get within a point of AdamW in | |
| 119 | +100 passes. A full Newton step for 1,025 classes would need a 2-million-by-2-million curvature matrix, which is | |
| 120 | +out of reach. For the yes/no task, full Newton is small (one 2,049 x 2,049 matrix) and converged in 12 steps. | |
| 121 | + | |
| 122 | +**Task B results** (test split): | |
| 123 | + | |
| 124 | +| method | passes | AUC | balanced accuracy | NLL | | |
| 125 | +|---|---|---|---|---| | |
| 126 | +| model's own output layer | none | 0.9992 | 98.7% | 0.034 | | |
| 127 | +| ridge solve | 1 | 0.9989 | 98.5% | (not a probability) | | |
| 128 | +| exact Newton (IRLS), cross-entropy | 12 | 0.9990 | 98.7% | 0.030 | | |
| 129 | +| AdamW, cross-entropy | 10 | 0.9989 | 98.7% | 0.032 | | |
| 130 | + | |
| 131 | +**Verdict: PARTLY.** | |
| 132 | +- For a routing or yes/no head on features that already hold the answer, the direct solve meets the bar: AUC | |
| 133 | + 0.9989 against 0.9990 for the fully trained head, 0.2 points of balanced accuracy, in one pass. PROVEN for this | |
| 134 | + task. If calibrated probabilities are needed, 12 exact Newton steps (each one weighted version of the same | |
| 135 | + table) finish the job. | |
| 136 | +- For next-token prediction, the solve does not meet the quality target: it is 6.7 points short, and a single | |
| 137 | + epoch of AdamW (also one pass) already matches it. RULED OUT BY MEASUREMENT as a replacement for | |
| 138 | + cross-entropy training of a language-model head. The Böhning variant is sound but too slow as built. | |
| 139 | +- Traffic: the features here fit in memory (2.1 GB), so passes are the honest cost, not "read once versus | |
| 140 | + epochs". If features had to be streamed from storage, each pass would cost 2.15 GB of reads (calc:ebed771e), 8.77 ms at the | |
| 141 | + measured 245.1 GB/s (calc:29c2dbaa) [L279]; the ridge solve is 1 pass and the best gradient method needs 2 to 3. | |
| 142 | + | |
| 143 | +## E2. Structured adapter bases versus LoRA | |
| 144 | + | |
| 145 | +**The question.** The paste says fewer trainable numbers do not automatically mean less arithmetic. Test it: | |
| 146 | +fine-tune the frozen model three ways with the same number of trainable numbers, then compare quality, step time | |
| 147 | +and memory. | |
| 148 | + | |
| 149 | +**The three adapters** (each one adds a correction ΔW to a frozen weight matrix W, so the layer computes | |
| 150 | +(W + ΔW)x). All three sit on the seven big matrices of every one of the 24 layers (q, k, v, o, gate, up, down), | |
| 151 | +and all three are written with plain tensor operations in one file, so the comparison is not a comparison of | |
| 152 | +libraries. | |
| 153 | +- **LoRA** [3]: ΔW = B·A, a product of two thin matrices of rank 8. 9,043,968 trainable numbers. | |
| 154 | +- **PHM** (parameterized hypercomplex multiplication) [1][4]: ΔW is a sum of Kronecker products, so the | |
| 155 | + multiplication rule between the four blocks of the layer is itself learned. This is the "learned structure | |
| 156 | + constants" idea in the paste, in its published form. 9,045,504 trainable numbers (1,536 more than LoRA, from the | |
| 157 | + small shared rule tables). | |
| 158 | +- **FourierFT** [2]: ΔW is the inverse 2-D Fourier transform of a few chosen frequency coefficients, and only | |
| 159 | + the coefficients are trained. Matched to 9,043,968 trainable numbers by choosing how many coefficients each | |
| 160 | + matrix gets. The frequencies are picked at random, once. | |
| 161 | + | |
| 162 | +**Operator checks first** (`e2-check.json`). The structured forms must compute what their equations say: PHM | |
| 163 | +applied without building ΔW matches the dense Kronecker form to relative error 1.25e-7; the hand-written | |
| 164 | +FourierFT backward pass matches automatic differentiation to 1.3e-7 on the coefficients and exactly on the | |
| 165 | +input gradient; its forward matches the dense inverse transform exactly (relative error 0.0). | |
| 166 | + | |
| 167 | +**Task.** Next-token cross-entropy on the answer text of GSM8K [7]: 6,500 training problems, a 300-problem tuning | |
| 168 | +split for choosing the learning rate, a separate 300-problem held-out test split. 300 steps of batch 8, AdamW, | |
| 169 | +three learning rates per method, the best one (by tuning NLL) repeated with a second random seed. The frozen model | |
| 170 | +scores NLL 0.588 on the test split before any adaptation. | |
| 171 | + | |
| 172 | +**Quality** (test NLL, lower is better; best learning rate by tuning NLL; `e2-train-*.json`): | |
| 173 | + | |
| 174 | +| method | trainable numbers | learning rate | seed 0 | seed 1 | | |
| 175 | +|---|---|---|---|---| | |
| 176 | +| frozen, no adapter | 0 | n/a | 0.5882 | n/a | | |
| 177 | +| LoRA rank 8 | 9,043,968 | 3e-4 | 0.4412 | 0.4455 | | |
| 178 | +| PHM, n = 4, r = 8 | 9,045,504 | 3e-4 | 0.4437 | 0.4454 | | |
| 179 | +| FourierFT | 9,043,968 | 1e-4 | 0.4463 | 0.4510 | | |
| 180 | +| LoRA rank 64 (8 times more) | 72,351,744 | 3e-4 | 0.4412 | not run | | |
| 181 | + | |
| 182 | +Other learning rates: LoRA 0.4463 (1e-4) and 0.4499 (1e-3); PHM 0.4513 (1e-4) and 0.4424 (1e-3, tuning NLL | |
| 183 | +0.3890 against 0.3880 for 3e-4, so 3e-4 was picked); FourierFT 0.4578 (1e-5) and 0.5187 (1e-3, which | |
| 184 | +degrades). | |
| 185 | + | |
| 186 | +What the numbers say: | |
| 187 | +- All three adapters take the test NLL from 0.588 down to about 0.44 to 0.45. That is a large, real gain | |
| 188 | + (0.14 to 0.15). | |
| 189 | +- The differences between the three methods are as small as the differences between two seeds of the same method | |
| 190 | + (LoRA 0.0043, PHM 0.0017, FourierFT 0.0047). LoRA and PHM are indistinguishable. FourierFT is about 0.005 | |
| 191 | + behind LoRA on both seeds, which is the size of the seed spread, so "slightly behind, not shown to be worse". | |
| 192 | +- LoRA with eight times more trainable numbers scores exactly the same, 0.4412. Capacity is not what limits | |
| 193 | + quality on this task, so a cleverer packing of the trainable numbers cannot buy quality here either. | |
| 194 | + | |
| 195 | +**Cost: measured step time and memory** (`e2-time.json`; one optimizer step on 566 tokens, median of 10 steps | |
| 196 | +after warm-up, three repeats per method, run under the quiet lock on the GB10, repeats within 4%): | |
| 197 | + | |
| 198 | +| | step time | peak GPU memory | relative to LoRA | | |
| 199 | +|---|---|---|---| | |
| 200 | +| frozen forward only | 0.054 s | 3,573 MiB | | | |
| 201 | +| LoRA | 0.187 s | 5,603 MiB | 1.00x | | |
| 202 | +| PHM | 0.205 s | 5,664 MiB | 1.10x (calc:f986ee7c) | | |
| 203 | +| FourierFT | 1.83 s | 5,834 MiB | 9.78x (calc:083dde1f) | | |
| 204 | + | |
| 205 | +- The paste's warning is confirmed with numbers. The three methods train the same 9.04 million numbers, yet one | |
| 206 | + LoRA step costs 3.46x a forward pass (calc:517f421e), and FourierFT costs 9.8x LoRA. | |
| 207 | +- Why FourierFT is slow: its update is not a small product of thin matrices. Every step, for every one of the 168 | |
| 208 | + adapted matrices, it rebuilds a full-size ΔW with an inverse 2-D Fourier transform (and again in the backward | |
| 209 | + pass), then multiplies by the full dense matrix. The trainable list is short but the arithmetic is the size of | |
| 210 | + the whole matrix. The same shape of problem will hit any basis whose ΔW has to be expanded before use. | |
| 211 | +- Why PHM costs a little more than LoRA: it avoids building ΔW but does three small contractions per matrix | |
| 212 | + instead of two. | |
| 213 | +- Memory: the adapters add 2.0 to 2.3 GiB over the frozen forward, most likely the activations kept for the backward pass (not separately measured), not | |
| 214 | + parameters. Fewer trainable numbers would not shrink it. | |
| 215 | +- Wall-clock times in the training receipts (1,400 to 1,600 s for FourierFT, 220 to 420 s for the others) were | |
| 216 | + measured while other jobs shared the GPU. They agree with the ordering above but are not the published timing; | |
| 217 | + the locked run is. | |
| 218 | + | |
| 219 | +**Limits.** One model (1.7 billion), one task (GSM8K answers), 300 steps, random Fourier frequencies (other selection rules | |
| 220 | +were not tried), a PHM block count fixed at 4, one seed for non-best learning rates. | |
| 221 | +A larger task could separate LoRA and PHM; this one does not. | |
| 222 | + | |
| 223 | +**Verdict per method.** | |
| 224 | +- **LoRA: PROVEN as the baseline.** Best or tied-best quality, cheapest step. | |
| 225 | +- **PHM (learned multiplication rules, the paste's structure-constants idea in practice): PARTLY.** Same quality as | |
| 226 | + LoRA at the same trainable count, 10% slower per step in our implementation. It adds no quality and no speed over | |
| 227 | + LoRA here, so it does not pass the paste's bar ("preserves quality while reducing actual memory traffic and | |
| 228 | + runtime"): it reduces neither. Next discriminating experiment: a task where LoRA rank 8 is short of capacity | |
| 229 | + (LoRA rank 8 and rank 64 tie here, so this task cannot show it), compared at equal step time rather than equal | |
| 230 | + parameters. | |
| 231 | +- **FourierFT: RULED OUT BY MEASUREMENT for speed on this stack.** Quality is within noise, memory similar, step | |
| 232 | + time 9.8x slower, because its update must be expanded to a dense matrix every step. It would only pay if | |
| 233 | + the transform were fused into the matrix multiply, which is a kernel we would have to write, and the best case | |
| 234 | + is still the dense multiply that LoRA avoids. | |
| 235 | + | |
| 236 | +## E3. Closure: do the real weights live in a small algebra? | |
| 237 | + | |
| 238 | +**The claim under test, as an equation.** Pick r basis matrices B_1..B_r. The weights are sums of them, | |
| 239 | +W = Σ a_i B_i, and the basis is closed if every product lands back in the span: | |
| 240 | +B_i B_j = Σ_k c_ij^k B_k (the c's are the structure constants). The golden-ratio toy is the case r = 2, | |
| 241 | +B = {I, Q}, Q² = Q + I. | |
| 242 | + | |
| 243 | +**The toy, checked exactly** (`e3-toy.json`, rational arithmetic, no rounding): Q² = Q + I holds exactly; the | |
| 244 | +eigenvalues are 1.6180339887 and -0.6180339887, the golden ratio and its partner; the product rule | |
| 245 | +(aI + bQ)(cI + dQ) = (ac + bd)I + (ad + bc + bd)Q holds exactly on 200 random fractions; and ReLU breaks it: | |
| 246 | +for v = (1, -2), Q·ReLU(v) = (1, 1) but ReLU(Q·v) = (0, 1). The paste's toy claims are all true. | |
| 247 | + | |
| 248 | +**What was measured on the real model** (`e3-algebra.json`). Which products to test matters: the model never | |
| 249 | +multiplies its heads inside one layer together (they run side by side), but it does chain one layer's | |
| 250 | +"value-output" map (OV, the map a head uses to copy information forward) into the next layer's. Those chained | |
| 251 | +maps are called virtual heads. So: | |
| 252 | +1. Per layer, the 32 OV maps and the 32 query-key maps (QK, the map a head uses to decide where to look): how | |
| 253 | + many basis matrices hold 99% of their energy? | |
| 254 | +2. For each pair of neighbouring layers, 256 sampled virtual-head products: how much of each product lies | |
| 255 | + outside the span of the 64 head maps it came from? (0 = closed, 1 = entirely outside.) | |
| 256 | +3. Growth: dimension of the span before and after adding the products. | |
| 257 | +4. Across depth: the 24 copies of each weight matrix (one per layer). | |
| 258 | +Every test runs next to two controls. A positive control: matrices built from the exact {I, Q} algebra, which | |
| 259 | +must close. A negative control: random matrices with the same singular values (the same "strengths") but | |
| 260 | +random directions, which should not. | |
| 261 | + | |
| 262 | +| measure | real SmolLM2 weights | random, same strengths | exact {I,Q} control | | |
| 263 | +|---|---|---|---| | |
| 264 | +| dims for 99% energy, 32 OV head maps | 31 to 32 of 32 | 32 of 32 | | | |
| 265 | +| dims for 99% energy, 32 QK head maps | 30 to 32 of 32 | 32 of 32 | | | |
| 266 | +| virtual-head product outside the span, median over layers | 0.991 to 0.999 | 0.99997 | 0.0003 | | |
| 267 | +| virtual-head product outside the span, best single product (any layer) | 0.61 | 0.9988 | | | |
| 268 | +| span dims, 64 heads + 256 products, 99% energy | 311 to 316 of 320 | 317 of 320 | | | |
| 269 | +| dims for 99% energy, the 24 per-layer copies of each matrix | 24 of 24 (all 7 kinds) | | | | |
| 270 | + | |
| 271 | +Reading it: every head map is its own direction (no small basis exists), every product of two heads points almost | |
| 272 | +entirely somewhere new (more than 99% outside, against the exact algebra's 0.03%), and adding products grows the | |
| 273 | +span almost one-for-one, the same as random matrices. The real weights are measurably a little more aligned | |
| 274 | +than random (the best single product is 61% outside, against 99.9% for random), which is real but small structure, not closure. | |
| 275 | + | |
| 276 | +**Cost, if it had closed.** Applying a head map kept in factored form costs 2 x 2 x 2048 x 64 = 524,288 | |
| 277 | +arithmetic operations per token, against 8.4 million for a dense 2048 x 2048 matrix (`apply_cost_per_token_flops` in the | |
| 278 | +receipt). That factored form is already how the model stores heads. Coefficients over a basis of r dense | |
| 279 | +matrices would cost r dense products, worse than one dense matrix for any r above 1, unless the basis matrices | |
| 280 | +are themselves cheap (the {I, Q} kind are; these are not). | |
| 281 | + | |
| 282 | +**Does a closed algebra survive the activation?** On real activations, every layer's MLP was replaced by the | |
| 283 | +best straight-line (linear) fit to it, one layer at a time: the 24 MLPs, one at a time, with the best straight-line fit to it (fit on GSM8K training problems 0 to 79, scored | |
| 284 | +on test problems 0 to 39, 7,331 positions, `e3-nonlin.json`). The model's own held-out NLL is 1.176. In 17 of 24 layers the | |
| 285 | +swap changes NLL by less than 0.03 (layers 2 to 6 and 8 to 16 by less than 0.025 either way); in layers 0, 1, 7, | |
| 286 | +22 and 23 it hurts by +0.50, +0.79, +0.28, +2.30 and +0.19. Yet the straight-line fit leaves 57% to 78% of the MLP's output (layers 2 to 6 and 8 to 21) | |
| 287 | +energy unexplained on held-out text (1.09 in layer 0, 0.08 in layer 7, 0.31 to 0.33 in layers 1, 22 and 23). | |
| 288 | +So the nonlinearity matters a lot inside each MLP, but in the middle layers the MLP's contribution to the output is | |
| 289 | +small or redundant, which is a separate fact from the weights closing under multiplication. | |
| 290 | + | |
| 291 | +**Verdict: RULED OUT BY MEASUREMENT** for this model's attention weights: there is no compact closed algebra | |
| 292 | +(products leave the span at the same rate as random matrices), and the activation does break the exact algebra on real data: the toy's ReLU counterexample is not an artefact, and the | |
| 293 | +straight-line stand-in for an MLP leaves most of its output unexplained even where the model survives its removal. The exact toy is real | |
| 294 | +mathematics; trained weights do not have its structure. This does not rule out building a model whose | |
| 295 | +weights are constrained to such an algebra from the start (PHM in E2 is one form of that); it rules out finding | |
| 296 | +one hidden in a model trained the normal way. | |
| 297 | + | |
| 298 | +## E4. Does the activation stay in a small subspace between layers? | |
| 299 | + | |
| 300 | +**The claim under test.** Let h be the 2,048-number state a layer hands to the next. If the states of real text sit | |
| 301 | +in a k-dimensional subspace (k much smaller than 2,048), a model could carry only k numbers between layers, expand | |
| 302 | +inside each nonlinear block, and compress again. Measured three ways on 14,957 positions of GSM8K test text | |
| 303 | +(`e4-subspace.json`): (a) how many directions hold 95%, 99%, 99.9% of the energy (PCA, the standard way to ask | |
| 304 | +this); (b) how much the best k-direction subspace of one layer overlaps the next layer's (overlap 1 = same | |
| 305 | +subspace, near 0 = unrelated); (c) the damage to the model's NLL if every layer boundary is squeezed through its | |
| 306 | +own best k-direction subspace and the layer's weights are folded to match (checked: folded and direct results | |
| 307 | +agree to 2.9 parts in ten million). | |
| 308 | + | |
| 309 | +**Results.** | |
| 310 | +- Effective size. Layers 7 to 23 need 924 to 1,391 directions for 95% of the energy, 1,588 to 1,848 for 99%, and | |
| 311 | + 1,970 to 2,020 for 99.9% (of 2,048). That is not small. Layers 1 to 6 look tiny (1 direction holds 99% in | |
| 312 | + layers 1 and 2) only because 2 or 3 "massive activation" coordinates (161, 227, 749) hold 89% to 99% of the raw | |
| 313 | + energy [8]; with those removed these layers need 717 to 937 directions for 95%, like the rest. | |
| 314 | +- Stability. The best 64-direction subspace of one layer overlaps the next layer's by 0.59 to 0.78 (0.45 into the | |
| 315 | + last layer), and the first layer's overlaps the last's by 0.05. At 1,024 directions the first and last overlap by 0.50. | |
| 316 | + The state is rewritten gradually; there is no single subspace it lives in. | |
| 317 | +- Damage when every boundary is squeezed (NLL baseline 1.174, so +0 is lossless): | |
| 318 | + | |
| 319 | +| k directions per boundary | NLL increase | next-token agreement with the full model | | |
| 320 | +|---|---|---| | |
| 321 | +| 64 | +4.73 | 24% | | |
| 322 | +| 256 | +2.67 | 47% | | |
| 323 | +| 512 | +1.59 | 60% | | |
| 324 | +| 1,024 | +0.61 | 72% | | |
| 325 | +| 1,536 | +0.14 | 82% | | |
| 326 | +| 2,048 (a rotation, no squeeze) | +0.001 | 99.3% | | |
| 327 | +| random k = 512, 1,024, 1,536 (control) | +8.5, +7.0, +6.8 | 6.7% | | |
| 328 | + | |
| 329 | + The control shows the PCA directions carry real information (random directions destroy the model), and the table | |
| 330 | + shows they do not carry enough: the NLL cost falls only as k approaches the full width. | |
| 331 | +- One boundary at a time at k = 256: +0.03 to +0.12 in layers 0 to 14, rising to +0.74 at the last layer. A single | |
| 332 | + squeeze is tolerable early; 24 of them compound. | |
| 333 | + | |
| 334 | +**Traffic at the GB10's measured read speed (245.1 GB/s [L279]; spec 273 [10]).** Decoding one token reads every | |
| 335 | +weight once: 3.42 GB for this model in bf16 (16-bit numbers; `e4-subspace.json`), 13.96 ms at 245.1 GB/s | |
| 336 | +(calc:3c7132b2). With k = 1,536 the folded weights are 2.68 GB, 21.7% less (calc:8d6aa6e9), 10.9 ms, at the price | |
| 337 | +of +0.14 NLL and 82% agreement. The key-value memory the model keeps for earlier tokens (0.2 GB per token at | |
| 338 | +context 1,024) does not shrink with k. | |
| 339 | + | |
| 340 | +**Verdict: RULED OUT BY MEASUREMENT as a way to cut traffic without retraining.** No k that is meaningfully small | |
| 341 | +keeps quality: the first k with under +0.2 NLL (1,536) saves 22% of weight traffic. The measurement does not rule | |
| 342 | +out training a model with a narrow stream from the start (then the weights are different, not folded), which is | |
| 343 | +what this test cannot see. Next discriminating experiment: train SmolLM2-sized layers with a rank-512 stream and | |
| 344 | +measure NLL at equal training tokens. | |
| 345 | + | |
| 346 | +## What to build in Omega, in order | |
| 347 | + | |
| 348 | +Nothing here ships from this stream. Only experiments that passed produce kernels. PyTorch was the oracle. | |
| 349 | + | |
| 350 | +1. **Gram accumulation, G = XᵀX and H = XᵀY in chunks (E1, PASSES for routing and classifier heads).** A | |
| 351 | + symmetric rank-k update: bf16 features in, fp32 accumulate on the tensor cores, one pass over the features. | |
| 352 | + Parts that exist: tensor-core GEMM generators `src/omega_blackwell_codegen_tc.c`, `_tc2.c`, `_gemm.c` and the | |
| 353 | + launcher `src/omega_gpu_tcgemm_api.c` (omega branch `fix/tcgemm-nj`, not yet on omega main `ce42e62`); bf16 | |
| 354 | + CPU reference `omega_matmul_cpu_oracle_bf16` in `src/omega_blackwell_matmul.h` (main). Missing: the | |
| 355 | + transposed-operand (AᵀA) variant, which is the same need as L294's backward GEMM dW = XᵀdY, so build it once. | |
| 356 | +2. **Linear solve (G + λI)W = H (E1).** A Cholesky factorisation and two triangular solves in binary64, on the CPU | |
| 357 | + for widths up to a few thousand (2,049 here). Parts that exist: Cholesky `chol` in `src/estimation/est_kf.c` | |
| 358 | + (main, a static function at line 48), and a binary64 ridge readout in `src/reservoir/omega_reservoir_readout.h` (branches | |
| 359 | + `research/learning-search-584` and `fix/tcgemm-nj`, not on main). The solve took 0.356 s in PyTorch on the | |
| 360 | + GPU (`e1-time.json`); a CPU time was not measured. | |
| 361 | +3. **Row-weighted Gram, XᵀDX (E1, yes/no task).** Exact Newton (IRLS) reached the trained head's AUC in 12 steps; each | |
| 362 | + step is kernel 1 with a per-row scale d_i and kernel 2. Cheap to add once kernel 1 exists. | |
| 363 | +4. **Skinny low-rank adapter forward and backward (E2, LoRA).** x·Aᵀ then ·Bᵀ with rank 8, and its three | |
| 364 | + backward products, using the same transposed-operand GEMM. L294 already scopes the backward GEMMs; add rank 8 | |
| 365 | + and rank 64 shapes (64 to 2,048 wide) to its acceptance shapes. PHM and FourierFT are **not** on the list. | |
| 366 | + | |
| 367 | +Not built, with the reason: composition by structure constants (E3, nothing to compose), a folded between-layer | |
| 368 | +subspace (E4, 22% traffic for +0.14 NLL), the Fourier expansion (E2, 9.8x slower), and a ridge head for next-word | |
| 369 | +prediction (E1, 6.7 points short). | |
| 370 | + | |
| 371 | +## Next discriminating experiments | |
| 372 | + | |
| 373 | +- **E1 (PARTLY):** use the ridge solution as the starting point for cross-entropy training and count passes to the | |
| 374 | + trained head's quality. Today AdamW needs 1 epoch from scratch to match ridge and 3 to reach the best head | |
| 375 | + minus 0.5 point; if a ridge start cuts the second number, the solve earns a place as a warm start. | |
| 376 | +- **E2 (PHM PARTLY):** repeat on a task where LoRA rank 8 and rank 64 differ (here they tie), and compare at equal | |
| 377 | + step time instead of equal parameter count. | |
| 378 | +- **E3/E4 (the surviving form of Drake's idea):** train small layers whose weights are constrained to a | |
| 379 | + closed algebra (or whose stream is rank 512) from step zero, and measure NLL at equal training tokens against | |
| 380 | + an unconstrained model of the same size. The trained-the-usual-way model has no such structure (E3, E4); a | |
| 381 | + model built with it is untested. | |
| 382 | + | |
| 383 | +## Sources | |
| 384 | + | |
| 385 | +[1] https://arxiv.org/abs/2102.08597 | |
| 386 | + Beyond Fully-Connected Layers with Quaternions: Parameterization of Hypercomplex Multiplications with 1/n Parameters (Zhang et al.), 2021-02-17, accessed 2026-10-20. | |
| 387 | + "we propose parameterizing hypercomplex multiplications, allowing models to learn multiplication rules from data regardless of whether such rules are predefined." | |
| 388 | + | |
| 389 | +[2] https://arxiv.org/abs/2405.03003 | |
| 390 | + Parameter-Efficient Fine-Tuning with Discrete Fourier Transform (Gao et al.), 2024-05-05, accessed 2026-10-20. | |
| 391 | + "we introduce FourierFT, which treats $\Delta W$ as a matrix in the spatial domain and learns only a small fraction of its spectral coefficients. With the trained spectral coefficients, we implement the inverse discrete Fourier transform to recover $\Delta W$." | |
| 392 | + | |
| 393 | +[3] https://arxiv.org/abs/2106.09685 | |
| 394 | + LoRA: Low-Rank Adaptation of Large Language Models (Hu et al.), 2021-06-17, accessed 2026-10-20. | |
| 395 | + "We propose Low-Rank Adaptation, or LoRA, which freezes the pre-trained model weights and injects trainable rank decomposition matrices into each layer of the Transformer architecture, greatly reducing the number of trainable parameters for downstream tasks." | |
| 396 | + | |
| 397 | +[4] https://arxiv.org/abs/2106.04647 | |
| 398 | + Compacter: Efficient Low-Rank Hypercomplex Adapter Layers (Karimi Mahabadi et al.), 2021-06-08, accessed 2026-10-20. | |
| 399 | + "Specifically, Compacter inserts task-specific weight matrices into a pretrained model's weights, which are computed efficiently as a sum of Kronecker products between shared "slow" weights and "fast" rank-one matrices defined per Compacter layer." | |
| 400 | + | |
| 401 | +[5] https://arxiv.org/abs/2603.12977 | |
| 402 | + Exact Federated Continual Unlearning for Ridge Heads on Frozen Foundation Models (Quan, Wu, Montana), 2026-03-13, accessed 2026-10-20. | |
| 403 | + "We study this problem in a practically relevant but under-explored regime: a frozen foundation model with a ridge-regression head. The exact optimum depends on the data only through two additive sufficient statistics" | |
| 404 | + | |
| 405 | +[6] https://www.ism.ac.jp/editsec/aism/44/17.html | |
| 406 | + Multinomial Logistic Regression Algorithm (Bohning, Ann. Inst. Statist. Math. 44), 1992 (received 1990-07-23), accessed 2026-10-20. | |
| 407 | + "consists of replacing the second derivative matrix by a global lower bound in the Loewner ordering. This bound is used in the Newton-Raphson iteration instead of the Hessian matrix leading to a monotonically converging sequence of iterates." | |
| 408 | + | |
| 409 | +[7] https://arxiv.org/abs/2110.14168 | |
| 410 | + Training Verifiers to Solve Math Word Problems (Cobbe et al.), GSM8K, 2021-10-27, accessed 2026-10-20. | |
| 411 | + "we introduce GSM8K, a dataset of 8.5K high quality linguistically diverse grade school math word problems." | |
| 412 | + | |
| 413 | +[8] https://arxiv.org/abs/2402.17762 | |
| 414 | + Massive Activations in Large Language Models (Sun et al.), 2024-02-27, accessed 2026-10-20. | |
| 415 | + "very few activations exhibit significantly larger values than others (e.g., 100,000 times larger). We call them massive activations." | |
| 416 | + | |
| 417 | +[9] https://arxiv.org/abs/2502.02737 | |
| 418 | + SmolLM2: When Smol Goes Big -- Data-Centric Training of a Small Language Model (Ben Allal et al.), 2025-02-04, accessed 2026-10-20. | |
| 419 | + "we overtrain SmolLM2 on ~11 trillion tokens of data using a multi-stage training process that mixes web text with specialized math, code, and instruction-following data." | |
| 420 | + | |
| 421 | +[10] https://www.nvidia.com/en-us/products/workstations/dgx-spark/ | |
| 422 | + NVIDIA DGX Spark product page, page as served 2026-10-20, accessed 2026-10-20. | |
| 423 | + "Memory Bandwidth 273 GB/s" | |
| 424 | + | |
| 425 | +[L279] Internal: aien-dev/aien-train branch physics/gb10 at 001ec9a, docs/physics/gb10-training.md line 56 (measured by L151, omega doc/machine-ceiling@3c8ce239, evidence/MACHINE-CEILING-20261020/raw/gpu-tc-peak.txt). | |
| 426 | + "| Main memory read, GPU | **245.1 GB/s** | measured (L151)" |
docs/math/sources.json
| new file mode 100644 | ||
| @@ -0,0 +1,12 @@ | ||
| 1 | +[ | |
| 2 | + {"n": 1, "url": "https://arxiv.org/abs/2102.08597", "title": "Beyond Fully-Connected Layers with Quaternions: Parameterization of Hypercomplex Multiplications with 1/n Parameters (Zhang et al.)", "date": "2021-02-17", "accessed": "2026-10-20", "quote": "we propose parameterizing hypercomplex multiplications, allowing models to learn multiplication rules from data regardless of whether such rules are predefined."}, | |
| 3 | + {"n": 2, "url": "https://arxiv.org/abs/2405.03003", "title": "Parameter-Efficient Fine-Tuning with Discrete Fourier Transform (Gao et al.)", "date": "2024-05-05", "accessed": "2026-10-20", "quote": "we introduce FourierFT, which treats $\\Delta W$ as a matrix in the spatial domain and learns only a small fraction of its spectral coefficients. With the trained spectral coefficients, we implement the inverse discrete Fourier transform to recover $\\Delta W$."}, | |
| 4 | + {"n": 3, "url": "https://arxiv.org/abs/2106.09685", "title": "LoRA: Low-Rank Adaptation of Large Language Models (Hu et al.)", "date": "2021-06-17", "accessed": "2026-10-20", "quote": "We propose Low-Rank Adaptation, or LoRA, which freezes the pre-trained model weights and injects trainable rank decomposition matrices into each layer of the Transformer architecture, greatly reducing the number of trainable parameters for downstream tasks."}, | |
| 5 | + {"n": 4, "url": "https://arxiv.org/abs/2106.04647", "title": "Compacter: Efficient Low-Rank Hypercomplex Adapter Layers (Karimi Mahabadi et al.)", "date": "2021-06-08", "accessed": "2026-10-20", "quote": "Specifically, Compacter inserts task-specific weight matrices into a pretrained model's weights, which are computed efficiently as a sum of Kronecker products between shared \"slow\" weights and \"fast\" rank-one matrices defined per Compacter layer."}, | |
| 6 | + {"n": 5, "url": "https://arxiv.org/abs/2603.12977", "title": "Exact Federated Continual Unlearning for Ridge Heads on Frozen Foundation Models (Quan, Wu, Montana)", "date": "2026-03-13", "accessed": "2026-10-20", "quote": "We study this problem in a practically relevant but under-explored regime: a frozen foundation model with a ridge-regression head. The exact optimum depends on the data only through two additive sufficient statistics"}, | |
| 7 | + {"n": 6, "url": "https://www.ism.ac.jp/editsec/aism/44/17.html", "title": "Multinomial Logistic Regression Algorithm (Bohning, Ann. Inst. Statist. Math. 44)", "date": "1992 (received 1990-07-23)", "accessed": "2026-10-20", "quote": "consists of replacing the second derivative matrix by a global lower bound in the Loewner ordering. This bound is used in the Newton-Raphson iteration instead of the Hessian matrix leading to a monotonically converging sequence of iterates."}, | |
| 8 | + {"n": 7, "url": "https://arxiv.org/abs/2110.14168", "title": "Training Verifiers to Solve Math Word Problems (Cobbe et al.), GSM8K", "date": "2021-10-27", "accessed": "2026-10-20", "quote": "we introduce GSM8K, a dataset of 8.5K high quality linguistically diverse grade school math word problems."}, | |
| 9 | + {"n": 8, "url": "https://arxiv.org/abs/2402.17762", "title": "Massive Activations in Large Language Models (Sun et al.)", "date": "2024-02-27", "accessed": "2026-10-20", "quote": "very few activations exhibit significantly larger values than others (e.g., 100,000 times larger). We call them massive activations."}, | |
| 10 | + {"n": 9, "url": "https://arxiv.org/abs/2502.02737", "title": "SmolLM2: When Smol Goes Big -- Data-Centric Training of a Small Language Model (Ben Allal et al.)", "date": "2025-02-04", "accessed": "2026-10-20", "quote": "we overtrain SmolLM2 on ~11 trillion tokens of data using a multi-stage training process that mixes web text with specialized math, code, and instruction-following data."}, | |
| 11 | + {"n": 10, "url": "https://www.nvidia.com/en-us/products/workstations/dgx-spark/", "title": "NVIDIA DGX Spark product page", "date": "page as served 2026-10-20", "accessed": "2026-10-20", "quote": "Memory Bandwidth 273 GB/s"} | |
| 12 | +] |
docs/numerics/OWN_FP4.md
| new file mode 100644 | ||
| @@ -0,0 +1,212 @@ | ||
| 1 | +# Our own 4-bit training numerics for the GB10 (L284, own-fp4) | |
| 2 | + | |
| 3 | +Status: DRAFT, parts fill in as receipts land. Every number is tagged **spec** (maker's page), **assembler** (NVIDIA's own | |
| 4 | +assembler run here, the strongest evidence short of the chip for "what the chip accepts"), **measured** (run on this | |
| 5 | +Spark's GB10 through Omega, with the receipt path) or **oracle** (a PyTorch simulation used only to choose a design, | |
| 6 | +never shipped). | |
| 7 | + | |
| 8 | +Words used below, once each: | |
| 9 | +- **Tensor core**: the part of the GPU that does small matrix multiplies in one instruction. It is where the GB10's speed is. | |
| 10 | +- **E2M1 / FP4**: a 4-bit number: 1 sign bit, 2 exponent bits, 1 fraction bit. It can only be 0, 0.5, 1, 1.5, 2, 3, 4, 6 | |
| 11 | + (and their negatives). | |
| 12 | +- **Block scale**: one shared multiplier for a small group (block) of 4-bit numbers, so the group can sit at any size. | |
| 13 | +- **E8M0 / UE4M3**: the two formats the scale can be stored in. E8M0 is a pure power of two (1, 2, 4, 1/2 ...). UE4M3 is | |
| 14 | + an 8-bit float with 3 fraction bits, so it can also be 1.25, 1.5 and so on. | |
| 15 | +- **MXFP4**: the open industry format: 32 numbers share one E8M0 scale. **NVFP4**: NVIDIA's format: 16 numbers share one | |
| 16 | + UE4M3 scale, plus one ordinary 32-bit scale for the whole tensor. | |
| 17 | +- **Rounding**: choosing which of the allowed values a real number becomes. **Nearest** picks the closest (ties to the | |
| 18 | + "even" code). **Stochastic** picks up or down at random in proportion to the distance, so on average nothing is lost. | |
| 19 | +- **GEMM**: a big matrix multiply. Training one layer needs three: forward (Fprop), gradient for the input (Dgrad), | |
| 20 | + gradient for the weights (Wgrad). | |
| 21 | +- **Master copy**: the full-precision copy of the weights the optimizer updates; the 4-bit copy is made from it. | |
| 22 | +- **Hadamard transform**: a fixed "mixing" matrix of +1 and -1 entries that spreads one big value across a block so | |
| 23 | + no single value dominates the block's scale. "Random" Hadamard also flips signs by a fixed random pattern. | |
| 24 | + | |
| 25 | +## Part 1. What the silicon fixes and what we own | |
| 26 | + | |
| 27 | +### 1.1 What the GB10 tensor core accepts (assembler, then chip) | |
| 28 | + | |
| 29 | +Method: write each candidate instruction in NVIDIA's portable assembly (PTX), hand it to NVIDIA's assembler for this | |
| 30 | +chip (`ptxas -arch=sm_121a`, CUDA 13.0 build 36424714), and read back the machine instruction it produced | |
| 31 | +(`nvdisasm`). The assembler is used here as a research oracle only; Omega never links it. Receipt: | |
| 32 | +`evidence/own-fp4/asm/MATRIX.txt` with every source and disassembly beside it. | |
| 33 | + | |
| 34 | +| What we asked for (PTX) | GB10 answer (assembler) | Meaning | | |
| 35 | +|---|---|---| | |
| 36 | +| `mma.m16n8k32 kind::f8f6f4` e2m1 x e2m1 | `QMMA.16832.F32.E2M1.E2M1` | 4-bit values carried in 8-bit slots, **same instruction and same work per instruction as FP8**. Saves memory, not time. | | |
| 37 | +| same, e2m1 x e4m3 (mixed) | `QMMA.16832.F32.E2M1.E4M3` | 4-bit weights times 8-bit activations is allowed in one instruction. | | |
| 38 | +| `kind::mxf8f6f4 block_scale scale_vec::1X ue8m0` | `QMMA.SF.16832 ... E8` | 8-bit-slot op with a hardware block scale, 32 values per scale. | | |
| 39 | +| `m16n8k64 kind::mxf4 scale_vec::2X ue8m0` | `OMMA.SF.16864.F32.E2M1.E2M1.E8` | **The fast 4-bit op**: twice the depth (k 64) per instruction, MX scales, 32 values per scale. | | |
| 40 | +| `kind::mxf4nvf4 scale_vec::4X ue4m3` | `OMMA.SF.16864 ... UE4M3.4X` | Same fast op with NVFP4 scales, 16 values per scale. | | |
| 41 | +| `kind::mxf4nvf4 scale_vec::2X ue8m0` | `OMMA.SF.16864 ... E8` | MX-style scales through the NV path. | | |
| 42 | +| `scale_vec::4X ue8m0` (16 per power-of-two scale) | rejected: needs PTX 9.1, this assembler is 9.0 | The manual says it exists from PTX 9.1 [2]; not testable with the toolkit on this box. | | |
| 43 | +| `scale_vec::2X ue4m3`, `kind::mxf4 scale_vec::1X` | rejected | No 32-per-UE4M3 and no 64-per-scale option. | | |
| 44 | +| sparse `mma.sp m16n8k128 mxf4nvf4` | `OMMA.SF.SP.168128` | 2:4 sparse fast op exists (this is where NVIDIA's "1 petaFLOP" comes from [1]); noted, not chased here. | | |
| 45 | +| `cvt.rn.satfinite.e2m1x2.f32` | `F2FP.SATFINITE.E2M1.F32.PACK_AB_MERGE_C` | Hardware convert to FP4 with nearest rounding: yes. | | |
| 46 | +| `cvt.rs.satfinite.e2m1x4.f32` (stochastic rounding) | **rejected on sm_121a and sm_120a**; accepted on sm_100a and sm_103a (`F2FP ... .RS`) | **The GB10 has no hardware stochastic rounding.** NVIDIA's paper says "Blackwell GPUs have native support for ... stochastic rounding for FP4 conversion instructions" [3]; that is true of the data-centre chips, not of this one. On GB10 stochastic rounding is software (random bits + integer ops on the general cores). | | |
| 47 | +| `cvt.rp/rz.satfinite.ue8m0x2.f32` | `F2FP ... E8 ... .RP/.RZ` | Hardware convert to a power-of-two scale, rounding up or toward zero. | | |
| 48 | +| `tcgen05.*` (the data-centre Blackwell tensor-memory MMA) | rejected | GB10 uses warp-level `mma.sync` only. | | |
| 49 | +| `mma ... s4.s4` (4-bit integers) | emulated with `IMMA.16832.S8.S8` plus unpacking | No native 4-bit integer path. | | |
| 50 | + | |
| 51 | +What the manual says about precision [2]: "Element-wise multiplication of matrix A and B is performed with specified | |
| 52 | +precision. Accumulation of the intermediate values is performed with at least single precision." The block scales are | |
| 53 | +applied by the hardware inside the instruction: "D = (A * scale_A) * (B * scale_B) + C" [2]. Scales are per row of A and | |
| 54 | +per column of B along the multiply's inner dimension (shapes M x SFA_N and SFB_M x N) [2]. So the silicon applies **only | |
| 55 | +1-D scales along the inner dimension**. NVIDIA's "16 x 16 two-dimensional" weight blocks are a software choice made | |
| 56 | +before the multiply: "2D block scales are replicated for each of the 1×16 blocks when being passed into Tensor Cores" [3]. | |
| 57 | + | |
| 58 | +### 1.2 Measured rates (chip, through Omega) | |
| 59 | + | |
| 60 | +| Instruction | Dense rate (measured) | Ratio to FP8 | Receipt | | |
| 61 | +|---|---|---|---| | |
| 62 | +| HMMA.16816 BF16 | 118.81 TFLOPS | 0.50 | omega `doc/machine-ceiling@3c8ce239` `evidence/MACHINE-CEILING-20261020/raw/gpu-tc-peak.txt` (L151) | | |
| 63 | +| QMMA.16832 FP8 E4M3 | 237.52 TFLOPS | 1.00 | same, `raw/gpu-qmma.txt` (L151) | | |
| 64 | +| QMMA.16832 E2M1 (no block scale) | PENDING | | `evidence/own-fp4/omma-peak/` | | |
| 65 | +| QMMA.SF.16832 E2M1 E8 | PENDING | | | | |
| 66 | +| OMMA.SF.16864 MXFP4 (E8, 32/scale) | PENDING | | | | |
| 67 | +| OMMA.SF.16864 NVFP4 (UE4M3, 16/scale) | PENDING | | | | |
| 68 | +| Maker's figure | "up to 1 petaFLOP of AI computing performance" with FP4 [1]; L151 quotes NVIDIA's hardware page as "with sparsity" | | spec | | |
| 69 | + | |
| 70 | +How the 4-bit probe works: Omega had no FP4 tensor-core code. The new probe (omega branch `numerics/own-fp4-omma`, | |
| 71 | +`src/omega_blackwell_codegen_omma.c`, `tests/gpu_omma_peak_test.c`) emits each 4-bit instruction by taking the exact | |
| 72 | +bits the assembler produced (above) and patching them into Omega's own encoder, the same method Omega already used for | |
| 73 | +FP8 (QMMA). It then runs long chains of the instruction with constant inputs and a non-trivial scale (2.0) and checks | |
| 74 | +every output equals the exact expected value, so a scale the chip ignored or misread shows up as a wrong number, not as | |
| 75 | +a fast time. | |
| 76 | + | |
| 77 | +### 1.3 The knobs: fixed by silicon or ours | |
| 78 | + | |
| 79 | +| Knob | Fixed by silicon or ours | What NVFP4 chose [3] | What else is possible on GB10 | | |
| 80 | +|---|---|---|---| | |
| 81 | +| Element format of the fast path | **silicon**: E2M1 only (OMMA.SF) | E2M1 | E2M1 x E4M3 mixed runs only on the FP8-rate op. Ternary {-1, 0, +1} is a subset of E2M1, so ternary weights ride the fast op for free. | | |
| 82 | +| Block length along the inner dimension | **silicon**: 32 (E8M0) or 16 (UE4M3, or E8M0 with PTX 9.1) | 16 | 32 | | |
| 83 | +| Scale encoding | **silicon**: E8M0 or UE4M3 | UE4M3 + one FP32 per tensor | E8M0 (exact powers of two, cheaper to compute, coarser) | | |
| 84 | +| Scale shape beyond 1-D | **ours** (software, before the multiply) | 16x16 tiles for weights, 1x16 for activations and gradients | any tiling that is constant along 16 or 32 inner elements; extra per-row/per-column factors applied after the multiply | | |
| 85 | +| Accumulator | **silicon**: at least FP32 [2] | FP32 | exact accumulation order and rounding are unspecified by the manual (UNKNOWN; the next chip probe measures it) | | |
| 86 | +| How values get to the grid (rounding) | **ours**: nearest is a hardware convert; stochastic is software on GB10 | nearest for weights and activations, stochastic for gradients | stochastic everywhere, nearest everywhere, error feedback | | |
| 87 | +| Transform before quantizing | **ours** | 16x16 random Hadamard on Wgrad inputs only | none, fixed Hadamard, per-token power-of-two balancing (exact and nearly free), rotate all three GEMMs | | |
| 88 | +| How scales are chosen | **ours** | block max / 6 | best-of-several clip per block (MSE), percentile, learned | | |
| 89 | +| Which tensors are 4-bit | **ours** | all linear layers except the last ~15% of blocks; attention, embeddings, head, norms in BF16 | everything, or fewer | | |
| 90 | +| Master copy and optimizer state | **ours** | FP32 master, FP32 Adam states | 4-bit weight + 8-bit residual (error feedback); 8-bit optimizer states | | |
| 91 | +| Not multiplying at all (ternary) | **ours** | not used | BitNet b1.58 ternary weights [6]; on GB10 run on the 4-bit tensor core, not as adds | | |
| 92 | + | |
| 93 | +## Part 2. Candidate designs of our own | |
| 94 | + | |
| 95 | +Notation for one linear layer: input X (tokens x in), weight W (out x in), output Y = X W^T, incoming gradient dY. | |
| 96 | +The three GEMMs: Fprop Y = X W^T (sums over "in"), Dgrad dX = dY W (sums over "out"), Wgrad dW = dY^T X (sums over | |
| 97 | +tokens). q(.) is "quantize to E2M1 with block scales along the summed dimension"; qn uses nearest rounding, qs | |
| 98 | +stochastic. g is the FP32 per-tensor scale. The tensor core computes sum_k (a_k s_a)(b_k s_b) in FP32 for each 16- or | |
| 99 | +32-long block; g_a g_b is applied once to the result. | |
| 100 | + | |
| 101 | +**Yardstick, NVFP4 as published [3].** Fprop: Y = qn(X) qn2D(W)^T. Dgrad: dX = qs(dY) qn2D(W). Wgrad: | |
| 102 | +dW = qs(R dY)^T qn(R X), with R a 16x16 Hadamard times one fixed random sign vector, applied in blocks of 16 tokens | |
| 103 | +(R^T R = I, so in exact arithmetic dW is unchanged). FP32 master W and FP32 Adam states. Last ~15% of blocks, attention, | |
| 104 | +embeddings, head and norms in BF16. Bytes per parameter per optimizer step: read+write master 8, read gradient 4, | |
| 105 | +read+write two Adam moments 16, write the 4-bit copy 0.5 + 1/256 scale = **28.504 B** (calc:538798c3). | |
| 106 | + | |
| 107 | +**(a) Error feedback instead of an FP32 master.** Stored per weight: c = 4-bit code (with its 16x16 UE4M3 scale) and | |
| 108 | +r = an 8-bit residual (E4M3 with one power-of-two scale per 16x16 tile). The weight the model sees is w = deq(c); the | |
| 109 | +optimizer's "master" is m = deq(c) + deq(r). Each step, with Adam update u: | |
| 110 | +m' = deq(c) + deq(r) + u; c' = qn2D(m'); r' = q8(m' - deq(c')). | |
| 111 | +So the rounding error of the 4-bit weight is carried forward in r instead of being thrown away; only the error of the | |
| 112 | +8-bit residual (about 1/16 of the residual, itself at most half a 4-bit step) is lost. Variant (a-SR) rounds r | |
| 113 | +stochastically, so even updates smaller than one residual step survive on average. Negative control (a0): no residual | |
| 114 | +at all (weights live only in 4 bits; any update smaller than half a 4-bit step is lost). Bytes per step: | |
| 115 | +1.5 + 1.5 + 4/256 (codes, residual, two scales) + 4 (gradient) + 16 (Adam) = **23.016 B** (calc:f959c88e), 0.8075 of | |
| 116 | +NVFP4's (calc:6b1f86f5). The advisor's point stands: the master is only a fraction of the budget; with 8-bit Adam | |
| 117 | +moments the pair becomes **11.016 B** vs **16.504 B** (calc:b0eef921, calc:c9f6b25a). Kernel sketch for Omega: one | |
| 118 | +fused "update" kernel per weight tensor, one CTA per 16x16 tile: load c (128 B), r (256 B), two scale bytes, the FP32 | |
| 119 | +gradient tile and Adam moments; FFMA the Adam math; find the tile max (warp shuffle); F2FP.E2M1 (hardware nearest | |
| 120 | +convert, present on GB10) for c'; subtract; F2FP.E4M3 for r' (or software stochastic rounding: add random bits from a | |
| 121 | +counter-based generator, then truncate); store. Rate: memory-bound, no tensor core. Known failure mode: if r's own | |
| 122 | +rounding loses updates systematically (RNE), small learning rates late in training stall; the race checks this. | |
| 123 | + | |
| 124 | +**(b) Our own outlier handling for Wgrad instead of the random Hadamard.** Candidates, all exact in real arithmetic | |
| 125 | +(dW unchanged): | |
| 126 | +- signs only (diagonal of +-1): **cannot help, by algebra**: block-max scaling and rounding of |x| do not depend on the | |
| 127 | + sign, so the quantization error is identical. Kept in the study as a control that must show no change. | |
| 128 | +- fixed Hadamard without the random signs (16x16). | |
| 129 | +- per-token power-of-two balancing: X_t -> X_t s_t, dY_t -> dY_t / s_t with s_t = 2^round(log2 sqrt(|dY_t|/|X_t|)). | |
| 130 | + Because s_t is a power of two this is exact on the chip (an exponent add), costs 1 operation per element instead of | |
| 131 | + 16 multiply-adds, and needs no tensor-core pass. It evens out tokens whose gradient is huge against tokens whose | |
| 132 | + gradient is tiny, which is the outlier pattern along the token dimension. | |
| 133 | +- balancing followed by the 16x16 RHT; 128x128 RHT (the paper's larger option). | |
| 134 | +Measured on real Wgrad operands from the BF16 baseline (4 layers x 3 points in training): see Part 3, table B. | |
| 135 | +Kernel sketch: the balancing is folded into the quantize kernel that already reads X and dY (one extra FMUL by a power | |
| 136 | +of two per element, one row-norm reduction per token); the RHT is a 16x16 GEMM per tile (on GB10 it can run as an | |
| 137 | +HMMA, 32 flops per element). | |
| 138 | + | |
| 139 | +**(c) Ternary weights.** W ~ a * T with T in {-1, 0, +1} and a = mean|W| (BitNet b1.58 absmean [6]) per tensor (c) or | |
| 140 | +per 16x16 tile (c16, which maps onto the NVFP4 hardware block scale: the tile scale becomes the UE4M3 scale). Forward: | |
| 141 | +Y = qn(X) (aT)^T; Dgrad uses the same aT; Wgrad as NVFP4 (it has no weight in it, so ternary does not change it). | |
| 142 | +Latent FP32 weights and Adam states as in BitNet ("straight-through": the gradient passes through the rounding as if it | |
| 143 | +were not there). On GB10, -1, 0, +1 are exact E2M1 codes, so the ternary GEMM runs on the **fast 4-bit tensor core**, | |
| 144 | +not as adds on the general cores (the adds path would run at the general-core rate, which L151 measured at 17.69 TFLOPS | |
| 145 | +FFMA, 0.074 of the FP8 tensor rate: an adds-only kernel cannot beat the tensor core here). Storage: 1.58 bits | |
| 146 | +of information, 2 bits packed, 4 bits as a tensor-core operand. Bytes per optimizer step: unchanged from NVFP4 (FP32 | |
| 147 | +latent weights): the advisor is right that ternary is a win for inference memory and forward/Dgrad operand bytes, not | |
| 148 | +for training optimizer traffic. Omega already has a ternary W2A8 GEMV on the general cores | |
| 149 | +(`src/omega_blackwell_codegen_tern.c`, omega main), the inference-side half. Known failure mode: at equal parameter | |
| 150 | +count ternary loses quality; BitNet reports parity only at larger sizes [6]. | |
| 151 | + | |
| 152 | +**(d) Rotate everything + best-clip scales (from Quartet [4] and the MXFP4 recipe [5]).** Quartet keeps all linear | |
| 153 | +layers in FP4 with a Hadamard rotation in the forward pass and stochastic rounding in the backward [4]; Tseng et al. | |
| 154 | +use RHT to bound the variance of stochastic rounding [5]. Ours: R applied along the summed dimension of all three GEMMs, | |
| 155 | +and for forward tensors each 16-block's scale picked as the best of four clip ratios (amax/6, /5, /4.5, /4) by squared | |
| 156 | +error. Cost: one extra 16x16 rotation per GEMM input (HMMA) and four trial quantizations in the quantize kernel | |
| 157 | +(general cores). Failure mode: clipping hurts when the clipped values carry the signal. | |
| 158 | + | |
| 159 | +Microsoft's FP4 framework [7] (a differentiable gradient estimator and outlier clamping with compensation) needs an extra | |
| 160 | +high-precision "compensation" matrix multiply; it is noted, not raced here (budget), and listed as a next experiment. | |
| 161 | + | |
| 162 | +Tensor-core rate each design can use: all of (a)-(d) feed the same OMMA.SF.16864 instruction in all three GEMMs | |
| 163 | +(rate in 1.2). The differences are in the side kernels (quantize, transform, update), which run on the general cores | |
| 164 | +or as small HMMA tiles. | |
| 165 | + | |
| 166 | +## Part 3. The race (oracle) | |
| 167 | + | |
| 168 | +### Table B. Outlier handling on real weight gradients (oracle) | |
| 169 | + | |
| 170 | +Real Wgrad inputs (X and dY) of four layers of the BF16 baseline at steps 200, 1500 and 2999; both quantized along the | |
| 171 | +token dimension (X nearest, dY stochastic); error of the resulting dW against the FP32 product. Receipt: | |
| 172 | +`evidence/own-fp4/outlier/` (rows.json, summary.txt, per_case.txt, README with the command). | |
| 173 | + | |
| 174 | +| Transform before quantizing | Cost per number | NVFP4 mean dW error (max) | MXFP4 mean dW error (max) | | |
| 175 | +|---|---|---|---| | |
| 176 | +| none | 0 | 0.1414 (0.1703) | 0.1849 (0.2356) | | |
| 177 | +| sign flips only (control) | 0 | 0.1413 (0.1741): same as none, as the algebra says | 0.1849 (0.2356) | | |
| 178 | +| fixed 16x16 Hadamard | 16 multiply-adds | 0.1433 | 0.1852 | | |
| 179 | +| **16x16 random Hadamard (NVIDIA's choice)** | 16 | **0.1466 (0.1934)** | 0.1713 (0.2141) | | |
| 180 | +| 128x128 random Hadamard | 128 | 0.1473 | 0.1701 | | |
| 181 | +| **per-token power-of-two balancing (ours)** | 1 (exponent add) | **0.1332 (0.1637)** | 0.1760 (0.2180) | | |
| 182 | +| balancing then 16x16 random Hadamard (ours) | 17 | 0.1310 (0.1596) | **0.1546 (0.1878)** | | |
| 183 | + | |
| 184 | +Case by case (12 layer-snapshots): with NVFP4 scales, the random Hadamard was worse than doing nothing in 10 of 12 and | |
| 185 | +our balancing beat it in 11 of 12. With MX scales (32 per power-of-two scale) the Hadamard helps in 12 of 12, and | |
| 186 | +balancing plus Hadamard beats Hadamard alone in 12 of 12. | |
| 187 | + | |
| 188 | +What this means: NVFP4's small 16-element blocks with a fine-grained (UE4M3) scale already absorb most outliers inside a | |
| 189 | +block; spreading values with a rotation then mostly adds rounding of its own. The outliers that remain are **between | |
| 190 | +tokens** (a few tokens carry far larger gradients than the rest), and an exact per-token power-of-two rescale fixes | |
| 191 | +exactly that at 1/16 of the cost. NVIDIA's own ablation found the Hadamard mattered at 12B and said "we observe | |
| 192 | +diminishing gains from Hadamard matrices beyond moderate sizes" [3]; at our 23M size it does not help NVFP4 at all. This | |
| 193 | +is a small-model, single-draw result (one stochastic-rounding draw per case); the training race below is the test that | |
| 194 | +counts. | |
| 195 | + | |
| 196 | +### Table A. Training race | |
| 197 | + | |
| 198 | +PENDING (runs in progress) | |
| 199 | + | |
| 200 | +## Part 4. Verdict | |
| 201 | + | |
| 202 | +PENDING | |
| 203 | + | |
| 204 | +## Sources | |
| 205 | + | |
| 206 | +[1] https://www.nvidia.com/en-us/products/workstations/dgx-spark/ , "NVIDIA DGX Spark", accessed 2026-10-20. "Fifth-generation Tensor Cores with support for FP4 deliver up to 1 petaFLOP of AI computing performance, combined with 128 GB of system mem[ory]" | |
| 207 | +[2] https://docs.nvidia.com/cuda/parallel-thread-execution/index.html , "PTX ISA" (section 9.7.16.3 Block Scaling for mma.sync, and mma), accessed 2026-10-20. "D = (A * scale_A) * (B * scale_B) + C." / "Element-wise multiplication of matrix A and B is performed with specified precision. Accumulation of the intermediate values is performed with at least single precision." / "Support for .scale_vec::4X on .ue8m0 as .stype with .kind::mxf4nvf4 is introduced in PTX ISA version 9.1." | |
| 208 | +[3] https://arxiv.org/abs/2509.25149 (HTML https://arxiv.org/html/2509.25149), NVIDIA, "Pretraining Large Language Models with NVFP4", accessed 2026-10-20. "Our method integrates Random Hadamard transforms (RHT) to bound block-level outliers, employs a two-dimensional quantization scheme for consistent representations across both the forward and backward passes, utilizes stochastic rounding for unbiased gradient estimation, and incorporates selective high-precision layers." / "Further, Blackwell GPUs have native support for several rounding modes including round-to-nearest-even and stochastic rounding for FP4 conversion instructions." / "2D block scales are replicated for each of the 1×16 blocks when being passed into Tensor Cores, and continue to leverage an FP32 per-tensor scale." | |
| 209 | +[4] https://arxiv.org/abs/2505.14669 , Castro et al., "Quartet: Native FP4 Training Can Be Optimal for Large Language Models", accessed 2026-10-20. "In this paper, we investigate hardware-supported FP4 training and introduce a new approach for accurate, end-to-end FP4 training with all the major computations (i.e., linear layers) in low precision." | |
| 210 | +[5] https://arxiv.org/abs/2502.20586 , Tseng et al., "Training LLMs with MXFP4", accessed 2026-10-20. "Our key insight is to compute unbiased gradient estimates with stochastic rounding (SR), resulting in more accurate model updates. However, directly applying SR to MXFP4 can result in high variance from block-level outliers, harming convergence. To overcome this, we use the random Hadamard tranform to theoretically bound the variance of SR." | |
| 211 | +[6] https://arxiv.org/abs/2402.17764 , Ma et al., "The Era of 1-bit LLMs: All Large Language Models are in 1.58 Bits", accessed 2026-10-20. "In this work, we introduce a 1-bit LLM variant, namely BitNet b1.58, in which every single parameter (or weight) of the LLM is ternary {-1, 0, 1}. It matches the full-precision (i.e., FP16 or BF16) Transformer LLM with the same model size and training tokens in terms of both perplexity and end-task performance" | |
| 212 | +[7] https://arxiv.org/abs/2501.17116 , Wang et al., "Optimizing Large Language Model Training Using FP4 Quantization", accessed 2026-10-20. "This work introduces the first FP4 training framework for LLMs, addressing these challenges with two key innovations: a differentiable quantization estimator for precise weight updates and an outlier clamping and compensation strategy to prevent activation collapse." |
docs/numerics/sources.json
| new file mode 100644 | ||
| @@ -0,0 +1,9 @@ | ||
| 1 | +[ | |
| 2 | + {"n": 1, "url": "https://www.nvidia.com/en-us/products/workstations/dgx-spark/", "title": "NVIDIA DGX Spark", "accessed": "2026-10-20"}, | |
| 3 | + {"n": 2, "url": "https://docs.nvidia.com/cuda/parallel-thread-execution/index.html", "title": "PTX ISA (Parallel Thread Execution)", "accessed": "2026-10-20"}, | |
| 4 | + {"n": 3, "url": "https://arxiv.org/abs/2509.25149", "title": "Pretraining Large Language Models with NVFP4", "accessed": "2026-10-20"}, | |
| 5 | + {"n": 4, "url": "https://arxiv.org/abs/2505.14669", "title": "Quartet: Native FP4 Training Can Be Optimal for Large Language Models", "accessed": "2026-10-20"}, | |
| 6 | + {"n": 5, "url": "https://arxiv.org/abs/2502.20586", "title": "Training LLMs with MXFP4", "accessed": "2026-10-20"}, | |
| 7 | + {"n": 6, "url": "https://arxiv.org/abs/2402.17764", "title": "The Era of 1-bit LLMs: All Large Language Models are in 1.58 Bits", "accessed": "2026-10-20"}, | |
| 8 | + {"n": 7, "url": "https://arxiv.org/abs/2501.17116", "title": "Optimizing Large Language Model Training Using FP4 Quantization", "accessed": "2026-10-20"} | |
| 9 | +] |
docs/omegallm/OM-BUNDLES.md
| new file mode 100644 | ||
| @@ -0,0 +1,225 @@ | ||
| 1 | +# `.om` Specialist Chains, DNA-Style Chain Clipping & Local `omc` Feedback Loop | |
| 2 | + | |
| 3 | +Architecture, measured corpus inventory, chain-organized dataset/refusal-pair builder, and local compile-retry loop for turning Omega LLM (`ollm`) + `OLLMSP01` swappable specialist packs ([SPECIALISTS.md](SPECIALISTS.md)) into composable **DNA-style Specialist Chains** for native `.om` coding. | |
| 4 | + | |
| 5 | +## 1. Three-Bottleneck Architecture | |
| 6 | + | |
| 7 | +| Bottleneck vs Python | Native Omega Target | Mechanism | | |
| 8 | +|---|---|---| | |
| 9 | +| **1. Large active weights / slow decode** | Smaller active weights and higher decode throughput on GB10 | Freeze base layers (`0..base_L-1`) and attach thin `OLLMSP01` specialist links (`14.1 MB` per 1 added layer / `28.3 MB` per 2 added layers on v2 `D=384, F=1536`) instead of serving one monolithic general model. Grow vertical Merkle chains and clip sibling strands together on a shared trunk. | | |
| 10 | +| **2. Out-of-distribution `.om` overhead** | Zero `writing-omega` prompt warmup; target 0–1 compile retries instead of 2–4 | Train chain links directly on deduplicated first-party `.om` code plus live `omc` refusal-repair pairs spanning all 30 compiler error codes (`1..30`), using completion-only masking (`fcachem`) so loss is computed only on `.om` completions. | | |
| 11 | +| **3. Slow edit-check-fix loop** | Millisecond local `omc` feedback loop | Generate candidate `.om` via `ollm spsamp` / `spchainsamp` / `spclip` -> compile via stdin with local `omc` in single-digit milliseconds -> on refusal (`rc != 0`), inject exact `omc: line N: error K` stderr back into the retry prompt. Never execute refused output. | | |
| 12 | + | |
| 13 | +## 2. DNA-Style Specialist Chains & Chain Clipping | |
| 14 | + | |
| 15 | +Rather than stopping at flat single-layer bundles, `.om` specialists are organized as **Vertical Merkle Chains (Strands)** that clip together with sibling strands via **Hybridization (`spclip`)** and **Residual Ligation (`spstack` + optional ligase bridge)**. | |
| 16 | + | |
| 17 | +### A. Vertical Merkle Chains (Strands) | |
| 18 | + | |
| 19 | +```text | |
| 20 | + base.ck (L0..7, frozen) | |
| 21 | + │ base_hash_0 | |
| 22 | + ▼ | |
| 23 | + om-core.sp (L8..9) [Link 1: core .om + 30-error omc refusals] | |
| 24 | + │ base_hash_1 | |
| 25 | + ▼ | |
| 26 | + aienux-kernel.sp (L10..11) [Link 2: Aienux OS / EFI / MMU / drivers] | |
| 27 | + ╱ ╲ base_hash_2 (shared trunk) | |
| 28 | + ▼ ▼ | |
| 29 | + gb20b-mmio.sp (L12..13) libos-rpc.sp (L12..13) | |
| 30 | + [Strand A: GB20B/GSP/ [Strand B: LibosLog / RPC / | |
| 31 | + SEC2/MMIO/CUDApp] HTTP / JSON / wire IPC] | |
| 32 | +``` | |
| 33 | + | |
| 34 | +- **Cryptographic prefix pinning:** every `OLLMSP01` link stores `base_L` and `base_hash = FNV1a64(shapes, ow[0..fz))`. Link `i+1` refuses to attach (`rc=62`) unless the exact frozen prefix chain `0..i` is present and bit-identical beneath it. | |
| 35 | +- **Per-link `fcachem` training:** each link caches the frozen prefix's hidden states once (`ollm fcachem`) and trains only its own added layers (`L -> L+2`) via `growpro` + `trainfc` + `spext`. | |
| 36 | + | |
| 37 | +### B. DNA-Style Chain Clipping (Multi-Strand Hybridization & Ligation) | |
| 38 | + | |
| 39 | +1. **Shared-Trunk Multi-Helix Clipping (`spclip`, `S = 2..4` strands — double, triple, or quad helix):** | |
| 40 | + - Two to four strands sharing a frozen trunk hash (e.g., **Double Helix** clipping `gb20b-mmio` ⊕ `libos-rpc` over `base -> om-core -> aienux-kernel`, or **Triple Helix** clipping `aienux-kernel` ⊕ `gb20b-mmio` ⊕ `libos-rpc` over `base -> om-core`) evaluate the **longest common shared prefix** across all `S` strands **once per token** (`H_trunk`), then evaluate each strand's divergent tail layers over `H_trunk`: | |
| 41 | + - **`MODE=0` (Prior-Weighted Product-of-Experts):** normalized weights `alpha_s = w_s / sum(w)`, fused `sum_s alpha_s * log P_s`. | |
| 42 | + - **`MODE=1` (Entropy-Gated Multi-Helix):** computes per-token Shannon entropy `H_s = -sum P_s log P_s` for each strand, sets `u_s = w_s / (H_s + 0.001)` and `alpha_s = u_s / sum(u)`, and fuses `sum_s alpha_s * log P_s` so whichever specialized strand is most certain on the current token (e.g., `aienux-kernel` on page-table flags, `gb20b-mmio` on MMIO register offsets, or `libos-rpc` on RPC framing) naturally dominates. | |
| 43 | +2. **Residual Ligation / Sticky-End Ligase:** | |
| 44 | + - Clips Strand B sequentially after Strand A via `ollm spstack` (`L_out <= 16`, with per-pack `(Wo, W2)` residual scaling), optionally followed by a 1-layer `fcachem`-trained **ligase bridge pack** (`L_out -> L_out + 1`) trained on cross-domain examples (e.g., GSP RPC over GB20B MMIO queues) to align the ligated representation while keeping both strands bit-identically frozen. | |
| 45 | + | |
| 46 | +## 3. Verification Status (`EXERCISED` vs `NOT_RUN`) | |
| 47 | + | |
| 48 | +| Capability | Status | Platform / Evidence | | |
| 49 | +|---|---|---| | |
| 50 | +| Local `.om` corpus audit & SHA-256 deduplication | `EXERCISED` | Apple Silicon M2 (Darwin arm64 CPU), `tools/om_bundle_data.py audit` | | |
| 51 | +| Live `omc` refusal-repair pair generation (all 30 error codes `1..30`) | `EXERCISED` | Apple Silicon M2 (Darwin arm64 CPU), local `omc` (`sha256: 68a590c3…feb9c`), 38/38 pairs compiled & verified | | |
| 52 | +| Chain-organized zero-leakage splits + `ollm bpeenc` + `ollm fcachem` verification | `EXERCISED` | Apple Silicon M2 (Darwin arm64 CPU), all 4 chain links verified `leakage_hashes=0` and `FCACHE 2 256 384 8` | | |
| 53 | +| Local `omc` compile latency benchmark (20 runs per unit) | `EXERCISED` | Apple Silicon M2 (Darwin arm64 CPU), `tools/om_compile_loop.py bench --runs 20` | | |
| 54 | +| Local single-pack `ollm spsamp` + `omc` compile-retry harness | `EXERCISED` | Apple Silicon M2 (Darwin arm64 CPU), `tools/om_compile_loop.py selftest` (deterministic refusal->repair + live `omega-code_pro.sp` loop) | | |
| 55 | +| Full M2 CPU multi-link chain training (`om-core` -> `aienux-kernel` -> `gb20b-mmio` / `libos-rpc`) | `NOT_RUN` | Exact chain recipes specified below; only dataset splits + `fcachem` compatibility exercised here | | |
| 56 | +| Pure-Omega `spchainapp` / `spchaineval` / `spchainsamp` / `spclip` (`S=2..4`) execution on trained `.om` chains | `NOT_RUN` | Engine verbs implemented in parallel branch `feat/ollm-chain-clip`; `.om` chain weights not yet trained | | |
| 57 | +| Sticky-end ligase bridge pack training (`L -> L+1`) | `NOT_RUN` | Architectural recipe documented below | | |
| 58 | +| On-chip GB10 frozen-core specialist training & GB10 decode throughput | `NOT_RUN` | Frozen-core GPU training is not yet implemented in `native/omegallm/gpu/gg.om` (CPU-only via `trainf`/`trainfc`); full-chip `gtrainf`/`gtrainb` mutates base layers and requires an authorized `spark-window` | | |
| 59 | +| Aienux / GB20B live inference & hardware-in-the-loop coding | `NOT_RUN` | Requires authorized hardware window; no GPU or Aienux runtime touched | | |
| 60 | + | |
| 61 | +## 4. Measured Local `.om` Corpus Inventory | |
| 62 | + | |
| 63 | +Measured on Apple Silicon M2 CPU via `python3 tools/om_bundle_data.py audit`: | |
| 64 | + | |
| 65 | +- **Total `.om` across all workspace directories:** `12,502` files, `5,870,743` LOC (`119,417,595` bytes; `6,960` duplicate files across git worktrees/clones). | |
| 66 | +- **Unique `.om` (SHA-256 deduplicated):** `5,542` files, `1,727,419` LOC (`35,730,214` bytes). | |
| 67 | +- **Clean positive `.om` (excluding intentional `errNN_*`, `mistake_*`, and mutant negative-control files):** `5,457` files, `1,726,006` LOC. | |
| 68 | + | |
| 69 | +### Audit Breakdown by Domain Category (SHA-256 Deduplicated) | |
| 70 | + | |
| 71 | +| Category | Unique Files | Unique LOC | Clean Positive Files | Clean Positive LOC | Chain Link | | |
| 72 | +|---|---:|---:|---:|---:|---| | |
| 73 | +| `om-core` | 4,023 | 1,173,226 | 3,944 | 1,172,390 | Link 1: `om-core.sp` (`L8..9`) | | |
| 74 | +| `ollm` (CPU/native trainer) | 156 | 80,744 | 156 | 80,744 | Link 1: `om-core.sp` (`L8..9`) | | |
| 75 | +| `aienux-kernel` (Aienux/EFI/MMU/drivers) | 249 | 102,658 | 243 | 102,081 | Link 2: `aienux-kernel.sp` (`L10..11`) | | |
| 76 | +| `gb20b-mmio` (Blackwell/GPU/CUDApp/GSP/SEC2/MMIO) | 907 | 276,096 | 907 | 276,096 | Link 3A: `gb20b-mmio.sp` (`L12..13`) | | |
| 77 | +| `libos-rpc` (LibosLog/RPC/HTTP/JSON/wire/net) | 207 | 94,695 | 207 | 94,695 | Link 3B: `libos-rpc.sp` (`L12..13`) | | |
| 78 | +| **Total** | **5,542** | **1,727,419** | **5,457** | **1,726,006** | — | | |
| 79 | + | |
| 80 | +### Chain-Organized Dataset Splits & `fcachem` Compatibility Check (Apple Silicon M2 CPU) | |
| 81 | + | |
| 82 | +`tools/om_bundle_data.py build --max-examples 400 --verify-fcachem --include-err24` verified deterministic SHA-256 hash splitting (`int(sha256[:8], 16) % 10 == 0` -> held-out), zero hash overlap, BPE encoding via `ollm bpeenc` + `merges4096.bin`, chain topology metadata in `manifest.json`, and live `OLLMFH01` cache creation: | |
| 83 | + | |
| 84 | +| Chain Link | Parent Prefix | Layers | Strand | Train Files | Held Files | Leakage | Train Wins (`T=256`) | Held Wins (`T=256`) | `ollm fcachem` Check | | |
| 85 | +|---|---|---|---|---:|---:|---:|---:|---:|---| | |
| 86 | +| `om-core` | `base` (`L0..7`) | `8->10` | `trunk` | 3,656 | 395 | 0 | 218 | 34 | `FCACHE 2 256 384 8` | | |
| 87 | +| `aienux-kernel` | `om-core` (`L0..9`) | `10->12` | `trunk` | 202 | 29 | 0 | 194 | 38 | `FCACHE 2 256 384 8` | | |
| 88 | +| `gb20b-mmio` | `aienux-kernel` (`L0..11`) | `12->14` | `branch-a` | 775 | 93 | 0 | 197 | 40 | `FCACHE 2 256 384 8` | | |
| 89 | +| `libos-rpc` | `aienux-kernel` (`L0..11`) | `12->14` | `branch-b` | 181 | 26 | 0 | 200 | 45 | `FCACHE 2 256 384 8` | | |
| 90 | + | |
| 91 | +## 5. Measured Local `omc` Compile Latency (Apple Silicon M2 CPU) | |
| 92 | + | |
| 93 | +Measured via `python3 tools/om_compile_loop.py bench --runs 20` against local Darwin ARM64 `omc` (`sha256: 68a590c37dfb1ec37a183f0032e02db1570db299266f574f65556edfc70feb9c`): | |
| 94 | + | |
| 95 | +| Unit | LOC | Runs | Min (ms) | Median (ms) | P95 (ms) | Max (ms) | Output Binary (bytes) | | |
| 96 | +|---|---:|---:|---:|---:|---:|---:|---:| | |
| 97 | +| `small_6loc` | 6 | 20 | 4.477 | 5.359 | 6.764 | 6.764 | 248 | | |
| 98 | +| `hello.om` | 9 | 20 | 4.069 | 4.914 | 6.992 | 6.992 | 396 | | |
| 99 | +| `om2_tour.om` | 43 | 20 | 4.077 | 4.875 | 6.810 | 6.810 | 716 | | |
| 100 | +| `medium_67loc` | 67 | 20 | 4.258 | 5.989 | 80.564 | 80.564 | 960 | | |
| 101 | +| `large_564loc` | 565 | 20 | 5.541 | 7.267 | 11.661 | 11.661 | 6,020 | | |
| 102 | +| `ollm-darwin.om` (full OLLM) | 6,423 | 20 | 32.116 | 36.044 | 126.225 | 126.225 | 214,816 | | |
| 103 | + | |
| 104 | +Typical single-function and module-sized `.om` edits (`6–565` LOC) compile in **4.9–7.3 ms median** on M2 CPU, and the entire 6,423-LOC `ollm` binary compiles in **36.0 ms median**. | |
| 105 | + | |
| 106 | +### Local Compile-Retry Harness Self-Test (Apple Silicon M2 CPU) | |
| 107 | + | |
| 108 | +`python3 tools/om_compile_loop.py selftest` exercised both: | |
| 109 | +1. **Deterministic refusal -> repair:** `x = 5` refused by `omc` (`rc=11`, `omc: line 2: error 11`) in `5.947 ms`; repaired `x = int 5` compiled cleanly (`rc=0`, `212` bytes) in `4.831 ms`. | |
| 110 | +2. **Live `ollm spsamp` + `omc` retry loop (`omega-code_pro.sp` on `omega-v2.ck`):** 3 attempts (`3.95–5.57 s` CPU `spsamp` + `5.80–6.86 ms` `omc` check per attempt), capturing real `omc` refusals (`error 16` -> `error 4`) and feeding them back into each retry prompt. | |
| 111 | + | |
| 112 | +## 6. Exact Commands | |
| 113 | + | |
| 114 | +### A. Audit Corpus, Verify 30-Error Refusals, and Build Chain-Organized Datasets | |
| 115 | + | |
| 116 | +```sh | |
| 117 | +# 1. Audit local .om corpus (total + SHA-256 deduplicated) | |
| 118 | +python3 tools/om_bundle_data.py audit --workspace "$HOME/workspace" | |
| 119 | + | |
| 120 | +# 2. Generate and live-verify all 30 omc refusal-repair pairs (errors 1..30) | |
| 121 | +python3 tools/om_bundle_data.py refusals \ | |
| 122 | + --omc "$HOME/.local/bin/omc" \ | |
| 123 | + --include-err24 \ | |
| 124 | + --out "$OUT/refusals.jsonl" | |
| 125 | + | |
| 126 | +# 3. Build deterministic, zero-leakage .tok + .msk chain splits and verify fcachem | |
| 127 | +python3 tools/om_bundle_data.py build \ | |
| 128 | + --workspace "$HOME/workspace" \ | |
| 129 | + --omc "$HOME/.local/bin/omc" \ | |
| 130 | + --ollm "$HOME/.local/bin/ollm" \ | |
| 131 | + --merges "$HOME/workspace/aien-train-macbook/local-mac/merges4096.bin" \ | |
| 132 | + --base-ck "$HOME/workspace/aien-train-macbook/local-mac/omega-v2.ck" \ | |
| 133 | + --out-dir "$OUT/bundles" \ | |
| 134 | + --verify-fcachem \ | |
| 135 | + --include-err24 | |
| 136 | +``` | |
| 137 | + | |
| 138 | +### B. Train Vertical Merkle Chains on M2 CPU (`growpro` + `fcachem` + `trainfc` + `spext`) | |
| 139 | + | |
| 140 | +Each link pins the frozen prefix beneath it via `OLLMSP01` `base_hash`: | |
| 141 | + | |
| 142 | +```sh | |
| 143 | +OLLM="$HOME/.local/bin/ollm" | |
| 144 | +BASE_CK="$HOME/workspace/aien-train-macbook/local-mac/omega-v2.ck" | |
| 145 | +MERGES="$HOME/workspace/aien-train-macbook/local-mac/merges4096.bin" | |
| 146 | +DATA="$OUT/bundles" | |
| 147 | + | |
| 148 | +# --- Link 1: base (L0..7) -> om-core.sp (L8..9) --- | |
| 149 | +"$OLLM" fcachem "$BASE_CK" "$DATA/om-core_aligned.tok" "$DATA/om-core_aligned.msk" 160 "$OUT/om-core.hc" | |
| 150 | +"$OLLM" growpro "$BASE_CK" "$OUT/prefix_l10.ck" 10 400 3500 | |
| 151 | +"$OLLM" trainfc "$OUT/prefix_l10.ck" "$OUT/om-core.hc" 400 50 8 1 | |
| 152 | +"$OLLM" spext "$BASE_CK" "$OUT/prefix_l10.ck" "$OUT/om-core.sp" | |
| 153 | + | |
| 154 | +# --- Link 2: prefix_l10 (L0..9) -> aienux-kernel.sp (L10..11) --- | |
| 155 | +"$OLLM" fcachem "$OUT/prefix_l10.ck" "$DATA/aienux-kernel_aligned.tok" "$DATA/aienux-kernel_aligned.msk" 160 "$OUT/aienux-kernel.hc" | |
| 156 | +"$OLLM" growpro "$OUT/prefix_l10.ck" "$OUT/prefix_l12.ck" 12 400 3500 | |
| 157 | +"$OLLM" trainfc "$OUT/prefix_l12.ck" "$OUT/aienux-kernel.hc" 400 50 10 1 | |
| 158 | +"$OLLM" spext "$OUT/prefix_l10.ck" "$OUT/prefix_l12.ck" "$OUT/aienux-kernel.sp" | |
| 159 | + | |
| 160 | +# --- Link 3A (Strand A): prefix_l12 (L0..11) -> gb20b-mmio.sp (L12..13) --- | |
| 161 | +"$OLLM" fcachem "$OUT/prefix_l12.ck" "$DATA/gb20b-mmio_aligned.tok" "$DATA/gb20b-mmio_aligned.msk" 160 "$OUT/gb20b-mmio.hc" | |
| 162 | +"$OLLM" growpro "$OUT/prefix_l12.ck" "$OUT/gb20b_l14.ck" 14 400 3500 | |
| 163 | +"$OLLM" trainfc "$OUT/gb20b_l14.ck" "$OUT/gb20b-mmio.hc" 400 50 12 1 | |
| 164 | +"$OLLM" spext "$OUT/prefix_l12.ck" "$OUT/gb20b_l14.ck" "$OUT/gb20b-mmio.sp" | |
| 165 | + | |
| 166 | +# --- Link 3B (Strand B, sibling): prefix_l12 (L0..11) -> libos-rpc.sp (L12..13) --- | |
| 167 | +"$OLLM" fcachem "$OUT/prefix_l12.ck" "$DATA/libos-rpc_aligned.tok" "$DATA/libos-rpc_aligned.msk" 160 "$OUT/libos-rpc.hc" | |
| 168 | +"$OLLM" growpro "$OUT/prefix_l12.ck" "$OUT/libos_l14.ck" 14 400 3500 | |
| 169 | +"$OLLM" trainfc "$OUT/libos_l14.ck" "$OUT/libos-rpc.hc" 400 50 12 1 | |
| 170 | +"$OLLM" spext "$OUT/prefix_l12.ck" "$OUT/libos_l14.ck" "$OUT/libos-rpc.sp" | |
| 171 | +``` | |
| 172 | + | |
| 173 | +### C. Compose & Clip Chains (`spchain*`, `spclip` `S=2..4`, and Sticky-End Ligation — `NOT_RUN` on `.om` chains yet) | |
| 174 | + | |
| 175 | +```sh | |
| 176 | +# Single-strand in-memory chain eval & sample (3 links: L0..7 -> L8..9 -> L10..11 -> L12..13) | |
| 177 | +"$OLLM" spchaineval "$BASE_CK" "$DATA/gb20b-mmio_held.tok" 20 "$MERGES" \ | |
| 178 | + 3 "$OUT/om-core.sp" "$OUT/aienux-kernel.sp" "$OUT/gb20b-mmio.sp" | |
| 179 | + | |
| 180 | +"$OLLM" spchainsamp "$BASE_CK" 64 200 "fn gsp_submit " 42 "$MERGES" \ | |
| 181 | + 3 "$OUT/om-core.sp" "$OUT/aienux-kernel.sp" "$OUT/gb20b-mmio.sp" | |
| 182 | + | |
| 183 | +# Double-Helix DNA clip (S=2, MODE=1 entropy-gated): | |
| 184 | +# Shared trunk (base -> om-core -> aienux-kernel) runs ONCE; gb20b-mmio + libos-rpc fuse in parallel: | |
| 185 | +"$OLLM" spclip "$BASE_CK" 1 "fn gsp_rpc_send " 64 200 42 "$MERGES" 2 \ | |
| 186 | + 500 3 "$OUT/om-core.sp" "$OUT/aienux-kernel.sp" "$OUT/gb20b-mmio.sp" \ | |
| 187 | + 500 3 "$OUT/om-core.sp" "$OUT/aienux-kernel.sp" "$OUT/libos-rpc.sp" | |
| 188 | + | |
| 189 | +# Triple-Helix DNA clip (S=3, MODE=1 entropy-gated): | |
| 190 | +# Shared trunk (base -> om-core) runs ONCE; aienux-kernel + gb20b-mmio + libos-rpc fuse in parallel: | |
| 191 | +"$OLLM" spclip "$BASE_CK" 1 "fn aienux_gsp_rpc " 64 200 42 "$MERGES" 3 \ | |
| 192 | + 334 2 "$OUT/om-core.sp" "$OUT/aienux-kernel.sp" \ | |
| 193 | + 333 3 "$OUT/om-core.sp" "$OUT/aienux-kernel.sp" "$OUT/gb20b-mmio.sp" \ | |
| 194 | + 333 3 "$OUT/om-core.sp" "$OUT/aienux-kernel.sp" "$OUT/libos-rpc.sp" | |
| 195 | + | |
| 196 | +# Residual ligation + optional 1-layer sticky-end ligase bridge (L14 -> L15): | |
| 197 | +"$OLLM" spchainapp "$BASE_CK" "$OUT/prefix_l12.ck" 2 "$OUT/om-core.sp" "$OUT/aienux-kernel.sp" | |
| 198 | +"$OLLM" spstack "$OUT/prefix_l12.ck" "$OUT/gb20b-mmio.sp" "$OUT/libos-rpc.sp" 1000 1000 "$OUT/ligated_l16.sp" | |
| 199 | +``` | |
| 200 | + | |
| 201 | +### D. Run the Local `ollm spsamp` + `omc` Feedback Loop on M2 CPU | |
| 202 | + | |
| 203 | +```sh | |
| 204 | +# 20-run omc latency benchmark | |
| 205 | +python3 tools/om_compile_loop.py bench --runs 20 | |
| 206 | + | |
| 207 | +# End-to-end self-test (deterministic refusal->repair + live spsamp->omc retry) | |
| 208 | +python3 tools/om_compile_loop.py selftest | |
| 209 | + | |
| 210 | +# Single-prompt compile-retry loop with any trained pack | |
| 211 | +python3 tools/om_compile_loop.py loop \ | |
| 212 | + --pack "$OUT/om-core.sp" \ | |
| 213 | + --prompt "note return sum of two ulong values\nfn add2 a ulong b ulong to ulong\n" \ | |
| 214 | + --max-retries 3 \ | |
| 215 | + --tokens 64 \ | |
| 216 | + --temp-milli 200 | |
| 217 | +``` | |
| 218 | + | |
| 219 | +### E. GB10 GPU Path (`NOT_RUN` — Frozen-Core GPU Training Not Yet Implemented) | |
| 220 | + | |
| 221 | +> Do **not** execute any GPU command without an explicitly authorized DGX Spark `spark-window`. | |
| 222 | + | |
| 223 | +- **Current state in `native/omegallm/gpu/gg.om`:** `gtrainf CK TRAIN UNTIL EVERY` (4 args) is **full-chip FP32 training** — it updates all layers including `0..7` (so `spext` against the original `BASE_CK` refuses with `rc=62`). | |
| 224 | +- **Frozen-core specialist training is currently CPU-only** (`trainf` / `fcachem` + `trainfc` in `native/omegallm/spec.om`, which runs on both Darwin arm64 and Linux AArch64 host CPUs). | |
| 225 | +- **Next engineering step for on-chip GB10 chain training:** add frozen-layer masking (`FREEZE_LAYERS` skip in backward/Adam, matching CPU `ofzlay`/`ofreeze`) to `gpu/gg.om` and qualify with an exact CPU-vs-GPU gate before training `.om` chain links on GB10. Meanwhile, packs trained via CPU `trainfc` + `spext` can be applied into a checkpoint (`spchainapp`) for on-chip GB10 evaluation/serving (`geval` / `gsample` / `gserve`) once authorized. |
docs/omegallm/SPECIALISTS.md
| new file mode 100644 | ||
| @@ -0,0 +1,101 @@ | ||
| 1 | +# Omega LLM Frozen-Core Specialists & Swappable Packs (`spec.om`) | |
| 2 | + | |
| 3 | +Pure seeded Omega extensions in [native/omegallm/spec.om](../../native/omegallm/spec.om) (with hooks in `model.om`, `adam.om`, and `cli.om`) that let `ollm` learn new specialist capabilities (such as tool calling) **without overwriting or degrading the base model**. | |
| 4 | + | |
| 5 | +## Commands | |
| 6 | + | |
| 7 | +### 1. Frozen-Core Specialist Training (`trainf`, `fcache`, `fcachem`, `trainfc`, `growpro`) | |
| 8 | +```sh | |
| 9 | +ollm growpro INPUT.ck OUTPUT.ck LAYERS TOTAL LRMICRO | |
| 10 | +ollm trainf CK TOKS UNTIL EVERY FREEZE_LAYERS [BATCH] | |
| 11 | +ollm fcache BASE.ck TOKS W OUT.hc | |
| 12 | +ollm fcachem BASE.ck TOKS MASK W OUT.hc | |
| 13 | +ollm trainfc CK CACHE.hc UNTIL EVERY FREEZE_LAYERS [BATCH] | |
| 14 | +``` | |
| 15 | +- **`growpro` (LLaMA-Pro block-expansion growth)** clones the last base layer's trained `(g1, Wq, Wk, Wv, g2, W1)` into each added specialist layer while zeroing only `(Wo, W2)`. Step-0 output remains bit-identical to the base checkpoint (`GP OLD_L NEW_L P`), while starting at the base layer's operating weight scale (`~44×` sharper initial `Q*K` logits than random `oinit` on `omega-v2.ck`). | |
| 16 | +- Freezes embeddings (`W_e`, `W_p`) and layers `0 .. FREEZE_LAYERS - 1` **bit-identically**: | |
| 17 | + - `ofzlay` in `model.om` skips `olayb` for layers `< FREEZE_LAYERS` and skips `obwde` (cutting backward compute proportionally to frozen depth while preserving identical gradients for unfrozen layers). | |
| 18 | + - `ofreeze` in `adam.om` zeroes frozen gradients before global-norm clipping and skips Adam updates for `i < ofreeze`. | |
| 19 | +- **`fcache` / `fcachem` / `trainfc` (format `OLLMFH01`)** precomputes the frozen base's output hidden states `HF[0..T*D)` + targets `y[0..T)` once for `W` windows (binding `T, D, base_L, base_hash` with FNV-1a 64; mismatched base refused `rc=62`) and trains unfrozen specialist layers (`flay .. L-1`) directly from the cache, skipping layers `0..flay-1` in both forward and backward (**bit-identical** to `trainf`, verified on `L2→3` and `L2→4` via `cmp`). `fcachem` applies a 1-byte-per-token completion-only mask (`y | 65536` when masked), skipping `oheadr` and `ohbwd` on prompt/padding tokens. | |
| 20 | +- Optional `[BATCH]` (`1..64`) overrides batch size during host CPU training and restores the checkpoint's original `B` and `G` before saving. | |
| 21 | +- Prints `F STEP FREEZE_LAYERS LOSS_MICRONATS` (`trainf`) or `FC STEP FREEZE_LAYERS LOSS_MICRONATS` (`trainfc`) at each save point. | |
| 22 | + | |
| 23 | +### 2. Swappable Specialist Layer Packs (`spext`, `spapp`, `spsamp`, `speval`, format `OLLMSP01`) | |
| 24 | +```sh | |
| 25 | +ollm spext BASE.ck SPEC.ck PACK.sp | |
| 26 | +ollm spapp BASE.ck PACK.sp OUT.ck | |
| 27 | +ollm spsamp BASE.ck PACK.sp N TEMPMILLI PROMPT SEED [MERGES] | |
| 28 | +ollm speval BASE.ck PACK.sp HELD W [MERGES] | |
| 29 | +``` | |
| 30 | +- **`spext`** hashes `BASE.ck`'s shapes (`V,T,D,H,F,base_L`) and all frozen base weights `ow[0 .. lay0 + base_L * lstr)` with FNV-1a 64, verifies `SPEC.ck` has `L > base_L` and a **bit-identical** frozen base, and writes only the added specialist layers + final norm gain `gf` into `PACK.sp` (for 1 specialist layer on v2 `D=384, F=1536`, ~14.1 MB vs 403 MB full checkpoint). | |
| 31 | +- **`spapp`** verifies `PACK.sp` magic, exact size, base FNV-1a 64 hash, and payload FNV-1a 64 hash, attaches the specialist weights onto `BASE.ck`, and saves `OUT.ck`. | |
| 32 | +- **`spsamp`** / **`speval`** verify and attach `PACK.sp` onto `BASE.ck` directly in memory and run sampling or held-out evaluation with zero temporary checkpoint write. | |
| 33 | + | |
| 34 | +#### `OLLMSP01` Binary Layout (little-endian) | |
| 35 | +| Offset | Size | Field | | |
| 36 | +|---|---|---| | |
| 37 | +| `0` | 8 | Magic `"OLLMSP01"` (`3544421225449933903`) | | |
| 38 | +| `8` | 8 | `base_L` (frozen base layer count) | | |
| 39 | +| `16` | 8 | `spec_L` (total layer count, `> base_L`) | | |
| 40 | +| `24` | 8 | `base_hash` (FNV-1a 64 over `V,T,D,H,F,base_L` + `ow[0 .. fz)`) | | |
| 41 | +| `32` | 8 | `n_spec_params` (`P_spec - fz`) | | |
| 42 | +| `40` | 8 | `pack_hash` (FNV-1a 64 over payload bytes) | | |
| 43 | +| `48` | `8 * n_spec_params` | Raw f64 LE specialist weights `ow[fz .. P_spec)` | | |
| 44 | + | |
| 45 | +#### Refusal Exit Codes | |
| 46 | +- `60`: malformed magic, truncated, or overlong `.sp` file | |
| 47 | +- `61`: `.sp` payload FNV-1a 64 mismatch (corrupted pack) | |
| 48 | +- `62`: base checkpoint mismatch (shape, layer count, or frozen base weights differ from `base_hash`) | |
| 49 | + | |
| 50 | +### 3. Pure-Omega Specialist Fusion & Ensembling (`spmerge`, `spstack`, `spens`) | |
| 51 | +```sh | |
| 52 | +ollm spmerge BASE.ck MODE OUT.sp W1 P1.sp W2 P2.sp [W3 P3.sp [W4 P4.sp]] | |
| 53 | +ollm spstack BASE.ck P1.sp P2.sp S1_MILLI S2_MILLI OUT.sp | |
| 54 | +ollm spens BASE.ck P1.sp P2.sp W1_MILLI PROMPT N TEMPMILLI SEED [MERGES] | |
| 55 | +``` | |
| 56 | +- **`spmerge`** verifies all input packs against `BASE.ck`'s `base_hash` (`rc=62` on mismatch) and merges 2–4 same-depth packs into a fresh `OLLMSP01` pack (`W_k` in milli-units): | |
| 57 | + - `MODE=0`: Weighted Linear Soup (`(1000, 0)` reproduces `P1` bit-for-bit). | |
| 58 | + - `MODE=1`: Task-Arithmetic Sum over exact `grow` init `W_0`. | |
| 59 | + - `MODE=2`: TIES Trimmed Sign-Consensus (`0.5×RMS` delta trim + sign election + agreeing weighted mean). | |
| 60 | +- **`spstack`** vertically stacks `P1`'s layers followed by `P2`'s layers (`L_out <= 16`) with per-pack `(Wo, W2)` residual scaling (`S_MILLI / 1000.0`) and averaged final norm gain `gf`. | |
| 61 | +- **`spens`** runs frozen base layers `0..base_L-1` once per step and evaluates `P1` and `P2` in parallel over the shared `H_base`, fusing `w1 * log_softmax(z1) + (1 - w1) * log_softmax(z2)` (Product-of-Experts, works across different initialization basins such as `grow` ⊕ `growpro`). | |
| 62 | + | |
| 63 | +### 4. Multi-Link Merkle Specialist Chains & DNA-Style Multi-Helix Clipping (`spchainapp`, `spchaineval`, `spchainsamp`, `spclip`) | |
| 64 | +```sh | |
| 65 | +ollm spchainapp BASE.ck OUT.ck K P1.sp ... PK.sp | |
| 66 | +ollm spchaineval BASE.ck HELD W MERGES K P1.sp ... PK.sp | |
| 67 | +ollm spchainsamp BASE.ck N TEMPMILLI PROMPT SEED MERGES K P1.sp ... PK.sp | |
| 68 | +ollm spclip BASE.ck MODE PROMPT N TEMPMILLI SEED MERGES S W1 K1 A1..AK1 W2 K2 B1..BK2 [W3 K3 C1..CK3 [W4 K4 D1..DK4]] | |
| 69 | +``` | |
| 70 | +- **Multi-link Merkle chains (`spchainapp`, `spchaineval`, `spchainsamp`)** load `BASE.ck` and sequentially verify and attach `K` (`1..8`, total `L <= 16`) `OLLMSP01` packs in memory: | |
| 71 | + - Link `i` verifies `P_i.base_L == cur_L`, `P_i.base_hash == FNV1a64(shapes, ow[0..cur_fz))`, exact `n_spec_params`, and `P_i.pack_hash` (`rc=60/61/62` on refusal), then updates `ow[cur_fz .. new_P)` and `cur_L = P_i.spec_L` so Link `i+1` cryptographically pins the exact chain `0..i` beneath it. | |
| 72 | + - Pass `-` for `MERGES` when `V <= 256` (loaded via `obload` when `V > 256`). | |
| 73 | + - `spchainapp` prints `SPCHAPP BASE_L FINAL_L K P` and saves `OUT.ck`; `spchaineval` prints `E step W loss_micro bpb_micro` matching `eval`; `spchainsamp` streams decoded tokens directly from memory. | |
| 74 | +- **DNA-style multi-helix chain clipping (`spclip`, `S = 2..4` strands, e.g. double, triple, or quad helix):** | |
| 75 | + - Detects the longest common prefix of identical verified packs across all `S` strands (verifying every strand's pack headers and payload FNV-1a 64 hashes) and runs the shared trunk layers `0..trunk_L-1` **once per token** into cached `H_trunk`. | |
| 76 | + - Evaluates each strand's remaining layers (`trunk_L .. L_s - 1`, supporting asymmetric strand depths up to `L <= 16`) over `H_trunk`, computes `log_softmax` and Shannon entropy `H_s = -sum P_s log P_s`, and fuses all `S` strands in log-probability space: | |
| 77 | + - `MODE=0`: Normalized prior Product-of-Experts (`alpha_s = w_s / sum(w)`). | |
| 78 | + - `MODE=1`: Entropy-gated multi-helix (`u_s = w_s / (H_s + 0.001)`, `alpha_s = u_s / sum(u)`, fused `sum_s alpha_s * log P_s`) so whichever specialized strand is more confident on the current token dominates. | |
| 79 | + | |
| 80 | +### 5. Bank-B KV Cache (`okvkv` in `model.om`) & Inference-Time Experiments (`ttteval`, `tttsamp`, `dolaeval`) | |
| 81 | +- **`okvkv` (`model.om`)** restores/saves only the `oak`/`oau` K/V slices in `oab` for bank-B layers (`l >= LAA`) without clobbering `oahin`, enabling exact KV-cached decode for `L = 8..16` (verified 0 mismatched logits via `ollm kvcmp` on `L=8` and `L=10`). | |
| 82 | +- `ollm ttteval CK HELD W PREFIX STEPS LRMICRO LAYER_FROM` — strictly-causal test-time fast-weight adaptation on `[0..PREFIX)`, scored on `[PREFIX..T)`, restoring base weights after every window. | |
| 83 | +- `ollm tttsamp CK SEED N TEMPMILLI PROMPT MERGES STEPS LRMICRO LAYER_FROM` — ephemeral test-time adaptation on `PROMPT` before sampling, then restoring base weights. | |
| 84 | +- `ollm dolaeval CK HELD W EARLY_LAYER BETA_MILLI` — layer-contrastive decoding evaluation (`log P_final - beta * log P_early`). | |
| 85 | + | |
| 86 | +## Measured Host Results (Apple Silicon M2, Darwin 25.6.0 arm64, f64 CPU) | |
| 87 | +- **Cross-target build:** compiles cleanly to Darwin ARM64 Mach-O (`mio.om`, 247,840 B), Linux AArch64 static ELF (`lio.om`, 405,436 B), and `gb10` (`lio.om` + `gpu/*`, 706,536 B) with 0 errors. Linux/x86/UEFI execution and GB10 GPU execution remain `NOT_RUN`. | |
| 88 | +- **Multi-link Merkle chains & multi-helix `spclip` (`V=256, T=16, D=32, H=2, F=64, L=2→3→4`):** | |
| 89 | + - Built 2-link chains (`base L=2` → `P1.sp L=2→3` → `P2_{a,b,c}.sp L=3→4` pinned to `base + P1`). | |
| 90 | + - `spchainapp` (`SPCHAPP 2 4 2 41760`) and in-memory `spchaineval` matched the trained 4-layer checkpoint `eval` **bit-identically** (`E 5 4 5492684 7924269`); greedy (`TEMPMILLI=0`) and stochastic (`TEMPMILLI=800`) `spchainsamp` matched `sample` bit-for-bit via `cmp`. | |
| 91 | + - Negative controls caught with exact refusal codes: swapped link order `P2 P1` (`rc=62`), skipped `P1` (`rc=62`), 1-bit flip in `P2` payload (`rc=61`), 1-bit flip in shared trunk `P1` on strand 2 in `spclip` (`rc=61`), truncated pack (`rc=60`), and invalid `S`/`MODE` (`rc=2`). | |
| 92 | + - `spclip` identity & multi-helix checks: double-helix `S=2 (A,A)`, triple-helix `S=3 (A,A,A)`, quad-helix `S=4 (A,A,A,A)`, and zero-weight isolation `(A@1000, B@0)` all matched single-strand `spchainsamp` **bit-identically** in both `MODE=0` and `MODE=1`. Distinct `S=2 (A,B)`, `S=3 (A,B,C)`, `S=4 (A,B,C,trunk)`, asymmetric-depth `(L=3, L=4)`, and direct-base fork (`common_links=0`) all executed cleanly (`rc=0`, finite 32-byte outputs). | |
| 93 | +- **Frozen-core preservation (2→3 layer host test):** `trainf` kept 100% of embeddings + layers `0..1` bit-identical while updating layer 2 (`F 5 2 5486997`, identical before and after the `ofzlay` backward-skip optimization). Negative control: standard `train` mutated layers `0..1`. | |
| 94 | +- **`spext`/`spapp` round-trip & negative controls:** rebuilt checkpoint matched trained `eval` bit-for-bit (`E 5 5 5445549 7856267` vs `E 0 5 5445549 7856267`). Negative controls caught: wrong base (`rc=62`), 1-bit flipped payload (`rc=61`), truncated pack (`rc=60`), non-frozen checkpoint passed to `spext` (`rc=62`). | |
| 95 | +- **v2 (`omega-v2.ck`, 15.8M → 17.6M, 8→9 layers) tool-call specialist run (25 steps, `FREEZE_LAYERS=8`, `B=2`, `lr=0.005`):** | |
| 96 | + - Held-out tool-call loss fell from `7.740902` (`E 0 3 7740902 7100033`) to `5.323565` nats/token (`E 25 3 5323565 4882828`) during initial warmup steps (`F 5..25: 7.771 -> 7.509 -> 6.983 -> 6.213 -> 5.357`). | |
| 97 | + - `spext` verified all 8 base layers + embeddings bit-identical to `omega-v2.ck` and extracted a `14 MB` (`1,770,624` params) `OLLMSP01` pack vs `403 MB` full checkpoint; `spapp` re-applied it onto untouched `omega-v2.ck` with bit-identical held-out eval (`E 60000 3 5323565 4882828`). | |
| 98 | +- **v2 (`omega-v2.ck`, 15.8M → 17.6M, 8→9 layers) longer `growpro` + `fcachem` + `trainfc` tool-call run (150 steps, `W=160`, `FREEZE_LAYERS=8`, `B=1`, `lr=0.0035`):** | |
| 99 | + - Full receipt in [evidence/OMEGALLM/specialists/tool-call-growpro-l9-150-20261119/README.md](../../evidence/OMEGALLM/specialists/tool-call-growpro-l9-150-20261119/README.md): step-0 `growpro` matched base held-out eval bit-identically (`7.183552 nats/tok`, `W=9`); masked train loss fell `5.512 → 0.439 nats/tok`, unmasked held-out NLL reached `4.528072 nats/tok` (`-36.97%`) at step 50 and `4.954553 nats/tok` at step 150; `spext` (`14.17 MB` vs `422.49 MB` checkpoint, `29.8×` smaller), `speval`/`spapp` round-trip, independent `126.66 MB` frozen-base byte check, and negative controls (`rc=60/61/62`) all passed. | |
| 100 | +- **TTT-Omega (`ttteval`, `W=5`, `PREFIX=128`):** `steps=0` control `Δ=0`; in-distribution TinyStories plain SGD slightly overfit prefix (`+7` to `+3945` µnats); on an out-of-distribution tool prompt, `tttsamp` adapted format without altering base weights. | |
| 101 | +- **DoLa (`dolaeval`, `W=5`):** `beta=0` control `Δ=0`; `beta=0.05..0.10` worsened calibrated NLL (`+2755` to `+12260` µnats) on the 8-layer model. |
docs/physics/gb10-training.md
| new file mode 100644 | ||
| @@ -0,0 +1,382 @@ | ||
| 1 | +# Training on one GB10: what fits on the math cores, and how fast it can go (L279) | |
| 2 | + | |
| 3 | +Drake's question (2026-10-20): can this Spark train our own language model if we cut the software out of the way, | |
| 4 | +and can the training stay on the "math cores" (the GPU's compute units and the fast storage inside them) instead of | |
| 5 | +streaming everything through the 128 GB main memory every step? | |
| 6 | + | |
| 7 | +Short answer, details below: | |
| 8 | + | |
| 9 | +- **What fits inside the chip is small.** All the fast storage inside the GPU adds up to about 42 MiB (registers | |
| 10 | + 12 MiB, per-core shared memory and L1 6 MiB, L2 cache 24 MiB). The part our code can actually address (registers and shared memory, not the caches) is | |
| 11 | + 12.75 MiB today and about 16.6 MiB once our launcher allows the full shared memory. A model whose weights, | |
| 12 | + gradients and optimizer state all live there has about **1 to 4 million parameters**, depending on how many bytes | |
| 13 | + each parameter costs. That is a toy model: useful for experiments and very small specialist tasks, far from a | |
| 14 | + general chat model. | |
| 15 | +- **For training, the memory pipe is not the main wall.** Unlike answering questions one word at a time (where | |
| 16 | + the weights are read once per word and memory speed decides everything), training processes thousands of words | |
| 17 | + per pass over the weights. Our measured numbers say a normal training step stops being limited by memory speed | |
| 18 | + once it processes about **3,300 words per step**, and normal training uses far more than that. The wall for | |
| 19 | + training is how busy we keep the tensor cores. | |
| 20 | +- **How big, how long, on this one box:** at a realistic 50% of the measured 16-bit tensor rate, a 125-million | |
| 21 | + parameter model trained the compute-optimal way takes about **9 hours**, 350 million about **2.9 days**, | |
| 22 | + 1 billion about **23 days**, 3 billion about **210 days**. At the speed of our best tensor kernel today (30.6 | |
| 23 | + trillion operations per second, about a quarter of the chip's 16-bit rate) each figure is roughly twice as long. | |
| 24 | + | |
| 25 | +Every number below says whether it is **spec** (the maker's or a reviewer's figure, cited), **measured** (our own | |
| 26 | +code on this GB10, with the receipt path), or **computed** (arithmetic on measured numbers, with an aien-calc | |
| 27 | +receipt id `calc:xxxxxxxx`). | |
| 28 | + | |
| 29 | +Words used here: | |
| 30 | +- **SM (streaming multiprocessor):** one of the GPU's compute units. Each has its own tensor cores (matrix-multiply | |
| 31 | + units), registers and shared memory. | |
| 32 | +- **Registers:** the fastest storage, inside each SM, private to each thread. | |
| 33 | +- **Shared memory / L1:** a 128 KB scratchpad and cache inside each SM, shared by the threads running there. | |
| 34 | +- **L2 cache:** a 24 MB cache shared by all SMs, still on the chip. | |
| 35 | +- **Main memory (DRAM):** the 128 GB LPDDR5x the CPU and GPU share. Off the GPU's compute dies, much slower. | |
| 36 | +- **Parameter:** one number (weight) in the model. A "125M model" has 125 million of them. | |
| 37 | +- **Gradient:** for each parameter, the direction and size of the change the last batch asks for. | |
| 38 | +- **Optimizer state:** extra numbers per parameter the update rule keeps between steps (Adam keeps two). | |
| 39 | +- **Token:** a word or piece of a word; models read and write tokens. | |
| 40 | + | |
| 41 | +## 1. What is on the chip, and what fits there (Q1) | |
| 42 | + | |
| 43 | +### 1.1 Inventory | |
| 44 | + | |
| 45 | +| Item | Value | Kind and source | | |
| 46 | +|---|---|---| | |
| 47 | +| CUDA cores (FP32 lanes) | 6,144 | measured through our path: RM `NV2080_CTRL_CMD_GR_GET_INFO` index `GPU_CORE_COUNT` = 6144, physics `evidence/m19r_gate4_forge_hwid_evidence.json` (physics@e95e3ed, code `forge/forge_descriptor.c`); spec agrees: "CUDA Cores: 6,144" [1] | | |
| 48 | +| Max resident warps per SM | 48 (1,536 threads) | measured through our path: same receipt, `max_warps_per_sm` 48; spec agrees: "Maximum number of resident warps per SM: 48" [2] | | |
| 49 | +| SMs per TPC | 2 | measured through our path: same receipt, `sm_per_tpc` 2 | | |
| 50 | +| SM count | **48** | measured through our path: `evidence/physics-gb10/gr_info.txt` (tool `streams/physics-gb10/gr_info.c`, read-only RM GR_GET_INFO, 2026-10-20T18:09Z): LITTER_NUM_GPCS 4 x LITTER_NUM_TPC_PER_GPC 6 x LITTER_NUM_SM_PER_TPC 2 = 48, and GPU_CORE_COUNT 6144 = 48 x 128. The "LITTER" values are the chip layout; the enabled count is confirmed by the core count. Spec agrees: "The iGPU features 48 Streaming Multiprocessors running at up to 2.55 GHz" [3]. The driver returns 0 (not reported) for SM_REG_BANK_COUNT, so register-file size stays spec | | |
| 51 | +| Registers per SM | 64 K x 32-bit = 256 KiB | spec: "Number of 32-bit registers per SM: 64 K" for compute capability 12.x [2] | | |
| 52 | +| Shared memory per SM | up to 100 KB (99 KB per block) | spec [2]. **Our launcher today caps a block at 16 KiB** (omega `src/omega_blackwell_qmd.h:41`, issue #560, noted by L272), so Omega kernels cannot yet use the full 100 KB | | |
| 53 | +| L1 + shared memory per SM | 128 KB | spec: "Unified Data Cache Size (KB): 128" [2]; "has 128 KB of L1/Shared Memory" [3] | | |
| 54 | +| L2 cache | 24 MB | outside report, not an NVIDIA page: "GB10’s 24 MB L2" [3]; ServeTheHome reports the same, quoted in omega `docs/MACHINE_CEILING.md` (doc/machine-ceiling@3c8ce239). NVIDIA's hardware page [1] states no L2 size | | |
| 55 | +| Main memory | 128 GB LPDDR5x, 273 GB/s | spec: "128 GB LPDDR5x unified system memory, 256-bit interface, 4266 MHz, 273 GB/s bandwidth" [1] | | |
| 56 | +| Main memory read, GPU | **245.1 GB/s** | measured (L151): omega doc/machine-ceiling@3c8ce239, `evidence/MACHINE-CEILING-20261020/raw/gpu-tc-peak.txt`, window 20261020T030919Z-9d9d5a | | |
| 57 | +| Main memory write, GPU | **175.1 GB/s** | measured (L151): same window, `raw/gpu-ceiling.txt`. Writes matter for training (gradients, optimizer state) | | |
| 58 | +| L2 read, all SMs | **5,110.8 GB/s** | measured (L151): `raw/gpu-pf-mem.txt` | | |
| 59 | +| L2 write | "just under 1 TB/s" (half rate) | spec/outside measurement [3]; not measured by us: UNKNOWN row U1 | | |
| 60 | +| Shared memory read, all SMs | **14.38 TB/s** (16 KB blocks) | measured (L151): `raw/gpu-ceiling.txt` | | |
| 61 | +| BF16 tensor rate (HMMA.16816.F32.BF16) | **118.81 TFLOPS** | measured (L151): `raw/gpu-tc-peak.txt`. NVIDIA publishes no dense BF16 figure | | |
| 62 | +| FP8 tensor rate (QMMA.16832.F32.E4M3) | **237.52 TFLOPS** | measured (L151): `raw/gpu-qmma.txt`. NVIDIA publishes "up to 1 PFLOP ... at FP4 precision with sparsity" [1], no dense FP8 figure | | |
| 63 | +| Best Omega tensor GEMM on a real shape | **30.6 TFLOPS** (FP8, 4096 x 5120 x 6144, loaded box) | measured: omega-mv `cascade/prefill-kernels` (commit 61274684), `evidence/qgemm-q38-group4-1f37f9f6-20261019T1731Z/raw.log`: "QGEMM-inplace group 4 q38o tokens 4096 M 4096 n 5120 k 6144 tiles 64: median 8.433 ms (min 8.121), 30.6 TFLOPS". A forward GEMM only; Omega has no backward GEMM yet (section 3.2). That is 0.129 of the FP8 rate (calc:fb7f5693, from MACHINE_CEILING) | | |
| 64 | + | |
| 65 | +These ceilings were measured by L151 (cc-machine-ceiling) in one quiet window with our own kernels. L272 | |
| 66 | +(cc-speed-onchip) is re-measuring the on-chip walls for decode in `docs/speed/GB10_CEILINGS.md` on omega | |
| 67 | +feat/decode-onchip-megakernel; it had not pushed when this was written (checked 2026-10-20 ~18Z). This stream ran | |
| 68 | +no bandwidth or tensor-rate benchmark of its own, by rule. | |
| 69 | + | |
| 70 | +### 1.2 The on-chip total | |
| 71 | + | |
| 72 | +| Storage | Per SM | x 48 SMs | Kind | | |
| 73 | +|---|---|---|---| | |
| 74 | +| Registers | 256 KiB | 12,582,912 B = 12 MiB (calc:aac73c4f) | spec per SM [2], x 48 [3] | | |
| 75 | +| L1 + shared memory | 128 KiB | 6,291,456 B = 6 MiB (calc:9e88360f) | spec per SM [2][3] | | |
| 76 | +| Inside the SMs | | 18,874,368 B = 18 MiB (calc:b90d90eb) | computed | | |
| 77 | +| L2 (shared by all SMs) | | 25,165,824 B = 24 MiB | outside report [3] (taken as MiB; if the 24 MB is decimal the total drops by 1.2 MB) | | |
| 78 | +| **Everything on the GPU die** | | **44,040,192 B = 42 MiB** (calc:8bc2b7c3) | computed | | |
| 79 | + | |
| 80 | +Main memory holds 128 GB. The chip holds about 1/3000 of that. | |
| 81 | + | |
| 82 | +This total is a physical upper bound, and two of its parts are caches: our code cannot place a number in L1 or L2 | |
| 83 | +and be sure it stays there (L2 is also shared with every other program on the box). What a kernel can address on | |
| 84 | +purpose is registers plus shared memory: | |
| 85 | + | |
| 86 | +| On-chip storage a kernel can hold model numbers in | Bytes | Kind | | |
| 87 | +|---|---|---| | |
| 88 | +| Physical upper bound: registers + L1/shared + L2 | 44,040,192 (42 MiB, calc:8bc2b7c3) | computed from spec | | |
| 89 | +| Addressable once the launcher allows the chip's 99 KB of shared memory per block (issue #560): registers + 48 x 99 KiB | 17,448,960 (about 16.6 MiB, calc:d1b858fa) | computed from spec [2] | | |
| 90 | +| **Addressable today** through our launcher: registers + 48 x 16 KiB (`src/omega_blackwell_qmd.h:41`) | **13,369,344 (12.75 MiB, calc:5c1c408c)** | computed | | |
| 91 | + | |
| 92 | +A real kernel also needs registers for its own working values, so even the addressable figure is an upper bound; | |
| 93 | +the Q3 probe uses 32 of its 68 registers per thread for weights (section 3). | |
| 94 | + | |
| 95 | +### 1.3 The largest model that fits | |
| 96 | + | |
| 97 | +Bytes per parameter for each training scheme: | |
| 98 | + | |
| 99 | +| Scheme | What is kept per parameter | Bytes | | |
| 100 | +|---|---|---| | |
| 101 | +| A. Standard mixed precision with Adam | BF16 weight 2 + BF16 gradient 2 + FP32 master weight 4 + FP32 Adam first moment 4 + FP32 second moment 4 | 16 | | |
| 102 | +| B. BF16 with 8-bit optimizer state | BF16 weight 2 + BF16 gradient 2 + two 8-bit Adam moments 2. Assumption of this document: no FP32 master copy (common 8-bit optimizer setups keep one, which makes it 10 B) | 6 | | |
| 103 | +| C. Muon-style (momentum only, no second moment) | BF16 weight 2 + BF16 gradient 2 + BF16 momentum 2. Assumption of this document: applied to every parameter (in practice Muon covers the matrix weights and the rest stays on Adam) | 6 | | |
| 104 | +| D. FP8 throughout | FP8 weight 1 + FP8 gradient 1 + two 8-bit moments 2 | 4 | | |
| 105 | +| Weights only, BF16 | gradients and state streamed from main memory | 2 | | |
| 106 | +| Weights only, FP8 | same | 1 | | |
| 107 | + | |
| 108 | +| Scheme | Physical bound, 42 MiB (incl. L1 and L2 caches) | Inside the SMs, 18 MiB (regs + all of L1/shared) | Addressable after #560, 16.6 MiB | **Addressable today, 12.75 MiB** | | |
| 109 | +|---|---|---|---|---| | |
| 110 | +| A (16 B) | 2,752,512 (calc:c630f624) | 1,179,648 (calc:c856b8ed) | 1,090,560 (calc:a9fca458) | **835,584** (calc:6140ea8a) | | |
| 111 | +| B or C (6 B) | 7,340,032 (calc:f4ec138e) | 3,145,728 (calc:a62edc13) | 2,908,160 (calc:0de0a5e2) | **2,228,224** (calc:8f899b5a) | | |
| 112 | +| D (4 B) | 11,010,048 (calc:9108596c) | 4,718,592 (calc:93fb98bb) | 4,362,240 (calc:ccfe1950) | **3,342,336** (calc:6d3d8afa) | | |
| 113 | +| Weights only, BF16 | 22,020,096 (calc:45c96809) | 9,437,184 (calc:45b867e6) | 8,724,480 (calc:99d76e23) | **6,684,672** (calc:f0dfa1da) | | |
| 114 | +| Weights only, FP8 | 44,040,192 | 18,874,368 | 17,448,960 | **13,369,344** | | |
| 115 | + | |
| 116 | +None of these leave room for the activations (the intermediate values each layer computes in the forward pass and | |
| 117 | +the backward pass needs again). Worked example with the addressable-after-#560 figure: a 4-layer model of width 96 | |
| 118 | +has 12 x 4 x 96² = 442,368 parameters (calc:da55f631), 7,077,888 bytes at scheme A. Stored activations are 34 x 96 | |
| 119 | +bytes per token per layer [6], 13,056 bytes per token for 4 layers, so the rest of the 17,448,960 bytes holds | |
| 120 | +**794 tokens** of activations at a time (calc:68a451c1). That is the largest micro-batch, and it makes every matrix | |
| 121 | +multiply 794 x 96 x 96: small. How much of the tensor rate such small multiplies reach is not measured (UNKNOWN U3). | |
| 122 | + | |
| 123 | +**The honest size of a "math cores only" model on this chip is about 1 to 4 million parameters** with full | |
| 124 | +training state in storage our code can address (0.8 to 3.3 million today, 1.1 to 4.4 million after #560), and up | |
| 125 | +to about 7 to 13 million if only the weights stay on chip and the gradients and optimizer state stream through main | |
| 126 | +memory. Counting the caches as if they were storage stretches that to 11 million (full state) and 44 million | |
| 127 | +(FP8 weights only), but nothing guarantees a number stays in a cache. | |
| 128 | + | |
| 129 | +What a model that small is good for: narrow tasks with a small vocabulary of behaviour (a classifier, a router that | |
| 130 | +picks which bigger model to call, a draft model that guesses the next few words for a big model to check, a | |
| 131 | +controller for one device), research on training methods where many quick runs matter more than quality, and | |
| 132 | +teaching. It will not hold general knowledge or carry a conversation. The L278 efficiency stream covers the | |
| 133 | +literature on tiny models; it had not pushed when this was written (origin/study/efficiency was at the skeleton | |
| 134 | +commit ed8b6ea, checked 2026-10-20 ~18Z). | |
| 135 | + | |
| 136 | +### 1.4 Open items for Q1 | |
| 137 | + | |
| 138 | +- U0 (closed): SM count read through our own RM query, 48 (`evidence/physics-gb10/gr_info.txt`). Register-file size per SM | |
| 139 | + is not reported by the driver (index returns 0); it stays spec [2]. | |
| 140 | +- U1: L2 write bandwidth on our own path (only an outside figure exists [3]). Owned by L272's ceilings work, not | |
| 141 | + this stream. | |
| 142 | + | |
| 143 | +## 2. The training roofline on this chip (Q2) | |
| 144 | + | |
| 145 | +### 2.1 The ridge point | |
| 146 | + | |
| 147 | +The **ridge point** is the number of arithmetic operations a kernel must do per byte it moves to or from main memory | |
| 148 | +before the math, not the memory, sets its speed. Below it the tensor cores wait for data; above it they are the | |
| 149 | +limit. | |
| 150 | + | |
| 151 | +| | Rate | Ridge (FLOPs per byte read) | | |
| 152 | +|---|---|---| | |
| 153 | +| BF16 tensor | 118.81 TFLOPS measured | **484.7** (calc:ac4723cb) | | |
| 154 | +| FP8 tensor | 237.52 TFLOPS measured | **969.1** (calc:05ef5299) | | |
| 155 | + | |
| 156 | +Both against the measured 245.1 GB/s read rate. Writes are slower (175.1 GB/s measured), which the step model below | |
| 157 | +accounts for separately. | |
| 158 | + | |
| 159 | +### 2.2 Work and bytes in one training step | |
| 160 | + | |
| 161 | +Work: the standard count is **6 x N operations per token** for a model with N parameters: 2N for the forward pass | |
| 162 | +(one multiply and one add per weight) and about twice that for the backward pass. Kaplan et al.: "Accounting for | |
| 163 | +the backwards pass (approximately twice the compute as the forwards pass), we then define the estimated | |
| 164 | +non-embedding compute as Câ6N floating point operators per training token." [4] So a step that processes B tokens | |
| 165 | +does 6NB operations. This leaves out attention's own work, which grows with context length; at short contexts it is | |
| 166 | +small next to 6N. | |
| 167 | + | |
| 168 | +Bytes, scheme A (16 B per parameter), three designs: | |
| 169 | + | |
| 170 | +**(a) The normal way.** Each step: forward reads the BF16 weights (2N), backward reads them again (2N) and writes | |
| 171 | +BF16 gradients (2N), the optimizer reads the FP32 master weights, both moments and the gradient (14N) and writes the | |
| 172 | +master weights, both moments and the new BF16 weights (14N). That is 18N bytes read and 16N bytes written per step, | |
| 173 | +whatever B is. Time on memory: N x (18 / 245.1 GB/s + 16 / 175.1 GB/s). This treats reads and writes as taking turns, which is a | |
| 174 | +bound; the chip can overlap some of them. Time on math: 6NB / 118.81 TFLOPS. | |
| 175 | +The weight-and-state traffic stops being the limit when | |
| 176 | + | |
| 177 | + **B ⥠3,264 tokens per step** (calc:1bcfc00a; N cancels out). | |
| 178 | + | |
| 179 | +Large training runs carry far more than that per step (Chinchilla 70B used "1.5M â 3M" tokens per batch [5]), so | |
| 180 | +in design (a) the weight and optimizer traffic is already a small share of the step. The bytes that grow with B are | |
| 181 | +the **activations**: Korthikanti et al. count the stored activations of one transformer layer as "sbh(34 + 5as/h)" | |
| 182 | +bytes (s sequence length, b batch, h hidden width, a attention heads) [6]. With attention done the fused way | |
| 183 | +(scores never written to memory) the per-token, per-layer figure is 34h bytes, written in the forward pass and read | |
| 184 | +back in the backward pass. With N â 12 L h² for L layers, work per token is 72 L h²; memory time per token is | |
| 185 | +34 L h (1/245.1 GB/s + 1/175.1 GB/s). Activations stop being the limit when | |
| 186 | + | |
| 187 | + **hidden width h ⥠549** (calc:743f74c8). | |
| 188 | + | |
| 189 | +For scale, a 12-layer model of exactly that width has 12 x 12 x 549² = 43,401,744 parameters (calc:8becebee); the | |
| 190 | +wider models in the table in 2.4 sit above the threshold. So, at the counted byte level, **a dense transformer | |
| 191 | +training step on the GB10 is compute-bound, not memory-bound**, for every model size in the table in 2.4. The | |
| 192 | +caveat is that 34h bytes counts only what is stored for the backward pass; a chain of separate kernels (matrix | |
| 193 | +multiply, then normalise, then activation function, then add) also writes and rereads every intermediate in | |
| 194 | +between. How many times over that multiplies the 34h figure in our own kernels is not measured: UNKNOWN row U2. | |
| 195 | +Every factor k of extra traffic raises the width threshold to 549k. | |
| 196 | + | |
| 197 | +**(b) Layer-resident.** A persistent kernel (one that stays running on the GPU instead of being launched again per | |
| 198 | +operation) holds one layer's weights on chip for the whole micro-batch, so weights are read once per step per | |
| 199 | +layer and the gradient for that layer is accumulated on chip; only activations stream. Bytes per step become 32N (the second | |
| 200 | +weight read of (a) is gone: forward and backward use the copy already on chip) plus the activation traffic. The | |
| 201 | +crossover batch is the same as (a), because (a) already reads weights only once per step; residency helps when | |
| 202 | +a step is split into micro-batches that would otherwise reread weights and re-add gradients each time. The limit is | |
| 203 | +the layer size: a whole layer (12h² parameters) fits in 42 MiB as BF16 weights only up to **h = 1,354** | |
| 204 | +(calc:2b49881b), and with its full scheme A state up to **h = 478** (calc:13ecaa54). The real gain of (b) is fusion: | |
| 205 | +keeping the intermediates between the matrix multiplies on chip removes the unmeasured factor k above. | |
| 206 | + | |
| 207 | +**(c) Fully on chip.** Weights, gradients and optimizer state never leave the chip; only the token batch streams in | |
| 208 | +(4 bytes per token id). Work per byte is 6N / 4 = 1.5N, which passes the BF16 ridge for any model above | |
| 209 | +**323 parameters** (calc:000271d5). It is always compute-bound. Its limit is size: 2,752,512 parameters at scheme A | |
| 210 | +(section 1.3). At the measured BF16 rate that model would process up to **7.19 million tokens per second** | |
| 211 | +(calc:5513f69c) at 100% tensor use. That figure is not reachable: the full 42 MiB is taken by the state, leaving no | |
| 212 | +room for activations, and the small matrices of a model this size are unlikely to keep the tensor cores busy (see | |
| 213 | +the worked example in 1.3 and U3). | |
| 214 | + | |
| 215 | +### 2.3 Time per token and tokens per second | |
| 216 | + | |
| 217 | +Because designs (a) and (b) are compute-bound for real model widths, their speed is set by the tensor rate and how | |
| 218 | +much of it the kernels use (called **utilization**: delivered operations divided by the chip's peak). Time per token | |
| 219 | += 6N / (utilization x rate). | |
| 220 | + | |
| 221 | +| Model | Design | Tokens per second at 100% BF16 | at 50% BF16 | | |
| 222 | +|---|---|---|---| | |
| 223 | +| 2.75M, scheme A | (c) fully on chip | 7,194,000 (calc:5513f69c) | about 3.6 million | | |
| 224 | +| 125M | (a) or (b) | 158,410 (calc:234a6d6e) | 79,207 (calc:4856abbc) | | |
| 225 | + | |
| 226 | +Utilization assumptions, stated: **today** = our best measured tensor GEMM, 30.6 TFLOPS (FP8, real shape, loaded | |
| 227 | +box; section 1.1); **target BF16** = 50% of the measured 118.81 TFLOPS, about the level large training runs report | |
| 228 | +(PaLM: "very high efficiency of 46.2% in model FLOPs utilization (observed throughput relative to theoretical max | |
| 229 | +throughput)" [7]); **target FP8** = 50% of the measured 237.52 TFLOPS, which assumes FP8 training works at our | |
| 230 | +quality bar (not shown here). | |
| 231 | + | |
| 232 | +### 2.4 Days to train compute-optimal models on one GB10 | |
| 233 | + | |
| 234 | +**Compute-optimal** (the "Chinchilla" rule): for a given compute budget, model size and training tokens should grow | |
| 235 | +together, "for compute-optimal training, the model size and the number of training tokens should be scaled | |
| 236 | +equally" [5]. Their Table 3 gives 20.2 billion tokens for a 1 billion parameter model [5], about 20 tokens per | |
| 237 | +parameter. With D = 20N tokens, total work = 6N x 20N = 120N² operations. | |
| 238 | + | |
| 239 | +| Model | Tokens (20N) | Total work | Tokens per second, BF16 at 50% | Days, today (30.6 TFLOPS) | Days, BF16 at 50% (59.4 TFLOPS) | Days, FP8 at 50% (118.8 TFLOPS) | | |
| 240 | +|---|---|---|---|---|---|---| | |
| 241 | +| 50M | 1 billion | 3.0e17 | 198,000 (calc:da5b68c9) | 0.11 (calc:e8e694cf) | 0.058 (calc:b21dcb17) | 0.029 (calc:246c83a8) | | |
| 242 | +| 125M | 2.5 billion | 1.9e18 | 79,207 (calc:4856abbc) | 0.71 (calc:6a08b864) | 0.37 (calc:fa2eb778) | 0.18 (calc:5ed28589) | | |
| 243 | +| 350M | 7 billion | 1.5e19 | 28,290 (calc:c7f54c42) | 5.6 (calc:32211650) | 2.9 (calc:a6986476) | 1.4 (calc:837a2552) | | |
| 244 | +| 1B | 20 billion | 1.2e20 | 9,901 (calc:3643de66) | 45 (calc:96fd4990) | 23 (calc:d76d8642) | 12 (calc:53791ae6) | | |
| 245 | +| 3B | 60 billion | 1.1e21 | 3,300 (calc:6d9c881f) | 409 (calc:31e78732) | 210 (calc:d9255171) | 105 (calc:b9679e62) | | |
| 246 | + | |
| 247 | +Read it as: **this one Spark can train a compute-optimal model of a few hundred million parameters in days, a | |
| 248 | +1 billion parameter model in two to six weeks, and a 3 billion parameter model only in months.** These are | |
| 249 | +compute-bound numbers; they assume the data pipeline and memory keep up (2.2 says the memory does at the counted | |
| 250 | +level), and they leave out attention's context-length work, evaluation and restarts. | |
| 251 | + | |
| 252 | +Memory capacity is not the limit at these sizes: scheme A at 3B is 48 GB of weights and state, within the 128 GB, | |
| 253 | +but not alongside today's 27B model server, which holds most of the unified memory. A training run needs the box, | |
| 254 | +or most of it. | |
| 255 | + | |
| 256 | +### 2.5 What Q2 means for Drake's idea | |
| 257 | + | |
| 258 | +For decoding (answering one word at a time), every word reads all the weights from memory, so memory speed is the | |
| 259 | +wall and keeping things on chip is the whole game; L272 owns that. For training, the same weights serve thousands | |
| 260 | +of tokens per step, so the counted memory traffic is already below the tensor wall on this chip. The speed of | |
| 261 | +training on the Spark is decided by **how much of the tensor rate our kernels deliver** (today 0.13 of FP8 peak on | |
| 262 | +a real shape) and by the **extra traffic between unfused kernels** (U2). That is where "get the bloat out of the | |
| 263 | +way" pays for training: fused, persistent kernels that keep each layer's intermediates on chip and keep the tensor | |
| 264 | +cores fed. | |
| 265 | + | |
| 266 | +## 3. The on-chip training experiment (Q3) | |
| 267 | + | |
| 268 | +**Built and run in this stream.** The smallest honest test of "a training step can stay on the math cores" that | |
| 269 | +Omega can express today, built from parts already in Omega (the Blackwell instruction encoder, the register | |
| 270 | +allocator, the emitter helpers in `src/omega_bw_em.h`, the driver-free launcher and session, the warp simulator): | |
| 271 | + | |
| 272 | +- Code: omega-mv branch `train/onchip-probe` at 4c8b69b2, files `src/omega_blackwell_codegen_train.c` and `.h` | |
| 273 | + (the kernel generator) and `tests/gpu_train_probe_test.c` (simulator check and chip run), Makefile target | |
| 274 | + `build/gpu_train_probe_test`. Base: omega main a8ffd2b9, physics 6d7cf0d4 (= `physics.lock`). | |
| 275 | +- Model: one linear layer, y = W x, 32 inputs per output, FP32, no bias. Each GPU thread owns one output row (32 | |
| 276 | + weights) and keeps it **in its registers** for the whole run. 48 thread blocks (one per SM) of as many threads as | |
| 277 | + the register file allows. Rows are independent, so no thread needs another thread's weights. | |
| 278 | +- Training: plain SGD on squared error, one sample per step (the textbook "LMS" rule). Per step each thread does the | |
| 279 | + forward pass (y = 32 multiply-adds), the backward pass (error e = y - target; gradient of each weight = e x input), | |
| 280 | + and the update (each weight += -lr x e x input, 32 multiply-adds), and adds e² to its running loss. Learning rate | |
| 281 | + 0.02. Data: 64 samples with inputs in [-1, 1] and targets made by a hidden random "teacher" layer, cycled. | |
| 282 | +- What a step reads: the sample's 32 inputs (128 bytes, the same for every thread) and each row's target | |
| 283 | + (4 bytes per row). Nothing else. The weights, the gradient and the "optimizer state" (none for plain SGD) never | |
| 284 | + leave the registers. The loss is written once per row at the end. | |
| 285 | +- The comparison, same model, same steps, same instruction sequence: | |
| 286 | + - **resident**: weights loaded from memory once before step 1, stored once after the last step; | |
| 287 | + - **streamed_cached**: weights loaded at the top of every step and stored at the bottom, from a GPU-cached buffer | |
| 288 | + (the 24 MB L2 cache can hold them); | |
| 289 | + - **streamed_dram**: the same, from a GPU-uncached buffer, so every load and store of the weights goes to the | |
| 290 | + 128 GB main memory ("gpu uncached for system memory", NVIDIA driver header `nvos.h` lines 1114-1116, recorded | |
| 291 | + with `docs-read`). | |
| 292 | +- Checks: the final weights and losses must be **bit-identical** across the three modes for every row (same | |
| 293 | + arithmetic, only the storage differs), bit-identical to a host `fmaf()` reference for every 97th row, and the | |
| 294 | + training loss on the data set must fall by at least 100x (computed on the host from the downloaded weights). | |
| 295 | +- Simulator (no GPU): resident and streamed both 0 wrong of 4,224 checked values against the host reference, 68 | |
| 296 | + registers per thread (`build/gpu_train_probe_test --host-only`, 2026-10-20). | |
| 297 | + | |
| 298 | +What this probe is and is not: | |
| 299 | +- It **is** a complete forward, backward and update loop running for thousands of steps with all model state on | |
| 300 | + chip, through our own launch path, and a like-for-like measurement of what streaming the weights through memory | |
| 301 | + costs. | |
| 302 | +- It **is not** a transformer. One linear layer has no hidden activations to keep for the backward pass, no | |
| 303 | + attention, no cross-SM traffic, and uses the plain FP32 multiply-add units, not the tensor cores. It answers the | |
| 304 | + residency question (can state stay on chip across steps, and what does it save), not the throughput question | |
| 305 | + for a real model; section 2 answers that from measured rates. | |
| 306 | +- With one sample per step it is the most memory-hungry way to train (every weight is used for only 4 operations | |
| 307 | + per load and store), so the gap between resident and streamed here is the largest gap residency can ever buy. | |
| 308 | + Section 2.2 shows that with thousands of tokens per step the streamed weight traffic of a normal design drops | |
| 309 | + below the tensor wall anyway. | |
| 310 | + | |
| 311 | +### 3.1 Result | |
| 312 | + | |
| 313 | +Q3_RESULT | |
| 314 | + | |
| 315 | +### 3.2 The next experiment: a tensor-core, multi-layer version (not built here) | |
| 316 | + | |
| 317 | +The probe above uses FP32 multiply-adds. A probe that answers the transformer question needs these pieces; what | |
| 318 | +Omega has and what it lacks (omega main a8ffd2b9): | |
| 319 | + | |
| 320 | +| Piece | Exists | Missing | | |
| 321 | +|---|---|---| | |
| 322 | +| BF16 tensor multiply (HMMA.16816.F32.BF16) | `BW_IR_HMMA_BF16`, `hmma()` in `src/omega_bw_em.h`, measured 118.81 TFLOPS (`src/omega_blackwell_codegen_tc.c`) | | | |
| 323 | +| FP8 tensor multiply (QMMA) | `src/omega_blackwell_codegen_qmma.c`, measured 237.52 TFLOPS | | | |
| 324 | +| Shared-memory tiles | `BW_IR_LDS128`, `BW_IR_STS32`, `BW_IR_BAR_SYNC` | QMD caps a block at 16 KiB of shared memory (`src/omega_blackwell_qmd.h:41`, issue #560); the chip allows 99 KB. A layer-resident kernel needs the full 99 KB | | |
| 325 | +| Grid-wide barrier between layers (all SMs finish layer k before k+1) | atomics `BW_IR_ATOMG_ADD_STRONG_SYS`, `BW_IR_MEMBAR_ALL_SYS`, strong loads; L272 is building and costing a persistent grid barrier (`gridbar` probe, worktree omega-decode-onchip-megakernel, uncommitted at 18Z) | a proven barrier primitive on main | | |
| 326 | +| Backward GEMMs (dX = dY Wáµ, dW = Xáµ dY) | forward GEMM generators (`src/omega_blackwell_codegen_gemm.c`, `_tc2.c`) | transposed-operand fragment loads for the two backward products | | |
| 327 | +| Reverse-mode gradients, CPU reference | `src/autodiff/omega_autodiff.c` (M21, CPU tier) | GPU tier | | |
| 328 | +| Optimizer step on chip | SGD substrate `src/train/tg_sgd.c` (M22, host, FP32) | an on-chip Adam or Muon update fused into the backward kernel | | |
| 329 | + | |
| 330 | +Experiment spec: a persistent kernel, one block per SM, each SM owning a slice of a 2-layer MLP (BF16 weights, FP32 | |
| 331 | +accumulate) of about 1 million parameters in shared memory and registers; forward layer 1, grid barrier, forward | |
| 332 | +layer 2, loss, backward layer 2 (dW2 and dX2), grid barrier, backward layer 1, fused SGD-with-momentum update, next | |
| 333 | +batch; versus the same layers as separate launches reading weights from memory. Measure step time, tokens per | |
| 334 | +second, fraction of the 118.81 TFLOPS BF16 rate, and bytes moved per step. Filed as ledger L286. | |
| 335 | + | |
| 336 | +## 4. Verdict (Q4) | |
| 337 | + | |
| 338 | +(In progress.) | |
| 339 | + | |
| 340 | +## UNKNOWN rows | |
| 341 | + | |
| 342 | +| Id | What is not known | Experiment that resolves it | Owner | | |
| 343 | +|---|---|---|---| | |
| 344 | +| U0 | closed: SM count 48 measured through our RM path; register-file size not reported by the driver (stays spec) | `evidence/physics-gb10/gr_info.txt` | L279 | | |
| 345 | +| U1 | L2 write bandwidth on our path | L2 write stream probe | L272 ceilings | | |
| 346 | +| U2 | Extra main-memory traffic per token from unfused kernels in a real Omega training step (factor k over the 34h stored-activation count) | count bytes per kernel in one Omega forward+backward layer, then measure | first training-side kernel (section 4) | | |
| 347 | +| U3 | Fraction of the tensor rate reached by the small matrix multiplies a fully on-chip model would run (for example 794 x 96 x 96, section 1.3) | small-shape sweep of the BF16 GEMM generator | L286 / L288 | | |
| 348 | + | |
| 349 | +## Sources | |
| 350 | + | |
| 351 | +[1] https://docs.nvidia.com/dgx/dgx-spark/hardware.html , NVIDIA DGX Spark User Guide, Hardware Overview, accessed | |
| 352 | +2026-10-20. "128 GB LPDDR5x unified system memory, 256-bit interface, 4266 MHz, 273 GB/s bandwidth"; "CUDA Cores: | |
| 353 | +6,144"; "up to 1 PFLOP (petaFLOP) at FP4 precision with sparsity". | |
| 354 | + | |
| 355 | +[2] https://docs.nvidia.com/cuda/cuda-programming-guide/05-appendices/compute-capabilities.html , CUDA Programming | |
| 356 | +Guide, Compute Capabilities, accessed 2026-10-20. Compute capability 12.x column: "Number of 32-bit registers per | |
| 357 | +SM: 64 K"; "Maximum amount of shared memory per SM: 100 KB"; "Maximum amount of shared memory per thread block: | |
| 358 | +99 KB"; "Unified Data Cache Size (KB): 128"; "Maximum number of resident warps per SM: 48". | |
| 359 | + | |
| 360 | +[3] https://chipsandcheese.com/p/analyzing-nvidia-gb10s-gpu , Chips and Cheese, "Analyzing Nvidia GB10's GPU", | |
| 361 | +accessed 2026-10-20. "The iGPU features 48 Streaming Multiprocessors running at up to 2.55 GHz"; "GB10 behaves much | |
| 362 | +like Nvidia's consumer Blackwell architecture and has 128 KB of L1/Shared Memory"; "GB10's 24 MB L2 is likely | |
| 363 | +almost as effective"; "GB10's L2 handles writes at half rate, and provides just under 1 TB/s of write bandwidth." | |
| 364 | + | |
| 365 | +[4] https://arxiv.org/html/2001.08361 , Kaplan et al., "Scaling Laws for Neural Language Models", 2020, accessed | |
| 366 | +2026-10-20. "Accounting for the backwards pass (approximately twice the compute as the forwards pass), we then | |
| 367 | +define the estimated non-embedding compute as Câ6N floating point operators per training token." | |
| 368 | + | |
| 369 | +[5] https://arxiv.org/pdf/2203.15556v1 , Hoffmann et al., "Training Compute-Optimal Large Language Models", 2022, | |
| 370 | +accessed 2026-10-20. "we find that for compute-optimal training, the model size and the number of training tokens | |
| 371 | +should be scaled equally"; Table 3: "1 Billion ... 1.21e+20 ... 20.2 Billion"; Table 4, Chinchilla 70B batch size: "1.5M â 3M" with caption "the training batch size (# tokens)"; "We verify this by training a more | |
| 372 | +compute-optimal 70B model, called Chinchilla, on 1.4 trillion tokens." | |
| 373 | + | |
| 374 | +[6] https://arxiv.org/pdf/2205.05198 , Korthikanti et al., "Reducing Activation Recomputation in Large Transformer | |
| 375 | +Models", 2022, accessed 2026-10-20. "Summing the memory required for attention, MLP, and the layer-norms, the memory | |
| 376 | +required to store the activations for a single layer of a transformer network is: Activations memory per layer = | |
| 377 | +sbh(34 + 5as/h)". | |
| 378 | + | |
| 379 | +[7] https://arxiv.org/pdf/2204.02311 , Chowdhery et al., "PaLM: Scaling Language Modeling with Pathways", 2022, | |
| 380 | +accessed 2026-10-20. "we describe how we were able to scale pipeline-free training of PaLM 540B to 6144 chips across | |
| 381 | +two TPU v4 Pods while achieving very high efficiency of 46.2% in model FLOPs utilization (observed throughput | |
| 382 | +relative to theoretical max throughput) and 57.8% in hardware FLOPs utilization." |
docs/physics/sources.json
| new file mode 100644 | ||
| @@ -0,0 +1,9 @@ | ||
| 1 | +[ | |
| 2 | + {"n": 1, "url": "https://docs.nvidia.com/dgx/dgx-spark/hardware.html", "title": "NVIDIA DGX Spark User Guide: Hardware Overview", "accessed": "2026-10-20"}, | |
| 3 | + {"n": 2, "url": "https://docs.nvidia.com/cuda/cuda-programming-guide/05-appendices/compute-capabilities.html", "title": "CUDA Programming Guide: Compute Capabilities", "accessed": "2026-10-20"}, | |
| 4 | + {"n": 3, "url": "https://chipsandcheese.com/p/analyzing-nvidia-gb10s-gpu", "title": "Analyzing Nvidia GB10's GPU (Chips and Cheese)", "accessed": "2026-10-20"}, | |
| 5 | + {"n": 4, "url": "https://arxiv.org/html/2001.08361", "title": "Scaling Laws for Neural Language Models (Kaplan et al., 2020)", "accessed": "2026-10-20"}, | |
| 6 | + {"n": 5, "url": "https://arxiv.org/pdf/2203.15556v1", "title": "Training Compute-Optimal Large Language Models (Hoffmann et al., 2022)", "accessed": "2026-10-20"}, | |
| 7 | + {"n": 6, "url": "https://arxiv.org/pdf/2205.05198", "title": "Reducing Activation Recomputation in Large Transformer Models (Korthikanti et al., 2022)", "accessed": "2026-10-20"}, | |
| 8 | + {"n": 7, "url": "https://arxiv.org/pdf/2204.02311", "title": "PaLM: Scaling Language Modeling with Pathways (Chowdhery et al., 2022)", "accessed": "2026-10-20"} | |
| 9 | +] |
evidence/OMEGALLM/specialists/tool-call-growpro-l9-150-20261119/README.md
| new file mode 100644 | ||
| @@ -0,0 +1,119 @@ | ||
| 1 | +# Frozen-Core Tool-Call Specialist Run (`growpro` + `fcachem` + `trainfc`, `L=8→9`, 150 steps) | |
| 2 | + | |
| 3 | +Measured host receipt on **Apple Silicon M2 (Darwin 25.6.0 arm64, f64 CPU)** using the `feat/darwin-ollm-specialists` codebase (`e993f179651b8dd5e99a040b6ec7284fff8cb12e`). Strictly local MacBook CPU execution; **no DGX Spark GPU work was performed** (GB10 GPU specialist training remains `NOT_RUN`). | |
| 4 | + | |
| 5 | +## 1. Environment & Artifact Pins | |
| 6 | + | |
| 7 | +- **Host:** Apple M2 (`ncpu=8`, `8 GiB` RAM), Darwin 25.6.0 `arm64`, f64 CPU | |
| 8 | +- **Source commit:** `e993f179651b8dd5e99a040b6ec7284fff8cb12e` | |
| 9 | +- **Build command:** | |
| 10 | + ```sh | |
| 11 | + { | |
| 12 | + printf 'target a64macos\n' | |
| 13 | + cat native/omegallm/math.om native/omegallm/data.om native/omegallm/lpool.om \ | |
| 14 | + native/omegallm/model.om native/omegallm/adam.om native/omegallm/ckpt.om \ | |
| 15 | + native/omegallm/bpe.om native/omegallm/spec.om native/omegallm/cli.om \ | |
| 16 | + native/omegallm/mio.om native/omegallm/noserve.om native/omegallm/nogpu.om | |
| 17 | + } > ollm-darwin.om | |
| 18 | + omc < ollm-darwin.om > ollm-darwin && chmod +x ollm-darwin | |
| 19 | + ``` | |
| 20 | + | |
| 21 | +| Artifact | Size (bytes) | SHA-256 | | |
| 22 | +|---|---|---| | |
| 23 | +| `omc` (Darwin arm64 Mach-O) | — | `68a590c37dfb1ec37a183f0032e02db1570db299266f574f65556edfc70feb9c` | | |
| 24 | +| `ollm-darwin.om` (concatenated source) | — | `5f53ca4a5ecc0b26dee0de4661feafae2cd500b873dee35953e15f77d4bb76cf` | | |
| 25 | +| `ollm-darwin` (Mach-O arm64 binary) | `214,816` | `dfece10d4e4bd20752c90c5af132f335b0166f65ea3b35e9d77d3eefd2f23846` | | |
| 26 | +| `omega-v2.ck` (base `L=8`, `15,833,472` params) | `380,003,448` | `a53ced7265818c8f6197449315e9ca4082721665022fec4f81d4538e8d6c2d0f` | | |
| 27 | +| `merges4096.bin` | `15,384` | `73a29baf97619a746a21232c403bf08af71a76e48b3b2cde6d64dab766083882` | | |
| 28 | +| `tool-call_aligned.tok` (train tokens) | `146,434` | `1de8d1fad6890c0ac73f679cd2fbfe3e9054d0ef4bdcf052b61cfe64aafcbe65` | | |
| 29 | +| `tool-call_aligned.msk` (completion-only mask) | `73,217` | `d972401efdbd0bd9b47bd7e471edb76722e0b2375a03a6bfb39bec9b76293b7c` | | |
| 30 | +| `tool-call_held.tok` (held-out, `W=9` windows) | `4,740` | `634fd8ed6f03f734167ebfea72f48ec53c6878022f9dd07cc8ca4e232df9a2af` | | |
| 31 | +| `tc_w160.hc` (`fcachem` `W=160` hidden cache) | `126,156,848` | `3f127597f9eed16fc973040c76463e4fd75b9c4837744e8b2beeafdfaf803166` | | |
| 32 | +| `spec_growpro_l9.ck` (trained `L=9`, `17,603,712` params) | `422,489,208` | `1317cf8784c16ca9ff522d5bf9022b8fa966b67550e19f71a076c98cd53363d4` | | |
| 33 | +| `tool-call_growpro_l9_150.sp` (`OLLMSP01`, `1,770,624` params) | `14,165,040` | `6e21157c45d463ed5c92d141a85ba632f07cb41353e928efea745a3971e99927` | | |
| 34 | + | |
| 35 | +The extracted `OLLMSP01` pack is **14.17 MB (`14,165,040` B)** vs **422.49 MB (`422,489,208` B)** for the full `L=9` checkpoint (**29.8× smaller**). | |
| 36 | + | |
| 37 | +## 2. Exact Commands | |
| 38 | + | |
| 39 | +```sh | |
| 40 | +# 1. Precompute masked frozen-base hidden states (W=160 windows, completion-only mask) | |
| 41 | +$OLLM fcachem $CK $TR $MK 160 $HC | |
| 42 | + | |
| 43 | +# 2. LLaMA-Pro block-expansion growth (L=8 -> 9, TOTAL=150, lr=0.0035) | |
| 44 | +$OLLM growpro $CK $SPEC_CK 9 150 3500 | |
| 45 | + | |
| 46 | +# 3. Verify step-0 held-out parity against base checkpoint (W=9 windows) | |
| 47 | +$OLLM eval $CK $HE 9 $MERGES | |
| 48 | +$OLLM eval $SPEC_CK $HE 9 $MERGES | |
| 49 | + | |
| 50 | +# 4. Frozen-core specialist training from hidden cache (FREEZE_LAYERS=8, B=1) | |
| 51 | +$OLLM trainfc $SPEC_CK $HC 50 25 8 1 | |
| 52 | +$OLLM eval $SPEC_CK $HE 9 $MERGES | |
| 53 | +$OLLM trainfc $SPEC_CK $HC 100 25 8 1 | |
| 54 | +$OLLM eval $SPEC_CK $HE 9 $MERGES | |
| 55 | +$OLLM trainfc $SPEC_CK $HC 150 25 8 1 | |
| 56 | +$OLLM eval $SPEC_CK $HE 9 $MERGES | |
| 57 | + | |
| 58 | +# 5. Extract OLLMSP01 pack and verify in-memory speval + spapp round-trip | |
| 59 | +$OLLM spext $CK $SPEC_CK $PACK | |
| 60 | +$OLLM speval $CK $PACK $HE 9 $MERGES | |
| 61 | +$OLLM spapp $CK $PACK $REBUILT_CK | |
| 62 | +$OLLM eval $REBUILT_CK $HE 9 $MERGES | |
| 63 | + | |
| 64 | +# 6. Qualitative sampling (N=32, temp=0.100, seed=42) | |
| 65 | +$OLLM spsamp $CK $PACK 32 100 "$PROMPT" 42 $MERGES | |
| 66 | +``` | |
| 67 | + | |
| 68 | +## 3. Training & Held-Out Eval Progression | |
| 69 | + | |
| 70 | +- **`fcachem` (`W=160`):** `FCACHE 160 256 384 8` in `618.10s` real (`608.94s` user, `3.70s` sys); bit-identical via `cmp` to prior `tool-call_w160.hc`. | |
| 71 | +- **`growpro` (`L=8→9`):** `GP 8 9 17603712` in `3.30s` real. | |
| 72 | +- **`trainfc` wall times (`B=1`, `FREEZE_LAYERS=8`):** | |
| 73 | + - Leg 1 (`0→50`): `363.16s` real (`7.26 s/step`) | |
| 74 | + - Leg 2 (`50→100`): `321.92s` real (`6.44 s/step`) | |
| 75 | + - Leg 3 (`100→150`): `313.11s` real (`6.26 s/step`) | |
| 76 | + - Total 150-step training time: **`998.19s` (~16.6 min)** on M2 CPU (single-threaded f64). | |
| 77 | + | |
| 78 | +| Step | Masked Train Loss (`FC`, µnats) | Masked Train Loss (nats/tok) | Held-Out `eval` (`W=9`, µnats) | Held-Out `eval` (nats/tok) | Held-Out `bpb` (µbpb) | Δ vs Base Held-Out | | |
| 79 | +|---:|---:|---:|---:|---:|---:|---:| | |
| 80 | +| Base (`omega-v2.ck`, step 60000) | — | — | `7,183,552` | `7.183552` | `6,325,274` | `0.00%` | | |
| 81 | +| `0` (`growpro` step 0) | — | — | `7,183,552` | `7.183552` | `6,325,274` | `0.00%` (bit-identical) | | |
| 82 | +| `25` | `5,511,696` | `5.511696` | — | — | — | — | | |
| 83 | +| `50` | `2,289,094` | `2.289094` | **`4,528,072`** | **`4.528072`** | **`3,987,066`** | **`-36.97%`** | | |
| 84 | +| `75` | `961,954` | `0.961954` | — | — | — | — | | |
| 85 | +| `100` | `628,315` | `0.628315` | `4,757,065` | `4.757065` | `4,188,699` | `-33.78%` | | |
| 86 | +| `125` | `690,457` | `0.690457` | — | — | — | — | | |
| 87 | +| `150` | `439,281` | `0.439281` | `4,954,553` | `4.954553` | `4,362,591` | `-31.03%` | | |
| 88 | + | |
| 89 | +**Observation:** Masked completion-only training loss fell monotonically from `5.511696` (step 25) to `0.439281` nats/tok (step 150), while unmasked full-sequence held-out NLL (`tool-call_held.tok`, which scores both prompt and completion tokens) dropped sharply by **`-36.97%`** at step 50 (`7.183552 → 4.528072 nats/tok`) and then drifted mildly upward (`4.757065` at step 100, `4.954553` at step 150) as the single specialist layer sharpened further on completion tokens at the expense of unmasked prompt-token likelihood. | |
| 90 | + | |
| 91 | +## 4. Base Preservation, Round-Trip & Negative Controls | |
| 92 | + | |
| 93 | +| Check | Result | | |
| 94 | +|---|---| | |
| 95 | +| Step-0 `growpro` parity | `BASE_V2_EVAL` (`E 60000 9 7183552 6325274`) == `STEP0_EVAL` (`E 0 9 7183552 6325274`) | | |
| 96 | +| `spext` extraction | `SPEXT 8 9 1770624` (`rc=0`, verifies FNV-1a 64 over frozen base) | | |
| 97 | +| In-memory `speval` round-trip | `E 60000 9 4954553 4362591` == trained `STEP150_EVAL` (`E 150 9 4954553 4362591`) | | |
| 98 | +| `spapp` + `eval` round-trip | `SPAPP 8 9 1770624` -> `E 60000 9 4954553 4362591` (bit-identical) | | |
| 99 | +| Independent byte check of frozen base (`OLLMCK02` 120-byte header + `15,833,088` f64 params = `126,664,704` bytes) | `spec_growpro_l9.ck` == `omega-v2.ck` (`True`), `rebuilt_growpro_l9.ck` == `omega-v2.ck` (`True`) | | |
| 100 | +| Negative control: truncated pack (`1024` B) | `rc=60` | | |
| 101 | +| Negative control: 1-bit flip in payload (byte 64) | `rc=61` | | |
| 102 | +| Negative control: wrong base (`omega-v2-edited-20261104.ck`) | `rc=62` | | |
| 103 | + | |
| 104 | +## 5. Qualitative Sampling (`spsamp` vs Base `omega-v2.ck`, `N=32`, `temp=0.100`, `seed=42`) | |
| 105 | + | |
| 106 | +Base `omega-v2.ck` (TinyStories pretraining only) produces non-tool story/number continuations on tool prompts, whereas the 1-layer 150-step `OLLMSP01` pack acquires the `<tool_call>...</tool_call>` syntax when given the exact tokenized training boundary (`" User: ...\nCall: "` with trailing space): | |
| 107 | + | |
| 108 | +| Prompt | Base `omega-v2.ck` (`sample`) | Specialist `spsamp` (`tool-call_growpro_l9_150.sp`) | | |
| 109 | +|---|---|---| | |
| 110 | +| `" User: What is 17 + 25?\nCall: "` | *(unspaced `Call:` baseline: ` 15 15 15 15 40 40 5.\nLittle did Light 5 5 `)* | `<tool_call>calc(25 / 15 / 15)</tool_call>` | | |
| 111 | +| `" User: Read SECURITY.md.\nCall: "` | *(unspaced `Call:` baseline: `\nRead SEST.\nRead SEST.\nRead SEST.\nRead SEST.`)* | `<tool_call>shell(df -n <tool_call>` | | |
| 112 | +| `" User: Multiply 29 by 14.\nCall: "` | *(unspaced `Call:` baseline: ` 123, 23, 44, 4, 4, 44.\nMile: 4, 4`)* | `<tool_call>search(25 + 15)</tool_call>` | | |
| 113 | +| `" User: What is 17 + 25?\nCall: <tool_call>"` | — | `calc(25 / 125)</tool_call>` | | |
| 114 | + | |
| 115 | +**Boundary sensitivity & capability limits:** | |
| 116 | +- Without the trailing space after `Call:` (i.e. `"User: ...\nCall:"`), all three prompts emitted ` NONE` (a valid no-tool class in the training data, merged by BPE with the leading space). | |
| 117 | +- With the exact `" Call: "` boundary, the single specialist layer reliably emits `<tool_call>` syntax and selects `calc(...)` on `"What is 17 + 25?"`, but still makes tool-routing and argument-copying errors (`shell`/`search` instead of `read_file`/`calc`, hallucinated operands) at 150 steps / 1 added layer. | |
| 118 | + | |
| 119 | +Verbatim sanitized outputs are preserved in [outputs.txt](outputs.txt). |
evidence/OMEGALLM/specialists/tool-call-growpro-l9-150-20261119/outputs.txt
| new file mode 100644 | ||
| @@ -0,0 +1,102 @@ | ||
| 1 | +=== OLLM FROZEN-CORE SPECIALIST RUN (M2 CPU, DARWIN ARM64, f64) === | |
| 2 | +START 2026-11-19T14:48:33Z | |
| 3 | +CPU: Apple M2 (ncpu=8, mem=8589934592) | |
| 4 | +OS: Darwin 25.6.0 RELEASE_ARM64_T8112 arm64 | |
| 5 | + | |
| 6 | +--- 0. FCACHEM (W=160, completion-only mask) --- | |
| 7 | +FCACHE 160 256 384 8 | |
| 8 | +real 618.10 | |
| 9 | +user 608.94 | |
| 10 | +sys 3.70 | |
| 11 | +FCACHEM_BIT_IDENTICAL (sha256: 3f127597f9eed16fc973040c76463e4fd75b9c4837744e8b2beeafdfaf803166) | |
| 12 | + | |
| 13 | +--- 1. GROWPRO L=8->9 TOTAL=150 LRMICRO=3500 --- | |
| 14 | +GP 8 9 17603712 | |
| 15 | +real 3.30 | |
| 16 | +user 2.97 | |
| 17 | +sys 0.27 | |
| 18 | + | |
| 19 | +--- 2. BASE vs STEP-0 HELD-OUT EVAL (W=9) --- | |
| 20 | +BASE_V2_EVAL: E 60000 9 7183552 6325274 | |
| 21 | +STEP0_EVAL: E 0 9 7183552 6325274 | |
| 22 | + | |
| 23 | +--- 3. TRAINFC LEG 1 (0 -> 50, every 25, freeze=8, B=1) --- | |
| 24 | +FC 25 8 5511696 | |
| 25 | +FC 50 8 2289094 | |
| 26 | +real 363.16 | |
| 27 | +user 346.75 | |
| 28 | +sys 4.73 | |
| 29 | +STEP50_EVAL: E 50 9 4528072 3987066 | |
| 30 | + | |
| 31 | +--- 4. TRAINFC LEG 2 (50 -> 100, every 25, freeze=8, B=1) --- | |
| 32 | +FC 75 8 961954 | |
| 33 | +FC 100 8 628315 | |
| 34 | +real 321.92 | |
| 35 | +user 307.98 | |
| 36 | +sys 3.88 | |
| 37 | +STEP100_EVAL: E 100 9 4757065 4188699 | |
| 38 | + | |
| 39 | +--- 5. TRAINFC LEG 3 (100 -> 150, every 25, freeze=8, B=1) --- | |
| 40 | +FC 125 8 690457 | |
| 41 | +FC 150 8 439281 | |
| 42 | +real 313.11 | |
| 43 | +user 303.54 | |
| 44 | +sys 3.00 | |
| 45 | +STEP150_EVAL: E 150 9 4954553 4362591 | |
| 46 | + | |
| 47 | +--- 6. SPEXT & SPAPP & SPEVAL ROUND-TRIP --- | |
| 48 | +SPEXT 8 9 1770624 | |
| 49 | +SIZES: base_ck=380003448 spec_ck=422489208 pack=14165040 | |
| 50 | +1317cf8784c16ca9ff522d5bf9022b8fa966b67550e19f71a076c98cd53363d4 spec_growpro_l9.ck | |
| 51 | +6e21157c45d463ed5c92d141a85ba632f07cb41353e928efea745a3971e99927 tool-call_growpro_l9_150.sp | |
| 52 | +SPEVAL_PACK: E 60000 9 4954553 4362591 | |
| 53 | +SPAPP 8 9 1770624 | |
| 54 | +REBUILT_EVAL: E 60000 9 4954553 4362591 | |
| 55 | + | |
| 56 | +--- 7. INDEPENDENT BIT-IDENTICAL BASE WEIGHTS CHECK (CK02 header = 120 bytes) --- | |
| 57 | +BASE: magic=b'OLLMCK02' shapes=(4096, 256, 384, 12, 1536, 8) fz_params=15833088 fz_bytes=126664704 | |
| 58 | +SPEC: magic=b'OLLMCK02' shapes=(4096, 256, 384, 12, 1536, 9) base_match=True | |
| 59 | +REBUILT: magic=b'OLLMCK02' shapes=(4096, 256, 384, 12, 1536, 9) base_match=True | |
| 60 | +BASE_PRESERVATION_VERIFIED: 100% bit-identical across all 15,833,088 frozen base parameters (126,664,704 bytes) | |
| 61 | + | |
| 62 | +--- 8. NEGATIVE CONTROLS (rc=60, rc=61, rc=62) --- | |
| 63 | +NEG_TRUNC_RC=60 | |
| 64 | +NEG_FLIP_RC=61 | |
| 65 | +NEG_WRONGBASE_RC=62 | |
| 66 | + | |
| 67 | +--- 9A. QUALITATIVE SAMPLES (unspaced "Call:" boundary, N=32, temp=0.100, seed=42) --- | |
| 68 | +>>> PROMPT: User: What is 17 + 25?\nCall: | |
| 69 | +BASE omega-v2.ck: | |
| 70 | + 15 15 15 15 40 40 5. | |
| 71 | +Little did Light 5 5 | |
| 72 | +SPECIALIST spsamp: | |
| 73 | + NONE | |
| 74 | + | |
| 75 | +>>> PROMPT: User: Read SECURITY.md.\nCall: | |
| 76 | +BASE omega-v2.ck: | |
| 77 | + | |
| 78 | +Read SEST. | |
| 79 | +Read SEST. | |
| 80 | +Read SEST. | |
| 81 | +Read SEST. | |
| 82 | +SPECIALIST spsamp: | |
| 83 | + NONE | |
| 84 | + | |
| 85 | +>>> PROMPT: User: Multiply 29 by 14.\nCall: | |
| 86 | +BASE omega-v2.ck: | |
| 87 | + 123, 23, 44, 4, 4, 44. | |
| 88 | +Mile: 4, 4 | |
| 89 | +SPECIALIST spsamp: | |
| 90 | + NONE | |
| 91 | + | |
| 92 | +--- 9B. QUALITATIVE SAMPLES (exact tokenized " User: ...\nCall: " boundary, N=32, temp=0.100, seed=42) --- | |
| 93 | +>>> [ User: What is 17 + 25?\nCall: ] | |
| 94 | +<tool_call>calc(25 / 15 / 15)</tool_call> | |
| 95 | +>>> [ User: Read SECURITY.md.\nCall: ] | |
| 96 | +<tool_call>shell(df -n <tool_call> | |
| 97 | +>>> [ User: Multiply 29 by 14.\nCall: ] | |
| 98 | +<tool_call>search(25 + 15)</tool_call> | |
| 99 | +>>> [ User: What is 17 + 25?\nCall: <tool_call>] | |
| 100 | +calc(25 / 125)</tool_call> | |
| 101 | + | |
| 102 | +END 2026-11-19T15:12:47Z |
evidence/efficiency/chinchilla-table.out
| new file mode 100644 | ||
| @@ -0,0 +1,5 @@ | ||
| 1 | +N=5e+07 L=8 h=512 D=1e+09 F=3e+17 | math hours: 25%=1.605 40%=1.003 55%=0.7295 | state floor h=0.002232 steps=1907 | act store-all h=0.2834 (0.283 x math@40%) | act recompute h=0.01667 (0.0166 x math@40%) | |
| 2 | +N=1.25e+08 L=12 h=768 D=2.5e+09 F=1.875e+18 | math hours: 25%=10.03 40%=6.269 55%=4.559 | state floor h=0.01395 steps=4768 | act store-all h=1.594 (0.254 x math@40%) | act recompute h=0.09377 (0.015 x math@40%) | |
| 3 | +N=3.5e+08 L=24 h=1024 D=7e+09 F=1.47e+19 | math hours: 25%=78.64 40%=49.15 55%=35.75 | state floor h=0.1094 steps=13351 | act store-all h=11.9 (0.242 x math@40%) | act recompute h=0.7002 (0.0142 x math@40%) | |
| 4 | +N=1e+09 L=24 h=2048 D=2e+10 F=1.2e+20 | math hours: 25%=642 40%=401.2 55%=291.8 | state floor h=0.8927 steps=38147 | act store-all h=68.02 (0.17 x math@40%) | act recompute h=4.001 (0.00997 x math@40%) | |
| 5 | +N=3e+09 L=32 h=2560 D=6e+10 F=1.08e+21 | math hours: 25%=5778 40%=3611 55%=2626 | state floor h=8.035 steps=114441 | act store-all h=340.1 (0.0942 x math@40%) | act recompute h=20 (0.00554 x math@40%) |
evidence/efficiency/chinchilla-table.sh
| new file mode 100644 | ||
| @@ -0,0 +1,12 @@ | ||
| 1 | +# aien-train L278 section 8: Chinchilla-optimal training on one GB10. | |
| 2 | +# N = parameters, L = layers, h = hidden width (nearest GPT-3 shapes; 50M shape is the author's choice). | |
| 3 | +# D = 20 N tokens, F = 6 N D FLOPs, peak p = 207.7e12 (measured FP8 best case), bw = 273e9 B/s, T = 524288 tokens/step. | |
| 4 | +# State floor: 23 bytes/param moved once per step. Activation floor: 2 x 34 h L bytes/token (store all, written once, read once). | |
| 5 | +# Recompute floor: 2 x 2 h L bytes/token (keep only each layer input; section 5.2 method). | |
| 6 | +for row in "50e6 8 512" "125e6 12 768" "350e6 24 1024" "1e9 24 2048" "3e9 32 2560"; do | |
| 7 | +set -- $row | |
| 8 | +awk -v N=$1 -v L=$2 -v h=$3 'BEGIN{D=20*N; F=6*N*D; p=207.7e12; T=524288; bw=273e9; | |
| 9 | + m40=F/(0.40*p); m25=F/(0.25*p); m55=F/(0.55*p); | |
| 10 | + st=(D/T)*23*N/bw; as=D*2*34*h*L/bw; ar=D*2*2*h*L/bw; | |
| 11 | + printf "N=%g L=%d h=%d D=%g F=%.4g | math hours: 25%%=%.4g 40%%=%.4g 55%%=%.4g | state floor h=%.4g steps=%.0f | act store-all h=%.4g (%.3g x math@40%%) | act recompute h=%.4g (%.3g x math@40%%)\n", N,L,h,D,F, m25/3600,m40/3600,m55/3600, st/3600,D/T, as/3600, as/m40, ar/3600, ar/m40}' | |
| 12 | +done |
evidence/efficiency/modded-nanogpt-LICENSE.md
| new file mode 100644 | ||
| @@ -0,0 +1,25 @@ | ||
| 1 | +Licence of the copy beside it: modded-nanogpt-README.2026-10-20.md is a copy of the README of | |
| 2 | +https://github.com/KellerJordan/modded-nanogpt (fetched 2026-10-20), redistributed under that | |
| 3 | +project's MIT License, reproduced unchanged below (fetched 2026-11-15 from the same repository). | |
| 4 | + | |
| 5 | +MIT License | |
| 6 | + | |
| 7 | +Copyright (c) 2024 Keller Jordan | |
| 8 | + | |
| 9 | +Permission is hereby granted, free of charge, to any person obtaining a copy | |
| 10 | +of this software and associated documentation files (the "Software"), to deal | |
| 11 | +in the Software without restriction, including without limitation the rights | |
| 12 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| 13 | +copies of the Software, and to permit persons to whom the Software is | |
| 14 | +furnished to do so, subject to the following conditions: | |
| 15 | + | |
| 16 | +The above copyright notice and this permission notice shall be included in all | |
| 17 | +copies or substantial portions of the Software. | |
| 18 | + | |
| 19 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | |
| 20 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |
| 21 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | |
| 22 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | |
| 23 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | |
| 24 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | |
| 25 | +SOFTWARE. |
evidence/efficiency/modded-nanogpt-README.2026-10-20.md
| new file mode 100644 | ||
| @@ -0,0 +1,450 @@ | ||
| 1 | +# Modded-NanoGPT | |
| 2 | + | |
| 3 | +This repository hosts the *NanoGPT speedrun*, in which we (collaboratively|competitively) search for the fastest algorithm to use 8 NVIDIA H100 GPUs to train a language model that attains 3.28 cross-entropy loss on the [FineWeb](https://huggingface.co/datasets/HuggingFaceFW/fineweb) validation set. | |
| 4 | + | |
| 5 | +(Note: Besides the main track, there is also an [optimization track](records/track_3_optimization) where we try to minimize steps subject to fixed arch/data/bsz and with unlimited wallclock budget.) | |
| 6 | + | |
| 7 | +The target (3.28 validation loss on FineWeb) follows Andrej Karpathy's [GPT-2 replication in llm.c, which attains that loss after running for 45 minutes](https://github.com/karpathy/llm.c/discussions/481#:~:text=By%20the%20end%20of%20the%20optimization%20we%27ll%20get%20to%20about%203.29). | |
| 8 | +The speedrun code also descends from llm.c's [PyTorch trainer](https://github.com/karpathy/llm.c/blob/master/train_gpt2.py), which itself descends from NanoGPT, hence the name of the repo. | |
| 9 | +Thanks to the efforts of many contributors, this repo now contains a training algorithm which attains the target performance in: | |
| 10 | +* Under 40 seconds on 8xH100 (the llm.c GPT-2 replication needed 45 minutes) | |
| 11 | +* under 330M tokens (the llm.c GPT-2 replication needed 10B) | |
| 12 | + | |
| 13 | +This improvement in training speed has been brought about by the following techniques: | |
| 14 | +* Modernized architecture: Rotary embeddings, QK-Norm, and ReLU² | |
| 15 | +* The Muon optimizer [[writeup](https://kellerjordan.github.io/posts/muon/)] [[repo](https://github.com/KellerJordan/Muon)] | |
| 16 | +* Use FP8 for head, and asymmetric rescale and softcap logits | |
| 17 | +* FP8 for the MLP forward and backward passes and the QKV projections | |
| 18 | +* Initialization of projections to zero (muP-like) | |
| 19 | +* Skip connections from embedding to every block as well as from block 3 to 6 | |
| 20 | +* Extra embeddings which are mixed into the values in attention layers (inspired by Zhou et al. 2024) | |
| 21 | +* Flash Attention 3 with long-short sliding window attention pattern (inspired by Gemma 2) and window size warmup with YaRN | |
| 22 | +* Align training batch starts with EoS and set a max document length | |
| 23 | +* Accumulate gradients for 2 steps for embedding and lm_head before updating parameters | |
| 24 | +* Single activation input for last 3 attention layers | |
| 25 | +* Polar Express implementation in Muon | |
| 26 | +* Smear module to enable 1 token look back | |
| 27 | +* Sparse attention gate | |
| 28 | +* NorMuon | |
| 29 | +* Cautious Weight Decay w/ schedule tied to LR | |
| 30 | +* Exponential decay of residual stream | |
| 31 | +* Batch size schedule | |
| 32 | +* Max seq length schedule | |
| 33 | +* Partial Key Offset | |
| 34 | +* Multi token prediction | |
| 35 | +* Untie embed and lm_head at 2/3 of training | |
| 36 | +* Additional gating on value embeddings and skip connection | |
| 37 | +* Paired head attention | |
| 38 | +* Hashed bigram + trigram embedding table (84.6M rows, 65B parameters) w/ sign trick, sharded across GPUs | |
| 39 | +* MUDD skip connections to residual stream and attention values | |
| 40 | +* Learnable XSA | |
| 41 | +* Lightweight Dynamically Composable MHA | |
| 42 | +* Prefix token prediction auxiliary loss | |
| 43 | +* ANVIL optimizer: twin-rail (fast + slow) momentum, re-derived orthogonalization maps, cautious decay gated on the slow rail | |
| 44 | +* Sampled softmax over a shared candidate set for most of training | |
| 45 | +* Sparse row-wise embedding updates: only touched rows are exchanged and updated (beta1 = 0, one second-moment value per row), every 4 steps | |
| 46 | +* Depth reduction and mixed-width attention (64-dim QK on most layers, half-width V on two layers) | |
| 47 | +* Tail weight averaging (EMA) with a raised LR floor | |
| 48 | +* CUDA-graph capture of the training step, optimizer and FP8 weight refresh | |
| 49 | + | |
| 50 | +As well as many systems optimizations. | |
| 51 | + | |
| 52 | +Contributors list (growing with each new record): [@bozavlado](https://x.com/bozavlado); [@brendanh0gan](https://x.com/brendanh0gan); | |
| 53 | +[@fernbear.bsky.social](https://bsky.app/profile/fernbear.bsky.social); [@Grad62304977](https://x.com/Grad62304977); | |
| 54 | +[@jxbz](https://x.com/jxbz); [@kellerjordan0](https://x.com/kellerjordan0); | |
| 55 | +[@KoszarskyB](https://x.com/KoszarskyB); [@leloykun](https://x.com/@leloykun); | |
| 56 | +[@YouJiacheng](https://x.com/YouJiacheng); [@jadenj3o](https://x.com/jadenj3o); | |
| 57 | +[@KonstantinWilleke](https://github.com/KonstantinWilleke), [@alexrgilbert](https://github.com/alexrgilbert), [@adricarda](https://github.com/adricarda), | |
| 58 | +[@tuttyfrutyee](https://github.com/tuttyfrutyee), [@vdlad](https://github.com/vdlad); | |
| 59 | +[@ryanyang0](https://x.com/ryanyang0), [@vagrawal](https://github.com/vagrawal), [@classiclarryd](https://x.com/classiclarryd), | |
| 60 | +[@byronxu99](https://github.com/byronxu99), [@varunneal](https://x.com/varunneal), [@EmelyanenkoK](https://github.com/EmelyanenkoK), | |
| 61 | +[@bernard24](https://github.com/bernard24)/https://www.hiverge.ai/, [@Gusarich](https://x.com/Gusarich), [@li_zichong](https://x.com/li_zichong), | |
| 62 | +[@akash5474](https://github.com/akash5474), [@snimu](https://x.com/omouamoua), [@roeeshenberg](https://x.com/roeeshenberg), | |
| 63 | +[@ChrisJMcCormick](https://x.com/ChrisJMcCormick), [@dominikkallusky](https://github.com/dominikkallusky), [@acutkosky](https://github.com/acutkosky), | |
| 64 | +[@manikbhandari](https://github.com/manikbhandari), [@andrewbriand](https://x.com/andrewbriand8), [@jrauvola](https://x.com/Joshrav21), | |
| 65 | +[@soren_dunn_](https://x.com/soren_dunn_), [@photon_mz](https://x.com/photon_mz), [@srashedll](https://x.com/srashedll), [@dhrvji](https://x.com/dhrvji), | |
| 66 | +[@EmmettBicker](https://github.com/EmmettBicker), [@dualverse-ai](https://github.com/dualverse-ai), [@sisovicm](https://x.com/sisovicm), | |
| 67 | +[@moof2x](https://github.com/moof2x), [@samacqua](https://github.com/samacqua), [@Lisennlp](https://github.com/Lisennlp), | |
| 68 | +[@_djdumpling](https://x.com/_djdumpling), [@TrianX](https://x.com/TrianX), [@aryavohra](https://github.com/aryavohra), | |
| 69 | +[@cong_ml](https://x.com/cong_ml), [@jvarho](https://github.com/jvarho), [@Mister-dev-oss](https://github.com/Mister-dev-oss), [@CerovazS](https://github.com/CerovazS), [@MarioPaerle](https://github.com/MarioPaerle), [@GabrieleCirillo](https://github.com/GabrieleCirillo), [@crisostomi](https://github.com/crisostomi), | |
| 70 | +[@theonlyglitch_](https://x.com/theonlyglitch_), [@DevenPzak](https://x.com/DevenPzak) | |
| 71 | + | |
| 72 | + | |
| 73 | +--- | |
| 74 | + | |
| 75 | +## Running the current record | |
| 76 | + | |
| 77 | +To run the current record, run the following commands. | |
| 78 | +```bash | |
| 79 | +git clone https://github.com/KellerJordan/modded-nanogpt.git && cd modded-nanogpt | |
| 80 | +pip install -r requirements.txt | |
| 81 | +pip install torch==2.10 --index-url https://download.pytorch.org/whl/cu128 # the pinned build, not a nightly | |
| 82 | +# downloads only the first 900M training tokens to save time | |
| 83 | +python data/cached_fineweb10B.py 9 | |
| 84 | +./run.sh | |
| 85 | +``` | |
| 86 | +Add torchrun to path if ./run.sh gives error `torchrun: command not found`. | |
| 87 | + | |
| 88 | +The attention kernel is a patched FlashAttention-3 build (`devenpzak/flash-attn3-12864`) that links `libcudart.so.13`, | |
| 89 | +so the system needs a CUDA 13 runtime (the Docker image below provides one). If `get_kernel` fails to download it | |
| 90 | +anonymously, either run `hf auth login`, or pre-seed the kernel cache and run offline: | |
| 91 | +```bash | |
| 92 | +hf download devenpzak/flash-attn3-12864 --revision 64c1e6d1f2780e7931839f41426ddcdb564a7cb9 | |
| 93 | +HUB=${HF_HOME:-~/.cache/huggingface}/hub | |
| 94 | +cp -rl $HUB/models--devenpzak--flash-attn3-12864 $HUB/kernels--devenpzak--flash-attn3-12864 | |
| 95 | +HF_HUB_OFFLINE=1 ./run.sh | |
| 96 | +``` | |
| 97 | + | |
| 98 | +**Note: torch.compile will add around 7 minutes of latency the first time you run the code.** | |
| 99 | + | |
| 100 | +The track-1 trainer is `train_gpt.py` plus the `track_1_short/` package. `train_gpt.py` is the outline of a run | |
| 101 | +(setup, model, warmup and CUDA-graph capture, the timed loop, the final validation); `track_1_short/` holds the model, | |
| 102 | +optimizer, data and schedules, and `track_1_short/perf/` holds the kernels and systems tricks that make it fast, which | |
| 103 | +can be skipped when reading for the algorithm. Every run log embeds the full source of both. | |
| 104 | + | |
| 105 | +Official records are timed on 8 NVIDIA H100 GPUs from https://app.primeintellect.ai/. PrimeIntellect has generously sponsored recent validation runs. | |
| 106 | + | |
| 107 | +## Alternative: Running with Docker (recommended for precise timing) | |
| 108 | + | |
| 109 | +For cases where CUDA or NCCL versions aren't compatible with your current system setup, Docker can be a helpful alternative. | |
| 110 | +This approach standardizes versions for CUDA, NCCL, CUDNN, and Python, reducing dependency issues and simplifying setup. | |
| 111 | +Note: an NVIDIA driver must already be installed on the system (useful if only the NVIDIA driver and Docker are available). | |
| 112 | + | |
| 113 | +```bash | |
| 114 | +git clone https://github.com/KellerJordan/modded-nanogpt.git && cd modded-nanogpt | |
| 115 | +sudo docker build -t modded-nanogpt . | |
| 116 | +sudo docker run -it --rm --gpus all -v $(pwd):/modded-nanogpt modded-nanogpt python data/cached_fineweb10B.py 8 | |
| 117 | +sudo docker run -it --rm --gpus all -v $(pwd):/modded-nanogpt modded-nanogpt sh run.sh | |
| 118 | +``` | |
| 119 | + | |
| 120 | +To get an interactive docker, you can use | |
| 121 | +```bash | |
| 122 | +sudo docker run -it --rm --gpus all -v $(pwd):/modded-nanogpt modded-nanogpt bash | |
| 123 | +``` | |
| 124 | + | |
| 125 | +--- | |
| 126 | + | |
| 127 | +## World record history | |
| 128 | + | |
| 129 | +The following is the historical progression of world speed records for the following competitive task: | |
| 130 | + | |
| 131 | +> *Train a neural network to ≤3.28 validation loss on FineWeb using 8x NVIDIA H100s.* | |
| 132 | + | |
| 133 | +Note: The 3.28 target was selected to match [Andrej Karpathy's GPT-2 (small) reproduction](https://github.com/karpathy/llm.c/discussions/481). | |
| 134 | + | |
| 135 | +| # | Record time | Description | Date | Log | Contributors | | |
| 136 | +| - | - | - | - | - | - | | |
| 137 | +1 | 45 minutes | [llm.c baseline](https://github.com/karpathy/llm.c/discussions/481) | 05/28/24 | [log](records/track_1_short/2024-10-13_llmc/main.log) | @karpathy, llm.c contributors | |
| 138 | +2 | 31.4 minutes | [Tuned learning rate & rotary embeddings](https://x.com/kellerjordan0/status/1798863559243513937) | 06/06/24 | [log](records/track_1_short/2024-06-06_AdamW/f66d43d7-e449-4029-8adf-e8537bab49ea.log) | @kellerjordan0 | |
| 139 | +3 | 24.9 minutes | [Introduced the Muon optimizer](https://x.com/kellerjordan0/status/1842300916864844014) | 10/04/24 | none | @kellerjordan0, @jxbz | |
| 140 | +4 | 22.3 minutes | [Muon improvements](https://x.com/kellerjordan0/status/1844820919061287009) | 10/11/24 | [log](records/track_1_short/2024-10-10_Muon/eb5659d0-fb6a-49e5-a311-f1f89412f726.txt) | @kellerjordan0, @bozavlado | |
| 141 | +5 | 15.2 minutes | [Pad embeddings, ReLU², zero-init projections, QK-norm](https://x.com/kellerjordan0/status/1845865698532450646) | 10/14/24 | [log](records/track_1_short/2024-10-14_ModernArch/dabaaddd-237c-4ec9-939d-6608a9ed5e27.txt) | @Grad62304977, @kellerjordan0 | |
| 142 | +6 | 13.1 minutes | [Distributed the overhead of Muon](https://x.com/kellerjordan0/status/1847291684016783746) | 10/18/24 | [log](records/track_1_short/2024-10-17_DistributedMuon/22d24867-eb5a-4fcc-ae2c-263d0277dfd1.txt) | @kellerjordan0 | |
| 143 | +7 | 12.0 minutes | [Upgraded PyTorch 2.5.0](https://x.com/kellerjordan0/status/1847358578686152764) | 10/18/24 | [log](records/track_1_short/2024-10-18_PyTorch25/d4bfb25f-688d-4da5-8743-33926fad4842.txt) | @kellerjordan0 | |
| 144 | +8 | 10.8 minutes | [Untied embedding and head](https://x.com/kellerjordan0/status/1853188916704387239) | 11/03/24 | [log](records/track_1_short/2024-11-03_UntieEmbed/d6b50d71-f419-4d26-bb39-a60d55ae7a04.txt) | @Grad62304977, @kellerjordan0 | |
| 145 | +9 | 8.2 minutes | [Value and embedding skip connections, momentum warmup, logit softcap](https://x.com/kellerjordan0/status/1854296101303800108) | 11/06/24 | [log](records/track_1_short/2024-11-06_ShortcutsTweaks/dd7304a6-cc43-4d5e-adb8-c070111464a1.txt) | @Grad62304977, @kellerjordan0 | |
| 146 | +10 | 7.8 minutes | [Bfloat16 activations](https://x.com/kellerjordan0/status/1855267054774865980) | 11/08/24 | [log](records/track_1_short/2024-11-08_CastBf16/a833bed8-2fa8-4cfe-af05-58c1cc48bc30.txt) | @kellerjordan0 | |
| 147 | +11 | 7.2 minutes | [U-net pattern skip connections & double lr](https://x.com/kellerjordan0/status/1856053121103093922) | 11/10/24 | [log](records/track_1_short/2024-11-10_UNetDoubleLr/c87bb826-797b-4f37-98c7-d3a5dad2de74.txt) | @brendanh0gan | |
| 148 | +12 | 5.03 minutes | [1024-ctx dense causal attention → 64K-ctx FlexAttention](https://x.com/kellerjordan0/status/1859331370268623321) | 11/19/24 | [log](records/track_1_short/2024-11-19_FlexAttention/8384493d-dba9-4991-b16b-8696953f5e6d.txt) | @KoszarskyB | |
| 149 | +13 | 4.66 minutes | [Attention window warmup](https://x.com/hi_tysam/status/1860851011797053450) | 11/24/24 | [log](records/track_1_short/2024-11-24_WindowWarmup/cf9e4571-c5fc-4323-abf3-a98d862ec6c8.txt) | @fernbear.bsky.social | |
| 150 | +14 | 4.41 minutes | [Value Embeddings](https://x.com/KoszarskyB/status/1864746625572257852) | 12/04/24 | [log](records/track_1_short/2024-12-04_ValueEmbed) | @KoszarskyB | |
| 151 | +15 | 3.95 minutes | [U-net pattern value embeddings, assorted code optimizations](https://x.com/YouJiacheng/status/1865761473886347747) | 12/08/24 | [log](records/track_1_short/2024-12-08_UNetValueEmbedsTweaks) | @leloykun, @YouJiacheng | |
| 152 | +16 | 3.80 minutes | [Split value embeddings, block sliding window, separate block mask](https://x.com/YouJiacheng/status/1866734331559071981) | 12/10/24 | [log](records/track_1_short/2024-12-10_MFUTweaks) | @YouJiacheng | |
| 153 | +17 | 3.57 minutes | [Sparsify value embeddings, improve rotary embeddings, drop an attn layer](https://x.com/YouJiacheng/status/1868938024731787640) | 12/17/24 | [log](records/track_1_short/2024-12-17_SparsifyEmbeds) | @YouJiacheng | |
| 154 | +18 | 3.4 minutes | [Lower logit softcap from 30 to 15](https://x.com/kellerjordan0/status/1876048851158880624) | 01/04/25 | [log](records/track_1_short/2025-01-04_SoftCap/31d6c427-f1f7-4d8a-91be-a67b5dcd13fd.txt) | @KoszarskyB | |
| 155 | +19 | 3.142 minutes | [FP8 head, offset logits, lr decay to 0.1 instead of 0.0](https://x.com/YouJiacheng/status/1878827972519772241) | 01/13/25 | [log](records/track_1_short/2025-01-13_Fp8LmHead/c51969c2-d04c-40a7-bcea-c092c3c2d11a.txt) | @YouJiacheng | |
| 156 | +20 | 2.992 minutes | [Merged QKV weights, long-short attention, attention scale, lower Adam epsilon, batched Muon](https://x.com/leloykun/status/1880301753213809016) | 01/16/25 | [log](records/track_1_short/2025-01-16_Sub3Min/1d3bd93b-a69e-4118-aeb8-8184239d7566.txt) | @leloykun, @fernbear.bsky.social, @YouJiacheng, @brendanh0gan, @scottjmaddox, @Grad62304977 | |
| 157 | +21 | 2.933 minutes | [Reduced batch size](https://x.com/leloykun/status/1885640350368420160) | 01/26/25 | [log](records/track_1_short/2025-01-26_BatchSize/c44090cc-1b99-4c95-8624-38fb4b5834f9.txt) | @leloykun | |
| 158 | +21 | 2.997 minutes | 21st record with new timing | 02/01/25 | [log](records/track_1_short/2025-02-01_RuleTweak/eff63a8c-2f7e-4fc5-97ce-7f600dae0bc7.txt) | not a new record, just re-timing #21 with the [updated rules](#timing-change-after-record-21) | |
| 159 | +21 | 3.014 minutes | 21st record with latest torch | 05/24/25 | [log](records/track_1_short/2025-05-24_StableTorch/89d9f224-3b01-4581-966e-358d692335e0.txt) | not a new record, just re-timing #21 with latest torch | |
| 160 | +22 | 2.990 minutes | [Faster gradient all-reduce](https://x.com/KonstantinWille/status/1927137223238909969) | 05/24/25 | [log](records/track_1_short/2025-05-24_FasterReduce/23f40b75-06fb-4c3f-87a8-743524769a35.txt) | @KonstantinWilleke, @alexrgilbert, @adricarda, @tuttyfrutyee, @vdlad; The Enigma project | |
| 161 | +23 | 2.979 minutes | [Overlap computation and gradient communication](https://x.com/kellerjordan0/status/1927460573098262616) | 05/25/25 | [log](records/track_1_short/2025-05-25_EvenFasterReduce/6ae86d05-5cb2-4e40-a512-63246fd08e45.txt) | @ryanyang0 | |
| 162 | +24 | 2.966 minutes | Replace gradient all_reduce with reduce_scatter | 05/30/25 | [log](records/track_1_short/2025-05-30_noallreduce/8054c239-3a18-499e-b0c8-dbd27cb4b3ab.txt) | @vagrawal | |
| 163 | +25 | 2.896 minutes | Upgrade PyTorch to 2.9.0.dev20250713+cu126 | 07/13/25 | [log](records/track_1_short/2025-07-13_UpgradeTorch190/692f80e0-5e64-4819-97d4-0dc83b7106b9.txt) | @kellerjordan0 | |
| 164 | +26 | 2.863 minutes | Align training batch starts with EoS, increase cooldown frac to .45 | 07/13/25 | [log](records/track_1_short/2025-07-12_BosAlign/c1fd8a38-bb9f-45c4-8af0-d37f70c993f3.txt) | @classiclarryd | |
| 165 | +27 | 2.817 minutes | Transpose one of the MLP matrices + add Triton kernel for symmetric matmul | 07/18/25 | [log](records/track_1_short/2025-07-18_TritonMuon/record.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/109) | @byronxu99 | |
| 166 | +28 | 2.812 minutes | Sparse attention gate | 08/23/25 | [log](records/track_1_short/2025-08-23_SparseAttnGate/020630eb-2191-4ba2-9ee4-4cdc94316943.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/117) | @classiclarryd | |
| 167 | +29 | 2.731 minutes | Flash Attention 3, 2048 max_doc_len, update ws schedule | 09/03/25 | [log](records/track_1_short/2025-09-03_FA3/44fc1276-0510-4961-92c0-730c65e5feba.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/118) | @varunneal | |
| 168 | +30 | 2.717 minutes | Drop first MLP layer | 09/05/25 | [log](records/track_1_short/2025-09-05_SkipMLPBlocks/07e7ae76-b7d0-4481-b149-01e7d81b5ad4.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/120) | @EmelyanenkoK | |
| 169 | +31 | 2.656 minutes | Dynamically incorporate YaRN during training and validation | 09/10/25 | [log](records/track_1_short/2025-09-10_Yarn/0ecdb695-510b-4c3b-b030-09861a162ce8.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/122) | @classiclarryd | |
| 170 | +32 | 2.625 minutes | Optimize distributed training, improve skip connection gating, and enhance bfloat16 usage | 09/11/25 | [log](records/track_1_short/2025-09-11_VectSigmoidBFloat16/0d0d9882-c34f-4d82-b961-a17d5659c988.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/125) | @bernard24 & AI system [hiverge.ai](https://www.hiverge.ai/) | |
| 171 | +33 | 2.565 minutes | Asynchronously fetch and index data batches, extend final layer attention window for validation | 09/15/25 | [log](records/track_1_short/2025-09-15_AsyncDataLoadAttnFinalWindow/25db37c7-2bab-4ef4-ae63-d593590ef823.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/127) | @classiclarryd | |
| 172 | +34 | 2.547 minutes | Smear token embeddings 1 position forward | 09/18/25 | [log](records/track_1_short/2025-09-18_Smear/18a1e5c7-947e-479d-bc3a-a57a61a98fc9.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/130) | @classiclarryd | |
| 173 | +35 | 2.527 minutes | Drop first attn layer, extend all long windows for validation, update schedule | 09/21/25 | [log](records/track_1_short/2025-09-21_DropAttn/01fc4a96-f2a0-47a1-8a6a-c7d10bac99fe.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/131) | @classiclarryd | |
| 174 | +36 | 2.495 minutes | MuonCustomSizing, perform mlp and attn reduce scatter in shared call | 09/23/25 | [log](records/track_1_short/2025-09-23_MuonCustomSizing/b067b4ac-72a6-4436-a6f8-ea51c1efeef3.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/132) | @classiclarryd | |
| 175 | +37 | 2.483 minutes | Compute cross entropy in BF16 during training | 09/27/25 | [log](records/track_1_short/2025-09-27_BF16CE/08c0770f-17fc-44cd-971d-734a7a28a3e3.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/133) | @Gusarich | |
| 176 | +38 | 2.476 minutes | Polar Express, replacement for Newton-Schulz | 09/29/25 | [log](records/track_1_short/2025-09-29_PolarExpress/0e3f0af5-ad08-47a6-813d-0c709b50d422.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/134) | @varunneal | |
| 177 | +39 | 2.447 minutes | Only update Adam params every other step, reduce batch size | 09/30/25 | [log](records/track_1_short/2025-09-30_CustomBatching/40b101b1-77ea-45ea-a089-1d3a647daa22.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/136) | @classiclarryd | |
| 178 | +40 | 2.358 minutes | Backout, misc hyperparameter tuning, optimize lambda padding | 10/04/25 | [log](records/track_1_short/2025-10-04_Backout/514e7581-fbd4-4338-a3e4-e556f9c958ce.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/140) | @classiclarryd | |
| 179 | +41 | 2.345 minutes | [NorMuon](https://arxiv.org/pdf/2510.05491) | 10/24/25 | [log](records/track_1_short/2025-10-24_NorMuon/088a77ee-9b67-475a-bbb9-3e92e4698799.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/144) | @li_zichong | |
| 180 | +42 | 2.313 minutes | Update NorMuon LR, Step Logic | 10/27/25 | [log](records/track_1_short/2025-10-27_FixMuonLR/14afd380-d3d9-48d7-ad23-4c13cb96754b.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/146) | @varunneal | |
| 181 | +43 | 2.284 minutes | Cautious Weight Decay w/ schedule | 11/10/25 | [log](records/track_1_short/2025-11-10_CautiousWD/1aac0132-a891-4ed9-b358-0fd2abd1b019.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/154) | @varunneal | |
| 182 | +44 | 2.269 minutes | Backward hooks on Adam, [Profiling 101](https://blog.underfit.ai/profiling-101-nanogpt) | 11/16/25 | [log](records/track_1_short/2025-10-31_AdamSyncGradientHook/0c17cdfd-772c-4906-8d11-141b370599a0.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/149) | @akash5474 | |
| 183 | +45 | 2.248 minutes | Refine skip arch, update exponential decay init| 11/18/25 | [log](records/track_1_short/2025-11-18_RefineSkip/00f4e1e6-0044-4a08-b88a-3b7ec0624081.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/159) | @classiclarryd | |
| 184 | +46 | 2.203 minutes | [Batch size schedule](https://x.com/classiclarryd/status/1998212158770065844) | 11/29/25 | [log](records/track_1_short/2025-11-29_BatchSizeSchedule/10e8f7c6-7175-4467-bdb0-a5de25d771a6.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/163) | @varunneal | |
| 185 | +47 | 2.193 minutes | [Multiply attn lambda with weight instead of data, fix warmup](https://x.com/classiclarryd/status/1999630732814348451) | 12/10/25 | [log](records/track_1_short/2025-12-10_SALambdaOnWeights/15ef5eaf-56e1-40e1-9ddf-af010027c9dd.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/166) | @roeeshenberg | |
| 186 | +48 | 2.170 minutes | [Speed up Muon, additional pre-multiply lambda, reshape matrices, update lr, update NorMuon axis](https://x.com/classiclarryd/status/2000272495644152317) | 12/11/25 | [log](records/track_1_short/2025-12-11_NorMuonOptimsAndFixes/82edf6be-f343-475d-b93a-47c32acf4de2.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/168) | @ChrisJMcCormick | |
| 187 | +49 | 2.146 minutes | [Partial Key Offset](https://x.com/classiclarryd/status/2000841339299402142) | 12/14/25 | [log](records/track_1_short/2025-12-14_PartialKeyOffset/150d40bf-c20b-4568-aac9-26eb919e25fd.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/169) | @classiclarryd | |
| 188 | +50 | 2.128 minutes | [Extend Cautious Weight Decay to Adam parameters](https://x.com/classiclarryd/status/2002482925741486381) | 12/18/25 | [log](records/track_1_short/2025-12-18_CautiousWDAdam/1981d492-bc65-4ba9-a0fa-2b30fc5c3eba.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/172) | @roeeshenberg | |
| 189 | +51 | 2.075 minutes | [Retie Embed to lm_head, retune fp8 scales](https://x.com/classiclarryd/status/2003167208483209668) | 12/19/25 | [log](records/track_1_short/2025-12-19_RetieLMHead/0828d309-ecfe-4442-9ee9-68fed3a4b599.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/175) | @varunneal | |
| 190 | +52 | 2.037 minutes | [Smooth scalars via beta increase, decrease smear gate lr, freeze scalars during transitions, adam all reduce](https://x.com/classiclarryd/status/2003863282613190656) | 12/21/25 | [log](records/track_1_short/2025-12-21_SmoothedScalars/12-21-Smoothed-Scalars/0bc6e909-8ee8-4ae3-ac62-0070e151a808.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/177) | @ChrisJMcCormick | |
| 191 | +53 | 1.988 minutes | [Multi-token prediction, untie embed/lm_head at 2/3 training, lr update, tweak CWD](https://x.com/classiclarryd/status/2004248941878296580) | 12/22/25 | [log](records/track_1_short/2025-12-22_MultiTokenPrediction/17aaf854-f338-4d0d-9767-a5db30fd7980.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/178) | @varunneal, feat. @classiclarryd | |
| 192 | +54 | 1.940 minutes | [Asymmetric Logit Rescale](https://x.com/classiclarryd/status/2004791008098480232) | 12/26/25 | [log](records/track_1_short/2025-12-26_LogitRescale/03e41c2d-2951-4546-a599-24cd723247fc.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/181) | @classiclarryd | |
| 193 | +55 | 1.918 minutes | [Gates on value embeds and skip connection](https://x.com/classiclarryd/status/2005659526960492638) | 12/29/25 | [log](records/track_1_short/2025-12-29_VeSkipGates/2851d7dc-d6a5-4e74-8623-57031425db16.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/186) | @classiclarryd | |
| 194 | +56 | 1.894 minutes | [Optimize and compile Adam, increase Adam buffer precision, move gates from Muon to Adam parameter banks](https://x.com/classiclarryd/status/2007882371576873445) | 12/31/25 | [log](records/track_1_short/2025-12-31_GatesToCompiledAdam/12-31-gates-to-adam-20stps/219a5f2f-151e-4c56-ab91-3735ae4610b8.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/187) | @ChrisJMcCormick | |
| 195 | +57 | 1.878 minutes | [Bfloat16 attn/mlp weights, mixed precision Muon, interweave Adam/Muon, finer-grain Adam beta](https://x.com/classiclarryd/status/2008261904566022590) | 01/04/26 | [log](records/track_1_short/2026-01-04_MixedPrecisionInterweavedOptimizer/41f606b6-1b9c-46a3-b46e-2beff1521d18.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/190) | @classiclarryd, feat. @YouJiacheng, @ChrisJMcCormick | |
| 196 | +58 | 1.820 minutes | [Paired Head Attention](https://x.com/classiclarryd/status/2008963501688324228) | 01/07/26 | [log](records/track_1_short/2026-01-07_PairedHeadAttention/2a5d5cde-db5f-4aab-a4a8-cc8e183ea671.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/191) | @classiclarryd | |
| 197 | +59 | 1.781 minutes | [Fused triton kernel for linear relu square MLP step](https://x.com/classiclarryd/status/2010545452832407943) | 01/10/26 | [log](records/track_1_short/2026-01-10_FusedLinearReLUSquare/3c47e63b-075e-4b5b-9c76-9dbe7bad9ad4.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/197) | @andrewbriand8, @Joshrav21 | |
| 198 | +60 | 1.765 minutes | [Fused triton kernel for softcapped multi-token prediction cross entropy step](https://x.com/classiclarryd/status/2012927211448516796) | 01/16/26 | [log](records/track_1_short/2026-01-16_FusedSoftcappedEntropy/45beba56-93e2-4995-bc5b-caff3cb2c1b5.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/199) | @soren_dunn_ & AI System [Locus](https://www.intology.ai/blog/previewing-locus) | |
| 199 | +61 | 1.748 minutes | [Unified Optimizers and Transposed LM Head](https://x.com/classiclarryd/status/2013399457841160702) | 01/18/26 | [log](records/track_1_short/2026-01-18_UnifiedOptimizers/unified-optimizer/2fc79469-a527-4bde-8540-8426ed3352d1.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/200) | @ChrisJMcCormick | |
| 200 | +62 | 1.655 minutes | [Bigram Hash Embedding](https://x.com/classiclarryd/status/2013520088297558274) | 01/19/26 | [log](records/track_1_short/2026-01-19_BigramHashEmbedding/40ec7bb6-14b3-46f8-90b7-bb5ed188faba.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/201) | @classiclarryd | |
| 201 | +63 | 1.650 minutes | [Untie Value Embeds](https://x.com/classiclarryd/status/2016968386476200301) | 01/26/26 | [log](records/track_1_short/2026-01-26-UntieValueEmbeddings/43955d93-6914-40cb-bdf8-786ace93784f.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/209) | @photon_mz | |
| 202 | +64 | 1.630 minutes | [Tuned nonzero Attn V and O init](https://x.com/classiclarryd/status/2017735338601726357) | 01/30/26 | [log](records/track_1_short/2026-01-30_MimeticValueOutput/runs/0f262f64-20c4-4268-9ae7-d7440c810abd.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/214) | @srashedll | |
| 203 | +65 | 1.613 minutes | [Group Value Embeds into single parameter](https://x.com/classiclarryd/status/2018057653742920016) | 01/30/26 | [log](records/track_1_short/2026-01-30_VeFused/0ba09d92-4ef1-440f-85e3-9d2766294db4.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/215) | @varunneal | |
| 204 | +66 | 1.595 minutes | Torch 2.10 | 01/31/26 | - | - | |
| 205 | +67 | 1.540 minutes | [Tune fused softcap kernels and fuse fp8 quantization in LM head](https://x.com/classiclarryd/status/2021015642472869978) | 01/31/26 | [log](records/track_1_short/2026-01-24_ImprovedLMHead/record/73a071ac-522d-4ce0-a4d6-cf3955a376e4.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/207) | @andrewbriand8 | |
| 206 | +68 | 1.535 minutes | [Move bigram hash to GPU](https://x.com/classiclarryd/status/2021450730117460439) | 01/31/26 | [log](records/track_1_short/2026-01-31-BigramHashH2D/112c686e-b0d6-4dc8-814a-1ad1f5d5b274.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/216) | @dhrvji | |
| 207 | +69 | 1.528 minutes | [Kernel Optimizations](https://x.com/classiclarryd/status/2023319358303510719) | 02/02/26 | [log](records/track_1_short/2026-02-02_KernelTuning/25afb73a-332f-4d69-b9ab-f6261497f2d8.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/217) | @EmmettBicker & AI System [Aster](https://www.asterlab.ai/) | |
| 208 | +70 | 1.521 minutes | [Tune value embed layout and ve_gates](https://x.com/classiclarryd/status/2023319358303510719) | 02/03/26 | [log](records/track_1_short/2026-02-03_VeTuned/42cbebac-0599-4a89-a00e-26d1c4cad140.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/218) | @photon_mz | |
| 209 | +71 | 1.516 minutes | [Sparse bigram gradient comms and optimized loading on CPU](https://x.com/classiclarryd/status/2023319358303510719) | 02/06/26 | [log](records/track_1_short/2026-02-06_SparseBigramGradient/02fee7bd-cd22-478b-9e8e-12e857ff3152.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/221) | @roeeshenberg | |
| 210 | +72 | 1.496 minutes | [Increase minimum lr and add max_seq_len schedule](https://x.com/classiclarryd/status/2023319358303510719) | 02/10/26 | [log](records/track_1_short/2026-02-10_ShortWindow/Short-Window_1_1.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/224) | @dualverse-ai & AI System [Station](https://github.com/dualverse-ai/station) | |
| 211 | +73 | 1.485 minutes | [Partitioned Hyperconnections](https://x.com/classiclarryd/status/2026131531207761924) | 02/12/26 | [log](records/track_1_short/2026-02-12_ParallelResiduals/451050db-d471-49db-b19b-be824bb896d0.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/230) | @sisovicm | |
| 212 | +74 | 1.468 minutes | [Flattened GPT forward, removed post attention lambdas, added transpose kernels](https://x.com/classiclarryd/status/2027228782483182059) | 02/16/26 | [log](records/track_1_short/2026-02-16_FlattenForward/pr233/2026-02-16_21-30-05_time-362_secs_F-inject-post-attn_9f12a3.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/233) | @ChrisJMcCormick | |
| 213 | +75 | 1.453 minutes | [Cross Entropy Kernel Optimizations](https://x.com/classiclarryd/status/2030087884854939947) | 02/23/26 | [log](records/track_1_short/2026-02-23_CrossEntropyKernel/1e51be6b-7dd4-41ab-b95d-e57da5814776.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/235) | @moof2x | |
| 214 | +76 | 1.446 minutes | [Reuse and tune backward transpose kernel](https://x.com/classiclarryd/status/2030403421027852337) | 02/28/26 | [log](records/track_1_short/2026-02-28_TransposeCopyBackward/this_pr/14c9cefc-c840-493f-870e-61bb1d2b1d97.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/240) | @samacqua | |
| 215 | +77 | 1.435 minutes | [Replace partitioned hyperconnections with single saved activation](https://x.com/classiclarryd/status/2030465730718908884) | 03/06/26 | [log](records/track_1_short/2026-03-06_SimplifyHC/0ab4a843-8c3a-4fb4-9fff-8e1d39852646.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/241) | @classiclarryd | |
| 216 | +78 | 1.426 minutes | [Tighten bounds on fa3 max_num_docs to match fineweb distribution](https://x.com/classiclarryd/status/2038077427180851240) | 03/22/26 | [log](records/track_1_short/2026-03-22_VarlenMaxDocs/combined/2026-03-22_20-07-32_time-186_secs_06-mbeta2-max-docs_227ce8.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/246) | @ChrisJMcCormick | |
| 217 | +79 | 1.411 minutes | [Fuse Cross Entropy Fwd/Bwk Kernel, to avoid recalc on softcap sigmoid](https://x.com/classiclarryd/status/2045270983343485140) | 04/04/26 | [log](records/track_1_short/2026-04-04_FuseCEFwdAndBwd/runs/19ad9161-37c0-4985-8dd4-6db4e27f34b4.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/251) | @andrewbriand8 | |
| 218 | +80 | 1.406 minutes | [In Muon orthogonize Q and K matrices in pairs of heads, instead of across the full 6 head matrix](https://x.com/classiclarryd/status/2046046809609457904) | 04/08/26 | [log](records/track_1_short/2026-04-08_PairedHeadMuon/logs/split_qk0-1480.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/253) | @samacqua | |
| 219 | +81 | 1.363 minutes | [MUDD Skip Connections](https://x.com/classiclarryd/status/2058486428255035457) | 04/22/26 | [log](records/track_1_short/2026-04-22_MuddFormer/this_pr_v3),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/259) | @Lisennlp | |
| 220 | +82 | 1.353 minutes | [Learnable XSA](https://x.com/classiclarryd/status/2058975556520329302) | 04/29/26 | [log](records/track_1_short/2026-04-29_XSAGatedLayers/this_pr_v1-s1410/06563169-6435-48ba-a1ad-f3e61bfcc573.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/264) | @_djdumpling | |
| 221 | +83 | 1.328 minutes | [Sign Trick on Bigram Embed](https://x.com/classiclarryd/status/2063061926092099868) | 05/20/26 | [log](records/track_1_short/2026-05-20_BigramsSignTrick/pr299/0cf91274-eda8-49cd-9a97-9369f730f271.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/299) | @TrianX | |
| 222 | +84 | 1.320 minutes | [FP8 on MLP up-projection forward pass]() | 05/21/26 | [log](records/track_1_short/2026-05-19_FP8MLPUpProj/this_record/008bb79d-d5bc-4205-bd4e-5e4ae82e658c.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/306) | @sisovicm | |
| 223 | +85 | 1.271 minutes | [MUDD gates and Lightweight Dynamically Composable MHA](https://x.com/classiclarryd/status/2081451521229881374) | 05/27/26 | [log](records/track_1_short/2026-05-27-MuddGatedAndDC),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/315) | @Lisennlp | |
| 224 | +86 | 1.266 minutes | [Algebraic rewrite of XSA, same math faster execution](https://x.com/classiclarryd/status/2081909171554071027) | 05/27/26 | [PR](https://github.com/KellerJordan/modded-nanogpt/pull/317) | @aryavohra | |
| 225 | +87 | 1.256 minutes | [Faster Implementation of Relu^2 Kernel](https://x.com/classiclarryd/status/2083739041338630372) | 06/11/26 | [log](records/track_1_short/2026-06-11_RecursiveFromBest/this_pr/00088a48-30a3-4ebd-9768-6061011337f4.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/322) | @cong_ml and AI System [Recursive](https://www.recursive.com/) | |
| 226 | +88 | 1.243 minutes | [Prefix token prediction auxiliary loss](https://x.com/classiclarryd/status/2083961001930834419) | 07/13/26 | [log](records/track_1_short/2026-07-13_PrefixTokenPrediction/prefix-1375/1b20ccf2-cb2f-4b6b-bc8a-2d9cd146f549.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/337) | @jvarho | |
| 227 | +89 | 1.23 minutes | [MLP down projection in FP8 with efficient delayed scaling metric](https://x.com/classiclarryd/status/2086582390135406713) | 07/17/26 | [log](records/track_1_short/2026-07-17_FP8DownProjection/this_pr/11cb620c-daaf-4e85-83fc-258a5eb7ba09.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/342) | @Mister-dev-oss, @CerovazS, @MarioPaerle, @GabrieleCirillo, @crisostomi | |
| 228 | +90 | 1.13 minutes | 128 -> 96 dim QK, Fuse QK Norm, RoPE, and KeyOffset into Triton, Move MLP bwk to FP8, Move QKV fwd and bwk to FP8. | 08/03/26 | [log](records/track_1_short/2026-08-03_FP8MLPBackwardPackedQKV),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/344) | @theonlyglitch_ | |
| 229 | +91 | 1.126 minutes | Mask logits for infeasible token continuations during validation. | 08/06/26 | [log](records/track_1_short/2026-08-06-CanonicalMasking),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/350) | @jvarho | |
| 230 | +92 | 0.665 minutes | Sampled softmax over the early stages, full FP8 MLP fwd+bwd, 84.6M-row hashed n-gram table, ANVIL optimizer stack, depth reduction + mixed-width QK attention, full CUDA-graph capture of the training step | 08/30/26 | [log](records/track_1_short/2026-08-30_ANVIL2),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/360) | @DevenPzak | |
| 231 | + | |
| 232 | + | |
| 233 | +## Rules | |
| 234 | + | |
| 235 | +New records must: | |
| 236 | + | |
| 237 | +1. Not modify the train or validation data pipelines. (You can change the batch size, sequence length, attention structure etc.; just don't change the underlying streams of tokens.) | |
| 238 | +2. Attain ≤3.28 mean val loss. (Due to inter-run variance, submissions must provide enough run logs to attain a statistical significance level of p<0.01 that their mean val loss is ≤3.28. Example code to compute p-value can be found [here](records/track_1_short/2025-01-04_SoftCap#softer-softcap). For submissions which improve speed by optimizing the systems performance, without touching the ML, this requirement is waived.) | |
| 239 | +3. Not use any extra `torch._inductor.config` or `torch.compile` flags. (These can save a few seconds, but they can also make compilation take >30min. This rule was introduced after the 21st record.) | |
| 240 | +4. Run faster than the prior record when baselined on the same hardware. | |
| 241 | + | |
| 242 | +Incorporating open PRs into a new record is strongly encouraged. This speeds up merges through peer validation and prevents new PRs from going stale due to conflicts with earlier, still-open PRs. | |
| 243 | + | |
| 244 | +Discretionary reasons why a PR may not be accepted: | |
| 245 | +1. Disproportionately degrades the readability of the codebase. A 200 line kernel to drop 300ms is considered worthwhile. 500 lines that convolute the optimizer layout for a 50ms gain will likely be rejected. | |
| 246 | +2. The current record is intentionally kept roughly 0.001-0.002 loss below 3.28 to make validation simpler. If a PR substantially consumes this buffer, it should do so in a way that outperforms a simple step count decrease, when measured at equivalent loss. | |
| 247 | + | |
| 248 | +> Note: `torch._inductor.config.coordinate_descent_tuning` is allowed for GPT-2 Medium track (a.k.a. 2.92 track). | |
| 249 | + | |
| 250 | +Other than that, anything and everything is fair game! | |
| 251 | + | |
| 252 | +[further clarifications](https://github.com/KellerJordan/modded-nanogpt/discussions/23?sort=new#discussioncomment-12109560) | |
| 253 | + | |
| 254 | +--- | |
| 255 | + | |
| 256 | +### Comment on the target metric | |
| 257 | + | |
| 258 | +The target metric is *cross-entropy loss on the FineWeb val set*. To speak mathematically, the goal of the speedrun is *to obtain a probability model of language which assigns a probability of at least `math.exp(-3.28 * 10485760)` to the first 10,485,760 tokens of the FineWeb valset. Hence, e.g., we allow evaluation at any sequence length, so long as we still have a valid probability model of language. | |
| 259 | + | |
| 260 | +--- | |
| 261 | + | |
| 262 | +### Timing change after record 21 | |
| 263 | + | |
| 264 | +After the 21st record, we made two changes to the timing. First, there used to be an initial "grace period" of 10 untimed steps to allow kernel warmup. We replaced this with an explicit kernel-warmup section which is untimed and uses dummy data. This results in an extra runtime of 850ms from the 10 extra timed steps. | |
| 265 | +Second, we banned the use of `torch._inductor.config.coordinate_descent_tuning`. This saves ~25min of untimed pre-run compilation, but results in an extra runtime of ~3s. | |
| 266 | + | |
| 267 | +<!--Note: The original llm.c baseline is intended to be closer to a replication of GPT-2 than to an optimized LLM training. | |
| 268 | +So it's no surprise that there is room to improve; as @karpathy has said, 'llm.c still has a lot of pending optimizations.' | |
| 269 | +In addition, many of the techniques used in these records are completely standard, such as rotary embeddings. | |
| 270 | +The goal of this benchmark/speedrun is simply to find out which techniques actually work, and maybe come up with some new ones.--> | |
| 271 | +<!--The goal of this benchmark is simply to find out all the techniques which actually work, because I'm going crazy reading all these | |
| 272 | +LLM training papers | |
| 273 | +which claim a huge benefit but then use their own idiosyncratic non-competitive benchmark and therefore no one in the community has any idea if it's legit for months.--> | |
| 274 | +<!--[LLM](https://arxiv.org/abs/2305.14342) [training](https://arxiv.org/abs/2402.17764) [papers](https://arxiv.org/abs/2410.01131)--> | |
| 275 | +<!--I mean hello??? We're in a completely empirical field; it is insane to not have a benchmark. Ideally everyone uses the same LLM training benchmark, | |
| 276 | +and then reviewing LLM training papers becomes as simple as checking if they beat the benchmark. It's not like this would be unprecedented, that's how things | |
| 277 | +were in the ImageNet days. | |
| 278 | +The only possible 'benefit' I can think of for any empirical field to abandon benchmarks is that it would make it easier to publish false results. Oh, I guess that's why it happened. | |
| 279 | +Hilarious to think about how, in the often-commented-upon and ongoing collapse of the peer review system, people blame the *reviewers* -- | |
| 280 | +yeah, those guys doing free labor who everyone constantly musters all of their intelligence to lie to, it's *their* fault! My bad, you caught me monologuing.--> | |
| 281 | + | |
| 282 | +--- | |
| 283 | + | |
| 284 | +### Notable attempts & forks | |
| 285 | + | |
| 286 | +**Notable runs:** | |
| 287 | + | |
| 288 | +* [@alexjc's 01/20/2025 2.77-minute TokenMonster-based record](https://x.com/alexjc/status/1881410039639863622). | |
| 289 | +This record is technically outside the rules of the speedrun, since we specified that the train/val tokens must be kept fixed. | |
| 290 | +However, it's very interesting, and worth including. The run is not more data-efficient; rather, the speedup comes from the improved tokenizer allowing | |
| 291 | +the vocabulary size to be reduced (nearly halved!) while preserving the same bytes-per-token, which saves lots of parameters and FLOPs in the head and embeddings. | |
| 292 | +* [@samacqua's 1/23/2026 test time training run](https://github.com/KellerJordan/modded-nanogpt/pull/205). Sam found that prediction accuracy on the later portions of a given document could be improved by performing a training | |
| 293 | +update on Adam parameters based on the early portion of the document. This 'parameter nudging' is repeated independently for each document. Interestingly, these gradient updates prove effective while only using ~500 tokens, substantially less than the over 200k tokens typically used on a normal training step. While technically a valid probability model, we are not allowing untimed backward passes. | |
| 294 | + | |
| 295 | +**Notable forks:** | |
| 296 | +* [https://github.com/BlinkDL/modded-nanogpt-rwkv](https://github.com/BlinkDL/modded-nanogpt-rwkv) | |
| 297 | +* [https://github.com/nikhilvyas/modded-nanogpt-SOAP](https://github.com/nikhilvyas/modded-nanogpt-SOAP) | |
| 298 | + | |
| 299 | +--- | |
| 300 | + | |
| 301 | +## Speedrun track 2: GPT-2 Medium | |
| 302 | + | |
| 303 | +The target loss for this track is lowered from 3.28 to 2.92, as per Andrej Karpathy's 350M-parameter llm.c baseline. | |
| 304 | +This baseline generates a model with performance similar to the original GPT-2 Medium, whereas the first track's baseline generates a model on par with GPT-2 Small. | |
| 305 | +All other rules remain the same. | |
| 306 | + | |
| 307 | +> Note: `torch._inductor.config.coordinate_descent_tuning` is turned on after the record 6 (*). | |
| 308 | + | |
| 309 | +| # | Record time | Description | Date | Log | Contributors | | |
| 310 | +| - | - | - | - | - | - | | |
| 311 | +1 | 5.8 hours | [llm.c baseline (350M parameters)](https://github.com/karpathy/llm.c/discussions/481) | 05/28/24 | [log](records/track_2_medium/2025-01-18/main.log) | @karpathy, llm.c contributors | |
| 312 | +2 | 29.3 minutes | [Initial record based on scaling up the GPT-2 small track speedrun](https://x.com/kellerjordan0/status/1881959719012847703) | 01/18/25 | [log](records/track_2_medium/2025-01-18/241dd7a7-3d76-4dce-85a4-7df60387f32a.txt) | @kellerjordan0 | |
| 313 | +3 | 28.1 minutes | [Added standard weight decay](https://x.com/kellerjordan0/status/1888320690543284449) | 02/08/25 | [log](records/track_2_medium/2025-02-08_WeightDecay/b01743db-605c-4326-b5b1-d388ee5bebc5.txt) | @kellerjordan0 | |
| 314 | +4 | 27.7 minutes | [Tuned Muon Newton-Schulz coefficients](https://x.com/leloykun/status/1892793848163946799) | 02/14/25 | [log](records/track_2_medium/2025-02-14_OptCoeffs/1baa66b2-bff7-4850-aced-d63885ffb4b6.txt) | @leloykun | |
| 315 | +5 | 27.2 minutes | [Increased learning rate cooldown phase duration](records/track_2_medium/2025-03-06_LongerCooldown/779c041a-2a37-45d2-a18b-ec0f223c2bb7.txt) | 03/06/25 | [log](records/track_2_medium/2025-03-06_LongerCooldown/779c041a-2a37-45d2-a18b-ec0f223c2bb7.txt) | @YouJiacheng | |
| 316 | +6 | 25.95 minutes* | [2x MLP wd, qkv norm, all_reduce/opt.step() overlap, optimized skip pattern](https://x.com/YouJiacheng/status/1905861218138804534) | 03/25/25 | [log](records/track_2_medium/2025-03-25_ArchOptTweaks/train_gpt-20250329.txt) | @YouJiacheng | |
| 317 | +7 | 25.29 minutes | [Remove FP8 head; ISRU logits softcap; New sharded mixed precision Muon; merge weights](https://x.com/YouJiacheng/status/1912570883878842527) | 04/16/25 | [log](records/track_2_medium/2025-04-16_Record7/223_3310d0b1-b24d-48ee-899f-d5c2a254a195.txt) | @YouJiacheng | |
| 318 | +8 | 24.50 minutes | [Cubic sliding window size schedule, 2× max window size (24.84 minutes)](https://x.com/jadenj3o/status/1914893086276169754) [24.5min repro](https://x.com/YouJiacheng/status/1915667616913645985) | 04/22/25 | [log](records/track_2_medium/2025-04-22_Record8/075_640429f2-e726-4e83-aa27-684626239ffc.txt) | @jadenj3o | |
| 319 | +9 | 24.12 minutes | [Add two value embeddings](https://snimu.github.io/2025/10/07/modded-nanogpt-value-embeddings.html) | 08/28/25 | [log](records/track_2_medium/2025-08-28_NewValemb/036_61ef4351-7b68-4897-b440-a99221a1a629.txt), [PR](https://github.com/KellerJordan/modded-nanogpt/pull/119) | @snimu | |
| 320 | +10 | 24.07 minutes | [Second input embedding](https://snimu.github.io/2025/10/10/modded-nanogpt-x0.html) | 09/11/25 | [log](records/track_2_medium/2025-09-11_SecondInputEmbed/000_592014ec-6781-4f59-b274-c4af68ccfe75.txt), [PR](https://github.com/KellerJordan/modded-nanogpt/pull/124) | @snimu | |
| 321 | +11 | 23.45 minutes | Upgrade from torch 2.7 to torch==2.10.0.dev20251210+cu126 | - | - | - | |
| 322 | +12 | 23.28 minutes | Snoo Optimizer (Outer optimizer around Adam and Muon) | 09/16/25 | [log](records/track_2_medium/2025-09-16_Snoo/000_01db7a67-f715-4114-a7b5-6bfe23bac1b1.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/128) | @dominikkallusky | |
| 323 | +13 | 23.14 minutes | EMA Wrapper on Muon | 09/17/25 | [log](records/track_2_medium/2025-09-17_UpdateSmoothing/001_8379f695-6bc3-4f76-b58b-8fadd3b6ebb0.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/129) | @acutkosky | |
| 324 | +14 | 23.08 minutes | Combine both records 12 & 13 | 09/30/25 | [log](records/track_2_medium/2025-09-30_SmoothedSnooMedium/101_5bc91cd0-cb46-428c-a5da-9d8d228f1f97.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/137) | @acutkosky | |
| 325 | +15 | 23.03 minutes | Backout (Skip from 2/3 point to pre-lm_head) | 10/04/25 | [log](records/track_2_medium/2025-10-04_GPT2MediumLayerReuse/000_cc3943e4-02b5-4ae3-9441-839d32dfd9b2.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/139) | @snimu | |
| 326 | +16 | 22.99 minutes | Smear-MTP | 11/02/25 | [log](records/track_2_medium/2025-11-02-Smear-MTP/000_3b50518d-d542-44bc-8566-3abf633f83ad.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/151) | @snimu | |
| 327 | +17 | 22.98 minutes | Remove Redundant Mask Op | 11/12/25 | [log](records/track_2_medium/2025-11-12_BlockMaskRedundantOp/000_3b22a9d4-b52e-4916-99bf-3d48b38747a7.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/157/) | @manikbhandari | |
| 328 | +18 | 17.35 minutes | Bulk transfer short track features | 12/31/25 | [log](records/track_2_medium/2025-12-31_BulkSmallTrackTransfer/354be270-7d41-44b7-8064-f040923f024f.txt),[PR](https://github.com/KellerJordan/modded-nanogpt/pull/188) | - | |
| 329 | +--- | |
| 330 | + | |
| 331 | +### Q: What is the point of NanoGPT speedrunning? | |
| 332 | + | |
| 333 | +A: The officially stated goal of NanoGPT speedrunning is as follows: `gotta go fast`. But for something a little more verbose involving an argument for good benchmarking, here's some kind of manifesto, adorned with a blessing from the master. [https://x.com/karpathy/status/1846790537262571739](https://x.com/karpathy/status/1846790537262571739) | |
| 334 | + | |
| 335 | +### Q: What makes "NanoGPT speedrunning" not just another idiosyncratic benchmark? | |
| 336 | + | |
| 337 | +A: Because it is a *competitive* benchmark. In particular, if you attain a new speed record (using whatever method you want), there is an open invitation for you | |
| 338 | +to post that record (on arXiv or X) and thereby vacuum up all the clout for yourself. I will even help you do it by reposting you as much as I can. | |
| 339 | + | |
| 340 | +<!--On the contrary, for example, the benchmark used in the [Sophia](https://arxiv.org/abs/2305.14342) paper does *not* have this property. | |
| 341 | +There is no such open invitation for anyone to compete on the benchmark they used. In particular, if, for a random and definitely not weirdly specific example, you happen to find better AdamW hyperparameters for their training setup than | |
| 342 | +the ones they used which significantly close the gap between AdamW and their proposed optimizer, | |
| 343 | +then there is no clear path for you to publish that result in *any* form. | |
| 344 | +You could try posting it on X.com, but then you would be risking being perceived as aggressive/confrontational, which is *not a good look* in this racket. | |
| 345 | +So if you're rational, the result probably just dies with you and no one else learns anything | |
| 346 | +(unless you're in a frontier lab, in which case you can do a nice internal writeup. Boy I'd love to get my hands on those writeups).--> | |
| 347 | + | |
| 348 | +["Artificial intelligence advances by inventing games and gloating to goad others to play" - Professor Ben Recht](https://www.argmin.net/p/too-much-information) | |
| 349 | + | |
| 350 | +### Q: NanoGPT speedrunning is cool and all, but meh it probably won't scale and is just overfitting to val loss | |
| 351 | + | |
| 352 | +A: This is hard to refute, since "at scale" is an infinite category (what if the methods stop working only for >100T models?), making it impossible to fully prove. | |
| 353 | +Also, I would agree that some of the methods used in the speedrun are unlikely to scale, particularly those which *impose additional structure* on the network, such as logit softcapping. | |
| 354 | +But if the reader cares about 1.5B models, they might be convinced by this result: | |
| 355 | + | |
| 356 | +*Straightforwardly scaling up the speedrun (10/18/24 version) to 1.5B parameters yields a model with GPT-2 (1.5B)-level HellaSwag performance 2.5x more cheaply than [@karpathy's baseline](https://github.com/karpathy/llm.c/discussions/677) ($233 instead of $576):* | |
| 357 | + | |
| 358 | + | |
| 359 | +[[reproducible log](https://github.com/KellerJordan/modded-nanogpt/blob/master/records/track_1_short/2024-10-20_ScaleUp1B/ad8d7ae5-7b2d-4ee9-bc52-f912e9174d7a.txt)] | |
| 360 | + | |
| 361 | + | |
| 362 | +--- | |
| 363 | + | |
| 364 | +## [Muon optimizer](https://github.com/KellerJordan/Muon) | |
| 365 | + | |
| 366 | +Muon is defined as follows: | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | +Where NewtonSchulz5 is the following Newton-Schulz iteration [2, 3], which approximately replaces `G` with `U @ V.T` where `U, S, V = G.svd()`. | |
| 371 | +```python | |
| 372 | +@torch.compile | |
| 373 | +def zeroth_power_via_newtonschulz5(G, steps=5, eps=1e-7): | |
| 374 | + assert len(G.shape) == 2 | |
| 375 | + a, b, c = (3.4445, -4.7750, 2.0315) | |
| 376 | + X = G.bfloat16() / (G.norm() + eps) | |
| 377 | + if G.size(0) > G.size(1): | |
| 378 | + X = X.T | |
| 379 | + for _ in range(steps): | |
| 380 | + A = X @ X.T | |
| 381 | + B = b * A + c * A @ A | |
| 382 | + X = a * X + B @ X | |
| 383 | + if G.size(0) > G.size(1): | |
| 384 | + X = X.T | |
| 385 | + return X.to(G.dtype) | |
| 386 | +``` | |
| 387 | + | |
| 388 | +For this training scenario, Muon has the following favorable properties: | |
| 389 | +* Lower memory usage than Adam | |
| 390 | +* ~1.5x better sample-efficiency | |
| 391 | +* <2% wallclock overhead | |
| 392 | + | |
| 393 | + | |
| 394 | +### Provenance | |
| 395 | + | |
| 396 | +Many of the choices made to generate this optimizer were obtained experimentally by our pursuit of [CIFAR-10 speedrunning](https://github.com/KellerJordan/cifar10-airbench). | |
| 397 | +In particular, we experimentally obtained the following practices: | |
| 398 | +* Using Nesterov momentum inside the update, with orthogonalization applied after momentum. | |
| 399 | +* Using a specifically quintic Newton-Schulz iteration as the method of orthogonalization. | |
| 400 | +* Using non-convergent coefficients for the quintic polynomial in order to maximize slope at zero, and thereby minimize the number of necessary Newton-Schulz iterations. | |
| 401 | +It turns out that the variance doesn't actually matter that much, so we end up with a quintic that rapidly converges to the range 0.68, 1.13 upon repeated application, rather than converging more slowly to 1. | |
| 402 | +* Running the Newton-Schulz iteration in bfloat16 (whereas Shampoo implementations often depend on inverse-pth-roots run in fp32 or fp64). | |
| 403 | + | |
| 404 | +Our use of a Newton-Schulz iteration for orthogonalization traces to [Bernstein & Newhouse (2024)](https://arxiv.org/abs/2409.20325), | |
| 405 | +who suggested it as a way to compute Shampoo [5, 6] preconditioners, and theoretically explored Shampoo without preconditioner accumulation. | |
| 406 | +In particular, Jeremy Bernstein @jxbz sent us the draft, which caused us to experiment with various Newton-Schulz iterations as the | |
| 407 | +orthogonalization method for this optimizer. | |
| 408 | +If we had used SVD instead of a Newton-Schulz iteration, this optimizer would have been too slow to be useful. | |
| 409 | +Bernstein & Newhouse also pointed out that Shampoo without preconditioner accumulation is equivalent to steepest descent in the spectral norm, | |
| 410 | +and therefore Shampoo can be thought of as a way to smooth out spectral steepest descent. | |
| 411 | +The proposed optimizer can be thought of as a second way of smoothing spectral steepest descent, with a different set of memory and runtime tradeoffs | |
| 412 | +compared to Shampoo. | |
| 413 | + | |
| 414 | +--- | |
| 415 | + | |
| 416 | +## Running on fewer GPUs | |
| 417 | + | |
| 418 | +* To run experiments on fewer GPUs, simply modify `run.sh` to have a different `--nproc_per_node`. This should not change the behavior of the training. | |
| 419 | +* If you're running out of memory, you may need to reduce the sequence length for FlexAttention (which does change the training. see [here](https://github.com/KellerJordan/modded-nanogpt/pull/38) for a guide) | |
| 420 | + | |
| 421 | +--- | |
| 422 | + | |
| 423 | +## References | |
| 424 | + | |
| 425 | +1. [Guilherme Penedo et al. "The fineweb datasets: Decanting the web for the finest text data at scale." arXiv preprint arXiv:2406.17557 (2024).](https://arxiv.org/abs/2406.17557) | |
| 426 | +2. Nicholas J. Higham. Functions of Matrices. Society for Industrial and Applied Mathematics (2008). Equation 5.22. | |
| 427 | +3. Günther Schulz. Iterative Berechnung der reziproken Matrix. Z. Angew. Math. Mech., 13:57â59 (1933). | |
| 428 | +4. [Jeremy Bernstein and Laker Newhouse. "Old Optimizer, New Norm: An Anthology." arxiv preprint arXiv:2409.20325 (2024).](https://arxiv.org/abs/2409.20325) | |
| 429 | +5. [Vineet Gupta, Tomer Koren, and Yoram Singer. "Shampoo: Preconditioned stochastic tensor optimization." International Conference on Machine Learning. PMLR, 2018.](https://arxiv.org/abs/1802.09568) | |
| 430 | +6. [Rohan Anil et al. "Scalable second order optimization for deep learning." arXiv preprint arXiv:2002.09018 (2020).](https://arxiv.org/abs/2002.09018) | |
| 431 | +7. [Alexander Hägele et al. "Scaling Laws and Compute-Optimal Training Beyond Fixed Training Durations." arXiv preprint arXiv:2405.18392 (2024).](https://arxiv.org/abs/2405.18392) | |
| 432 | +8. [Zhanchao Zhou et al. "Value Residual Learning For Alleviating Attention Concentration In Transformers." arXiv preprint arXiv:2410.17897 (2024).](https://arxiv.org/abs/2410.17897) | |
| 433 | +9. [Team, Gemma, et al. "Gemma 2: Improving open language models at a practical size." arXiv preprint arXiv:2408.00118 (2024).](https://arxiv.org/abs/2408.00118) | |
| 434 | +10. [Alec Radford et al. "Language models are unsupervised multitask learners." OpenAI blog 1.8 (2019).](https://cdn.openai.com/better-language-models/language_models_are_unsupervised_multitask_learners.pdf) | |
| 435 | + | |
| 436 | +## Citation | |
| 437 | + | |
| 438 | +``` | |
| 439 | +@misc{modded_nanogpt_2024, | |
| 440 | + author = {Keller Jordan and Jeremy Bernstein and Brendan Rappazzo and | |
| 441 | + @fernbear.bsky.social and Boza Vlado and You Jiacheng and | |
| 442 | + Franz Cesista and Braden Koszarsky and @Grad62304977}, | |
| 443 | + title = {modded-nanogpt: Speedrunning the NanoGPT baseline}, | |
| 444 | + year = {2024}, | |
| 445 | + url = {https://github.com/KellerJordan/modded-nanogpt} | |
| 446 | +} | |
| 447 | +``` | |
| 448 | + | |
| 449 | +<img src="img/dofa.jpg" alt="itsover_wereback" style="width:100%;"> | |
| 450 | + |
evidence/math-training/data-sha256.txt
| new file mode 100644 | ||
| @@ -0,0 +1,4 @@ | ||
| 1 | +45965b000311d1550e5619b60b5bf31cf76edebfd8b8eddc62a876fbf8c9be95 /home/drakestapleton/.cache/huggingface/datasets/openai___gsm8k/main/0.0.0/740312add88f781978c0658806c59bc2815b9866/gsm8k-test.arrow | |
| 2 | +6146bca074f4c6c5e07de7e96cc968adab3833dbdafeda21830f27558eea3d9b /home/drakestapleton/.cache/huggingface/datasets/openai___gsm8k/main/0.0.0/740312add88f781978c0658806c59bc2815b9866/gsm8k-train.arrow | |
| 3 | +3730d312f6e3440559ace48831e51066acaca737f6eabec99bccb9e4b3c39d14 .scratch/gsm8k-test.jsonl | |
| 4 | +17f347dc51477c50d4efb83959dbb7c56297aba886e5544ee2aaed3024813465 .scratch/gsm8k-train.jsonl |
evidence/math-training/e1-extract.json
| new file mode 100644 | ||
| @@ -0,0 +1,36 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "ed8b6ea2562efdda7913234ca8f34b443714a987", | |
| 8 | + "code_dirty": true, | |
| 9 | + "command": ".venv/bin/python extract_e1.py", | |
| 10 | + "utc": "2026-10-20T18:22:33Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "logit_check_max_abs_diff": 0.0, | |
| 14 | + "fit": { | |
| 15 | + "examples_available": 6000, | |
| 16 | + "tokens": 262144, | |
| 17 | + "d": 2048, | |
| 18 | + "sha256_X": "c12832f42858c3b7df4ae9906633dc482c7bfffad8fd6f64fc566871411ac990", | |
| 19 | + "seconds": 54.25414299964905 | |
| 20 | + }, | |
| 21 | + "val": { | |
| 22 | + "examples_available": 1473, | |
| 23 | + "tokens": 32768, | |
| 24 | + "d": 2048, | |
| 25 | + "sha256_X": "782aac1adbd7d2502335878179a92355c243c65b03b54cdc245edc4cdc2b55ca", | |
| 26 | + "seconds": 5.358727931976318 | |
| 27 | + }, | |
| 28 | + "test": { | |
| 29 | + "examples_available": 1319, | |
| 30 | + "tokens": 65536, | |
| 31 | + "d": 2048, | |
| 32 | + "sha256_X": "197c9f6967f8bdc39eaf62befef3c4a3c92f905a7c3a490fd9e504eafeec1f35", | |
| 33 | + "seconds": 15.12168836593628 | |
| 34 | + }, | |
| 35 | + "peak_gpu_bytes": 5461195776 | |
| 36 | +} | |
| \ No newline at end of file |
evidence/math-training/e1-sweep.json
| new file mode 100644 | ||
| @@ -0,0 +1,5274 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "2b78ff0c9f2a49994214b301e8f5360050a72256", | |
| 8 | + "code_dirty": true, | |
| 9 | + "command": ".venv/bin/python e1.py sweep", | |
| 10 | + "utc": "2026-10-20T18:38:28Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "N_fit": 262144, | |
| 14 | + "N_val": 32768, | |
| 15 | + "N_test": 65536, | |
| 16 | + "D_with_bias": 2049, | |
| 17 | + "K": 1024, | |
| 18 | + "class_coverage_in_topK": { | |
| 19 | + "fit": 0.9151954650878906, | |
| 20 | + "val": 0.912200927734375, | |
| 21 | + "test": 0.90447998046875 | |
| 22 | + }, | |
| 23 | + "digit_rate": { | |
| 24 | + "fit": 0.2727012634277344, | |
| 25 | + "val": 0.27850341796875, | |
| 26 | + "test": 0.2714996337890625 | |
| 27 | + }, | |
| 28 | + "ceiling_A": { | |
| 29 | + "val": { | |
| 30 | + "top1": 0.8548583984375, | |
| 31 | + "nll": 0.5199834406375885 | |
| 32 | + }, | |
| 33 | + "test": { | |
| 34 | + "top1": 0.7472381591796875, | |
| 35 | + "nll": 1.0199434161186218 | |
| 36 | + } | |
| 37 | + }, | |
| 38 | + "ceiling_B": { | |
| 39 | + "val": { | |
| 40 | + "auc": 0.9997035264968872, | |
| 41 | + "bal_acc": 0.9927416741847992, | |
| 42 | + "nll": 0.019762713462114334 | |
| 43 | + }, | |
| 44 | + "test": { | |
| 45 | + "auc": 0.9992262125015259, | |
| 46 | + "bal_acc": 0.9873001575469971, | |
| 47 | + "nll": 0.034085046499967575 | |
| 48 | + } | |
| 49 | + }, | |
| 50 | + "target_val_top1": { | |
| 51 | + "ceil-1.0": 0.8448583984375, | |
| 52 | + "ceil-0.5": 0.8498583984375 | |
| 53 | + }, | |
| 54 | + "ridge_A": { | |
| 55 | + "val_by_lambda": { | |
| 56 | + "1e-06": { | |
| 57 | + "top1": 0.712158203125, | |
| 58 | + "nll": 6.44181752204895 | |
| 59 | + }, | |
| 60 | + "1e-05": { | |
| 61 | + "top1": 0.712127685546875, | |
| 62 | + "nll": 6.441824674606323 | |
| 63 | + }, | |
| 64 | + "0.0001": { | |
| 65 | + "top1": 0.712188720703125, | |
| 66 | + "nll": 6.441891193389893 | |
| 67 | + }, | |
| 68 | + "0.001": { | |
| 69 | + "top1": 0.711761474609375, | |
| 70 | + "nll": 6.442440509796143 | |
| 71 | + }, | |
| 72 | + "0.01": { | |
| 73 | + "top1": 0.710601806640625, | |
| 74 | + "nll": 6.445611953735352 | |
| 75 | + } | |
| 76 | + }, | |
| 77 | + "lambda": 0.0001, | |
| 78 | + "beta": 23.80158338356333, | |
| 79 | + "gram_pass_seconds_unlocked": 0.29088497161865234, | |
| 80 | + "val": { | |
| 81 | + "top1": 0.712188720703125, | |
| 82 | + "nll": 1.9058706760406494 | |
| 83 | + }, | |
| 84 | + "test": { | |
| 85 | + "top1": 0.6735992431640625, | |
| 86 | + "nll": 2.188477098941803 | |
| 87 | + }, | |
| 88 | + "checks": { | |
| 89 | + "rel_grad_norm_at_solution_fp64": 6.194980233043746e-15, | |
| 90 | + "G_reverse_chunk_order_rel_diff": 3.6543056493743327e-07, | |
| 91 | + "cond_G_plus_lam": 493557.62237012025 | |
| 92 | + } | |
| 93 | + }, | |
| 94 | + "adamw_ce_A": { | |
| 95 | + "runs": [ | |
| 96 | + { | |
| 97 | + "lr": 0.001, | |
| 98 | + "wd": 0.0, | |
| 99 | + "best_val_top1": 0.81768798828125, | |
| 100 | + "reach": {}, | |
| 101 | + "hist": [ | |
| 102 | + { | |
| 103 | + "epoch": 1, | |
| 104 | + "val_top1": 0.791595458984375, | |
| 105 | + "val_nll": 0.8351218998432159, | |
| 106 | + "t": 0.41481876373291016 | |
| 107 | + }, | |
| 108 | + { | |
| 109 | + "epoch": 2, | |
| 110 | + "val_top1": 0.80999755859375, | |
| 111 | + "val_nll": 0.716192364692688, | |
| 112 | + "t": 0.7279102802276611 | |
| 113 | + }, | |
| 114 | + { | |
| 115 | + "epoch": 3, | |
| 116 | + "val_top1": 0.81365966796875, | |
| 117 | + "val_nll": 0.68497234582901, | |
| 118 | + "t": 1.0380725860595703 | |
| 119 | + }, | |
| 120 | + { | |
| 121 | + "epoch": 4, | |
| 122 | + "val_top1": 0.81671142578125, | |
| 123 | + "val_nll": 0.6774360835552216, | |
| 124 | + "t": 1.3484101295471191 | |
| 125 | + }, | |
| 126 | + { | |
| 127 | + "epoch": 5, | |
| 128 | + "val_top1": 0.816619873046875, | |
| 129 | + "val_nll": 0.6779485642910004, | |
| 130 | + "t": 1.6590328216552734 | |
| 131 | + }, | |
| 132 | + { | |
| 133 | + "epoch": 6, | |
| 134 | + "val_top1": 0.816802978515625, | |
| 135 | + "val_nll": 0.6782289147377014, | |
| 136 | + "t": 1.9689216613769531 | |
| 137 | + }, | |
| 138 | + { | |
| 139 | + "epoch": 7, | |
| 140 | + "val_top1": 0.81768798828125, | |
| 141 | + "val_nll": 0.6817654669284821, | |
| 142 | + "t": 2.2797560691833496 | |
| 143 | + }, | |
| 144 | + { | |
| 145 | + "epoch": 8, | |
| 146 | + "val_top1": 0.8170166015625, | |
| 147 | + "val_nll": 0.688721626996994, | |
| 148 | + "t": 2.5901870727539062 | |
| 149 | + }, | |
| 150 | + { | |
| 151 | + "epoch": 9, | |
| 152 | + "val_top1": 0.815673828125, | |
| 153 | + "val_nll": 0.6940702497959137, | |
| 154 | + "t": 2.903477668762207 | |
| 155 | + }, | |
| 156 | + { | |
| 157 | + "epoch": 10, | |
| 158 | + "val_top1": 0.815765380859375, | |
| 159 | + "val_nll": 0.7045280337333679, | |
| 160 | + "t": 3.2147085666656494 | |
| 161 | + }, | |
| 162 | + { | |
| 163 | + "epoch": 11, | |
| 164 | + "val_top1": 0.814666748046875, | |
| 165 | + "val_nll": 0.7112206518650055, | |
| 166 | + "t": 3.5264360904693604 | |
| 167 | + }, | |
| 168 | + { | |
| 169 | + "epoch": 12, | |
| 170 | + "val_top1": 0.813690185546875, | |
| 171 | + "val_nll": 0.720238447189331, | |
| 172 | + "t": 3.838054895401001 | |
| 173 | + }, | |
| 174 | + { | |
| 175 | + "epoch": 13, | |
| 176 | + "val_top1": 0.814483642578125, | |
| 177 | + "val_nll": 0.7258883416652679, | |
| 178 | + "t": 4.150056600570679 | |
| 179 | + }, | |
| 180 | + { | |
| 181 | + "epoch": 14, | |
| 182 | + "val_top1": 0.813079833984375, | |
| 183 | + "val_nll": 0.7334135174751282, | |
| 184 | + "t": 4.4623191356658936 | |
| 185 | + }, | |
| 186 | + { | |
| 187 | + "epoch": 15, | |
| 188 | + "val_top1": 0.81201171875, | |
| 189 | + "val_nll": 0.7526441812515259, | |
| 190 | + "t": 4.774455785751343 | |
| 191 | + }, | |
| 192 | + { | |
| 193 | + "epoch": 16, | |
| 194 | + "val_top1": 0.811614990234375, | |
| 195 | + "val_nll": 0.756002813577652, | |
| 196 | + "t": 5.0895750522613525 | |
| 197 | + }, | |
| 198 | + { | |
| 199 | + "epoch": 17, | |
| 200 | + "val_top1": 0.810150146484375, | |
| 201 | + "val_nll": 0.7647913992404938, | |
| 202 | + "t": 5.4020774364471436 | |
| 203 | + }, | |
| 204 | + { | |
| 205 | + "epoch": 18, | |
| 206 | + "val_top1": 0.809844970703125, | |
| 207 | + "val_nll": 0.7681356370449066, | |
| 208 | + "t": 5.715954303741455 | |
| 209 | + }, | |
| 210 | + { | |
| 211 | + "epoch": 19, | |
| 212 | + "val_top1": 0.810699462890625, | |
| 213 | + "val_nll": 0.7753023505210876, | |
| 214 | + "t": 6.026729345321655 | |
| 215 | + }, | |
| 216 | + { | |
| 217 | + "epoch": 20, | |
| 218 | + "val_top1": 0.809967041015625, | |
| 219 | + "val_nll": 0.7835691571235657, | |
| 220 | + "t": 6.337351083755493 | |
| 221 | + }, | |
| 222 | + { | |
| 223 | + "epoch": 21, | |
| 224 | + "val_top1": 0.809295654296875, | |
| 225 | + "val_nll": 0.7900449931621552, | |
| 226 | + "t": 6.649342775344849 | |
| 227 | + }, | |
| 228 | + { | |
| 229 | + "epoch": 22, | |
| 230 | + "val_top1": 0.808807373046875, | |
| 231 | + "val_nll": 0.795873373746872, | |
| 232 | + "t": 6.962270736694336 | |
| 233 | + }, | |
| 234 | + { | |
| 235 | + "epoch": 23, | |
| 236 | + "val_top1": 0.807586669921875, | |
| 237 | + "val_nll": 0.8073506653308868, | |
| 238 | + "t": 7.279354572296143 | |
| 239 | + }, | |
| 240 | + { | |
| 241 | + "epoch": 24, | |
| 242 | + "val_top1": 0.807891845703125, | |
| 243 | + "val_nll": 0.8121293485164642, | |
| 244 | + "t": 7.593052864074707 | |
| 245 | + }, | |
| 246 | + { | |
| 247 | + "epoch": 25, | |
| 248 | + "val_top1": 0.806304931640625, | |
| 249 | + "val_nll": 0.8244801461696625, | |
| 250 | + "t": 7.9057886600494385 | |
| 251 | + }, | |
| 252 | + { | |
| 253 | + "epoch": 26, | |
| 254 | + "val_top1": 0.806671142578125, | |
| 255 | + "val_nll": 0.8308258652687073, | |
| 256 | + "t": 8.219221115112305 | |
| 257 | + }, | |
| 258 | + { | |
| 259 | + "epoch": 27, | |
| 260 | + "val_top1": 0.806121826171875, | |
| 261 | + "val_nll": 0.8421289920806885, | |
| 262 | + "t": 8.534549474716187 | |
| 263 | + }, | |
| 264 | + { | |
| 265 | + "epoch": 28, | |
| 266 | + "val_top1": 0.806732177734375, | |
| 267 | + "val_nll": 0.8415939807891846, | |
| 268 | + "t": 8.847214698791504 | |
| 269 | + }, | |
| 270 | + { | |
| 271 | + "epoch": 29, | |
| 272 | + "val_top1": 0.8067626953125, | |
| 273 | + "val_nll": 0.8462265431880951, | |
| 274 | + "t": 9.160706758499146 | |
| 275 | + }, | |
| 276 | + { | |
| 277 | + "epoch": 30, | |
| 278 | + "val_top1": 0.804962158203125, | |
| 279 | + "val_nll": 0.8595981597900391, | |
| 280 | + "t": 9.474058151245117 | |
| 281 | + } | |
| 282 | + ] | |
| 283 | + }, | |
| 284 | + { | |
| 285 | + "lr": 0.001, | |
| 286 | + "wd": 0.01, | |
| 287 | + "best_val_top1": 0.817626953125, | |
| 288 | + "reach": {}, | |
| 289 | + "hist": [ | |
| 290 | + { | |
| 291 | + "epoch": 1, | |
| 292 | + "val_top1": 0.7916259765625, | |
| 293 | + "val_nll": 0.8352191150188446, | |
| 294 | + "t": 0.31592392921447754 | |
| 295 | + }, | |
| 296 | + { | |
| 297 | + "epoch": 2, | |
| 298 | + "val_top1": 0.810028076171875, | |
| 299 | + "val_nll": 0.716304361820221, | |
| 300 | + "t": 0.6338903903961182 | |
| 301 | + }, | |
| 302 | + { | |
| 303 | + "epoch": 3, | |
| 304 | + "val_top1": 0.813629150390625, | |
| 305 | + "val_nll": 0.6850606501102448, | |
| 306 | + "t": 0.9502394199371338 | |
| 307 | + }, | |
| 308 | + { | |
| 309 | + "epoch": 4, | |
| 310 | + "val_top1": 0.816619873046875, | |
| 311 | + "val_nll": 0.6774758100509644, | |
| 312 | + "t": 1.268829584121704 | |
| 313 | + }, | |
| 314 | + { | |
| 315 | + "epoch": 5, | |
| 316 | + "val_top1": 0.81658935546875, | |
| 317 | + "val_nll": 0.6779467165470123, | |
| 318 | + "t": 1.5882608890533447 | |
| 319 | + }, | |
| 320 | + { | |
| 321 | + "epoch": 6, | |
| 322 | + "val_top1": 0.816802978515625, | |
| 323 | + "val_nll": 0.6781363189220428, | |
| 324 | + "t": 1.909569501876831 | |
| 325 | + }, | |
| 326 | + { | |
| 327 | + "epoch": 7, | |
| 328 | + "val_top1": 0.817626953125, | |
| 329 | + "val_nll": 0.6815900802612305, | |
| 330 | + "t": 2.2351410388946533 | |
| 331 | + }, | |
| 332 | + { | |
| 333 | + "epoch": 8, | |
| 334 | + "val_top1": 0.8170166015625, | |
| 335 | + "val_nll": 0.6884405612945557, | |
| 336 | + "t": 2.555532693862915 | |
| 337 | + }, | |
| 338 | + { | |
| 339 | + "epoch": 9, | |
| 340 | + "val_top1": 0.81585693359375, | |
| 341 | + "val_nll": 0.6937165260314941, | |
| 342 | + "t": 2.875847101211548 | |
| 343 | + }, | |
| 344 | + { | |
| 345 | + "epoch": 10, | |
| 346 | + "val_top1": 0.815704345703125, | |
| 347 | + "val_nll": 0.7040497064590454, | |
| 348 | + "t": 3.196455717086792 | |
| 349 | + }, | |
| 350 | + { | |
| 351 | + "epoch": 11, | |
| 352 | + "val_top1": 0.814788818359375, | |
| 353 | + "val_nll": 0.7106465697288513, | |
| 354 | + "t": 3.517784595489502 | |
| 355 | + }, | |
| 356 | + { | |
| 357 | + "epoch": 12, | |
| 358 | + "val_top1": 0.813629150390625, | |
| 359 | + "val_nll": 0.7195194959640503, | |
| 360 | + "t": 3.8381295204162598 | |
| 361 | + }, | |
| 362 | + { | |
| 363 | + "epoch": 13, | |
| 364 | + "val_top1": 0.814453125, | |
| 365 | + "val_nll": 0.7250848412513733, | |
| 366 | + "t": 4.160460472106934 | |
| 367 | + }, | |
| 368 | + { | |
| 369 | + "epoch": 14, | |
| 370 | + "val_top1": 0.813018798828125, | |
| 371 | + "val_nll": 0.7324557900428772, | |
| 372 | + "t": 4.478353500366211 | |
| 373 | + }, | |
| 374 | + { | |
| 375 | + "epoch": 15, | |
| 376 | + "val_top1": 0.81201171875, | |
| 377 | + "val_nll": 0.7515466213226318, | |
| 378 | + "t": 4.795692682266235 | |
| 379 | + }, | |
| 380 | + { | |
| 381 | + "epoch": 16, | |
| 382 | + "val_top1": 0.811614990234375, | |
| 383 | + "val_nll": 0.7547834813594818, | |
| 384 | + "t": 5.114276647567749 | |
| 385 | + }, | |
| 386 | + { | |
| 387 | + "epoch": 17, | |
| 388 | + "val_top1": 0.810150146484375, | |
| 389 | + "val_nll": 0.7634302079677582, | |
| 390 | + "t": 5.431447505950928 | |
| 391 | + }, | |
| 392 | + { | |
| 393 | + "epoch": 18, | |
| 394 | + "val_top1": 0.809906005859375, | |
| 395 | + "val_nll": 0.7665842771530151, | |
| 396 | + "t": 5.746692895889282 | |
| 397 | + }, | |
| 398 | + { | |
| 399 | + "epoch": 19, | |
| 400 | + "val_top1": 0.810791015625, | |
| 401 | + "val_nll": 0.7736303806304932, | |
| 402 | + "t": 6.061405897140503 | |
| 403 | + }, | |
| 404 | + { | |
| 405 | + "epoch": 20, | |
| 406 | + "val_top1": 0.810028076171875, | |
| 407 | + "val_nll": 0.7817462980747223, | |
| 408 | + "t": 6.381723403930664 | |
| 409 | + }, | |
| 410 | + { | |
| 411 | + "epoch": 21, | |
| 412 | + "val_top1": 0.80938720703125, | |
| 413 | + "val_nll": 0.7880541682243347, | |
| 414 | + "t": 6.698005437850952 | |
| 415 | + }, | |
| 416 | + { | |
| 417 | + "epoch": 22, | |
| 418 | + "val_top1": 0.808990478515625, | |
| 419 | + "val_nll": 0.7937114834785461, | |
| 420 | + "t": 7.0156779289245605 | |
| 421 | + }, | |
| 422 | + { | |
| 423 | + "epoch": 23, | |
| 424 | + "val_top1": 0.80780029296875, | |
| 425 | + "val_nll": 0.8049923777580261, | |
| 426 | + "t": 7.334255218505859 | |
| 427 | + }, | |
| 428 | + { | |
| 429 | + "epoch": 24, | |
| 430 | + "val_top1": 0.807891845703125, | |
| 431 | + "val_nll": 0.8096512258052826, | |
| 432 | + "t": 7.654448747634888 | |
| 433 | + }, | |
| 434 | + { | |
| 435 | + "epoch": 25, | |
| 436 | + "val_top1": 0.806671142578125, | |
| 437 | + "val_nll": 0.8217775523662567, | |
| 438 | + "t": 7.975011110305786 | |
| 439 | + }, | |
| 440 | + { | |
| 441 | + "epoch": 26, | |
| 442 | + "val_top1": 0.806671142578125, | |
| 443 | + "val_nll": 0.8279542922973633, | |
| 444 | + "t": 8.299707651138306 | |
| 445 | + }, | |
| 446 | + { | |
| 447 | + "epoch": 27, | |
| 448 | + "val_top1": 0.806243896484375, | |
| 449 | + "val_nll": 0.8390899896621704, | |
| 450 | + "t": 8.6278977394104 | |
| 451 | + }, | |
| 452 | + { | |
| 453 | + "epoch": 28, | |
| 454 | + "val_top1": 0.806854248046875, | |
| 455 | + "val_nll": 0.8382821083068848, | |
| 456 | + "t": 8.9519624710083 | |
| 457 | + }, | |
| 458 | + { | |
| 459 | + "epoch": 29, | |
| 460 | + "val_top1": 0.80670166015625, | |
| 461 | + "val_nll": 0.8428284823894501, | |
| 462 | + "t": 9.276282787322998 | |
| 463 | + }, | |
| 464 | + { | |
| 465 | + "epoch": 30, | |
| 466 | + "val_top1": 0.805023193359375, | |
| 467 | + "val_nll": 0.855927973985672, | |
| 468 | + "t": 9.601333856582642 | |
| 469 | + } | |
| 470 | + ] | |
| 471 | + }, | |
| 472 | + { | |
| 473 | + "lr": 0.003, | |
| 474 | + "wd": 0.0, | |
| 475 | + "best_val_top1": 0.81121826171875, | |
| 476 | + "reach": {}, | |
| 477 | + "hist": [ | |
| 478 | + { | |
| 479 | + "epoch": 1, | |
| 480 | + "val_top1": 0.806884765625, | |
| 481 | + "val_nll": 0.754603773355484, | |
| 482 | + "t": 0.3156850337982178 | |
| 483 | + }, | |
| 484 | + { | |
| 485 | + "epoch": 2, | |
| 486 | + "val_top1": 0.81121826171875, | |
| 487 | + "val_nll": 0.7386071681976318, | |
| 488 | + "t": 0.6307849884033203 | |
| 489 | + }, | |
| 490 | + { | |
| 491 | + "epoch": 3, | |
| 492 | + "val_top1": 0.81121826171875, | |
| 493 | + "val_nll": 0.7454781234264374, | |
| 494 | + "t": 0.9472346305847168 | |
| 495 | + }, | |
| 496 | + { | |
| 497 | + "epoch": 4, | |
| 498 | + "val_top1": 0.808197021484375, | |
| 499 | + "val_nll": 0.7750797867774963, | |
| 500 | + "t": 1.2663788795471191 | |
| 501 | + }, | |
| 502 | + { | |
| 503 | + "epoch": 5, | |
| 504 | + "val_top1": 0.806884765625, | |
| 505 | + "val_nll": 0.7975501418113708, | |
| 506 | + "t": 1.5826828479766846 | |
| 507 | + }, | |
| 508 | + { | |
| 509 | + "epoch": 6, | |
| 510 | + "val_top1": 0.802947998046875, | |
| 511 | + "val_nll": 0.828572154045105, | |
| 512 | + "t": 1.89866304397583 | |
| 513 | + }, | |
| 514 | + { | |
| 515 | + "epoch": 7, | |
| 516 | + "val_top1": 0.8048095703125, | |
| 517 | + "val_nll": 0.8351204991340637, | |
| 518 | + "t": 2.2145230770111084 | |
| 519 | + }, | |
| 520 | + { | |
| 521 | + "epoch": 8, | |
| 522 | + "val_top1": 0.805389404296875, | |
| 523 | + "val_nll": 0.8538047075271606, | |
| 524 | + "t": 2.5310556888580322 | |
| 525 | + }, | |
| 526 | + { | |
| 527 | + "epoch": 9, | |
| 528 | + "val_top1": 0.802947998046875, | |
| 529 | + "val_nll": 0.8784689605236053, | |
| 530 | + "t": 2.8473763465881348 | |
| 531 | + }, | |
| 532 | + { | |
| 533 | + "epoch": 10, | |
| 534 | + "val_top1": 0.80279541015625, | |
| 535 | + "val_nll": 0.8963218629360199, | |
| 536 | + "t": 3.164372444152832 | |
| 537 | + }, | |
| 538 | + { | |
| 539 | + "epoch": 11, | |
| 540 | + "val_top1": 0.80206298828125, | |
| 541 | + "val_nll": 0.9103721380233765, | |
| 542 | + "t": 3.483520984649658 | |
| 543 | + }, | |
| 544 | + { | |
| 545 | + "epoch": 12, | |
| 546 | + "val_top1": 0.80072021484375, | |
| 547 | + "val_nll": 0.9371270537376404, | |
| 548 | + "t": 3.7999870777130127 | |
| 549 | + }, | |
| 550 | + { | |
| 551 | + "epoch": 13, | |
| 552 | + "val_top1": 0.798370361328125, | |
| 553 | + "val_nll": 0.9602230787277222, | |
| 554 | + "t": 4.1160290241241455 | |
| 555 | + }, | |
| 556 | + { | |
| 557 | + "epoch": 14, | |
| 558 | + "val_top1": 0.796295166015625, | |
| 559 | + "val_nll": 0.9724001288414001, | |
| 560 | + "t": 4.432616233825684 | |
| 561 | + }, | |
| 562 | + { | |
| 563 | + "epoch": 15, | |
| 564 | + "val_top1": 0.798370361328125, | |
| 565 | + "val_nll": 0.9875990152359009, | |
| 566 | + "t": 4.754007816314697 | |
| 567 | + }, | |
| 568 | + { | |
| 569 | + "epoch": 16, | |
| 570 | + "val_top1": 0.795257568359375, | |
| 571 | + "val_nll": 0.9984632134437561, | |
| 572 | + "t": 5.069209337234497 | |
| 573 | + }, | |
| 574 | + { | |
| 575 | + "epoch": 17, | |
| 576 | + "val_top1": 0.79376220703125, | |
| 577 | + "val_nll": 1.0207512974739075, | |
| 578 | + "t": 5.384187459945679 | |
| 579 | + }, | |
| 580 | + { | |
| 581 | + "epoch": 18, | |
| 582 | + "val_top1": 0.795257568359375, | |
| 583 | + "val_nll": 1.0343081951141357, | |
| 584 | + "t": 5.701379060745239 | |
| 585 | + }, | |
| 586 | + { | |
| 587 | + "epoch": 19, | |
| 588 | + "val_top1": 0.793182373046875, | |
| 589 | + "val_nll": 1.048746645450592, | |
| 590 | + "t": 6.01325798034668 | |
| 591 | + }, | |
| 592 | + { | |
| 593 | + "epoch": 20, | |
| 594 | + "val_top1": 0.792449951171875, | |
| 595 | + "val_nll": 1.06510990858078, | |
| 596 | + "t": 6.326289176940918 | |
| 597 | + }, | |
| 598 | + { | |
| 599 | + "epoch": 21, | |
| 600 | + "val_top1": 0.79345703125, | |
| 601 | + "val_nll": 1.0773299932479858, | |
| 602 | + "t": 6.635779142379761 | |
| 603 | + }, | |
| 604 | + { | |
| 605 | + "epoch": 22, | |
| 606 | + "val_top1": 0.794158935546875, | |
| 607 | + "val_nll": 1.0928505063056946, | |
| 608 | + "t": 6.947635173797607 | |
| 609 | + }, | |
| 610 | + { | |
| 611 | + "epoch": 23, | |
| 612 | + "val_top1": 0.79119873046875, | |
| 613 | + "val_nll": 1.1127960085868835, | |
| 614 | + "t": 7.260022401809692 | |
| 615 | + }, | |
| 616 | + { | |
| 617 | + "epoch": 24, | |
| 618 | + "val_top1": 0.79144287109375, | |
| 619 | + "val_nll": 1.1296281218528748, | |
| 620 | + "t": 7.569845914840698 | |
| 621 | + }, | |
| 622 | + { | |
| 623 | + "epoch": 25, | |
| 624 | + "val_top1": 0.7894287109375, | |
| 625 | + "val_nll": 1.147707760334015, | |
| 626 | + "t": 7.881677150726318 | |
| 627 | + }, | |
| 628 | + { | |
| 629 | + "epoch": 26, | |
| 630 | + "val_top1": 0.79071044921875, | |
| 631 | + "val_nll": 1.1531789302825928, | |
| 632 | + "t": 8.186869859695435 | |
| 633 | + }, | |
| 634 | + { | |
| 635 | + "epoch": 27, | |
| 636 | + "val_top1": 0.788818359375, | |
| 637 | + "val_nll": 1.1796469688415527, | |
| 638 | + "t": 8.494823694229126 | |
| 639 | + }, | |
| 640 | + { | |
| 641 | + "epoch": 28, | |
| 642 | + "val_top1": 0.788818359375, | |
| 643 | + "val_nll": 1.1838504672050476, | |
| 644 | + "t": 8.80467414855957 | |
| 645 | + }, | |
| 646 | + { | |
| 647 | + "epoch": 29, | |
| 648 | + "val_top1": 0.78802490234375, | |
| 649 | + "val_nll": 1.2011030912399292, | |
| 650 | + "t": 9.112893104553223 | |
| 651 | + }, | |
| 652 | + { | |
| 653 | + "epoch": 30, | |
| 654 | + "val_top1": 0.788238525390625, | |
| 655 | + "val_nll": 1.221420407295227, | |
| 656 | + "t": 9.418999195098877 | |
| 657 | + } | |
| 658 | + ] | |
| 659 | + }, | |
| 660 | + { | |
| 661 | + "lr": 0.003, | |
| 662 | + "wd": 0.01, | |
| 663 | + "best_val_top1": 0.811279296875, | |
| 664 | + "reach": {}, | |
| 665 | + "hist": [ | |
| 666 | + { | |
| 667 | + "epoch": 1, | |
| 668 | + "val_top1": 0.80682373046875, | |
| 669 | + "val_nll": 0.7544827163219452, | |
| 670 | + "t": 0.3129611015319824 | |
| 671 | + }, | |
| 672 | + { | |
| 673 | + "epoch": 2, | |
| 674 | + "val_top1": 0.811279296875, | |
| 675 | + "val_nll": 0.7383347451686859, | |
| 676 | + "t": 0.6298696994781494 | |
| 677 | + }, | |
| 678 | + { | |
| 679 | + "epoch": 3, | |
| 680 | + "val_top1": 0.811279296875, | |
| 681 | + "val_nll": 0.7450006008148193, | |
| 682 | + "t": 0.9426479339599609 | |
| 683 | + }, | |
| 684 | + { | |
| 685 | + "epoch": 4, | |
| 686 | + "val_top1": 0.80816650390625, | |
| 687 | + "val_nll": 0.7740614414215088, | |
| 688 | + "t": 1.2567126750946045 | |
| 689 | + }, | |
| 690 | + { | |
| 691 | + "epoch": 5, | |
| 692 | + "val_top1": 0.806671142578125, | |
| 693 | + "val_nll": 0.7963278293609619, | |
| 694 | + "t": 1.5710692405700684 | |
| 695 | + }, | |
| 696 | + { | |
| 697 | + "epoch": 6, | |
| 698 | + "val_top1": 0.802886962890625, | |
| 699 | + "val_nll": 0.826686292886734, | |
| 700 | + "t": 1.8905706405639648 | |
| 701 | + }, | |
| 702 | + { | |
| 703 | + "epoch": 7, | |
| 704 | + "val_top1": 0.804779052734375, | |
| 705 | + "val_nll": 0.8325616121292114, | |
| 706 | + "t": 2.2019786834716797 | |
| 707 | + }, | |
| 708 | + { | |
| 709 | + "epoch": 8, | |
| 710 | + "val_top1": 0.805389404296875, | |
| 711 | + "val_nll": 0.8507247567176819, | |
| 712 | + "t": 2.5178232192993164 | |
| 713 | + }, | |
| 714 | + { | |
| 715 | + "epoch": 9, | |
| 716 | + "val_top1": 0.8031005859375, | |
| 717 | + "val_nll": 0.8749451637268066, | |
| 718 | + "t": 2.8366007804870605 | |
| 719 | + }, | |
| 720 | + { | |
| 721 | + "epoch": 10, | |
| 722 | + "val_top1": 0.802886962890625, | |
| 723 | + "val_nll": 0.8919993042945862, | |
| 724 | + "t": 3.1525795459747314 | |
| 725 | + }, | |
| 726 | + { | |
| 727 | + "epoch": 11, | |
| 728 | + "val_top1": 0.801971435546875, | |
| 729 | + "val_nll": 0.9053263068199158, | |
| 730 | + "t": 3.470287799835205 | |
| 731 | + }, | |
| 732 | + { | |
| 733 | + "epoch": 12, | |
| 734 | + "val_top1": 0.80096435546875, | |
| 735 | + "val_nll": 0.9317970871925354, | |
| 736 | + "t": 3.788048267364502 | |
| 737 | + }, | |
| 738 | + { | |
| 739 | + "epoch": 13, | |
| 740 | + "val_top1": 0.798614501953125, | |
| 741 | + "val_nll": 0.9546141922473907, | |
| 742 | + "t": 4.108020305633545 | |
| 743 | + }, | |
| 744 | + { | |
| 745 | + "epoch": 14, | |
| 746 | + "val_top1": 0.79693603515625, | |
| 747 | + "val_nll": 0.9663087725639343, | |
| 748 | + "t": 4.422959089279175 | |
| 749 | + }, | |
| 750 | + { | |
| 751 | + "epoch": 15, | |
| 752 | + "val_top1": 0.798431396484375, | |
| 753 | + "val_nll": 0.980350911617279, | |
| 754 | + "t": 4.735546350479126 | |
| 755 | + }, | |
| 756 | + { | |
| 757 | + "epoch": 16, | |
| 758 | + "val_top1": 0.795379638671875, | |
| 759 | + "val_nll": 0.9964904189109802, | |
| 760 | + "t": 5.051578998565674 | |
| 761 | + }, | |
| 762 | + { | |
| 763 | + "epoch": 17, | |
| 764 | + "val_top1": 0.793914794921875, | |
| 765 | + "val_nll": 1.0161861181259155, | |
| 766 | + "t": 5.36388635635376 | |
| 767 | + }, | |
| 768 | + { | |
| 769 | + "epoch": 18, | |
| 770 | + "val_top1": 0.795257568359375, | |
| 771 | + "val_nll": 1.0249831676483154, | |
| 772 | + "t": 5.675719738006592 | |
| 773 | + }, | |
| 774 | + { | |
| 775 | + "epoch": 19, | |
| 776 | + "val_top1": 0.792938232421875, | |
| 777 | + "val_nll": 1.0402019619941711, | |
| 778 | + "t": 5.991122484207153 | |
| 779 | + }, | |
| 780 | + { | |
| 781 | + "epoch": 20, | |
| 782 | + "val_top1": 0.79266357421875, | |
| 783 | + "val_nll": 1.054689109325409, | |
| 784 | + "t": 6.308439016342163 | |
| 785 | + }, | |
| 786 | + { | |
| 787 | + "epoch": 21, | |
| 788 | + "val_top1": 0.793853759765625, | |
| 789 | + "val_nll": 1.0653363466262817, | |
| 790 | + "t": 6.625518321990967 | |
| 791 | + }, | |
| 792 | + { | |
| 793 | + "epoch": 22, | |
| 794 | + "val_top1": 0.79400634765625, | |
| 795 | + "val_nll": 1.0814025402069092, | |
| 796 | + "t": 6.944399833679199 | |
| 797 | + }, | |
| 798 | + { | |
| 799 | + "epoch": 23, | |
| 800 | + "val_top1": 0.79132080078125, | |
| 801 | + "val_nll": 1.0964604020118713, | |
| 802 | + "t": 7.261733293533325 | |
| 803 | + }, | |
| 804 | + { | |
| 805 | + "epoch": 24, | |
| 806 | + "val_top1": 0.79180908203125, | |
| 807 | + "val_nll": 1.1170942783355713, | |
| 808 | + "t": 7.580559730529785 | |
| 809 | + }, | |
| 810 | + { | |
| 811 | + "epoch": 25, | |
| 812 | + "val_top1": 0.789703369140625, | |
| 813 | + "val_nll": 1.1296749114990234, | |
| 814 | + "t": 7.900287866592407 | |
| 815 | + }, | |
| 816 | + { | |
| 817 | + "epoch": 26, | |
| 818 | + "val_top1": 0.791473388671875, | |
| 819 | + "val_nll": 1.136732280254364, | |
| 820 | + "t": 8.218662738800049 | |
| 821 | + }, | |
| 822 | + { | |
| 823 | + "epoch": 27, | |
| 824 | + "val_top1": 0.78863525390625, | |
| 825 | + "val_nll": 1.1617799997329712, | |
| 826 | + "t": 8.533445835113525 | |
| 827 | + }, | |
| 828 | + { | |
| 829 | + "epoch": 28, | |
| 830 | + "val_top1": 0.78973388671875, | |
| 831 | + "val_nll": 1.1646673679351807, | |
| 832 | + "t": 8.849791288375854 | |
| 833 | + }, | |
| 834 | + { | |
| 835 | + "epoch": 29, | |
| 836 | + "val_top1": 0.788482666015625, | |
| 837 | + "val_nll": 1.1826202869415283, | |
| 838 | + "t": 9.162278652191162 | |
| 839 | + }, | |
| 840 | + { | |
| 841 | + "epoch": 30, | |
| 842 | + "val_top1": 0.78887939453125, | |
| 843 | + "val_nll": 1.1986799836158752, | |
| 844 | + "t": 9.47732424736023 | |
| 845 | + } | |
| 846 | + ] | |
| 847 | + }, | |
| 848 | + { | |
| 849 | + "lr": 0.01, | |
| 850 | + "wd": 0.0, | |
| 851 | + "best_val_top1": 0.787506103515625, | |
| 852 | + "reach": {}, | |
| 853 | + "hist": [ | |
| 854 | + { | |
| 855 | + "epoch": 1, | |
| 856 | + "val_top1": 0.78692626953125, | |
| 857 | + "val_nll": 1.25206857919693, | |
| 858 | + "t": 0.30182576179504395 | |
| 859 | + }, | |
| 860 | + { | |
| 861 | + "epoch": 2, | |
| 862 | + "val_top1": 0.787506103515625, | |
| 863 | + "val_nll": 1.3036836385726929, | |
| 864 | + "t": 0.6056337356567383 | |
| 865 | + }, | |
| 866 | + { | |
| 867 | + "epoch": 3, | |
| 868 | + "val_top1": 0.784332275390625, | |
| 869 | + "val_nll": 1.3778460025787354, | |
| 870 | + "t": 0.909111499786377 | |
| 871 | + }, | |
| 872 | + { | |
| 873 | + "epoch": 4, | |
| 874 | + "val_top1": 0.78155517578125, | |
| 875 | + "val_nll": 1.482495903968811, | |
| 876 | + "t": 1.213484764099121 | |
| 877 | + }, | |
| 878 | + { | |
| 879 | + "epoch": 5, | |
| 880 | + "val_top1": 0.779815673828125, | |
| 881 | + "val_nll": 1.5546661019325256, | |
| 882 | + "t": 1.5168108940124512 | |
| 883 | + }, | |
| 884 | + { | |
| 885 | + "epoch": 6, | |
| 886 | + "val_top1": 0.779754638671875, | |
| 887 | + "val_nll": 1.6257577538490295, | |
| 888 | + "t": 1.821481466293335 | |
| 889 | + }, | |
| 890 | + { | |
| 891 | + "epoch": 7, | |
| 892 | + "val_top1": 0.78045654296875, | |
| 893 | + "val_nll": 1.6657145023345947, | |
| 894 | + "t": 2.1291747093200684 | |
| 895 | + }, | |
| 896 | + { | |
| 897 | + "epoch": 8, | |
| 898 | + "val_top1": 0.77728271484375, | |
| 899 | + "val_nll": 1.7564502954483032, | |
| 900 | + "t": 2.442608118057251 | |
| 901 | + }, | |
| 902 | + { | |
| 903 | + "epoch": 9, | |
| 904 | + "val_top1": 0.7774658203125, | |
| 905 | + "val_nll": 1.8074918985366821, | |
| 906 | + "t": 2.750049352645874 | |
| 907 | + }, | |
| 908 | + { | |
| 909 | + "epoch": 10, | |
| 910 | + "val_top1": 0.775787353515625, | |
| 911 | + "val_nll": 1.8634201288223267, | |
| 912 | + "t": 3.0552423000335693 | |
| 913 | + }, | |
| 914 | + { | |
| 915 | + "epoch": 11, | |
| 916 | + "val_top1": 0.772613525390625, | |
| 917 | + "val_nll": 1.9403839707374573, | |
| 918 | + "t": 3.3639626502990723 | |
| 919 | + }, | |
| 920 | + { | |
| 921 | + "epoch": 12, | |
| 922 | + "val_top1": 0.7735595703125, | |
| 923 | + "val_nll": 2.0429471731185913, | |
| 924 | + "t": 3.6733546257019043 | |
| 925 | + }, | |
| 926 | + { | |
| 927 | + "epoch": 13, | |
| 928 | + "val_top1": 0.772430419921875, | |
| 929 | + "val_nll": 2.087469458580017, | |
| 930 | + "t": 3.98299503326416 | |
| 931 | + }, | |
| 932 | + { | |
| 933 | + "epoch": 14, | |
| 934 | + "val_top1": 0.776458740234375, | |
| 935 | + "val_nll": 2.1369823217391968, | |
| 936 | + "t": 4.293109655380249 | |
| 937 | + }, | |
| 938 | + { | |
| 939 | + "epoch": 15, | |
| 940 | + "val_top1": 0.776611328125, | |
| 941 | + "val_nll": 2.186018228530884, | |
| 942 | + "t": 4.60488748550415 | |
| 943 | + }, | |
| 944 | + { | |
| 945 | + "epoch": 16, | |
| 946 | + "val_top1": 0.77362060546875, | |
| 947 | + "val_nll": 2.2714470624923706, | |
| 948 | + "t": 4.913114070892334 | |
| 949 | + }, | |
| 950 | + { | |
| 951 | + "epoch": 17, | |
| 952 | + "val_top1": 0.773651123046875, | |
| 953 | + "val_nll": 2.3236615657806396, | |
| 954 | + "t": 5.220798492431641 | |
| 955 | + }, | |
| 956 | + { | |
| 957 | + "epoch": 18, | |
| 958 | + "val_top1": 0.769439697265625, | |
| 959 | + "val_nll": 2.4204070568084717, | |
| 960 | + "t": 5.527655601501465 | |
| 961 | + }, | |
| 962 | + { | |
| 963 | + "epoch": 19, | |
| 964 | + "val_top1": 0.770233154296875, | |
| 965 | + "val_nll": 2.4660685062408447, | |
| 966 | + "t": 5.8334267139434814 | |
| 967 | + }, | |
| 968 | + { | |
| 969 | + "epoch": 20, | |
| 970 | + "val_top1": 0.7728271484375, | |
| 971 | + "val_nll": 2.4793968200683594, | |
| 972 | + "t": 6.138057231903076 | |
| 973 | + }, | |
| 974 | + { | |
| 975 | + "epoch": 21, | |
| 976 | + "val_top1": 0.76934814453125, | |
| 977 | + "val_nll": 2.5697869062423706, | |
| 978 | + "t": 6.443342685699463 | |
| 979 | + }, | |
| 980 | + { | |
| 981 | + "epoch": 22, | |
| 982 | + "val_top1": 0.770263671875, | |
| 983 | + "val_nll": 2.6131545305252075, | |
| 984 | + "t": 6.751752853393555 | |
| 985 | + }, | |
| 986 | + { | |
| 987 | + "epoch": 23, | |
| 988 | + "val_top1": 0.766876220703125, | |
| 989 | + "val_nll": 2.6946927309036255, | |
| 990 | + "t": 7.057014226913452 | |
| 991 | + }, | |
| 992 | + { | |
| 993 | + "epoch": 24, | |
| 994 | + "val_top1": 0.766693115234375, | |
| 995 | + "val_nll": 2.7745126485824585, | |
| 996 | + "t": 7.360522747039795 | |
| 997 | + }, | |
| 998 | + { | |
| 999 | + "epoch": 25, | |
| 1000 | + "val_top1": 0.7716064453125, | |
| 1001 | + "val_nll": 2.8045226335525513, | |
| 1002 | + "t": 7.663311958312988 | |
| 1003 | + }, | |
| 1004 | + { | |
| 1005 | + "epoch": 26, | |
| 1006 | + "val_top1": 0.770721435546875, | |
| 1007 | + "val_nll": 2.928425669670105, | |
| 1008 | + "t": 7.966393232345581 | |
| 1009 | + }, | |
| 1010 | + { | |
| 1011 | + "epoch": 27, | |
| 1012 | + "val_top1": 0.77130126953125, | |
| 1013 | + "val_nll": 2.992764711380005, | |
| 1014 | + "t": 8.268929481506348 | |
| 1015 | + }, | |
| 1016 | + { | |
| 1017 | + "epoch": 28, | |
| 1018 | + "val_top1": 0.768157958984375, | |
| 1019 | + "val_nll": 3.048698306083679, | |
| 1020 | + "t": 8.58258605003357 | |
| 1021 | + }, | |
| 1022 | + { | |
| 1023 | + "epoch": 29, | |
| 1024 | + "val_top1": 0.762420654296875, | |
| 1025 | + "val_nll": 3.1338499784469604, | |
| 1026 | + "t": 8.905018091201782 | |
| 1027 | + }, | |
| 1028 | + { | |
| 1029 | + "epoch": 30, | |
| 1030 | + "val_top1": 0.76416015625, | |
| 1031 | + "val_nll": 3.185441493988037, | |
| 1032 | + "t": 9.212862491607666 | |
| 1033 | + } | |
| 1034 | + ] | |
| 1035 | + }, | |
| 1036 | + { | |
| 1037 | + "lr": 0.01, | |
| 1038 | + "wd": 0.01, | |
| 1039 | + "best_val_top1": 0.787628173828125, | |
| 1040 | + "reach": {}, | |
| 1041 | + "hist": [ | |
| 1042 | + { | |
| 1043 | + "epoch": 1, | |
| 1044 | + "val_top1": 0.786590576171875, | |
| 1045 | + "val_nll": 1.2494319677352905, | |
| 1046 | + "t": 0.3144075870513916 | |
| 1047 | + }, | |
| 1048 | + { | |
| 1049 | + "epoch": 2, | |
| 1050 | + "val_top1": 0.787628173828125, | |
| 1051 | + "val_nll": 1.2985586524009705, | |
| 1052 | + "t": 0.6303365230560303 | |
| 1053 | + }, | |
| 1054 | + { | |
| 1055 | + "epoch": 3, | |
| 1056 | + "val_top1": 0.781280517578125, | |
| 1057 | + "val_nll": 1.3723347783088684, | |
| 1058 | + "t": 0.9454395771026611 | |
| 1059 | + }, | |
| 1060 | + { | |
| 1061 | + "epoch": 4, | |
| 1062 | + "val_top1": 0.780303955078125, | |
| 1063 | + "val_nll": 1.4623485803604126, | |
| 1064 | + "t": 1.263056993484497 | |
| 1065 | + }, | |
| 1066 | + { | |
| 1067 | + "epoch": 5, | |
| 1068 | + "val_top1": 0.778533935546875, | |
| 1069 | + "val_nll": 1.5358875393867493, | |
| 1070 | + "t": 1.5802066326141357 | |
| 1071 | + }, | |
| 1072 | + { | |
| 1073 | + "epoch": 6, | |
| 1074 | + "val_top1": 0.779266357421875, | |
| 1075 | + "val_nll": 1.6256190538406372, | |
| 1076 | + "t": 1.9005191326141357 | |
| 1077 | + }, | |
| 1078 | + { | |
| 1079 | + "epoch": 7, | |
| 1080 | + "val_top1": 0.784149169921875, | |
| 1081 | + "val_nll": 1.636785089969635, | |
| 1082 | + "t": 2.217616081237793 | |
| 1083 | + }, | |
| 1084 | + { | |
| 1085 | + "epoch": 8, | |
| 1086 | + "val_top1": 0.781982421875, | |
| 1087 | + "val_nll": 1.725938081741333, | |
| 1088 | + "t": 2.5344605445861816 | |
| 1089 | + }, | |
| 1090 | + { | |
| 1091 | + "epoch": 9, | |
| 1092 | + "val_top1": 0.779541015625, | |
| 1093 | + "val_nll": 1.7659395337104797, | |
| 1094 | + "t": 2.8532094955444336 | |
| 1095 | + }, | |
| 1096 | + { | |
| 1097 | + "epoch": 10, | |
| 1098 | + "val_top1": 0.773223876953125, | |
| 1099 | + "val_nll": 1.844916582107544, | |
| 1100 | + "t": 3.168653964996338 | |
| 1101 | + }, | |
| 1102 | + { | |
| 1103 | + "epoch": 11, | |
| 1104 | + "val_top1": 0.771636962890625, | |
| 1105 | + "val_nll": 1.9053218364715576, | |
| 1106 | + "t": 3.486408233642578 | |
| 1107 | + }, | |
| 1108 | + { | |
| 1109 | + "epoch": 12, | |
| 1110 | + "val_top1": 0.77777099609375, | |
| 1111 | + "val_nll": 1.9748759269714355, | |
| 1112 | + "t": 3.8056387901306152 | |
| 1113 | + }, | |
| 1114 | + { | |
| 1115 | + "epoch": 13, | |
| 1116 | + "val_top1": 0.773681640625, | |
| 1117 | + "val_nll": 2.0467900037765503, | |
| 1118 | + "t": 4.1223368644714355 | |
| 1119 | + }, | |
| 1120 | + { | |
| 1121 | + "epoch": 14, | |
| 1122 | + "val_top1": 0.772796630859375, | |
| 1123 | + "val_nll": 2.1003109216690063, | |
| 1124 | + "t": 4.442686080932617 | |
| 1125 | + }, | |
| 1126 | + { | |
| 1127 | + "epoch": 15, | |
| 1128 | + "val_top1": 0.773590087890625, | |
| 1129 | + "val_nll": 2.135758638381958, | |
| 1130 | + "t": 4.760825157165527 | |
| 1131 | + }, | |
| 1132 | + { | |
| 1133 | + "epoch": 16, | |
| 1134 | + "val_top1": 0.772979736328125, | |
| 1135 | + "val_nll": 2.2061502933502197, | |
| 1136 | + "t": 5.0762598514556885 | |
| 1137 | + }, | |
| 1138 | + { | |
| 1139 | + "epoch": 17, | |
| 1140 | + "val_top1": 0.771881103515625, | |
| 1141 | + "val_nll": 2.255655884742737, | |
| 1142 | + "t": 5.394243478775024 | |
| 1143 | + }, | |
| 1144 | + { | |
| 1145 | + "epoch": 18, | |
| 1146 | + "val_top1": 0.772979736328125, | |
| 1147 | + "val_nll": 2.3236368894577026, | |
| 1148 | + "t": 5.710097074508667 | |
| 1149 | + }, | |
| 1150 | + { | |
| 1151 | + "epoch": 19, | |
| 1152 | + "val_top1": 0.7713623046875, | |
| 1153 | + "val_nll": 2.3707876205444336, | |
| 1154 | + "t": 6.028972625732422 | |
| 1155 | + }, | |
| 1156 | + { | |
| 1157 | + "epoch": 20, | |
| 1158 | + "val_top1": 0.7730712890625, | |
| 1159 | + "val_nll": 2.4152421951293945, | |
| 1160 | + "t": 6.351716995239258 | |
| 1161 | + }, | |
| 1162 | + { | |
| 1163 | + "epoch": 21, | |
| 1164 | + "val_top1": 0.770782470703125, | |
| 1165 | + "val_nll": 2.4786280393600464, | |
| 1166 | + "t": 6.671931505203247 | |
| 1167 | + }, | |
| 1168 | + { | |
| 1169 | + "epoch": 22, | |
| 1170 | + "val_top1": 0.768951416015625, | |
| 1171 | + "val_nll": 2.519807457923889, | |
| 1172 | + "t": 6.990980386734009 | |
| 1173 | + }, | |
| 1174 | + { | |
| 1175 | + "epoch": 23, | |
| 1176 | + "val_top1": 0.767822265625, | |
| 1177 | + "val_nll": 2.61177921295166, | |
| 1178 | + "t": 7.3132665157318115 | |
| 1179 | + }, | |
| 1180 | + { | |
| 1181 | + "epoch": 24, | |
| 1182 | + "val_top1": 0.76678466796875, | |
| 1183 | + "val_nll": 2.665786623954773, | |
| 1184 | + "t": 7.6342079639434814 | |
| 1185 | + }, | |
| 1186 | + { | |
| 1187 | + "epoch": 25, | |
| 1188 | + "val_top1": 0.769287109375, | |
| 1189 | + "val_nll": 2.7263349294662476, | |
| 1190 | + "t": 7.953841924667358 | |
| 1191 | + }, | |
| 1192 | + { | |
| 1193 | + "epoch": 26, | |
| 1194 | + "val_top1": 0.771270751953125, | |
| 1195 | + "val_nll": 2.7606585025787354, | |
| 1196 | + "t": 8.2771315574646 | |
| 1197 | + }, | |
| 1198 | + { | |
| 1199 | + "epoch": 27, | |
| 1200 | + "val_top1": 0.7689208984375, | |
| 1201 | + "val_nll": 2.829269766807556, | |
| 1202 | + "t": 8.596861600875854 | |
| 1203 | + }, | |
| 1204 | + { | |
| 1205 | + "epoch": 28, | |
| 1206 | + "val_top1": 0.77008056640625, | |
| 1207 | + "val_nll": 2.8457378149032593, | |
| 1208 | + "t": 8.913144588470459 | |
| 1209 | + }, | |
| 1210 | + { | |
| 1211 | + "epoch": 29, | |
| 1212 | + "val_top1": 0.767791748046875, | |
| 1213 | + "val_nll": 2.928621530532837, | |
| 1214 | + "t": 9.23871397972107 | |
| 1215 | + }, | |
| 1216 | + { | |
| 1217 | + "epoch": 30, | |
| 1218 | + "val_top1": 0.764739990234375, | |
| 1219 | + "val_nll": 3.0150688886642456, | |
| 1220 | + "t": 9.555766344070435 | |
| 1221 | + } | |
| 1222 | + ] | |
| 1223 | + } | |
| 1224 | + ], | |
| 1225 | + "chosen": { | |
| 1226 | + "lr": 0.001, | |
| 1227 | + "wd": 0.0 | |
| 1228 | + }, | |
| 1229 | + "val": { | |
| 1230 | + "top1": 0.804962158203125, | |
| 1231 | + "nll": 0.8595981597900391 | |
| 1232 | + }, | |
| 1233 | + "test": { | |
| 1234 | + "top1": 0.73687744140625, | |
| 1235 | + "nll": 1.3480360209941864 | |
| 1236 | + }, | |
| 1237 | + "reach": {} | |
| 1238 | + }, | |
| 1239 | + "adamw_mse_A": { | |
| 1240 | + "runs": [ | |
| 1241 | + { | |
| 1242 | + "lr": 0.001, | |
| 1243 | + "wd": 0.0, | |
| 1244 | + "best_val_top1": 0.709075927734375, | |
| 1245 | + "reach": {}, | |
| 1246 | + "hist": [ | |
| 1247 | + { | |
| 1248 | + "epoch": 1, | |
| 1249 | + "val_top1": 0.691375732421875, | |
| 1250 | + "val_nll": 6.4591381549835205, | |
| 1251 | + "t": 0.3821127414703369 | |
| 1252 | + }, | |
| 1253 | + { | |
| 1254 | + "epoch": 2, | |
| 1255 | + "val_top1": 0.7042236328125, | |
| 1256 | + "val_nll": 6.453079700469971, | |
| 1257 | + "t": 0.7346405982971191 | |
| 1258 | + }, | |
| 1259 | + { | |
| 1260 | + "epoch": 3, | |
| 1261 | + "val_top1": 0.7081298828125, | |
| 1262 | + "val_nll": 6.44866418838501, | |
| 1263 | + "t": 1.0794506072998047 | |
| 1264 | + }, | |
| 1265 | + { | |
| 1266 | + "epoch": 4, | |
| 1267 | + "val_top1": 0.70770263671875, | |
| 1268 | + "val_nll": 6.44779634475708, | |
| 1269 | + "t": 1.4280858039855957 | |
| 1270 | + }, | |
| 1271 | + { | |
| 1272 | + "epoch": 5, | |
| 1273 | + "val_top1": 0.708831787109375, | |
| 1274 | + "val_nll": 6.445864200592041, | |
| 1275 | + "t": 1.7838053703308105 | |
| 1276 | + }, | |
| 1277 | + { | |
| 1278 | + "epoch": 6, | |
| 1279 | + "val_top1": 0.705291748046875, | |
| 1280 | + "val_nll": 6.443304777145386, | |
| 1281 | + "t": 2.140139102935791 | |
| 1282 | + }, | |
| 1283 | + { | |
| 1284 | + "epoch": 7, | |
| 1285 | + "val_top1": 0.705535888671875, | |
| 1286 | + "val_nll": 6.4425530433654785, | |
| 1287 | + "t": 2.491119623184204 | |
| 1288 | + }, | |
| 1289 | + { | |
| 1290 | + "epoch": 8, | |
| 1291 | + "val_top1": 0.706329345703125, | |
| 1292 | + "val_nll": 6.446917295455933, | |
| 1293 | + "t": 2.8450045585632324 | |
| 1294 | + }, | |
| 1295 | + { | |
| 1296 | + "epoch": 9, | |
| 1297 | + "val_top1": 0.70697021484375, | |
| 1298 | + "val_nll": 6.442870616912842, | |
| 1299 | + "t": 3.203629493713379 | |
| 1300 | + }, | |
| 1301 | + { | |
| 1302 | + "epoch": 10, | |
| 1303 | + "val_top1": 0.705718994140625, | |
| 1304 | + "val_nll": 6.443723678588867, | |
| 1305 | + "t": 3.5508546829223633 | |
| 1306 | + }, | |
| 1307 | + { | |
| 1308 | + "epoch": 11, | |
| 1309 | + "val_top1": 0.706146240234375, | |
| 1310 | + "val_nll": 6.444611549377441, | |
| 1311 | + "t": 3.914308786392212 | |
| 1312 | + }, | |
| 1313 | + { | |
| 1314 | + "epoch": 12, | |
| 1315 | + "val_top1": 0.709075927734375, | |
| 1316 | + "val_nll": 6.4448182582855225, | |
| 1317 | + "t": 4.266427040100098 | |
| 1318 | + }, | |
| 1319 | + { | |
| 1320 | + "epoch": 13, | |
| 1321 | + "val_top1": 0.704833984375, | |
| 1322 | + "val_nll": 6.4412760734558105, | |
| 1323 | + "t": 4.615390777587891 | |
| 1324 | + }, | |
| 1325 | + { | |
| 1326 | + "epoch": 14, | |
| 1327 | + "val_top1": 0.70562744140625, | |
| 1328 | + "val_nll": 6.443255424499512, | |
| 1329 | + "t": 4.967027425765991 | |
| 1330 | + }, | |
| 1331 | + { | |
| 1332 | + "epoch": 15, | |
| 1333 | + "val_top1": 0.704315185546875, | |
| 1334 | + "val_nll": 6.442655563354492, | |
| 1335 | + "t": 5.3244593143463135 | |
| 1336 | + }, | |
| 1337 | + { | |
| 1338 | + "epoch": 16, | |
| 1339 | + "val_top1": 0.705474853515625, | |
| 1340 | + "val_nll": 6.441724538803101, | |
| 1341 | + "t": 5.673213243484497 | |
| 1342 | + }, | |
| 1343 | + { | |
| 1344 | + "epoch": 17, | |
| 1345 | + "val_top1": 0.701507568359375, | |
| 1346 | + "val_nll": 6.442738056182861, | |
| 1347 | + "t": 6.035881757736206 | |
| 1348 | + }, | |
| 1349 | + { | |
| 1350 | + "epoch": 18, | |
| 1351 | + "val_top1": 0.707855224609375, | |
| 1352 | + "val_nll": 6.4443535804748535, | |
| 1353 | + "t": 6.377256631851196 | |
| 1354 | + }, | |
| 1355 | + { | |
| 1356 | + "epoch": 19, | |
| 1357 | + "val_top1": 0.70452880859375, | |
| 1358 | + "val_nll": 6.446102142333984, | |
| 1359 | + "t": 6.723688840866089 | |
| 1360 | + }, | |
| 1361 | + { | |
| 1362 | + "epoch": 20, | |
| 1363 | + "val_top1": 0.703277587890625, | |
| 1364 | + "val_nll": 6.44429349899292, | |
| 1365 | + "t": 7.074011564254761 | |
| 1366 | + }, | |
| 1367 | + { | |
| 1368 | + "epoch": 21, | |
| 1369 | + "val_top1": 0.706817626953125, | |
| 1370 | + "val_nll": 6.44250226020813, | |
| 1371 | + "t": 7.427382946014404 | |
| 1372 | + }, | |
| 1373 | + { | |
| 1374 | + "epoch": 22, | |
| 1375 | + "val_top1": 0.703704833984375, | |
| 1376 | + "val_nll": 6.441684246063232, | |
| 1377 | + "t": 7.77675461769104 | |
| 1378 | + }, | |
| 1379 | + { | |
| 1380 | + "epoch": 23, | |
| 1381 | + "val_top1": 0.7076416015625, | |
| 1382 | + "val_nll": 6.4482035636901855, | |
| 1383 | + "t": 8.129599571228027 | |
| 1384 | + }, | |
| 1385 | + { | |
| 1386 | + "epoch": 24, | |
| 1387 | + "val_top1": 0.704254150390625, | |
| 1388 | + "val_nll": 6.441695690155029, | |
| 1389 | + "t": 8.479692459106445 | |
| 1390 | + }, | |
| 1391 | + { | |
| 1392 | + "epoch": 25, | |
| 1393 | + "val_top1": 0.706787109375, | |
| 1394 | + "val_nll": 6.447396755218506, | |
| 1395 | + "t": 8.8309805393219 | |
| 1396 | + }, | |
| 1397 | + { | |
| 1398 | + "epoch": 26, | |
| 1399 | + "val_top1": 0.70233154296875, | |
| 1400 | + "val_nll": 6.440568447113037, | |
| 1401 | + "t": 9.181374311447144 | |
| 1402 | + }, | |
| 1403 | + { | |
| 1404 | + "epoch": 27, | |
| 1405 | + "val_top1": 0.706207275390625, | |
| 1406 | + "val_nll": 6.445327997207642, | |
| 1407 | + "t": 9.533124446868896 | |
| 1408 | + }, | |
| 1409 | + { | |
| 1410 | + "epoch": 28, | |
| 1411 | + "val_top1": 0.7083740234375, | |
| 1412 | + "val_nll": 6.443869590759277, | |
| 1413 | + "t": 9.884357213973999 | |
| 1414 | + }, | |
| 1415 | + { | |
| 1416 | + "epoch": 29, | |
| 1417 | + "val_top1": 0.707916259765625, | |
| 1418 | + "val_nll": 6.443602085113525, | |
| 1419 | + "t": 10.232008695602417 | |
| 1420 | + }, | |
| 1421 | + { | |
| 1422 | + "epoch": 30, | |
| 1423 | + "val_top1": 0.70343017578125, | |
| 1424 | + "val_nll": 6.444926500320435, | |
| 1425 | + "t": 10.586443185806274 | |
| 1426 | + } | |
| 1427 | + ] | |
| 1428 | + }, | |
| 1429 | + { | |
| 1430 | + "lr": 0.001, | |
| 1431 | + "wd": 0.01, | |
| 1432 | + "best_val_top1": 0.709075927734375, | |
| 1433 | + "reach": {}, | |
| 1434 | + "hist": [ | |
| 1435 | + { | |
| 1436 | + "epoch": 1, | |
| 1437 | + "val_top1": 0.691375732421875, | |
| 1438 | + "val_nll": 6.459164142608643, | |
| 1439 | + "t": 0.35620808601379395 | |
| 1440 | + }, | |
| 1441 | + { | |
| 1442 | + "epoch": 2, | |
| 1443 | + "val_top1": 0.7042236328125, | |
| 1444 | + "val_nll": 6.453106880187988, | |
| 1445 | + "t": 0.7128465175628662 | |
| 1446 | + }, | |
| 1447 | + { | |
| 1448 | + "epoch": 3, | |
| 1449 | + "val_top1": 0.708160400390625, | |
| 1450 | + "val_nll": 6.448690414428711, | |
| 1451 | + "t": 1.0675928592681885 | |
| 1452 | + }, | |
| 1453 | + { | |
| 1454 | + "epoch": 4, | |
| 1455 | + "val_top1": 0.70770263671875, | |
| 1456 | + "val_nll": 6.44782280921936, | |
| 1457 | + "t": 1.424119234085083 | |
| 1458 | + }, | |
| 1459 | + { | |
| 1460 | + "epoch": 5, | |
| 1461 | + "val_top1": 0.708831787109375, | |
| 1462 | + "val_nll": 6.4458887577056885, | |
| 1463 | + "t": 1.7795522212982178 | |
| 1464 | + }, | |
| 1465 | + { | |
| 1466 | + "epoch": 6, | |
| 1467 | + "val_top1": 0.705291748046875, | |
| 1468 | + "val_nll": 6.443328857421875, | |
| 1469 | + "t": 2.1407196521759033 | |
| 1470 | + }, | |
| 1471 | + { | |
| 1472 | + "epoch": 7, | |
| 1473 | + "val_top1": 0.70550537109375, | |
| 1474 | + "val_nll": 6.442575931549072, | |
| 1475 | + "t": 2.494050979614258 | |
| 1476 | + }, | |
| 1477 | + { | |
| 1478 | + "epoch": 8, | |
| 1479 | + "val_top1": 0.706298828125, | |
| 1480 | + "val_nll": 6.446940183639526, | |
| 1481 | + "t": 2.848133087158203 | |
| 1482 | + }, | |
| 1483 | + { | |
| 1484 | + "epoch": 9, | |
| 1485 | + "val_top1": 0.706939697265625, | |
| 1486 | + "val_nll": 6.442866563796997, | |
| 1487 | + "t": 3.199779510498047 | |
| 1488 | + }, | |
| 1489 | + { | |
| 1490 | + "epoch": 10, | |
| 1491 | + "val_top1": 0.7056884765625, | |
| 1492 | + "val_nll": 6.443722724914551, | |
| 1493 | + "t": 3.5550951957702637 | |
| 1494 | + }, | |
| 1495 | + { | |
| 1496 | + "epoch": 11, | |
| 1497 | + "val_top1": 0.706146240234375, | |
| 1498 | + "val_nll": 6.444544792175293, | |
| 1499 | + "t": 3.906862735748291 | |
| 1500 | + }, | |
| 1501 | + { | |
| 1502 | + "epoch": 12, | |
| 1503 | + "val_top1": 0.709075927734375, | |
| 1504 | + "val_nll": 6.444828033447266, | |
| 1505 | + "t": 4.258718013763428 | |
| 1506 | + }, | |
| 1507 | + { | |
| 1508 | + "epoch": 13, | |
| 1509 | + "val_top1": 0.70501708984375, | |
| 1510 | + "val_nll": 6.441169023513794, | |
| 1511 | + "t": 4.611753463745117 | |
| 1512 | + }, | |
| 1513 | + { | |
| 1514 | + "epoch": 14, | |
| 1515 | + "val_top1": 0.70562744140625, | |
| 1516 | + "val_nll": 6.443342447280884, | |
| 1517 | + "t": 4.963138103485107 | |
| 1518 | + }, | |
| 1519 | + { | |
| 1520 | + "epoch": 15, | |
| 1521 | + "val_top1": 0.7039794921875, | |
| 1522 | + "val_nll": 6.442891597747803, | |
| 1523 | + "t": 5.314917802810669 | |
| 1524 | + }, | |
| 1525 | + { | |
| 1526 | + "epoch": 16, | |
| 1527 | + "val_top1": 0.705535888671875, | |
| 1528 | + "val_nll": 6.4414963722229, | |
| 1529 | + "t": 5.673588752746582 | |
| 1530 | + }, | |
| 1531 | + { | |
| 1532 | + "epoch": 17, | |
| 1533 | + "val_top1": 0.70159912109375, | |
| 1534 | + "val_nll": 6.442721843719482, | |
| 1535 | + "t": 6.038833141326904 | |
| 1536 | + }, | |
| 1537 | + { | |
| 1538 | + "epoch": 18, | |
| 1539 | + "val_top1": 0.70794677734375, | |
| 1540 | + "val_nll": 6.444617986679077, | |
| 1541 | + "t": 6.394712448120117 | |
| 1542 | + }, | |
| 1543 | + { | |
| 1544 | + "epoch": 19, | |
| 1545 | + "val_top1": 0.7044677734375, | |
| 1546 | + "val_nll": 6.446082830429077, | |
| 1547 | + "t": 6.746114730834961 | |
| 1548 | + }, | |
| 1549 | + { | |
| 1550 | + "epoch": 20, | |
| 1551 | + "val_top1": 0.703155517578125, | |
| 1552 | + "val_nll": 6.444330930709839, | |
| 1553 | + "t": 7.096192121505737 | |
| 1554 | + }, | |
| 1555 | + { | |
| 1556 | + "epoch": 21, | |
| 1557 | + "val_top1": 0.7071533203125, | |
| 1558 | + "val_nll": 6.443079471588135, | |
| 1559 | + "t": 7.445265531539917 | |
| 1560 | + }, | |
| 1561 | + { | |
| 1562 | + "epoch": 22, | |
| 1563 | + "val_top1": 0.703460693359375, | |
| 1564 | + "val_nll": 6.44155478477478, | |
| 1565 | + "t": 7.796196222305298 | |
| 1566 | + }, | |
| 1567 | + { | |
| 1568 | + "epoch": 23, | |
| 1569 | + "val_top1": 0.707672119140625, | |
| 1570 | + "val_nll": 6.447818279266357, | |
| 1571 | + "t": 8.150745630264282 | |
| 1572 | + }, | |
| 1573 | + { | |
| 1574 | + "epoch": 24, | |
| 1575 | + "val_top1": 0.703857421875, | |
| 1576 | + "val_nll": 6.4411420822143555, | |
| 1577 | + "t": 8.504662036895752 | |
| 1578 | + }, | |
| 1579 | + { | |
| 1580 | + "epoch": 25, | |
| 1581 | + "val_top1": 0.70684814453125, | |
| 1582 | + "val_nll": 6.445939064025879, | |
| 1583 | + "t": 8.858058452606201 | |
| 1584 | + }, | |
| 1585 | + { | |
| 1586 | + "epoch": 26, | |
| 1587 | + "val_top1": 0.70208740234375, | |
| 1588 | + "val_nll": 6.440791130065918, | |
| 1589 | + "t": 9.210033178329468 | |
| 1590 | + }, | |
| 1591 | + { | |
| 1592 | + "epoch": 27, | |
| 1593 | + "val_top1": 0.70654296875, | |
| 1594 | + "val_nll": 6.445314407348633, | |
| 1595 | + "t": 9.563246011734009 | |
| 1596 | + }, | |
| 1597 | + { | |
| 1598 | + "epoch": 28, | |
| 1599 | + "val_top1": 0.70794677734375, | |
| 1600 | + "val_nll": 6.444009065628052, | |
| 1601 | + "t": 9.916882038116455 | |
| 1602 | + }, | |
| 1603 | + { | |
| 1604 | + "epoch": 29, | |
| 1605 | + "val_top1": 0.7078857421875, | |
| 1606 | + "val_nll": 6.444253206253052, | |
| 1607 | + "t": 10.281306505203247 | |
| 1608 | + }, | |
| 1609 | + { | |
| 1610 | + "epoch": 30, | |
| 1611 | + "val_top1": 0.703399658203125, | |
| 1612 | + "val_nll": 6.444473743438721, | |
| 1613 | + "t": 10.639086723327637 | |
| 1614 | + } | |
| 1615 | + ] | |
| 1616 | + }, | |
| 1617 | + { | |
| 1618 | + "lr": 0.003, | |
| 1619 | + "wd": 0.0, | |
| 1620 | + "best_val_top1": 0.708587646484375, | |
| 1621 | + "reach": {}, | |
| 1622 | + "hist": [ | |
| 1623 | + { | |
| 1624 | + "epoch": 1, | |
| 1625 | + "val_top1": 0.69970703125, | |
| 1626 | + "val_nll": 6.46789026260376, | |
| 1627 | + "t": 0.3485991954803467 | |
| 1628 | + }, | |
| 1629 | + { | |
| 1630 | + "epoch": 2, | |
| 1631 | + "val_top1": 0.7059326171875, | |
| 1632 | + "val_nll": 6.4519898891448975, | |
| 1633 | + "t": 0.7003459930419922 | |
| 1634 | + }, | |
| 1635 | + { | |
| 1636 | + "epoch": 3, | |
| 1637 | + "val_top1": 0.708587646484375, | |
| 1638 | + "val_nll": 6.449271202087402, | |
| 1639 | + "t": 1.0470244884490967 | |
| 1640 | + }, | |
| 1641 | + { | |
| 1642 | + "epoch": 4, | |
| 1643 | + "val_top1": 0.707244873046875, | |
| 1644 | + "val_nll": 6.446864604949951, | |
| 1645 | + "t": 1.3932414054870605 | |
| 1646 | + }, | |
| 1647 | + { | |
| 1648 | + "epoch": 5, | |
| 1649 | + "val_top1": 0.7081298828125, | |
| 1650 | + "val_nll": 6.44577956199646, | |
| 1651 | + "t": 1.7412643432617188 | |
| 1652 | + }, | |
| 1653 | + { | |
| 1654 | + "epoch": 6, | |
| 1655 | + "val_top1": 0.705169677734375, | |
| 1656 | + "val_nll": 6.442918300628662, | |
| 1657 | + "t": 2.0874016284942627 | |
| 1658 | + }, | |
| 1659 | + { | |
| 1660 | + "epoch": 7, | |
| 1661 | + "val_top1": 0.70428466796875, | |
| 1662 | + "val_nll": 6.443058967590332, | |
| 1663 | + "t": 2.4347057342529297 | |
| 1664 | + }, | |
| 1665 | + { | |
| 1666 | + "epoch": 8, | |
| 1667 | + "val_top1": 0.679931640625, | |
| 1668 | + "val_nll": 6.447438478469849, | |
| 1669 | + "t": 2.7796738147735596 | |
| 1670 | + }, | |
| 1671 | + { | |
| 1672 | + "epoch": 9, | |
| 1673 | + "val_top1": 0.6864013671875, | |
| 1674 | + "val_nll": 6.442473411560059, | |
| 1675 | + "t": 3.1253433227539062 | |
| 1676 | + }, | |
| 1677 | + { | |
| 1678 | + "epoch": 10, | |
| 1679 | + "val_top1": 0.687652587890625, | |
| 1680 | + "val_nll": 6.443049907684326, | |
| 1681 | + "t": 3.475026845932007 | |
| 1682 | + }, | |
| 1683 | + { | |
| 1684 | + "epoch": 11, | |
| 1685 | + "val_top1": 0.6552734375, | |
| 1686 | + "val_nll": 6.447127342224121, | |
| 1687 | + "t": 3.8240206241607666 | |
| 1688 | + }, | |
| 1689 | + { | |
| 1690 | + "epoch": 12, | |
| 1691 | + "val_top1": 0.695343017578125, | |
| 1692 | + "val_nll": 6.444120407104492, | |
| 1693 | + "t": 4.17674994468689 | |
| 1694 | + }, | |
| 1695 | + { | |
| 1696 | + "epoch": 13, | |
| 1697 | + "val_top1": 0.696380615234375, | |
| 1698 | + "val_nll": 6.440161228179932, | |
| 1699 | + "t": 4.528055667877197 | |
| 1700 | + }, | |
| 1701 | + { | |
| 1702 | + "epoch": 14, | |
| 1703 | + "val_top1": 0.694549560546875, | |
| 1704 | + "val_nll": 6.441398859024048, | |
| 1705 | + "t": 4.876509428024292 | |
| 1706 | + }, | |
| 1707 | + { | |
| 1708 | + "epoch": 15, | |
| 1709 | + "val_top1": 0.672882080078125, | |
| 1710 | + "val_nll": 6.442431211471558, | |
| 1711 | + "t": 5.22350549697876 | |
| 1712 | + }, | |
| 1713 | + { | |
| 1714 | + "epoch": 16, | |
| 1715 | + "val_top1": 0.6702880859375, | |
| 1716 | + "val_nll": 6.44258975982666, | |
| 1717 | + "t": 5.576217174530029 | |
| 1718 | + }, | |
| 1719 | + { | |
| 1720 | + "epoch": 17, | |
| 1721 | + "val_top1": 0.697967529296875, | |
| 1722 | + "val_nll": 6.4445436000823975, | |
| 1723 | + "t": 5.927518606185913 | |
| 1724 | + }, | |
| 1725 | + { | |
| 1726 | + "epoch": 18, | |
| 1727 | + "val_top1": 0.679107666015625, | |
| 1728 | + "val_nll": 6.4458723068237305, | |
| 1729 | + "t": 6.279755353927612 | |
| 1730 | + }, | |
| 1731 | + { | |
| 1732 | + "epoch": 19, | |
| 1733 | + "val_top1": 0.6910400390625, | |
| 1734 | + "val_nll": 6.4470391273498535, | |
| 1735 | + "t": 6.6292290687561035 | |
| 1736 | + }, | |
| 1737 | + { | |
| 1738 | + "epoch": 20, | |
| 1739 | + "val_top1": 0.673675537109375, | |
| 1740 | + "val_nll": 6.4508233070373535, | |
| 1741 | + "t": 6.976941823959351 | |
| 1742 | + }, | |
| 1743 | + { | |
| 1744 | + "epoch": 21, | |
| 1745 | + "val_top1": 0.662689208984375, | |
| 1746 | + "val_nll": 6.444362640380859, | |
| 1747 | + "t": 7.3239641189575195 | |
| 1748 | + }, | |
| 1749 | + { | |
| 1750 | + "epoch": 22, | |
| 1751 | + "val_top1": 0.684356689453125, | |
| 1752 | + "val_nll": 6.442435026168823, | |
| 1753 | + "t": 7.672644138336182 | |
| 1754 | + }, | |
| 1755 | + { | |
| 1756 | + "epoch": 23, | |
| 1757 | + "val_top1": 0.65411376953125, | |
| 1758 | + "val_nll": 6.444352626800537, | |
| 1759 | + "t": 8.016082525253296 | |
| 1760 | + }, | |
| 1761 | + { | |
| 1762 | + "epoch": 24, | |
| 1763 | + "val_top1": 0.680999755859375, | |
| 1764 | + "val_nll": 6.442901611328125, | |
| 1765 | + "t": 8.365975141525269 | |
| 1766 | + }, | |
| 1767 | + { | |
| 1768 | + "epoch": 25, | |
| 1769 | + "val_top1": 0.63916015625, | |
| 1770 | + "val_nll": 6.448564767837524, | |
| 1771 | + "t": 8.711909770965576 | |
| 1772 | + }, | |
| 1773 | + { | |
| 1774 | + "epoch": 26, | |
| 1775 | + "val_top1": 0.642791748046875, | |
| 1776 | + "val_nll": 6.446295738220215, | |
| 1777 | + "t": 9.058385372161865 | |
| 1778 | + }, | |
| 1779 | + { | |
| 1780 | + "epoch": 27, | |
| 1781 | + "val_top1": 0.679962158203125, | |
| 1782 | + "val_nll": 6.442688703536987, | |
| 1783 | + "t": 9.403579711914062 | |
| 1784 | + }, | |
| 1785 | + { | |
| 1786 | + "epoch": 28, | |
| 1787 | + "val_top1": 0.68670654296875, | |
| 1788 | + "val_nll": 6.448308229446411, | |
| 1789 | + "t": 9.750171661376953 | |
| 1790 | + }, | |
| 1791 | + { | |
| 1792 | + "epoch": 29, | |
| 1793 | + "val_top1": 0.661651611328125, | |
| 1794 | + "val_nll": 6.440078020095825, | |
| 1795 | + "t": 10.09628963470459 | |
| 1796 | + }, | |
| 1797 | + { | |
| 1798 | + "epoch": 30, | |
| 1799 | + "val_top1": 0.675140380859375, | |
| 1800 | + "val_nll": 6.454646110534668, | |
| 1801 | + "t": 10.443051099777222 | |
| 1802 | + } | |
| 1803 | + ] | |
| 1804 | + }, | |
| 1805 | + { | |
| 1806 | + "lr": 0.003, | |
| 1807 | + "wd": 0.01, | |
| 1808 | + "best_val_top1": 0.708526611328125, | |
| 1809 | + "reach": {}, | |
| 1810 | + "hist": [ | |
| 1811 | + { | |
| 1812 | + "epoch": 1, | |
| 1813 | + "val_top1": 0.69964599609375, | |
| 1814 | + "val_nll": 6.467931032180786, | |
| 1815 | + "t": 0.3572702407836914 | |
| 1816 | + }, | |
| 1817 | + { | |
| 1818 | + "epoch": 2, | |
| 1819 | + "val_top1": 0.70587158203125, | |
| 1820 | + "val_nll": 6.452078580856323, | |
| 1821 | + "t": 0.7115335464477539 | |
| 1822 | + }, | |
| 1823 | + { | |
| 1824 | + "epoch": 3, | |
| 1825 | + "val_top1": 0.708526611328125, | |
| 1826 | + "val_nll": 6.449355125427246, | |
| 1827 | + "t": 1.0625464916229248 | |
| 1828 | + }, | |
| 1829 | + { | |
| 1830 | + "epoch": 4, | |
| 1831 | + "val_top1": 0.7071533203125, | |
| 1832 | + "val_nll": 6.446946620941162, | |
| 1833 | + "t": 1.4134941101074219 | |
| 1834 | + }, | |
| 1835 | + { | |
| 1836 | + "epoch": 5, | |
| 1837 | + "val_top1": 0.708160400390625, | |
| 1838 | + "val_nll": 6.445855379104614, | |
| 1839 | + "t": 1.7653422355651855 | |
| 1840 | + }, | |
| 1841 | + { | |
| 1842 | + "epoch": 6, | |
| 1843 | + "val_top1": 0.705108642578125, | |
| 1844 | + "val_nll": 6.442993640899658, | |
| 1845 | + "t": 2.1150875091552734 | |
| 1846 | + }, | |
| 1847 | + { | |
| 1848 | + "epoch": 7, | |
| 1849 | + "val_top1": 0.704254150390625, | |
| 1850 | + "val_nll": 6.44312596321106, | |
| 1851 | + "t": 2.4681460857391357 | |
| 1852 | + }, | |
| 1853 | + { | |
| 1854 | + "epoch": 8, | |
| 1855 | + "val_top1": 0.6971435546875, | |
| 1856 | + "val_nll": 6.447124719619751, | |
| 1857 | + "t": 2.818361759185791 | |
| 1858 | + }, | |
| 1859 | + { | |
| 1860 | + "epoch": 9, | |
| 1861 | + "val_top1": 0.686248779296875, | |
| 1862 | + "val_nll": 6.442376136779785, | |
| 1863 | + "t": 3.1685690879821777 | |
| 1864 | + }, | |
| 1865 | + { | |
| 1866 | + "epoch": 10, | |
| 1867 | + "val_top1": 0.687469482421875, | |
| 1868 | + "val_nll": 6.442922353744507, | |
| 1869 | + "t": 3.5199124813079834 | |
| 1870 | + }, | |
| 1871 | + { | |
| 1872 | + "epoch": 11, | |
| 1873 | + "val_top1": 0.65240478515625, | |
| 1874 | + "val_nll": 6.446220397949219, | |
| 1875 | + "t": 3.873997688293457 | |
| 1876 | + }, | |
| 1877 | + { | |
| 1878 | + "epoch": 12, | |
| 1879 | + "val_top1": 0.693603515625, | |
| 1880 | + "val_nll": 6.443889379501343, | |
| 1881 | + "t": 4.223783016204834 | |
| 1882 | + }, | |
| 1883 | + { | |
| 1884 | + "epoch": 13, | |
| 1885 | + "val_top1": 0.67755126953125, | |
| 1886 | + "val_nll": 6.44130539894104, | |
| 1887 | + "t": 4.582846403121948 | |
| 1888 | + }, | |
| 1889 | + { | |
| 1890 | + "epoch": 14, | |
| 1891 | + "val_top1": 0.694793701171875, | |
| 1892 | + "val_nll": 6.4412877559661865, | |
| 1893 | + "t": 4.93133807182312 | |
| 1894 | + }, | |
| 1895 | + { | |
| 1896 | + "epoch": 15, | |
| 1897 | + "val_top1": 0.670654296875, | |
| 1898 | + "val_nll": 6.441680192947388, | |
| 1899 | + "t": 5.282924652099609 | |
| 1900 | + }, | |
| 1901 | + { | |
| 1902 | + "epoch": 16, | |
| 1903 | + "val_top1": 0.6798095703125, | |
| 1904 | + "val_nll": 6.445827007293701, | |
| 1905 | + "t": 5.646338701248169 | |
| 1906 | + }, | |
| 1907 | + { | |
| 1908 | + "epoch": 17, | |
| 1909 | + "val_top1": 0.6943359375, | |
| 1910 | + "val_nll": 6.445727348327637, | |
| 1911 | + "t": 5.996695518493652 | |
| 1912 | + }, | |
| 1913 | + { | |
| 1914 | + "epoch": 18, | |
| 1915 | + "val_top1": 0.671112060546875, | |
| 1916 | + "val_nll": 6.443555116653442, | |
| 1917 | + "t": 6.351628065109253 | |
| 1918 | + }, | |
| 1919 | + { | |
| 1920 | + "epoch": 19, | |
| 1921 | + "val_top1": 0.6937255859375, | |
| 1922 | + "val_nll": 6.447257041931152, | |
| 1923 | + "t": 6.708799600601196 | |
| 1924 | + }, | |
| 1925 | + { | |
| 1926 | + "epoch": 20, | |
| 1927 | + "val_top1": 0.671051025390625, | |
| 1928 | + "val_nll": 6.450349569320679, | |
| 1929 | + "t": 7.0588414669036865 | |
| 1930 | + }, | |
| 1931 | + { | |
| 1932 | + "epoch": 21, | |
| 1933 | + "val_top1": 0.668914794921875, | |
| 1934 | + "val_nll": 6.444246053695679, | |
| 1935 | + "t": 7.407181978225708 | |
| 1936 | + }, | |
| 1937 | + { | |
| 1938 | + "epoch": 22, | |
| 1939 | + "val_top1": 0.691802978515625, | |
| 1940 | + "val_nll": 6.4426469802856445, | |
| 1941 | + "t": 7.75655722618103 | |
| 1942 | + }, | |
| 1943 | + { | |
| 1944 | + "epoch": 23, | |
| 1945 | + "val_top1": 0.66192626953125, | |
| 1946 | + "val_nll": 6.443329572677612, | |
| 1947 | + "t": 8.107460260391235 | |
| 1948 | + }, | |
| 1949 | + { | |
| 1950 | + "epoch": 24, | |
| 1951 | + "val_top1": 0.654388427734375, | |
| 1952 | + "val_nll": 6.443274259567261, | |
| 1953 | + "t": 8.458791255950928 | |
| 1954 | + }, | |
| 1955 | + { | |
| 1956 | + "epoch": 25, | |
| 1957 | + "val_top1": 0.599517822265625, | |
| 1958 | + "val_nll": 6.448134422302246, | |
| 1959 | + "t": 8.805012464523315 | |
| 1960 | + }, | |
| 1961 | + { | |
| 1962 | + "epoch": 26, | |
| 1963 | + "val_top1": 0.646148681640625, | |
| 1964 | + "val_nll": 6.448085784912109, | |
| 1965 | + "t": 9.158044815063477 | |
| 1966 | + }, | |
| 1967 | + { | |
| 1968 | + "epoch": 27, | |
| 1969 | + "val_top1": 0.652679443359375, | |
| 1970 | + "val_nll": 6.443188667297363, | |
| 1971 | + "t": 9.510326147079468 | |
| 1972 | + }, | |
| 1973 | + { | |
| 1974 | + "epoch": 28, | |
| 1975 | + "val_top1": 0.685150146484375, | |
| 1976 | + "val_nll": 6.446719169616699, | |
| 1977 | + "t": 9.86588716506958 | |
| 1978 | + }, | |
| 1979 | + { | |
| 1980 | + "epoch": 29, | |
| 1981 | + "val_top1": 0.674774169921875, | |
| 1982 | + "val_nll": 6.437758684158325, | |
| 1983 | + "t": 10.212992906570435 | |
| 1984 | + }, | |
| 1985 | + { | |
| 1986 | + "epoch": 30, | |
| 1987 | + "val_top1": 0.6788330078125, | |
| 1988 | + "val_nll": 6.4540863037109375, | |
| 1989 | + "t": 10.563465118408203 | |
| 1990 | + } | |
| 1991 | + ] | |
| 1992 | + }, | |
| 1993 | + { | |
| 1994 | + "lr": 0.01, | |
| 1995 | + "wd": 0.0, | |
| 1996 | + "best_val_top1": 0.71026611328125, | |
| 1997 | + "reach": {}, | |
| 1998 | + "hist": [ | |
| 1999 | + { | |
| 2000 | + "epoch": 1, | |
| 2001 | + "val_top1": 0.593841552734375, | |
| 2002 | + "val_nll": 6.505146741867065, | |
| 2003 | + "t": 0.3446085453033447 | |
| 2004 | + }, | |
| 2005 | + { | |
| 2006 | + "epoch": 2, | |
| 2007 | + "val_top1": 0.704376220703125, | |
| 2008 | + "val_nll": 6.447669506072998, | |
| 2009 | + "t": 0.6926748752593994 | |
| 2010 | + }, | |
| 2011 | + { | |
| 2012 | + "epoch": 3, | |
| 2013 | + "val_top1": 0.71026611328125, | |
| 2014 | + "val_nll": 6.447699069976807, | |
| 2015 | + "t": 1.0366642475128174 | |
| 2016 | + }, | |
| 2017 | + { | |
| 2018 | + "epoch": 4, | |
| 2019 | + "val_top1": 0.707000732421875, | |
| 2020 | + "val_nll": 6.446061611175537, | |
| 2021 | + "t": 1.385895013809204 | |
| 2022 | + }, | |
| 2023 | + { | |
| 2024 | + "epoch": 5, | |
| 2025 | + "val_top1": 0.708221435546875, | |
| 2026 | + "val_nll": 6.445434808731079, | |
| 2027 | + "t": 1.7324984073638916 | |
| 2028 | + }, | |
| 2029 | + { | |
| 2030 | + "epoch": 6, | |
| 2031 | + "val_top1": 0.683807373046875, | |
| 2032 | + "val_nll": 6.442526817321777, | |
| 2033 | + "t": 2.076007127761841 | |
| 2034 | + }, | |
| 2035 | + { | |
| 2036 | + "epoch": 7, | |
| 2037 | + "val_top1": 0.70458984375, | |
| 2038 | + "val_nll": 6.443272352218628, | |
| 2039 | + "t": 2.4209258556365967 | |
| 2040 | + }, | |
| 2041 | + { | |
| 2042 | + "epoch": 8, | |
| 2043 | + "val_top1": 0.359375, | |
| 2044 | + "val_nll": 6.448428392410278, | |
| 2045 | + "t": 2.7723886966705322 | |
| 2046 | + }, | |
| 2047 | + { | |
| 2048 | + "epoch": 9, | |
| 2049 | + "val_top1": 0.4229736328125, | |
| 2050 | + "val_nll": 6.441183805465698, | |
| 2051 | + "t": 3.115097761154175 | |
| 2052 | + }, | |
| 2053 | + { | |
| 2054 | + "epoch": 10, | |
| 2055 | + "val_top1": 0.28411865234375, | |
| 2056 | + "val_nll": 6.445623397827148, | |
| 2057 | + "t": 3.4628472328186035 | |
| 2058 | + }, | |
| 2059 | + { | |
| 2060 | + "epoch": 11, | |
| 2061 | + "val_top1": 0.242950439453125, | |
| 2062 | + "val_nll": 6.451725959777832, | |
| 2063 | + "t": 3.810321092605591 | |
| 2064 | + }, | |
| 2065 | + { | |
| 2066 | + "epoch": 12, | |
| 2067 | + "val_top1": 0.452362060546875, | |
| 2068 | + "val_nll": 6.44697642326355, | |
| 2069 | + "t": 4.158412456512451 | |
| 2070 | + }, | |
| 2071 | + { | |
| 2072 | + "epoch": 13, | |
| 2073 | + "val_top1": 0.385162353515625, | |
| 2074 | + "val_nll": 6.446882009506226, | |
| 2075 | + "t": 4.502410173416138 | |
| 2076 | + }, | |
| 2077 | + { | |
| 2078 | + "epoch": 14, | |
| 2079 | + "val_top1": 0.3983154296875, | |
| 2080 | + "val_nll": 6.453195333480835, | |
| 2081 | + "t": 4.848613977432251 | |
| 2082 | + }, | |
| 2083 | + { | |
| 2084 | + "epoch": 15, | |
| 2085 | + "val_top1": 0.17742919921875, | |
| 2086 | + "val_nll": 6.452726125717163, | |
| 2087 | + "t": 5.19637393951416 | |
| 2088 | + }, | |
| 2089 | + { | |
| 2090 | + "epoch": 16, | |
| 2091 | + "val_top1": 0.2801513671875, | |
| 2092 | + "val_nll": 6.4574408531188965, | |
| 2093 | + "t": 5.539978504180908 | |
| 2094 | + }, | |
| 2095 | + { | |
| 2096 | + "epoch": 17, | |
| 2097 | + "val_top1": 0.377349853515625, | |
| 2098 | + "val_nll": 6.4500892162323, | |
| 2099 | + "t": 5.888188362121582 | |
| 2100 | + }, | |
| 2101 | + { | |
| 2102 | + "epoch": 18, | |
| 2103 | + "val_top1": 0.351776123046875, | |
| 2104 | + "val_nll": 6.444501638412476, | |
| 2105 | + "t": 6.232806444168091 | |
| 2106 | + }, | |
| 2107 | + { | |
| 2108 | + "epoch": 19, | |
| 2109 | + "val_top1": 0.34515380859375, | |
| 2110 | + "val_nll": 6.463596820831299, | |
| 2111 | + "t": 6.577976942062378 | |
| 2112 | + }, | |
| 2113 | + { | |
| 2114 | + "epoch": 20, | |
| 2115 | + "val_top1": 0.223419189453125, | |
| 2116 | + "val_nll": 6.45979642868042, | |
| 2117 | + "t": 6.925522327423096 | |
| 2118 | + }, | |
| 2119 | + { | |
| 2120 | + "epoch": 21, | |
| 2121 | + "val_top1": 0.166290283203125, | |
| 2122 | + "val_nll": 6.464598178863525, | |
| 2123 | + "t": 7.274820804595947 | |
| 2124 | + }, | |
| 2125 | + { | |
| 2126 | + "epoch": 22, | |
| 2127 | + "val_top1": 0.3729248046875, | |
| 2128 | + "val_nll": 6.410276174545288, | |
| 2129 | + "t": 7.620648145675659 | |
| 2130 | + }, | |
| 2131 | + { | |
| 2132 | + "epoch": 23, | |
| 2133 | + "val_top1": 0.319122314453125, | |
| 2134 | + "val_nll": 6.421350717544556, | |
| 2135 | + "t": 7.965811014175415 | |
| 2136 | + }, | |
| 2137 | + { | |
| 2138 | + "epoch": 24, | |
| 2139 | + "val_top1": 0.239837646484375, | |
| 2140 | + "val_nll": 6.469540119171143, | |
| 2141 | + "t": 8.309915781021118 | |
| 2142 | + }, | |
| 2143 | + { | |
| 2144 | + "epoch": 25, | |
| 2145 | + "val_top1": 0.221923828125, | |
| 2146 | + "val_nll": 6.475996494293213, | |
| 2147 | + "t": 8.654000759124756 | |
| 2148 | + }, | |
| 2149 | + { | |
| 2150 | + "epoch": 26, | |
| 2151 | + "val_top1": 0.329010009765625, | |
| 2152 | + "val_nll": 6.460695743560791, | |
| 2153 | + "t": 8.998011112213135 | |
| 2154 | + }, | |
| 2155 | + { | |
| 2156 | + "epoch": 27, | |
| 2157 | + "val_top1": 0.26556396484375, | |
| 2158 | + "val_nll": 6.42104697227478, | |
| 2159 | + "t": 9.346989393234253 | |
| 2160 | + }, | |
| 2161 | + { | |
| 2162 | + "epoch": 28, | |
| 2163 | + "val_top1": 0.229705810546875, | |
| 2164 | + "val_nll": 6.4840779304504395, | |
| 2165 | + "t": 9.693361043930054 | |
| 2166 | + }, | |
| 2167 | + { | |
| 2168 | + "epoch": 29, | |
| 2169 | + "val_top1": 0.3472900390625, | |
| 2170 | + "val_nll": 6.428587198257446, | |
| 2171 | + "t": 10.04000473022461 | |
| 2172 | + }, | |
| 2173 | + { | |
| 2174 | + "epoch": 30, | |
| 2175 | + "val_top1": 0.200042724609375, | |
| 2176 | + "val_nll": 6.48280143737793, | |
| 2177 | + "t": 10.391770601272583 | |
| 2178 | + } | |
| 2179 | + ] | |
| 2180 | + }, | |
| 2181 | + { | |
| 2182 | + "lr": 0.01, | |
| 2183 | + "wd": 0.01, | |
| 2184 | + "best_val_top1": 0.709991455078125, | |
| 2185 | + "reach": {}, | |
| 2186 | + "hist": [ | |
| 2187 | + { | |
| 2188 | + "epoch": 1, | |
| 2189 | + "val_top1": 0.594818115234375, | |
| 2190 | + "val_nll": 6.505126476287842, | |
| 2191 | + "t": 0.3537425994873047 | |
| 2192 | + }, | |
| 2193 | + { | |
| 2194 | + "epoch": 2, | |
| 2195 | + "val_top1": 0.70452880859375, | |
| 2196 | + "val_nll": 6.448051691055298, | |
| 2197 | + "t": 0.7087059020996094 | |
| 2198 | + }, | |
| 2199 | + { | |
| 2200 | + "epoch": 3, | |
| 2201 | + "val_top1": 0.709991455078125, | |
| 2202 | + "val_nll": 6.448024272918701, | |
| 2203 | + "t": 1.0611562728881836 | |
| 2204 | + }, | |
| 2205 | + { | |
| 2206 | + "epoch": 4, | |
| 2207 | + "val_top1": 0.707000732421875, | |
| 2208 | + "val_nll": 6.446350574493408, | |
| 2209 | + "t": 1.411653995513916 | |
| 2210 | + }, | |
| 2211 | + { | |
| 2212 | + "epoch": 5, | |
| 2213 | + "val_top1": 0.7081298828125, | |
| 2214 | + "val_nll": 6.445698499679565, | |
| 2215 | + "t": 1.7623305320739746 | |
| 2216 | + }, | |
| 2217 | + { | |
| 2218 | + "epoch": 6, | |
| 2219 | + "val_top1": 0.678436279296875, | |
| 2220 | + "val_nll": 6.442789316177368, | |
| 2221 | + "t": 2.1136069297790527 | |
| 2222 | + }, | |
| 2223 | + { | |
| 2224 | + "epoch": 7, | |
| 2225 | + "val_top1": 0.704559326171875, | |
| 2226 | + "val_nll": 6.443491458892822, | |
| 2227 | + "t": 2.464402437210083 | |
| 2228 | + }, | |
| 2229 | + { | |
| 2230 | + "epoch": 8, | |
| 2231 | + "val_top1": 0.3775634765625, | |
| 2232 | + "val_nll": 6.4485673904418945, | |
| 2233 | + "t": 2.8170597553253174 | |
| 2234 | + }, | |
| 2235 | + { | |
| 2236 | + "epoch": 9, | |
| 2237 | + "val_top1": 0.38531494140625, | |
| 2238 | + "val_nll": 6.441689491271973, | |
| 2239 | + "t": 3.1661384105682373 | |
| 2240 | + }, | |
| 2241 | + { | |
| 2242 | + "epoch": 10, | |
| 2243 | + "val_top1": 0.312957763671875, | |
| 2244 | + "val_nll": 6.444810390472412, | |
| 2245 | + "t": 3.51820707321167 | |
| 2246 | + }, | |
| 2247 | + { | |
| 2248 | + "epoch": 11, | |
| 2249 | + "val_top1": 0.1728515625, | |
| 2250 | + "val_nll": 6.451758861541748, | |
| 2251 | + "t": 3.8723442554473877 | |
| 2252 | + }, | |
| 2253 | + { | |
| 2254 | + "epoch": 12, | |
| 2255 | + "val_top1": 0.341583251953125, | |
| 2256 | + "val_nll": 6.448825120925903, | |
| 2257 | + "t": 4.2247154712677 | |
| 2258 | + }, | |
| 2259 | + { | |
| 2260 | + "epoch": 13, | |
| 2261 | + "val_top1": 0.46209716796875, | |
| 2262 | + "val_nll": 6.444767475128174, | |
| 2263 | + "t": 4.573038339614868 | |
| 2264 | + }, | |
| 2265 | + { | |
| 2266 | + "epoch": 14, | |
| 2267 | + "val_top1": 0.42974853515625, | |
| 2268 | + "val_nll": 6.448354721069336, | |
| 2269 | + "t": 4.925668716430664 | |
| 2270 | + }, | |
| 2271 | + { | |
| 2272 | + "epoch": 15, | |
| 2273 | + "val_top1": 0.28118896484375, | |
| 2274 | + "val_nll": 6.456234455108643, | |
| 2275 | + "t": 5.277758359909058 | |
| 2276 | + }, | |
| 2277 | + { | |
| 2278 | + "epoch": 16, | |
| 2279 | + "val_top1": 0.265106201171875, | |
| 2280 | + "val_nll": 6.454460620880127, | |
| 2281 | + "t": 5.637317419052124 | |
| 2282 | + }, | |
| 2283 | + { | |
| 2284 | + "epoch": 17, | |
| 2285 | + "val_top1": 0.378143310546875, | |
| 2286 | + "val_nll": 6.46045184135437, | |
| 2287 | + "t": 5.986838102340698 | |
| 2288 | + }, | |
| 2289 | + { | |
| 2290 | + "epoch": 18, | |
| 2291 | + "val_top1": 0.28375244140625, | |
| 2292 | + "val_nll": 6.466175556182861, | |
| 2293 | + "t": 6.333662748336792 | |
| 2294 | + }, | |
| 2295 | + { | |
| 2296 | + "epoch": 19, | |
| 2297 | + "val_top1": 0.413116455078125, | |
| 2298 | + "val_nll": 6.4557929039001465, | |
| 2299 | + "t": 6.682986259460449 | |
| 2300 | + }, | |
| 2301 | + { | |
| 2302 | + "epoch": 20, | |
| 2303 | + "val_top1": 0.28662109375, | |
| 2304 | + "val_nll": 6.461572170257568, | |
| 2305 | + "t": 7.03390097618103 | |
| 2306 | + }, | |
| 2307 | + { | |
| 2308 | + "epoch": 21, | |
| 2309 | + "val_top1": 0.131256103515625, | |
| 2310 | + "val_nll": 6.4702208042144775, | |
| 2311 | + "t": 7.384650230407715 | |
| 2312 | + }, | |
| 2313 | + { | |
| 2314 | + "epoch": 22, | |
| 2315 | + "val_top1": 0.35369873046875, | |
| 2316 | + "val_nll": 6.41960883140564, | |
| 2317 | + "t": 7.761572599411011 | |
| 2318 | + }, | |
| 2319 | + { | |
| 2320 | + "epoch": 23, | |
| 2321 | + "val_top1": 0.2142333984375, | |
| 2322 | + "val_nll": 6.465413331985474, | |
| 2323 | + "t": 8.114521265029907 | |
| 2324 | + }, | |
| 2325 | + { | |
| 2326 | + "epoch": 24, | |
| 2327 | + "val_top1": 0.329254150390625, | |
| 2328 | + "val_nll": 6.465343475341797, | |
| 2329 | + "t": 8.461325645446777 | |
| 2330 | + }, | |
| 2331 | + { | |
| 2332 | + "epoch": 25, | |
| 2333 | + "val_top1": 0.17340087890625, | |
| 2334 | + "val_nll": 6.51074743270874, | |
| 2335 | + "t": 8.816457271575928 | |
| 2336 | + }, | |
| 2337 | + { | |
| 2338 | + "epoch": 26, | |
| 2339 | + "val_top1": 0.29461669921875, | |
| 2340 | + "val_nll": 6.45954442024231, | |
| 2341 | + "t": 9.230611801147461 | |
| 2342 | + }, | |
| 2343 | + { | |
| 2344 | + "epoch": 27, | |
| 2345 | + "val_top1": 0.26776123046875, | |
| 2346 | + "val_nll": 6.4204261302948, | |
| 2347 | + "t": 9.577163457870483 | |
| 2348 | + }, | |
| 2349 | + { | |
| 2350 | + "epoch": 28, | |
| 2351 | + "val_top1": 0.367584228515625, | |
| 2352 | + "val_nll": 6.4228596687316895, | |
| 2353 | + "t": 9.928158283233643 | |
| 2354 | + }, | |
| 2355 | + { | |
| 2356 | + "epoch": 29, | |
| 2357 | + "val_top1": 0.29669189453125, | |
| 2358 | + "val_nll": 6.442505836486816, | |
| 2359 | + "t": 10.27524447441101 | |
| 2360 | + }, | |
| 2361 | + { | |
| 2362 | + "epoch": 30, | |
| 2363 | + "val_top1": 0.3636474609375, | |
| 2364 | + "val_nll": 6.473464488983154, | |
| 2365 | + "t": 10.627685785293579 | |
| 2366 | + } | |
| 2367 | + ] | |
| 2368 | + } | |
| 2369 | + ], | |
| 2370 | + "chosen": { | |
| 2371 | + "lr": 0.01, | |
| 2372 | + "wd": 0.0 | |
| 2373 | + }, | |
| 2374 | + "val": { | |
| 2375 | + "top1": 0.200042724609375, | |
| 2376 | + "nll": 6.48280143737793 | |
| 2377 | + }, | |
| 2378 | + "test": { | |
| 2379 | + "top1": 0.1779327392578125, | |
| 2380 | + "nll": 6.516726732254028 | |
| 2381 | + }, | |
| 2382 | + "reach": {} | |
| 2383 | + }, | |
| 2384 | + "lbfgs_ce_A": { | |
| 2385 | + "lambda": 0.0001, | |
| 2386 | + "runs": { | |
| 2387 | + "1e-05": { | |
| 2388 | + "hist": [ | |
| 2389 | + { | |
| 2390 | + "passes": 12, | |
| 2391 | + "val_top1": 0.4747314453125, | |
| 2392 | + "val_nll": 3.2495909929275513, | |
| 2393 | + "t": 2.8169302940368652 | |
| 2394 | + }, | |
| 2395 | + { | |
| 2396 | + "passes": 23, | |
| 2397 | + "val_top1": 0.659423828125, | |
| 2398 | + "val_nll": 1.915787160396576, | |
| 2399 | + "t": 5.419461965560913 | |
| 2400 | + }, | |
| 2401 | + { | |
| 2402 | + "passes": 34, | |
| 2403 | + "val_top1": 0.71075439453125, | |
| 2404 | + "val_nll": 1.4772437810897827, | |
| 2405 | + "t": 8.084282875061035 | |
| 2406 | + }, | |
| 2407 | + { | |
| 2408 | + "passes": 45, | |
| 2409 | + "val_top1": 0.746185302734375, | |
| 2410 | + "val_nll": 1.1868815422058105, | |
| 2411 | + "t": 10.790548324584961 | |
| 2412 | + }, | |
| 2413 | + { | |
| 2414 | + "passes": 56, | |
| 2415 | + "val_top1": 0.76751708984375, | |
| 2416 | + "val_nll": 1.0228981375694275, | |
| 2417 | + "t": 13.515612125396729 | |
| 2418 | + }, | |
| 2419 | + { | |
| 2420 | + "passes": 67, | |
| 2421 | + "val_top1": 0.7847900390625, | |
| 2422 | + "val_nll": 0.9112331569194794, | |
| 2423 | + "t": 16.17979121208191 | |
| 2424 | + }, | |
| 2425 | + { | |
| 2426 | + "passes": 79, | |
| 2427 | + "val_top1": 0.79547119140625, | |
| 2428 | + "val_nll": 0.8419247269630432, | |
| 2429 | + "t": 19.117775917053223 | |
| 2430 | + }, | |
| 2431 | + { | |
| 2432 | + "passes": 90, | |
| 2433 | + "val_top1": 0.800048828125, | |
| 2434 | + "val_nll": 0.8115136325359344, | |
| 2435 | + "t": 21.746538639068604 | |
| 2436 | + }, | |
| 2437 | + { | |
| 2438 | + "passes": 101, | |
| 2439 | + "val_top1": 0.804779052734375, | |
| 2440 | + "val_nll": 0.778416782617569, | |
| 2441 | + "t": 24.280574560165405 | |
| 2442 | + }, | |
| 2443 | + { | |
| 2444 | + "passes": 113, | |
| 2445 | + "val_top1": 0.80731201171875, | |
| 2446 | + "val_nll": 0.7712537348270416, | |
| 2447 | + "t": 27.164397716522217 | |
| 2448 | + }, | |
| 2449 | + { | |
| 2450 | + "passes": 124, | |
| 2451 | + "val_top1": 0.808807373046875, | |
| 2452 | + "val_nll": 0.7637747228145599, | |
| 2453 | + "t": 29.724287509918213 | |
| 2454 | + }, | |
| 2455 | + { | |
| 2456 | + "passes": 137, | |
| 2457 | + "val_top1": 0.81005859375, | |
| 2458 | + "val_nll": 0.7661287784576416, | |
| 2459 | + "t": 32.75278973579407 | |
| 2460 | + }, | |
| 2461 | + { | |
| 2462 | + "passes": 148, | |
| 2463 | + "val_top1": 0.80718994140625, | |
| 2464 | + "val_nll": 0.7739642560482025, | |
| 2465 | + "t": 35.40171694755554 | |
| 2466 | + }, | |
| 2467 | + { | |
| 2468 | + "passes": 160, | |
| 2469 | + "val_top1": 0.809967041015625, | |
| 2470 | + "val_nll": 0.7722652852535248, | |
| 2471 | + "t": 38.2191424369812 | |
| 2472 | + }, | |
| 2473 | + { | |
| 2474 | + "passes": 172, | |
| 2475 | + "val_top1": 0.811431884765625, | |
| 2476 | + "val_nll": 0.7725585997104645, | |
| 2477 | + "t": 41.066253423690796 | |
| 2478 | + }, | |
| 2479 | + { | |
| 2480 | + "passes": 183, | |
| 2481 | + "val_top1": 0.80859375, | |
| 2482 | + "val_nll": 0.7962510585784912, | |
| 2483 | + "t": 43.67973256111145 | |
| 2484 | + }, | |
| 2485 | + { | |
| 2486 | + "passes": 195, | |
| 2487 | + "val_top1": 0.808837890625, | |
| 2488 | + "val_nll": 0.8058283925056458, | |
| 2489 | + "t": 46.5659875869751 | |
| 2490 | + }, | |
| 2491 | + { | |
| 2492 | + "passes": 206, | |
| 2493 | + "val_top1": 0.807830810546875, | |
| 2494 | + "val_nll": 0.8198990523815155, | |
| 2495 | + "t": 49.13427948951721 | |
| 2496 | + }, | |
| 2497 | + { | |
| 2498 | + "passes": 218, | |
| 2499 | + "val_top1": 0.806976318359375, | |
| 2500 | + "val_nll": 0.8337454795837402, | |
| 2501 | + "t": 52.05453062057495 | |
| 2502 | + }, | |
| 2503 | + { | |
| 2504 | + "passes": 230, | |
| 2505 | + "val_top1": 0.80596923828125, | |
| 2506 | + "val_nll": 0.852423906326294, | |
| 2507 | + "t": 54.84880447387695 | |
| 2508 | + }, | |
| 2509 | + { | |
| 2510 | + "passes": 242, | |
| 2511 | + "val_top1": 0.80401611328125, | |
| 2512 | + "val_nll": 0.878303050994873, | |
| 2513 | + "t": 57.69625186920166 | |
| 2514 | + }, | |
| 2515 | + { | |
| 2516 | + "passes": 254, | |
| 2517 | + "val_top1": 0.80303955078125, | |
| 2518 | + "val_nll": 0.8989858627319336, | |
| 2519 | + "t": 60.52817749977112 | |
| 2520 | + }, | |
| 2521 | + { | |
| 2522 | + "passes": 266, | |
| 2523 | + "val_top1": 0.80291748046875, | |
| 2524 | + "val_nll": 0.9133257567882538, | |
| 2525 | + "t": 63.38065767288208 | |
| 2526 | + }, | |
| 2527 | + { | |
| 2528 | + "passes": 278, | |
| 2529 | + "val_top1": 0.8016357421875, | |
| 2530 | + "val_nll": 0.9289783537387848, | |
| 2531 | + "t": 66.41101598739624 | |
| 2532 | + }, | |
| 2533 | + { | |
| 2534 | + "passes": 290, | |
| 2535 | + "val_top1": 0.800689697265625, | |
| 2536 | + "val_nll": 0.9513852000236511, | |
| 2537 | + "t": 69.19390654563904 | |
| 2538 | + }, | |
| 2539 | + { | |
| 2540 | + "passes": 302, | |
| 2541 | + "val_top1": 0.80078125, | |
| 2542 | + "val_nll": 0.969844788312912, | |
| 2543 | + "t": 72.0432677268982 | |
| 2544 | + } | |
| 2545 | + ], | |
| 2546 | + "reach": {} | |
| 2547 | + }, | |
| 2548 | + "0.0001": { | |
| 2549 | + "hist": [ | |
| 2550 | + { | |
| 2551 | + "passes": 12, | |
| 2552 | + "val_top1": 0.4747314453125, | |
| 2553 | + "val_nll": 3.249597430229187, | |
| 2554 | + "t": 2.7832350730895996 | |
| 2555 | + }, | |
| 2556 | + { | |
| 2557 | + "passes": 23, | |
| 2558 | + "val_top1": 0.659271240234375, | |
| 2559 | + "val_nll": 1.915880799293518, | |
| 2560 | + "t": 5.360274076461792 | |
| 2561 | + }, | |
| 2562 | + { | |
| 2563 | + "passes": 34, | |
| 2564 | + "val_top1": 0.710906982421875, | |
| 2565 | + "val_nll": 1.47743821144104, | |
| 2566 | + "t": 7.921369791030884 | |
| 2567 | + }, | |
| 2568 | + { | |
| 2569 | + "passes": 45, | |
| 2570 | + "val_top1": 0.7459716796875, | |
| 2571 | + "val_nll": 1.1854286193847656, | |
| 2572 | + "t": 10.552916288375854 | |
| 2573 | + }, | |
| 2574 | + { | |
| 2575 | + "passes": 57, | |
| 2576 | + "val_top1": 0.7628173828125, | |
| 2577 | + "val_nll": 1.0337932109832764, | |
| 2578 | + "t": 13.327110767364502 | |
| 2579 | + }, | |
| 2580 | + { | |
| 2581 | + "passes": 68, | |
| 2582 | + "val_top1": 0.781402587890625, | |
| 2583 | + "val_nll": 0.9404293596744537, | |
| 2584 | + "t": 15.916584491729736 | |
| 2585 | + }, | |
| 2586 | + { | |
| 2587 | + "passes": 80, | |
| 2588 | + "val_top1": 0.794708251953125, | |
| 2589 | + "val_nll": 0.8586232662200928, | |
| 2590 | + "t": 18.73744034767151 | |
| 2591 | + }, | |
| 2592 | + { | |
| 2593 | + "passes": 91, | |
| 2594 | + "val_top1": 0.79840087890625, | |
| 2595 | + "val_nll": 0.8201556503772736, | |
| 2596 | + "t": 21.40697932243347 | |
| 2597 | + }, | |
| 2598 | + { | |
| 2599 | + "passes": 102, | |
| 2600 | + "val_top1": 0.802459716796875, | |
| 2601 | + "val_nll": 0.7811061441898346, | |
| 2602 | + "t": 23.9751455783844 | |
| 2603 | + }, | |
| 2604 | + { | |
| 2605 | + "passes": 114, | |
| 2606 | + "val_top1": 0.80621337890625, | |
| 2607 | + "val_nll": 0.7589944005012512, | |
| 2608 | + "t": 26.790009021759033 | |
| 2609 | + }, | |
| 2610 | + { | |
| 2611 | + "passes": 125, | |
| 2612 | + "val_top1": 0.807952880859375, | |
| 2613 | + "val_nll": 0.7443333864212036, | |
| 2614 | + "t": 29.37828826904297 | |
| 2615 | + }, | |
| 2616 | + { | |
| 2617 | + "passes": 136, | |
| 2618 | + "val_top1": 0.811126708984375, | |
| 2619 | + "val_nll": 0.7301788330078125, | |
| 2620 | + "t": 32.01680040359497 | |
| 2621 | + }, | |
| 2622 | + { | |
| 2623 | + "passes": 148, | |
| 2624 | + "val_top1": 0.810699462890625, | |
| 2625 | + "val_nll": 0.7249797880649567, | |
| 2626 | + "t": 34.896923780441284 | |
| 2627 | + }, | |
| 2628 | + { | |
| 2629 | + "passes": 159, | |
| 2630 | + "val_top1": 0.811737060546875, | |
| 2631 | + "val_nll": 0.7211858630180359, | |
| 2632 | + "t": 37.5617139339447 | |
| 2633 | + }, | |
| 2634 | + { | |
| 2635 | + "passes": 170, | |
| 2636 | + "val_top1": 0.81243896484375, | |
| 2637 | + "val_nll": 0.7170268893241882, | |
| 2638 | + "t": 40.269996643066406 | |
| 2639 | + }, | |
| 2640 | + { | |
| 2641 | + "passes": 182, | |
| 2642 | + "val_top1": 0.812652587890625, | |
| 2643 | + "val_nll": 0.7164435982704163, | |
| 2644 | + "t": 43.22937870025635 | |
| 2645 | + }, | |
| 2646 | + { | |
| 2647 | + "passes": 193, | |
| 2648 | + "val_top1": 0.81365966796875, | |
| 2649 | + "val_nll": 0.7149734497070312, | |
| 2650 | + "t": 45.98551559448242 | |
| 2651 | + }, | |
| 2652 | + { | |
| 2653 | + "passes": 205, | |
| 2654 | + "val_top1": 0.813690185546875, | |
| 2655 | + "val_nll": 0.7152076959609985, | |
| 2656 | + "t": 48.87936592102051 | |
| 2657 | + }, | |
| 2658 | + { | |
| 2659 | + "passes": 216, | |
| 2660 | + "val_top1": 0.8138427734375, | |
| 2661 | + "val_nll": 0.716541975736618, | |
| 2662 | + "t": 51.54072093963623 | |
| 2663 | + }, | |
| 2664 | + { | |
| 2665 | + "passes": 228, | |
| 2666 | + "val_top1": 0.813323974609375, | |
| 2667 | + "val_nll": 0.7208894789218903, | |
| 2668 | + "t": 54.43611717224121 | |
| 2669 | + }, | |
| 2670 | + { | |
| 2671 | + "passes": 240, | |
| 2672 | + "val_top1": 0.8118896484375, | |
| 2673 | + "val_nll": 0.7279211282730103, | |
| 2674 | + "t": 57.38322329521179 | |
| 2675 | + }, | |
| 2676 | + { | |
| 2677 | + "passes": 253, | |
| 2678 | + "val_top1": 0.811370849609375, | |
| 2679 | + "val_nll": 0.7314850687980652, | |
| 2680 | + "t": 60.56230306625366 | |
| 2681 | + }, | |
| 2682 | + { | |
| 2683 | + "passes": 266, | |
| 2684 | + "val_top1": 0.811431884765625, | |
| 2685 | + "val_nll": 0.7378299832344055, | |
| 2686 | + "t": 63.81092309951782 | |
| 2687 | + }, | |
| 2688 | + { | |
| 2689 | + "passes": 277, | |
| 2690 | + "val_top1": 0.811004638671875, | |
| 2691 | + "val_nll": 0.7391043901443481, | |
| 2692 | + "t": 66.55108904838562 | |
| 2693 | + }, | |
| 2694 | + { | |
| 2695 | + "passes": 288, | |
| 2696 | + "val_top1": 0.809906005859375, | |
| 2697 | + "val_nll": 0.7461071312427521, | |
| 2698 | + "t": 69.31008577346802 | |
| 2699 | + }, | |
| 2700 | + { | |
| 2701 | + "passes": 300, | |
| 2702 | + "val_top1": 0.809112548828125, | |
| 2703 | + "val_nll": 0.7485460638999939, | |
| 2704 | + "t": 72.36433863639832 | |
| 2705 | + } | |
| 2706 | + ], | |
| 2707 | + "reach": {} | |
| 2708 | + } | |
| 2709 | + }, | |
| 2710 | + "val": { | |
| 2711 | + "top1": 0.809112548828125, | |
| 2712 | + "nll": 0.7485460638999939 | |
| 2713 | + }, | |
| 2714 | + "test": { | |
| 2715 | + "top1": 0.7394256591796875, | |
| 2716 | + "nll": 1.191632241010666 | |
| 2717 | + }, | |
| 2718 | + "reach": {} | |
| 2719 | + }, | |
| 2720 | + "bohning_cold_A": { | |
| 2721 | + "lambda": 1e-05, | |
| 2722 | + "runs": { | |
| 2723 | + "1e-05": { | |
| 2724 | + "hist": [ | |
| 2725 | + { | |
| 2726 | + "passes": 1, | |
| 2727 | + "val_top1": 0.71209716796875, | |
| 2728 | + "val_nll": 5.952229261398315, | |
| 2729 | + "t": 0.27783656120300293 | |
| 2730 | + }, | |
| 2731 | + { | |
| 2732 | + "passes": 2, | |
| 2733 | + "val_top1": 0.712127685546875, | |
| 2734 | + "val_nll": 4.98691463470459, | |
| 2735 | + "t": 0.5647788047790527 | |
| 2736 | + }, | |
| 2737 | + { | |
| 2738 | + "passes": 3, | |
| 2739 | + "val_top1": 0.712371826171875, | |
| 2740 | + "val_nll": 4.093729496002197, | |
| 2741 | + "t": 0.8581464290618896 | |
| 2742 | + }, | |
| 2743 | + { | |
| 2744 | + "passes": 4, | |
| 2745 | + "val_top1": 0.712982177734375, | |
| 2746 | + "val_nll": 3.407430052757263, | |
| 2747 | + "t": 1.1464838981628418 | |
| 2748 | + }, | |
| 2749 | + { | |
| 2750 | + "passes": 5, | |
| 2751 | + "val_top1": 0.714630126953125, | |
| 2752 | + "val_nll": 2.9605863094329834, | |
| 2753 | + "t": 1.4389610290527344 | |
| 2754 | + }, | |
| 2755 | + { | |
| 2756 | + "passes": 6, | |
| 2757 | + "val_top1": 0.71710205078125, | |
| 2758 | + "val_nll": 2.6623376607894897, | |
| 2759 | + "t": 1.7275567054748535 | |
| 2760 | + }, | |
| 2761 | + { | |
| 2762 | + "passes": 7, | |
| 2763 | + "val_top1": 0.7196044921875, | |
| 2764 | + "val_nll": 2.4481303691864014, | |
| 2765 | + "t": 2.014779567718506 | |
| 2766 | + }, | |
| 2767 | + { | |
| 2768 | + "passes": 8, | |
| 2769 | + "val_top1": 0.7225341796875, | |
| 2770 | + "val_nll": 2.2851974964141846, | |
| 2771 | + "t": 2.2979846000671387 | |
| 2772 | + }, | |
| 2773 | + { | |
| 2774 | + "passes": 9, | |
| 2775 | + "val_top1": 0.7254638671875, | |
| 2776 | + "val_nll": 2.156085968017578, | |
| 2777 | + "t": 2.5841219425201416 | |
| 2778 | + }, | |
| 2779 | + { | |
| 2780 | + "passes": 10, | |
| 2781 | + "val_top1": 0.728271484375, | |
| 2782 | + "val_nll": 2.0505603551864624, | |
| 2783 | + "t": 2.873302936553955 | |
| 2784 | + }, | |
| 2785 | + { | |
| 2786 | + "passes": 11, | |
| 2787 | + "val_top1": 0.73150634765625, | |
| 2788 | + "val_nll": 1.9621737003326416, | |
| 2789 | + "t": 3.1644978523254395 | |
| 2790 | + }, | |
| 2791 | + { | |
| 2792 | + "passes": 12, | |
| 2793 | + "val_top1": 0.734405517578125, | |
| 2794 | + "val_nll": 1.8866719007492065, | |
| 2795 | + "t": 3.490699291229248 | |
| 2796 | + }, | |
| 2797 | + { | |
| 2798 | + "passes": 13, | |
| 2799 | + "val_top1": 0.737213134765625, | |
| 2800 | + "val_nll": 1.8211431503295898, | |
| 2801 | + "t": 3.7747209072113037 | |
| 2802 | + }, | |
| 2803 | + { | |
| 2804 | + "passes": 14, | |
| 2805 | + "val_top1": 0.739837646484375, | |
| 2806 | + "val_nll": 1.7635288834571838, | |
| 2807 | + "t": 4.067702770233154 | |
| 2808 | + }, | |
| 2809 | + { | |
| 2810 | + "passes": 15, | |
| 2811 | + "val_top1": 0.742279052734375, | |
| 2812 | + "val_nll": 1.712331473827362, | |
| 2813 | + "t": 4.349720239639282 | |
| 2814 | + }, | |
| 2815 | + { | |
| 2816 | + "passes": 16, | |
| 2817 | + "val_top1": 0.745361328125, | |
| 2818 | + "val_nll": 1.6664299368858337, | |
| 2819 | + "t": 4.646488189697266 | |
| 2820 | + }, | |
| 2821 | + { | |
| 2822 | + "passes": 17, | |
| 2823 | + "val_top1": 0.747314453125, | |
| 2824 | + "val_nll": 1.624964416027069, | |
| 2825 | + "t": 4.928377628326416 | |
| 2826 | + }, | |
| 2827 | + { | |
| 2828 | + "passes": 18, | |
| 2829 | + "val_top1": 0.74920654296875, | |
| 2830 | + "val_nll": 1.5872597694396973, | |
| 2831 | + "t": 5.212855815887451 | |
| 2832 | + }, | |
| 2833 | + { | |
| 2834 | + "passes": 19, | |
| 2835 | + "val_top1": 0.75152587890625, | |
| 2836 | + "val_nll": 1.5527761578559875, | |
| 2837 | + "t": 5.499136686325073 | |
| 2838 | + }, | |
| 2839 | + { | |
| 2840 | + "passes": 20, | |
| 2841 | + "val_top1": 0.7535400390625, | |
| 2842 | + "val_nll": 1.5210742950439453, | |
| 2843 | + "t": 5.785634994506836 | |
| 2844 | + }, | |
| 2845 | + { | |
| 2846 | + "passes": 21, | |
| 2847 | + "val_top1": 0.755126953125, | |
| 2848 | + "val_nll": 1.4917927384376526, | |
| 2849 | + "t": 6.096140146255493 | |
| 2850 | + }, | |
| 2851 | + { | |
| 2852 | + "passes": 22, | |
| 2853 | + "val_top1": 0.7569580078125, | |
| 2854 | + "val_nll": 1.4646304845809937, | |
| 2855 | + "t": 6.3858044147491455 | |
| 2856 | + }, | |
| 2857 | + { | |
| 2858 | + "passes": 23, | |
| 2859 | + "val_top1": 0.75897216796875, | |
| 2860 | + "val_nll": 1.439335823059082, | |
| 2861 | + "t": 6.674629211425781 | |
| 2862 | + }, | |
| 2863 | + { | |
| 2864 | + "passes": 24, | |
| 2865 | + "val_top1": 0.7607421875, | |
| 2866 | + "val_nll": 1.4156963229179382, | |
| 2867 | + "t": 6.960375070571899 | |
| 2868 | + }, | |
| 2869 | + { | |
| 2870 | + "passes": 25, | |
| 2871 | + "val_top1": 0.7625732421875, | |
| 2872 | + "val_nll": 1.393531858921051, | |
| 2873 | + "t": 7.252870559692383 | |
| 2874 | + }, | |
| 2875 | + { | |
| 2876 | + "passes": 26, | |
| 2877 | + "val_top1": 0.764068603515625, | |
| 2878 | + "val_nll": 1.3726894855499268, | |
| 2879 | + "t": 7.539679050445557 | |
| 2880 | + }, | |
| 2881 | + { | |
| 2882 | + "passes": 27, | |
| 2883 | + "val_top1": 0.76544189453125, | |
| 2884 | + "val_nll": 1.3530377745628357, | |
| 2885 | + "t": 7.82398247718811 | |
| 2886 | + }, | |
| 2887 | + { | |
| 2888 | + "passes": 28, | |
| 2889 | + "val_top1": 0.766845703125, | |
| 2890 | + "val_nll": 1.3344639539718628, | |
| 2891 | + "t": 8.11166787147522 | |
| 2892 | + }, | |
| 2893 | + { | |
| 2894 | + "passes": 29, | |
| 2895 | + "val_top1": 0.768035888671875, | |
| 2896 | + "val_nll": 1.3168708086013794, | |
| 2897 | + "t": 8.402305603027344 | |
| 2898 | + }, | |
| 2899 | + { | |
| 2900 | + "passes": 30, | |
| 2901 | + "val_top1": 0.769439697265625, | |
| 2902 | + "val_nll": 1.3001732230186462, | |
| 2903 | + "t": 8.687081575393677 | |
| 2904 | + }, | |
| 2905 | + { | |
| 2906 | + "passes": 31, | |
| 2907 | + "val_top1": 0.770599365234375, | |
| 2908 | + "val_nll": 1.2842971086502075, | |
| 2909 | + "t": 8.9740731716156 | |
| 2910 | + }, | |
| 2911 | + { | |
| 2912 | + "passes": 32, | |
| 2913 | + "val_top1": 0.77166748046875, | |
| 2914 | + "val_nll": 1.2691773176193237, | |
| 2915 | + "t": 9.267617464065552 | |
| 2916 | + }, | |
| 2917 | + { | |
| 2918 | + "passes": 33, | |
| 2919 | + "val_top1": 0.772613525390625, | |
| 2920 | + "val_nll": 1.2547560930252075, | |
| 2921 | + "t": 9.555848836898804 | |
| 2922 | + }, | |
| 2923 | + { | |
| 2924 | + "passes": 34, | |
| 2925 | + "val_top1": 0.7738037109375, | |
| 2926 | + "val_nll": 1.240981936454773, | |
| 2927 | + "t": 9.839445114135742 | |
| 2928 | + }, | |
| 2929 | + { | |
| 2930 | + "passes": 35, | |
| 2931 | + "val_top1": 0.774566650390625, | |
| 2932 | + "val_nll": 1.2278093099594116, | |
| 2933 | + "t": 10.130168914794922 | |
| 2934 | + }, | |
| 2935 | + { | |
| 2936 | + "passes": 36, | |
| 2937 | + "val_top1": 0.7755126953125, | |
| 2938 | + "val_nll": 1.2151963710784912, | |
| 2939 | + "t": 10.41530179977417 | |
| 2940 | + }, | |
| 2941 | + { | |
| 2942 | + "passes": 37, | |
| 2943 | + "val_top1": 0.776519775390625, | |
| 2944 | + "val_nll": 1.2031064629554749, | |
| 2945 | + "t": 10.781859397888184 | |
| 2946 | + }, | |
| 2947 | + { | |
| 2948 | + "passes": 38, | |
| 2949 | + "val_top1": 0.777801513671875, | |
| 2950 | + "val_nll": 1.191505491733551, | |
| 2951 | + "t": 11.06904125213623 | |
| 2952 | + }, | |
| 2953 | + { | |
| 2954 | + "passes": 39, | |
| 2955 | + "val_top1": 0.778472900390625, | |
| 2956 | + "val_nll": 1.1803628206253052, | |
| 2957 | + "t": 11.35368037223816 | |
| 2958 | + }, | |
| 2959 | + { | |
| 2960 | + "passes": 40, | |
| 2961 | + "val_top1": 0.7791748046875, | |
| 2962 | + "val_nll": 1.1696507930755615, | |
| 2963 | + "t": 11.640761852264404 | |
| 2964 | + }, | |
| 2965 | + { | |
| 2966 | + "passes": 41, | |
| 2967 | + "val_top1": 0.779876708984375, | |
| 2968 | + "val_nll": 1.1593434810638428, | |
| 2969 | + "t": 11.926718950271606 | |
| 2970 | + }, | |
| 2971 | + { | |
| 2972 | + "passes": 42, | |
| 2973 | + "val_top1": 0.78057861328125, | |
| 2974 | + "val_nll": 1.1494176387786865, | |
| 2975 | + "t": 12.21908712387085 | |
| 2976 | + }, | |
| 2977 | + { | |
| 2978 | + "passes": 43, | |
| 2979 | + "val_top1": 0.78131103515625, | |
| 2980 | + "val_nll": 1.1398517489433289, | |
| 2981 | + "t": 12.505436897277832 | |
| 2982 | + }, | |
| 2983 | + { | |
| 2984 | + "passes": 44, | |
| 2985 | + "val_top1": 0.782257080078125, | |
| 2986 | + "val_nll": 1.13062584400177, | |
| 2987 | + "t": 12.795402765274048 | |
| 2988 | + }, | |
| 2989 | + { | |
| 2990 | + "passes": 45, | |
| 2991 | + "val_top1": 0.783172607421875, | |
| 2992 | + "val_nll": 1.1217216849327087, | |
| 2993 | + "t": 13.086244821548462 | |
| 2994 | + }, | |
| 2995 | + { | |
| 2996 | + "passes": 46, | |
| 2997 | + "val_top1": 0.7838134765625, | |
| 2998 | + "val_nll": 1.1131223440170288, | |
| 2999 | + "t": 13.374281644821167 | |
| 3000 | + }, | |
| 3001 | + { | |
| 3002 | + "passes": 47, | |
| 3003 | + "val_top1": 0.78448486328125, | |
| 3004 | + "val_nll": 1.104812204837799, | |
| 3005 | + "t": 13.660990238189697 | |
| 3006 | + }, | |
| 3007 | + { | |
| 3008 | + "passes": 48, | |
| 3009 | + "val_top1": 0.78485107421875, | |
| 3010 | + "val_nll": 1.0967766046524048, | |
| 3011 | + "t": 13.9431312084198 | |
| 3012 | + }, | |
| 3013 | + { | |
| 3014 | + "passes": 49, | |
| 3015 | + "val_top1": 0.7857666015625, | |
| 3016 | + "val_nll": 1.0890018939971924, | |
| 3017 | + "t": 14.231344223022461 | |
| 3018 | + }, | |
| 3019 | + { | |
| 3020 | + "passes": 50, | |
| 3021 | + "val_top1": 0.78631591796875, | |
| 3022 | + "val_nll": 1.0814756155014038, | |
| 3023 | + "t": 14.514714241027832 | |
| 3024 | + }, | |
| 3025 | + { | |
| 3026 | + "passes": 51, | |
| 3027 | + "val_top1": 0.7867431640625, | |
| 3028 | + "val_nll": 1.0741859078407288, | |
| 3029 | + "t": 14.794291019439697 | |
| 3030 | + }, | |
| 3031 | + { | |
| 3032 | + "passes": 52, | |
| 3033 | + "val_top1": 0.787109375, | |
| 3034 | + "val_nll": 1.0671217441558838, | |
| 3035 | + "t": 15.101354837417603 | |
| 3036 | + }, | |
| 3037 | + { | |
| 3038 | + "passes": 53, | |
| 3039 | + "val_top1": 0.7877197265625, | |
| 3040 | + "val_nll": 1.0602729320526123, | |
| 3041 | + "t": 15.394583225250244 | |
| 3042 | + }, | |
| 3043 | + { | |
| 3044 | + "passes": 54, | |
| 3045 | + "val_top1": 0.788604736328125, | |
| 3046 | + "val_nll": 1.0536296367645264, | |
| 3047 | + "t": 15.688019275665283 | |
| 3048 | + }, | |
| 3049 | + { | |
| 3050 | + "passes": 55, | |
| 3051 | + "val_top1": 0.789306640625, | |
| 3052 | + "val_nll": 1.047182857990265, | |
| 3053 | + "t": 15.981118202209473 | |
| 3054 | + }, | |
| 3055 | + { | |
| 3056 | + "passes": 56, | |
| 3057 | + "val_top1": 0.78985595703125, | |
| 3058 | + "val_nll": 1.040924072265625, | |
| 3059 | + "t": 16.27251148223877 | |
| 3060 | + }, | |
| 3061 | + { | |
| 3062 | + "passes": 57, | |
| 3063 | + "val_top1": 0.79046630859375, | |
| 3064 | + "val_nll": 1.0348452925682068, | |
| 3065 | + "t": 16.561485767364502 | |
| 3066 | + }, | |
| 3067 | + { | |
| 3068 | + "passes": 58, | |
| 3069 | + "val_top1": 0.790924072265625, | |
| 3070 | + "val_nll": 1.0289389491081238, | |
| 3071 | + "t": 16.851162433624268 | |
| 3072 | + }, | |
| 3073 | + { | |
| 3074 | + "passes": 59, | |
| 3075 | + "val_top1": 0.79156494140625, | |
| 3076 | + "val_nll": 1.0231977701187134, | |
| 3077 | + "t": 17.144426584243774 | |
| 3078 | + }, | |
| 3079 | + { | |
| 3080 | + "passes": 60, | |
| 3081 | + "val_top1": 0.79205322265625, | |
| 3082 | + "val_nll": 1.0176153182983398, | |
| 3083 | + "t": 17.449169158935547 | |
| 3084 | + }, | |
| 3085 | + { | |
| 3086 | + "passes": 61, | |
| 3087 | + "val_top1": 0.792633056640625, | |
| 3088 | + "val_nll": 1.0121850371360779, | |
| 3089 | + "t": 17.743599891662598 | |
| 3090 | + }, | |
| 3091 | + { | |
| 3092 | + "passes": 62, | |
| 3093 | + "val_top1": 0.79302978515625, | |
| 3094 | + "val_nll": 1.0069010257720947, | |
| 3095 | + "t": 18.032780408859253 | |
| 3096 | + }, | |
| 3097 | + { | |
| 3098 | + "passes": 63, | |
| 3099 | + "val_top1": 0.793701171875, | |
| 3100 | + "val_nll": 1.00175741314888, | |
| 3101 | + "t": 18.318681478500366 | |
| 3102 | + }, | |
| 3103 | + { | |
| 3104 | + "passes": 64, | |
| 3105 | + "val_top1": 0.793731689453125, | |
| 3106 | + "val_nll": 0.996749073266983, | |
| 3107 | + "t": 18.604215145111084 | |
| 3108 | + }, | |
| 3109 | + { | |
| 3110 | + "passes": 65, | |
| 3111 | + "val_top1": 0.794403076171875, | |
| 3112 | + "val_nll": 0.9918707013130188, | |
| 3113 | + "t": 18.886240243911743 | |
| 3114 | + }, | |
| 3115 | + { | |
| 3116 | + "passes": 66, | |
| 3117 | + "val_top1": 0.79498291015625, | |
| 3118 | + "val_nll": 0.9871175289154053, | |
| 3119 | + "t": 19.170507431030273 | |
| 3120 | + }, | |
| 3121 | + { | |
| 3122 | + "passes": 67, | |
| 3123 | + "val_top1": 0.795379638671875, | |
| 3124 | + "val_nll": 0.9824849367141724, | |
| 3125 | + "t": 19.45241618156433 | |
| 3126 | + }, | |
| 3127 | + { | |
| 3128 | + "passes": 68, | |
| 3129 | + "val_top1": 0.79583740234375, | |
| 3130 | + "val_nll": 0.9779686331748962, | |
| 3131 | + "t": 19.740343809127808 | |
| 3132 | + }, | |
| 3133 | + { | |
| 3134 | + "passes": 69, | |
| 3135 | + "val_top1": 0.796356201171875, | |
| 3136 | + "val_nll": 0.9735642969608307, | |
| 3137 | + "t": 20.027751445770264 | |
| 3138 | + }, | |
| 3139 | + { | |
| 3140 | + "passes": 70, | |
| 3141 | + "val_top1": 0.79644775390625, | |
| 3142 | + "val_nll": 0.9692680537700653, | |
| 3143 | + "t": 20.311054706573486 | |
| 3144 | + }, | |
| 3145 | + { | |
| 3146 | + "passes": 71, | |
| 3147 | + "val_top1": 0.796905517578125, | |
| 3148 | + "val_nll": 0.965076208114624, | |
| 3149 | + "t": 20.602024793624878 | |
| 3150 | + }, | |
| 3151 | + { | |
| 3152 | + "passes": 72, | |
| 3153 | + "val_top1": 0.797271728515625, | |
| 3154 | + "val_nll": 0.9609850347042084, | |
| 3155 | + "t": 20.891011714935303 | |
| 3156 | + }, | |
| 3157 | + { | |
| 3158 | + "passes": 73, | |
| 3159 | + "val_top1": 0.797332763671875, | |
| 3160 | + "val_nll": 0.9569911360740662, | |
| 3161 | + "t": 21.183250904083252 | |
| 3162 | + }, | |
| 3163 | + { | |
| 3164 | + "passes": 74, | |
| 3165 | + "val_top1": 0.797576904296875, | |
| 3166 | + "val_nll": 0.9530913829803467, | |
| 3167 | + "t": 21.471391677856445 | |
| 3168 | + }, | |
| 3169 | + { | |
| 3170 | + "passes": 75, | |
| 3171 | + "val_top1": 0.797882080078125, | |
| 3172 | + "val_nll": 0.9492824375629425, | |
| 3173 | + "t": 21.758798837661743 | |
| 3174 | + }, | |
| 3175 | + { | |
| 3176 | + "passes": 76, | |
| 3177 | + "val_top1": 0.79840087890625, | |
| 3178 | + "val_nll": 0.9455614387989044, | |
| 3179 | + "t": 22.045923948287964 | |
| 3180 | + }, | |
| 3181 | + { | |
| 3182 | + "passes": 77, | |
| 3183 | + "val_top1": 0.798797607421875, | |
| 3184 | + "val_nll": 0.9419255256652832, | |
| 3185 | + "t": 22.33021116256714 | |
| 3186 | + }, | |
| 3187 | + { | |
| 3188 | + "passes": 78, | |
| 3189 | + "val_top1": 0.798980712890625, | |
| 3190 | + "val_nll": 0.9383719861507416, | |
| 3191 | + "t": 22.614474058151245 | |
| 3192 | + }, | |
| 3193 | + { | |
| 3194 | + "passes": 79, | |
| 3195 | + "val_top1": 0.799407958984375, | |
| 3196 | + "val_nll": 0.9348981082439423, | |
| 3197 | + "t": 22.904125213623047 | |
| 3198 | + }, | |
| 3199 | + { | |
| 3200 | + "passes": 80, | |
| 3201 | + "val_top1": 0.799652099609375, | |
| 3202 | + "val_nll": 0.9315014183521271, | |
| 3203 | + "t": 23.187506675720215 | |
| 3204 | + }, | |
| 3205 | + { | |
| 3206 | + "passes": 81, | |
| 3207 | + "val_top1": 0.800018310546875, | |
| 3208 | + "val_nll": 0.9281796216964722, | |
| 3209 | + "t": 23.47526502609253 | |
| 3210 | + }, | |
| 3211 | + { | |
| 3212 | + "passes": 82, | |
| 3213 | + "val_top1": 0.800201416015625, | |
| 3214 | + "val_nll": 0.9249303936958313, | |
| 3215 | + "t": 23.762660026550293 | |
| 3216 | + }, | |
| 3217 | + { | |
| 3218 | + "passes": 83, | |
| 3219 | + "val_top1": 0.80029296875, | |
| 3220 | + "val_nll": 0.9217514991760254, | |
| 3221 | + "t": 24.0488440990448 | |
| 3222 | + }, | |
| 3223 | + { | |
| 3224 | + "passes": 84, | |
| 3225 | + "val_top1": 0.80072021484375, | |
| 3226 | + "val_nll": 0.9186407625675201, | |
| 3227 | + "t": 24.343865871429443 | |
| 3228 | + }, | |
| 3229 | + { | |
| 3230 | + "passes": 85, | |
| 3231 | + "val_top1": 0.800994873046875, | |
| 3232 | + "val_nll": 0.915596216917038, | |
| 3233 | + "t": 24.631511449813843 | |
| 3234 | + }, | |
| 3235 | + { | |
| 3236 | + "passes": 86, | |
| 3237 | + "val_top1": 0.800994873046875, | |
| 3238 | + "val_nll": 0.9126158952713013, | |
| 3239 | + "t": 24.92665386199951 | |
| 3240 | + }, | |
| 3241 | + { | |
| 3242 | + "passes": 87, | |
| 3243 | + "val_top1": 0.8013916015625, | |
| 3244 | + "val_nll": 0.909697949886322, | |
| 3245 | + "t": 25.204851627349854 | |
| 3246 | + }, | |
| 3247 | + { | |
| 3248 | + "passes": 88, | |
| 3249 | + "val_top1": 0.801605224609375, | |
| 3250 | + "val_nll": 0.9068405330181122, | |
| 3251 | + "t": 25.484670400619507 | |
| 3252 | + }, | |
| 3253 | + { | |
| 3254 | + "passes": 89, | |
| 3255 | + "val_top1": 0.802093505859375, | |
| 3256 | + "val_nll": 0.904041975736618, | |
| 3257 | + "t": 25.76793909072876 | |
| 3258 | + }, | |
| 3259 | + { | |
| 3260 | + "passes": 90, | |
| 3261 | + "val_top1": 0.8023681640625, | |
| 3262 | + "val_nll": 0.9013005495071411, | |
| 3263 | + "t": 26.051669120788574 | |
| 3264 | + }, | |
| 3265 | + { | |
| 3266 | + "passes": 91, | |
| 3267 | + "val_top1": 0.802734375, | |
| 3268 | + "val_nll": 0.8986146450042725, | |
| 3269 | + "t": 26.338721752166748 | |
| 3270 | + }, | |
| 3271 | + { | |
| 3272 | + "passes": 92, | |
| 3273 | + "val_top1": 0.802886962890625, | |
| 3274 | + "val_nll": 0.8959828019142151, | |
| 3275 | + "t": 26.641064643859863 | |
| 3276 | + }, | |
| 3277 | + { | |
| 3278 | + "passes": 93, | |
| 3279 | + "val_top1": 0.80316162109375, | |
| 3280 | + "val_nll": 0.8934034407138824, | |
| 3281 | + "t": 26.929415702819824 | |
| 3282 | + }, | |
| 3283 | + { | |
| 3284 | + "passes": 94, | |
| 3285 | + "val_top1": 0.803619384765625, | |
| 3286 | + "val_nll": 0.8908751904964447, | |
| 3287 | + "t": 27.221022605895996 | |
| 3288 | + }, | |
| 3289 | + { | |
| 3290 | + "passes": 95, | |
| 3291 | + "val_top1": 0.80401611328125, | |
| 3292 | + "val_nll": 0.8883965611457825, | |
| 3293 | + "t": 27.516308307647705 | |
| 3294 | + }, | |
| 3295 | + { | |
| 3296 | + "passes": 96, | |
| 3297 | + "val_top1": 0.80413818359375, | |
| 3298 | + "val_nll": 0.8859663605690002, | |
| 3299 | + "t": 27.809423446655273 | |
| 3300 | + }, | |
| 3301 | + { | |
| 3302 | + "passes": 97, | |
| 3303 | + "val_top1": 0.804229736328125, | |
| 3304 | + "val_nll": 0.8835832476615906, | |
| 3305 | + "t": 28.096521854400635 | |
| 3306 | + }, | |
| 3307 | + { | |
| 3308 | + "passes": 98, | |
| 3309 | + "val_top1": 0.80419921875, | |
| 3310 | + "val_nll": 0.8812459111213684, | |
| 3311 | + "t": 28.386763095855713 | |
| 3312 | + }, | |
| 3313 | + { | |
| 3314 | + "passes": 99, | |
| 3315 | + "val_top1": 0.804443359375, | |
| 3316 | + "val_nll": 0.8789532482624054, | |
| 3317 | + "t": 28.67714548110962 | |
| 3318 | + }, | |
| 3319 | + { | |
| 3320 | + "passes": 100, | |
| 3321 | + "val_top1": 0.804656982421875, | |
| 3322 | + "val_nll": 0.8767041563987732, | |
| 3323 | + "t": 28.955758333206177 | |
| 3324 | + } | |
| 3325 | + ], | |
| 3326 | + "reach": {} | |
| 3327 | + }, | |
| 3328 | + "0.0001": { | |
| 3329 | + "hist": [ | |
| 3330 | + { | |
| 3331 | + "passes": 1, | |
| 3332 | + "val_top1": 0.71197509765625, | |
| 3333 | + "val_nll": 5.95248818397522, | |
| 3334 | + "t": 0.25568342208862305 | |
| 3335 | + }, | |
| 3336 | + { | |
| 3337 | + "passes": 2, | |
| 3338 | + "val_top1": 0.711944580078125, | |
| 3339 | + "val_nll": 4.987666606903076, | |
| 3340 | + "t": 0.5365695953369141 | |
| 3341 | + }, | |
| 3342 | + { | |
| 3343 | + "passes": 3, | |
| 3344 | + "val_top1": 0.71209716796875, | |
| 3345 | + "val_nll": 4.095117092132568, | |
| 3346 | + "t": 0.8185157775878906 | |
| 3347 | + }, | |
| 3348 | + { | |
| 3349 | + "passes": 4, | |
| 3350 | + "val_top1": 0.713043212890625, | |
| 3351 | + "val_nll": 3.409350037574768, | |
| 3352 | + "t": 1.1099064350128174 | |
| 3353 | + }, | |
| 3354 | + { | |
| 3355 | + "passes": 5, | |
| 3356 | + "val_top1": 0.71429443359375, | |
| 3357 | + "val_nll": 2.962818145751953, | |
| 3358 | + "t": 1.3892426490783691 | |
| 3359 | + }, | |
| 3360 | + { | |
| 3361 | + "passes": 6, | |
| 3362 | + "val_top1": 0.716705322265625, | |
| 3363 | + "val_nll": 2.6647727489471436, | |
| 3364 | + "t": 1.6770927906036377 | |
| 3365 | + }, | |
| 3366 | + { | |
| 3367 | + "passes": 7, | |
| 3368 | + "val_top1": 0.71978759765625, | |
| 3369 | + "val_nll": 2.4507322311401367, | |
| 3370 | + "t": 1.959362268447876 | |
| 3371 | + }, | |
| 3372 | + { | |
| 3373 | + "passes": 8, | |
| 3374 | + "val_top1": 0.722503662109375, | |
| 3375 | + "val_nll": 2.2879481315612793, | |
| 3376 | + "t": 2.2438485622406006 | |
| 3377 | + }, | |
| 3378 | + { | |
| 3379 | + "passes": 9, | |
| 3380 | + "val_top1": 0.725006103515625, | |
| 3381 | + "val_nll": 2.1589728593826294, | |
| 3382 | + "t": 2.5228207111358643 | |
| 3383 | + }, | |
| 3384 | + { | |
| 3385 | + "passes": 10, | |
| 3386 | + "val_top1": 0.72784423828125, | |
| 3387 | + "val_nll": 2.053574323654175, | |
| 3388 | + "t": 2.8030786514282227 | |
| 3389 | + }, | |
| 3390 | + { | |
| 3391 | + "passes": 11, | |
| 3392 | + "val_top1": 0.731048583984375, | |
| 3393 | + "val_nll": 1.9653079509735107, | |
| 3394 | + "t": 3.088552474975586 | |
| 3395 | + }, | |
| 3396 | + { | |
| 3397 | + "passes": 12, | |
| 3398 | + "val_top1": 0.733795166015625, | |
| 3399 | + "val_nll": 1.889920711517334, | |
| 3400 | + "t": 3.38002347946167 | |
| 3401 | + }, | |
| 3402 | + { | |
| 3403 | + "passes": 13, | |
| 3404 | + "val_top1": 0.736968994140625, | |
| 3405 | + "val_nll": 1.8245014548301697, | |
| 3406 | + "t": 3.6648526191711426 | |
| 3407 | + }, | |
| 3408 | + { | |
| 3409 | + "passes": 14, | |
| 3410 | + "val_top1": 0.74005126953125, | |
| 3411 | + "val_nll": 1.7669928073883057, | |
| 3412 | + "t": 3.955763339996338 | |
| 3413 | + }, | |
| 3414 | + { | |
| 3415 | + "passes": 15, | |
| 3416 | + "val_top1": 0.742156982421875, | |
| 3417 | + "val_nll": 1.7158971428871155, | |
| 3418 | + "t": 4.2447755336761475 | |
| 3419 | + }, | |
| 3420 | + { | |
| 3421 | + "passes": 16, | |
| 3422 | + "val_top1": 0.744873046875, | |
| 3423 | + "val_nll": 1.6700941324234009, | |
| 3424 | + "t": 4.536765098571777 | |
| 3425 | + }, | |
| 3426 | + { | |
| 3427 | + "passes": 17, | |
| 3428 | + "val_top1": 0.74713134765625, | |
| 3429 | + "val_nll": 1.6287238597869873, | |
| 3430 | + "t": 4.821157932281494 | |
| 3431 | + }, | |
| 3432 | + { | |
| 3433 | + "passes": 18, | |
| 3434 | + "val_top1": 0.749267578125, | |
| 3435 | + "val_nll": 1.5911115407943726, | |
| 3436 | + "t": 5.131028890609741 | |
| 3437 | + }, | |
| 3438 | + { | |
| 3439 | + "passes": 19, | |
| 3440 | + "val_top1": 0.751190185546875, | |
| 3441 | + "val_nll": 1.5567172169685364, | |
| 3442 | + "t": 5.411196231842041 | |
| 3443 | + }, | |
| 3444 | + { | |
| 3445 | + "passes": 20, | |
| 3446 | + "val_top1": 0.752960205078125, | |
| 3447 | + "val_nll": 1.5251016020774841, | |
| 3448 | + "t": 5.689759731292725 | |
| 3449 | + }, | |
| 3450 | + { | |
| 3451 | + "passes": 21, | |
| 3452 | + "val_top1": 0.75469970703125, | |
| 3453 | + "val_nll": 1.4959034323692322, | |
| 3454 | + "t": 5.967045307159424 | |
| 3455 | + }, | |
| 3456 | + { | |
| 3457 | + "passes": 22, | |
| 3458 | + "val_top1": 0.75665283203125, | |
| 3459 | + "val_nll": 1.468821942806244, | |
| 3460 | + "t": 6.259353876113892 | |
| 3461 | + }, | |
| 3462 | + { | |
| 3463 | + "passes": 23, | |
| 3464 | + "val_top1": 0.7586669921875, | |
| 3465 | + "val_nll": 1.4436053037643433, | |
| 3466 | + "t": 6.543303966522217 | |
| 3467 | + }, | |
| 3468 | + { | |
| 3469 | + "passes": 24, | |
| 3470 | + "val_top1": 0.7603759765625, | |
| 3471 | + "val_nll": 1.4200410842895508, | |
| 3472 | + "t": 6.956557273864746 | |
| 3473 | + }, | |
| 3474 | + { | |
| 3475 | + "passes": 25, | |
| 3476 | + "val_top1": 0.7623291015625, | |
| 3477 | + "val_nll": 1.3979495763778687, | |
| 3478 | + "t": 7.228449106216431 | |
| 3479 | + }, | |
| 3480 | + { | |
| 3481 | + "passes": 26, | |
| 3482 | + "val_top1": 0.763641357421875, | |
| 3483 | + "val_nll": 1.3771774768829346, | |
| 3484 | + "t": 7.508611679077148 | |
| 3485 | + }, | |
| 3486 | + { | |
| 3487 | + "passes": 27, | |
| 3488 | + "val_top1": 0.76507568359375, | |
| 3489 | + "val_nll": 1.3575938940048218, | |
| 3490 | + "t": 7.785913467407227 | |
| 3491 | + }, | |
| 3492 | + { | |
| 3493 | + "passes": 28, | |
| 3494 | + "val_top1": 0.7664794921875, | |
| 3495 | + "val_nll": 1.339085876941681, | |
| 3496 | + "t": 8.071253299713135 | |
| 3497 | + }, | |
| 3498 | + { | |
| 3499 | + "passes": 29, | |
| 3500 | + "val_top1": 0.767791748046875, | |
| 3501 | + "val_nll": 1.321556031703949, | |
| 3502 | + "t": 8.359038591384888 | |
| 3503 | + }, | |
| 3504 | + { | |
| 3505 | + "passes": 30, | |
| 3506 | + "val_top1": 0.768829345703125, | |
| 3507 | + "val_nll": 1.3049196600914001, | |
| 3508 | + "t": 8.661280870437622 | |
| 3509 | + }, | |
| 3510 | + { | |
| 3511 | + "passes": 31, | |
| 3512 | + "val_top1": 0.7701416015625, | |
| 3513 | + "val_nll": 1.2891024351119995, | |
| 3514 | + "t": 8.950402975082397 | |
| 3515 | + }, | |
| 3516 | + { | |
| 3517 | + "passes": 32, | |
| 3518 | + "val_top1": 0.771148681640625, | |
| 3519 | + "val_nll": 1.2740395069122314, | |
| 3520 | + "t": 9.240302801132202 | |
| 3521 | + }, | |
| 3522 | + { | |
| 3523 | + "passes": 33, | |
| 3524 | + "val_top1": 0.7723388671875, | |
| 3525 | + "val_nll": 1.259672999382019, | |
| 3526 | + "t": 9.530731678009033 | |
| 3527 | + }, | |
| 3528 | + { | |
| 3529 | + "passes": 34, | |
| 3530 | + "val_top1": 0.77313232421875, | |
| 3531 | + "val_nll": 1.2459516525268555, | |
| 3532 | + "t": 9.81918454170227 | |
| 3533 | + }, | |
| 3534 | + { | |
| 3535 | + "passes": 35, | |
| 3536 | + "val_top1": 0.774017333984375, | |
| 3537 | + "val_nll": 1.2328296303749084, | |
| 3538 | + "t": 10.110192775726318 | |
| 3539 | + }, | |
| 3540 | + { | |
| 3541 | + "passes": 36, | |
| 3542 | + "val_top1": 0.774993896484375, | |
| 3543 | + "val_nll": 1.2202658653259277, | |
| 3544 | + "t": 10.401224136352539 | |
| 3545 | + }, | |
| 3546 | + { | |
| 3547 | + "passes": 37, | |
| 3548 | + "val_top1": 0.77606201171875, | |
| 3549 | + "val_nll": 1.2082231044769287, | |
| 3550 | + "t": 10.696002721786499 | |
| 3551 | + }, | |
| 3552 | + { | |
| 3553 | + "passes": 38, | |
| 3554 | + "val_top1": 0.777099609375, | |
| 3555 | + "val_nll": 1.1966676712036133, | |
| 3556 | + "t": 10.988378524780273 | |
| 3557 | + }, | |
| 3558 | + { | |
| 3559 | + "passes": 39, | |
| 3560 | + "val_top1": 0.77783203125, | |
| 3561 | + "val_nll": 1.185568928718567, | |
| 3562 | + "t": 11.278589963912964 | |
| 3563 | + }, | |
| 3564 | + { | |
| 3565 | + "passes": 40, | |
| 3566 | + "val_top1": 0.778411865234375, | |
| 3567 | + "val_nll": 1.1748991012573242, | |
| 3568 | + "t": 11.56430959701538 | |
| 3569 | + }, | |
| 3570 | + { | |
| 3571 | + "passes": 41, | |
| 3572 | + "val_top1": 0.779327392578125, | |
| 3573 | + "val_nll": 1.1646325588226318, | |
| 3574 | + "t": 11.847338199615479 | |
| 3575 | + }, | |
| 3576 | + { | |
| 3577 | + "passes": 42, | |
| 3578 | + "val_top1": 0.78021240234375, | |
| 3579 | + "val_nll": 1.1547461152076721, | |
| 3580 | + "t": 12.130185604095459 | |
| 3581 | + }, | |
| 3582 | + { | |
| 3583 | + "passes": 43, | |
| 3584 | + "val_top1": 0.78094482421875, | |
| 3585 | + "val_nll": 1.1452180743217468, | |
| 3586 | + "t": 12.41211986541748 | |
| 3587 | + }, | |
| 3588 | + { | |
| 3589 | + "passes": 44, | |
| 3590 | + "val_top1": 0.781707763671875, | |
| 3591 | + "val_nll": 1.13602876663208, | |
| 3592 | + "t": 12.701200246810913 | |
| 3593 | + }, | |
| 3594 | + { | |
| 3595 | + "passes": 45, | |
| 3596 | + "val_top1": 0.782501220703125, | |
| 3597 | + "val_nll": 1.1271597743034363, | |
| 3598 | + "t": 12.983942747116089 | |
| 3599 | + }, | |
| 3600 | + { | |
| 3601 | + "passes": 46, | |
| 3602 | + "val_top1": 0.7830810546875, | |
| 3603 | + "val_nll": 1.1185944080352783, | |
| 3604 | + "t": 13.26570439338684 | |
| 3605 | + }, | |
| 3606 | + { | |
| 3607 | + "passes": 47, | |
| 3608 | + "val_top1": 0.783721923828125, | |
| 3609 | + "val_nll": 1.1103168725967407, | |
| 3610 | + "t": 13.547516584396362 | |
| 3611 | + }, | |
| 3612 | + { | |
| 3613 | + "passes": 48, | |
| 3614 | + "val_top1": 0.784271240234375, | |
| 3615 | + "val_nll": 1.102312684059143, | |
| 3616 | + "t": 13.829593896865845 | |
| 3617 | + }, | |
| 3618 | + { | |
| 3619 | + "passes": 49, | |
| 3620 | + "val_top1": 0.784637451171875, | |
| 3621 | + "val_nll": 1.0945682525634766, | |
| 3622 | + "t": 14.112191438674927 | |
| 3623 | + }, | |
| 3624 | + { | |
| 3625 | + "passes": 50, | |
| 3626 | + "val_top1": 0.78509521484375, | |
| 3627 | + "val_nll": 1.0870710015296936, | |
| 3628 | + "t": 14.395742416381836 | |
| 3629 | + }, | |
| 3630 | + { | |
| 3631 | + "passes": 51, | |
| 3632 | + "val_top1": 0.785675048828125, | |
| 3633 | + "val_nll": 1.0798092484474182, | |
| 3634 | + "t": 14.67961049079895 | |
| 3635 | + }, | |
| 3636 | + { | |
| 3637 | + "passes": 52, | |
| 3638 | + "val_top1": 0.786407470703125, | |
| 3639 | + "val_nll": 1.0727719068527222, | |
| 3640 | + "t": 14.962048292160034 | |
| 3641 | + }, | |
| 3642 | + { | |
| 3643 | + "passes": 53, | |
| 3644 | + "val_top1": 0.787384033203125, | |
| 3645 | + "val_nll": 1.065948724746704, | |
| 3646 | + "t": 15.24504041671753 | |
| 3647 | + }, | |
| 3648 | + { | |
| 3649 | + "passes": 54, | |
| 3650 | + "val_top1": 0.7880859375, | |
| 3651 | + "val_nll": 1.0593300461769104, | |
| 3652 | + "t": 15.528608083724976 | |
| 3653 | + }, | |
| 3654 | + { | |
| 3655 | + "passes": 55, | |
| 3656 | + "val_top1": 0.78887939453125, | |
| 3657 | + "val_nll": 1.05290687084198, | |
| 3658 | + "t": 15.8142728805542 | |
| 3659 | + }, | |
| 3660 | + { | |
| 3661 | + "passes": 56, | |
| 3662 | + "val_top1": 0.789337158203125, | |
| 3663 | + "val_nll": 1.04667067527771, | |
| 3664 | + "t": 16.103431224822998 | |
| 3665 | + }, | |
| 3666 | + { | |
| 3667 | + "passes": 57, | |
| 3668 | + "val_top1": 0.789886474609375, | |
| 3669 | + "val_nll": 1.0406135320663452, | |
| 3670 | + "t": 16.38707137107849 | |
| 3671 | + }, | |
| 3672 | + { | |
| 3673 | + "passes": 58, | |
| 3674 | + "val_top1": 0.790313720703125, | |
| 3675 | + "val_nll": 1.0347278714179993, | |
| 3676 | + "t": 16.669502019882202 | |
| 3677 | + }, | |
| 3678 | + { | |
| 3679 | + "passes": 59, | |
| 3680 | + "val_top1": 0.790557861328125, | |
| 3681 | + "val_nll": 1.0290064811706543, | |
| 3682 | + "t": 17.040220022201538 | |
| 3683 | + }, | |
| 3684 | + { | |
| 3685 | + "passes": 60, | |
| 3686 | + "val_top1": 0.7913818359375, | |
| 3687 | + "val_nll": 1.023442804813385, | |
| 3688 | + "t": 17.34441637992859 | |
| 3689 | + }, | |
| 3690 | + { | |
| 3691 | + "passes": 61, | |
| 3692 | + "val_top1": 0.791656494140625, | |
| 3693 | + "val_nll": 1.0180304050445557, | |
| 3694 | + "t": 17.626043796539307 | |
| 3695 | + }, | |
| 3696 | + { | |
| 3697 | + "passes": 62, | |
| 3698 | + "val_top1": 0.79193115234375, | |
| 3699 | + "val_nll": 1.0127633810043335, | |
| 3700 | + "t": 17.916197061538696 | |
| 3701 | + }, | |
| 3702 | + { | |
| 3703 | + "passes": 63, | |
| 3704 | + "val_top1": 0.79241943359375, | |
| 3705 | + "val_nll": 1.0076360702514648, | |
| 3706 | + "t": 18.204976320266724 | |
| 3707 | + }, | |
| 3708 | + { | |
| 3709 | + "passes": 64, | |
| 3710 | + "val_top1": 0.7928466796875, | |
| 3711 | + "val_nll": 1.0026429295539856, | |
| 3712 | + "t": 18.49370527267456 | |
| 3713 | + }, | |
| 3714 | + { | |
| 3715 | + "passes": 65, | |
| 3716 | + "val_top1": 0.793243408203125, | |
| 3717 | + "val_nll": 0.9977790713310242, | |
| 3718 | + "t": 18.781431674957275 | |
| 3719 | + }, | |
| 3720 | + { | |
| 3721 | + "passes": 66, | |
| 3722 | + "val_top1": 0.79376220703125, | |
| 3723 | + "val_nll": 0.9930395781993866, | |
| 3724 | + "t": 19.06827735900879 | |
| 3725 | + }, | |
| 3726 | + { | |
| 3727 | + "passes": 67, | |
| 3728 | + "val_top1": 0.79437255859375, | |
| 3729 | + "val_nll": 0.9884198307991028, | |
| 3730 | + "t": 19.355144023895264 | |
| 3731 | + }, | |
| 3732 | + { | |
| 3733 | + "passes": 68, | |
| 3734 | + "val_top1": 0.794891357421875, | |
| 3735 | + "val_nll": 0.9839155673980713, | |
| 3736 | + "t": 19.63891911506653 | |
| 3737 | + }, | |
| 3738 | + { | |
| 3739 | + "passes": 69, | |
| 3740 | + "val_top1": 0.795440673828125, | |
| 3741 | + "val_nll": 0.9795225262641907, | |
| 3742 | + "t": 19.924840211868286 | |
| 3743 | + }, | |
| 3744 | + { | |
| 3745 | + "passes": 70, | |
| 3746 | + "val_top1": 0.79583740234375, | |
| 3747 | + "val_nll": 0.9752367734909058, | |
| 3748 | + "t": 20.210800647735596 | |
| 3749 | + }, | |
| 3750 | + { | |
| 3751 | + "passes": 71, | |
| 3752 | + "val_top1": 0.796142578125, | |
| 3753 | + "val_nll": 0.9710546433925629, | |
| 3754 | + "t": 20.493706226348877 | |
| 3755 | + }, | |
| 3756 | + { | |
| 3757 | + "passes": 72, | |
| 3758 | + "val_top1": 0.796295166015625, | |
| 3759 | + "val_nll": 0.9669724702835083, | |
| 3760 | + "t": 20.77763843536377 | |
| 3761 | + }, | |
| 3762 | + { | |
| 3763 | + "passes": 73, | |
| 3764 | + "val_top1": 0.79669189453125, | |
| 3765 | + "val_nll": 0.9629867374897003, | |
| 3766 | + "t": 21.060668468475342 | |
| 3767 | + }, | |
| 3768 | + { | |
| 3769 | + "passes": 74, | |
| 3770 | + "val_top1": 0.797210693359375, | |
| 3771 | + "val_nll": 0.9590944945812225, | |
| 3772 | + "t": 21.343761682510376 | |
| 3773 | + }, | |
| 3774 | + { | |
| 3775 | + "passes": 75, | |
| 3776 | + "val_top1": 0.79766845703125, | |
| 3777 | + "val_nll": 0.9552923142910004, | |
| 3778 | + "t": 21.640226364135742 | |
| 3779 | + }, | |
| 3780 | + { | |
| 3781 | + "passes": 76, | |
| 3782 | + "val_top1": 0.798126220703125, | |
| 3783 | + "val_nll": 0.951577365398407, | |
| 3784 | + "t": 21.9301118850708 | |
| 3785 | + }, | |
| 3786 | + { | |
| 3787 | + "passes": 77, | |
| 3788 | + "val_top1": 0.79864501953125, | |
| 3789 | + "val_nll": 0.9479467868804932, | |
| 3790 | + "t": 22.221707820892334 | |
| 3791 | + }, | |
| 3792 | + { | |
| 3793 | + "passes": 78, | |
| 3794 | + "val_top1": 0.79901123046875, | |
| 3795 | + "val_nll": 0.9443978667259216, | |
| 3796 | + "t": 22.50673007965088 | |
| 3797 | + }, | |
| 3798 | + { | |
| 3799 | + "passes": 79, | |
| 3800 | + "val_top1": 0.79913330078125, | |
| 3801 | + "val_nll": 0.9409279227256775, | |
| 3802 | + "t": 22.79114079475403 | |
| 3803 | + }, | |
| 3804 | + { | |
| 3805 | + "passes": 80, | |
| 3806 | + "val_top1": 0.799346923828125, | |
| 3807 | + "val_nll": 0.9375346004962921, | |
| 3808 | + "t": 23.078250408172607 | |
| 3809 | + }, | |
| 3810 | + { | |
| 3811 | + "passes": 81, | |
| 3812 | + "val_top1": 0.799652099609375, | |
| 3813 | + "val_nll": 0.9342153966426849, | |
| 3814 | + "t": 23.363102912902832 | |
| 3815 | + }, | |
| 3816 | + { | |
| 3817 | + "passes": 82, | |
| 3818 | + "val_top1": 0.7999267578125, | |
| 3819 | + "val_nll": 0.9309681057929993, | |
| 3820 | + "t": 23.650768041610718 | |
| 3821 | + }, | |
| 3822 | + { | |
| 3823 | + "passes": 83, | |
| 3824 | + "val_top1": 0.800048828125, | |
| 3825 | + "val_nll": 0.9277904033660889, | |
| 3826 | + "t": 23.936222553253174 | |
| 3827 | + }, | |
| 3828 | + { | |
| 3829 | + "passes": 84, | |
| 3830 | + "val_top1": 0.80035400390625, | |
| 3831 | + "val_nll": 0.9246803820133209, | |
| 3832 | + "t": 24.221773386001587 | |
| 3833 | + }, | |
| 3834 | + { | |
| 3835 | + "passes": 85, | |
| 3836 | + "val_top1": 0.8004150390625, | |
| 3837 | + "val_nll": 0.9216358363628387, | |
| 3838 | + "t": 24.515185594558716 | |
| 3839 | + }, | |
| 3840 | + { | |
| 3841 | + "passes": 86, | |
| 3842 | + "val_top1": 0.8006591796875, | |
| 3843 | + "val_nll": 0.9186549186706543, | |
| 3844 | + "t": 24.79932188987732 | |
| 3845 | + }, | |
| 3846 | + { | |
| 3847 | + "passes": 87, | |
| 3848 | + "val_top1": 0.80078125, | |
| 3849 | + "val_nll": 0.9157357513904572, | |
| 3850 | + "t": 25.084030866622925 | |
| 3851 | + }, | |
| 3852 | + { | |
| 3853 | + "passes": 88, | |
| 3854 | + "val_top1": 0.80126953125, | |
| 3855 | + "val_nll": 0.9128764867782593, | |
| 3856 | + "t": 25.366108179092407 | |
| 3857 | + }, | |
| 3858 | + { | |
| 3859 | + "passes": 89, | |
| 3860 | + "val_top1": 0.80126953125, | |
| 3861 | + "val_nll": 0.9100755155086517, | |
| 3862 | + "t": 25.6491539478302 | |
| 3863 | + }, | |
| 3864 | + { | |
| 3865 | + "passes": 90, | |
| 3866 | + "val_top1": 0.801544189453125, | |
| 3867 | + "val_nll": 0.9073310792446136, | |
| 3868 | + "t": 25.93683695793152 | |
| 3869 | + }, | |
| 3870 | + { | |
| 3871 | + "passes": 91, | |
| 3872 | + "val_top1": 0.80194091796875, | |
| 3873 | + "val_nll": 0.9046416282653809, | |
| 3874 | + "t": 26.219354152679443 | |
| 3875 | + }, | |
| 3876 | + { | |
| 3877 | + "passes": 92, | |
| 3878 | + "val_top1": 0.802032470703125, | |
| 3879 | + "val_nll": 0.9020056128501892, | |
| 3880 | + "t": 26.500341176986694 | |
| 3881 | + }, | |
| 3882 | + { | |
| 3883 | + "passes": 93, | |
| 3884 | + "val_top1": 0.80230712890625, | |
| 3885 | + "val_nll": 0.8994215726852417, | |
| 3886 | + "t": 26.790250301361084 | |
| 3887 | + }, | |
| 3888 | + { | |
| 3889 | + "passes": 94, | |
| 3890 | + "val_top1": 0.80255126953125, | |
| 3891 | + "val_nll": 0.896888017654419, | |
| 3892 | + "t": 27.070640087127686 | |
| 3893 | + }, | |
| 3894 | + { | |
| 3895 | + "passes": 95, | |
| 3896 | + "val_top1": 0.802825927734375, | |
| 3897 | + "val_nll": 0.8944036662578583, | |
| 3898 | + "t": 27.351467609405518 | |
| 3899 | + }, | |
| 3900 | + { | |
| 3901 | + "passes": 96, | |
| 3902 | + "val_top1": 0.803070068359375, | |
| 3903 | + "val_nll": 0.8919671177864075, | |
| 3904 | + "t": 27.631575345993042 | |
| 3905 | + }, | |
| 3906 | + { | |
| 3907 | + "passes": 97, | |
| 3908 | + "val_top1": 0.803253173828125, | |
| 3909 | + "val_nll": 0.889577180147171, | |
| 3910 | + "t": 27.91559386253357 | |
| 3911 | + }, | |
| 3912 | + { | |
| 3913 | + "passes": 98, | |
| 3914 | + "val_top1": 0.80364990234375, | |
| 3915 | + "val_nll": 0.8872325718402863, | |
| 3916 | + "t": 28.20548367500305 | |
| 3917 | + }, | |
| 3918 | + { | |
| 3919 | + "passes": 99, | |
| 3920 | + "val_top1": 0.803741455078125, | |
| 3921 | + "val_nll": 0.8849320709705353, | |
| 3922 | + "t": 28.484708309173584 | |
| 3923 | + }, | |
| 3924 | + { | |
| 3925 | + "passes": 100, | |
| 3926 | + "val_top1": 0.803924560546875, | |
| 3927 | + "val_nll": 0.8826745748519897, | |
| 3928 | + "t": 28.76818585395813 | |
| 3929 | + } | |
| 3930 | + ], | |
| 3931 | + "reach": {} | |
| 3932 | + } | |
| 3933 | + }, | |
| 3934 | + "val": { | |
| 3935 | + "top1": 0.804656982421875, | |
| 3936 | + "nll": 0.8767041563987732 | |
| 3937 | + }, | |
| 3938 | + "test": { | |
| 3939 | + "top1": 0.740753173828125, | |
| 3940 | + "nll": 1.2092631161212921 | |
| 3941 | + }, | |
| 3942 | + "reach": {} | |
| 3943 | + }, | |
| 3944 | + "bohning_warm_A": { | |
| 3945 | + "lambda": 1e-05, | |
| 3946 | + "runs": { | |
| 3947 | + "1e-05": { | |
| 3948 | + "hist": [ | |
| 3949 | + { | |
| 3950 | + "passes": 1, | |
| 3951 | + "val_top1": 0.717071533203125, | |
| 3952 | + "val_nll": 1.8400930762290955, | |
| 3953 | + "t": 0.31205129623413086 | |
| 3954 | + }, | |
| 3955 | + { | |
| 3956 | + "passes": 2, | |
| 3957 | + "val_top1": 0.72174072265625, | |
| 3958 | + "val_nll": 1.7819340229034424, | |
| 3959 | + "t": 0.6212522983551025 | |
| 3960 | + }, | |
| 3961 | + { | |
| 3962 | + "passes": 3, | |
| 3963 | + "val_top1": 0.726654052734375, | |
| 3964 | + "val_nll": 1.7305083870887756, | |
| 3965 | + "t": 0.9263114929199219 | |
| 3966 | + }, | |
| 3967 | + { | |
| 3968 | + "passes": 4, | |
| 3969 | + "val_top1": 0.732635498046875, | |
| 3970 | + "val_nll": 1.684700071811676, | |
| 3971 | + "t": 1.232388973236084 | |
| 3972 | + }, | |
| 3973 | + { | |
| 3974 | + "passes": 5, | |
| 3975 | + "val_top1": 0.736846923828125, | |
| 3976 | + "val_nll": 1.6434720754623413, | |
| 3977 | + "t": 1.539966106414795 | |
| 3978 | + }, | |
| 3979 | + { | |
| 3980 | + "passes": 6, | |
| 3981 | + "val_top1": 0.739898681640625, | |
| 3982 | + "val_nll": 1.6060475707054138, | |
| 3983 | + "t": 1.8520152568817139 | |
| 3984 | + }, | |
| 3985 | + { | |
| 3986 | + "passes": 7, | |
| 3987 | + "val_top1": 0.74298095703125, | |
| 3988 | + "val_nll": 1.5718472599983215, | |
| 3989 | + "t": 2.167304039001465 | |
| 3990 | + }, | |
| 3991 | + { | |
| 3992 | + "passes": 8, | |
| 3993 | + "val_top1": 0.74615478515625, | |
| 3994 | + "val_nll": 1.5404115915298462, | |
| 3995 | + "t": 2.4797914028167725 | |
| 3996 | + }, | |
| 3997 | + { | |
| 3998 | + "passes": 9, | |
| 3999 | + "val_top1": 0.748870849609375, | |
| 4000 | + "val_nll": 1.5113648772239685, | |
| 4001 | + "t": 2.794843912124634 | |
| 4002 | + }, | |
| 4003 | + { | |
| 4004 | + "passes": 10, | |
| 4005 | + "val_top1": 0.7509765625, | |
| 4006 | + "val_nll": 1.4843971133232117, | |
| 4007 | + "t": 3.1185851097106934 | |
| 4008 | + }, | |
| 4009 | + { | |
| 4010 | + "passes": 11, | |
| 4011 | + "val_top1": 0.75311279296875, | |
| 4012 | + "val_nll": 1.4592525362968445, | |
| 4013 | + "t": 3.438655138015747 | |
| 4014 | + }, | |
| 4015 | + { | |
| 4016 | + "passes": 12, | |
| 4017 | + "val_top1": 0.754730224609375, | |
| 4018 | + "val_nll": 1.43571937084198, | |
| 4019 | + "t": 3.744431257247925 | |
| 4020 | + }, | |
| 4021 | + { | |
| 4022 | + "passes": 13, | |
| 4023 | + "val_top1": 0.75689697265625, | |
| 4024 | + "val_nll": 1.4136205315589905, | |
| 4025 | + "t": 4.051554203033447 | |
| 4026 | + }, | |
| 4027 | + { | |
| 4028 | + "passes": 14, | |
| 4029 | + "val_top1": 0.759002685546875, | |
| 4030 | + "val_nll": 1.3928067684173584, | |
| 4031 | + "t": 4.358155965805054 | |
| 4032 | + }, | |
| 4033 | + { | |
| 4034 | + "passes": 15, | |
| 4035 | + "val_top1": 0.76043701171875, | |
| 4036 | + "val_nll": 1.3731516003608704, | |
| 4037 | + "t": 4.6687304973602295 | |
| 4038 | + }, | |
| 4039 | + { | |
| 4040 | + "passes": 16, | |
| 4041 | + "val_top1": 0.762054443359375, | |
| 4042 | + "val_nll": 1.3545463681221008, | |
| 4043 | + "t": 4.97620153427124 | |
| 4044 | + }, | |
| 4045 | + { | |
| 4046 | + "passes": 17, | |
| 4047 | + "val_top1": 0.7635498046875, | |
| 4048 | + "val_nll": 1.336897611618042, | |
| 4049 | + "t": 5.282274961471558 | |
| 4050 | + }, | |
| 4051 | + { | |
| 4052 | + "passes": 18, | |
| 4053 | + "val_top1": 0.765167236328125, | |
| 4054 | + "val_nll": 1.3201242685317993, | |
| 4055 | + "t": 5.583961009979248 | |
| 4056 | + }, | |
| 4057 | + { | |
| 4058 | + "passes": 19, | |
| 4059 | + "val_top1": 0.7662353515625, | |
| 4060 | + "val_nll": 1.304155170917511, | |
| 4061 | + "t": 5.8894898891448975 | |
| 4062 | + }, | |
| 4063 | + { | |
| 4064 | + "passes": 20, | |
| 4065 | + "val_top1": 0.767730712890625, | |
| 4066 | + "val_nll": 1.2889280319213867, | |
| 4067 | + "t": 6.197061777114868 | |
| 4068 | + }, | |
| 4069 | + { | |
| 4070 | + "passes": 21, | |
| 4071 | + "val_top1": 0.768707275390625, | |
| 4072 | + "val_nll": 1.274387001991272, | |
| 4073 | + "t": 6.5041913986206055 | |
| 4074 | + }, | |
| 4075 | + { | |
| 4076 | + "passes": 22, | |
| 4077 | + "val_top1": 0.76995849609375, | |
| 4078 | + "val_nll": 1.2604827880859375, | |
| 4079 | + "t": 6.8159778118133545 | |
| 4080 | + }, | |
| 4081 | + { | |
| 4082 | + "passes": 23, | |
| 4083 | + "val_top1": 0.771087646484375, | |
| 4084 | + "val_nll": 1.2471712827682495, | |
| 4085 | + "t": 7.125877141952515 | |
| 4086 | + }, | |
| 4087 | + { | |
| 4088 | + "passes": 24, | |
| 4089 | + "val_top1": 0.77294921875, | |
| 4090 | + "val_nll": 1.2344123125076294, | |
| 4091 | + "t": 7.435112237930298 | |
| 4092 | + }, | |
| 4093 | + { | |
| 4094 | + "passes": 25, | |
| 4095 | + "val_top1": 0.773590087890625, | |
| 4096 | + "val_nll": 1.222169816493988, | |
| 4097 | + "t": 7.752815246582031 | |
| 4098 | + }, | |
| 4099 | + { | |
| 4100 | + "passes": 26, | |
| 4101 | + "val_top1": 0.774627685546875, | |
| 4102 | + "val_nll": 1.210411012172699, | |
| 4103 | + "t": 8.070286989212036 | |
| 4104 | + }, | |
| 4105 | + { | |
| 4106 | + "passes": 27, | |
| 4107 | + "val_top1": 0.775299072265625, | |
| 4108 | + "val_nll": 1.1991060972213745, | |
| 4109 | + "t": 8.379205703735352 | |
| 4110 | + }, | |
| 4111 | + { | |
| 4112 | + "passes": 28, | |
| 4113 | + "val_top1": 0.776458740234375, | |
| 4114 | + "val_nll": 1.188227891921997, | |
| 4115 | + "t": 8.693660259246826 | |
| 4116 | + }, | |
| 4117 | + { | |
| 4118 | + "passes": 29, | |
| 4119 | + "val_top1": 0.777130126953125, | |
| 4120 | + "val_nll": 1.177751362323761, | |
| 4121 | + "t": 8.99691390991211 | |
| 4122 | + }, | |
| 4123 | + { | |
| 4124 | + "passes": 30, | |
| 4125 | + "val_top1": 0.7781982421875, | |
| 4126 | + "val_nll": 1.1676536798477173, | |
| 4127 | + "t": 9.298978328704834 | |
| 4128 | + }, | |
| 4129 | + { | |
| 4130 | + "passes": 31, | |
| 4131 | + "val_top1": 0.77880859375, | |
| 4132 | + "val_nll": 1.1579140424728394, | |
| 4133 | + "t": 9.608279943466187 | |
| 4134 | + }, | |
| 4135 | + { | |
| 4136 | + "passes": 32, | |
| 4137 | + "val_top1": 0.779449462890625, | |
| 4138 | + "val_nll": 1.1485128998756409, | |
| 4139 | + "t": 9.919137239456177 | |
| 4140 | + }, | |
| 4141 | + { | |
| 4142 | + "passes": 33, | |
| 4143 | + "val_top1": 0.779998779296875, | |
| 4144 | + "val_nll": 1.139432430267334, | |
| 4145 | + "t": 10.22804570198059 | |
| 4146 | + }, | |
| 4147 | + { | |
| 4148 | + "passes": 34, | |
| 4149 | + "val_top1": 0.78070068359375, | |
| 4150 | + "val_nll": 1.1306560039520264, | |
| 4151 | + "t": 10.530920028686523 | |
| 4152 | + }, | |
| 4153 | + { | |
| 4154 | + "passes": 35, | |
| 4155 | + "val_top1": 0.7816162109375, | |
| 4156 | + "val_nll": 1.1221686601638794, | |
| 4157 | + "t": 10.831153392791748 | |
| 4158 | + }, | |
| 4159 | + { | |
| 4160 | + "passes": 36, | |
| 4161 | + "val_top1": 0.7822265625, | |
| 4162 | + "val_nll": 1.1139557361602783, | |
| 4163 | + "t": 11.136896133422852 | |
| 4164 | + }, | |
| 4165 | + { | |
| 4166 | + "passes": 37, | |
| 4167 | + "val_top1": 0.782684326171875, | |
| 4168 | + "val_nll": 1.1060041785240173, | |
| 4169 | + "t": 11.436570167541504 | |
| 4170 | + }, | |
| 4171 | + { | |
| 4172 | + "passes": 38, | |
| 4173 | + "val_top1": 0.783538818359375, | |
| 4174 | + "val_nll": 1.0983017086982727, | |
| 4175 | + "t": 11.792770624160767 | |
| 4176 | + }, | |
| 4177 | + { | |
| 4178 | + "passes": 39, | |
| 4179 | + "val_top1": 0.7843017578125, | |
| 4180 | + "val_nll": 1.0908364653587341, | |
| 4181 | + "t": 12.095982074737549 | |
| 4182 | + }, | |
| 4183 | + { | |
| 4184 | + "passes": 40, | |
| 4185 | + "val_top1": 0.784881591796875, | |
| 4186 | + "val_nll": 1.0835978388786316, | |
| 4187 | + "t": 12.398747444152832 | |
| 4188 | + }, | |
| 4189 | + { | |
| 4190 | + "passes": 41, | |
| 4191 | + "val_top1": 0.78564453125, | |
| 4192 | + "val_nll": 1.076575756072998, | |
| 4193 | + "t": 12.713023900985718 | |
| 4194 | + }, | |
| 4195 | + { | |
| 4196 | + "passes": 42, | |
| 4197 | + "val_top1": 0.786376953125, | |
| 4198 | + "val_nll": 1.0697606205940247, | |
| 4199 | + "t": 13.017452478408813 | |
| 4200 | + }, | |
| 4201 | + { | |
| 4202 | + "passes": 43, | |
| 4203 | + "val_top1": 0.7872314453125, | |
| 4204 | + "val_nll": 1.0631434917449951, | |
| 4205 | + "t": 13.328097581863403 | |
| 4206 | + }, | |
| 4207 | + { | |
| 4208 | + "passes": 44, | |
| 4209 | + "val_top1": 0.787933349609375, | |
| 4210 | + "val_nll": 1.0567160248756409, | |
| 4211 | + "t": 13.636863470077515 | |
| 4212 | + }, | |
| 4213 | + { | |
| 4214 | + "passes": 45, | |
| 4215 | + "val_top1": 0.78875732421875, | |
| 4216 | + "val_nll": 1.050470232963562, | |
| 4217 | + "t": 13.943104982376099 | |
| 4218 | + }, | |
| 4219 | + { | |
| 4220 | + "passes": 46, | |
| 4221 | + "val_top1": 0.789337158203125, | |
| 4222 | + "val_nll": 1.0443987250328064, | |
| 4223 | + "t": 14.254416942596436 | |
| 4224 | + }, | |
| 4225 | + { | |
| 4226 | + "passes": 47, | |
| 4227 | + "val_top1": 0.789947509765625, | |
| 4228 | + "val_nll": 1.038494348526001, | |
| 4229 | + "t": 14.562744617462158 | |
| 4230 | + }, | |
| 4231 | + { | |
| 4232 | + "passes": 48, | |
| 4233 | + "val_top1": 0.790313720703125, | |
| 4234 | + "val_nll": 1.03275066614151, | |
| 4235 | + "t": 14.87409257888794 | |
| 4236 | + }, | |
| 4237 | + { | |
| 4238 | + "passes": 49, | |
| 4239 | + "val_top1": 0.79083251953125, | |
| 4240 | + "val_nll": 1.0271612405776978, | |
| 4241 | + "t": 15.18883490562439 | |
| 4242 | + }, | |
| 4243 | + { | |
| 4244 | + "passes": 50, | |
| 4245 | + "val_top1": 0.79119873046875, | |
| 4246 | + "val_nll": 1.021720051765442, | |
| 4247 | + "t": 15.503705263137817 | |
| 4248 | + }, | |
| 4249 | + { | |
| 4250 | + "passes": 51, | |
| 4251 | + "val_top1": 0.79150390625, | |
| 4252 | + "val_nll": 1.0164216756820679, | |
| 4253 | + "t": 15.809309482574463 | |
| 4254 | + }, | |
| 4255 | + { | |
| 4256 | + "passes": 52, | |
| 4257 | + "val_top1": 0.79205322265625, | |
| 4258 | + "val_nll": 1.0112605690956116, | |
| 4259 | + "t": 16.120131015777588 | |
| 4260 | + }, | |
| 4261 | + { | |
| 4262 | + "passes": 53, | |
| 4263 | + "val_top1": 0.79248046875, | |
| 4264 | + "val_nll": 1.0062316060066223, | |
| 4265 | + "t": 16.43357825279236 | |
| 4266 | + }, | |
| 4267 | + { | |
| 4268 | + "passes": 54, | |
| 4269 | + "val_top1": 0.792877197265625, | |
| 4270 | + "val_nll": 1.0013301968574524, | |
| 4271 | + "t": 16.740004539489746 | |
| 4272 | + }, | |
| 4273 | + { | |
| 4274 | + "passes": 55, | |
| 4275 | + "val_top1": 0.793426513671875, | |
| 4276 | + "val_nll": 0.996551513671875, | |
| 4277 | + "t": 17.053146362304688 | |
| 4278 | + }, | |
| 4279 | + { | |
| 4280 | + "passes": 56, | |
| 4281 | + "val_top1": 0.793548583984375, | |
| 4282 | + "val_nll": 0.9918914437294006, | |
| 4283 | + "t": 17.366469144821167 | |
| 4284 | + }, | |
| 4285 | + { | |
| 4286 | + "passes": 57, | |
| 4287 | + "val_top1": 0.794189453125, | |
| 4288 | + "val_nll": 0.9873455762863159, | |
| 4289 | + "t": 17.681215286254883 | |
| 4290 | + }, | |
| 4291 | + { | |
| 4292 | + "passes": 58, | |
| 4293 | + "val_top1": 0.794403076171875, | |
| 4294 | + "val_nll": 0.9829100370407104, | |
| 4295 | + "t": 17.987152814865112 | |
| 4296 | + }, | |
| 4297 | + { | |
| 4298 | + "passes": 59, | |
| 4299 | + "val_top1": 0.794830322265625, | |
| 4300 | + "val_nll": 0.9785810708999634, | |
| 4301 | + "t": 18.292009353637695 | |
| 4302 | + }, | |
| 4303 | + { | |
| 4304 | + "passes": 60, | |
| 4305 | + "val_top1": 0.7952880859375, | |
| 4306 | + "val_nll": 0.974355012178421, | |
| 4307 | + "t": 18.598751068115234 | |
| 4308 | + }, | |
| 4309 | + { | |
| 4310 | + "passes": 61, | |
| 4311 | + "val_top1": 0.795501708984375, | |
| 4312 | + "val_nll": 0.9702284336090088, | |
| 4313 | + "t": 18.916499137878418 | |
| 4314 | + }, | |
| 4315 | + { | |
| 4316 | + "passes": 62, | |
| 4317 | + "val_top1": 0.79583740234375, | |
| 4318 | + "val_nll": 0.9661981165409088, | |
| 4319 | + "t": 19.233553171157837 | |
| 4320 | + }, | |
| 4321 | + { | |
| 4322 | + "passes": 63, | |
| 4323 | + "val_top1": 0.79583740234375, | |
| 4324 | + "val_nll": 0.9622607827186584, | |
| 4325 | + "t": 19.54401969909668 | |
| 4326 | + }, | |
| 4327 | + { | |
| 4328 | + "passes": 64, | |
| 4329 | + "val_top1": 0.795989990234375, | |
| 4330 | + "val_nll": 0.9584134817123413, | |
| 4331 | + "t": 19.852747201919556 | |
| 4332 | + }, | |
| 4333 | + { | |
| 4334 | + "passes": 65, | |
| 4335 | + "val_top1": 0.79669189453125, | |
| 4336 | + "val_nll": 0.9546533823013306, | |
| 4337 | + "t": 20.15592932701111 | |
| 4338 | + }, | |
| 4339 | + { | |
| 4340 | + "passes": 66, | |
| 4341 | + "val_top1": 0.796966552734375, | |
| 4342 | + "val_nll": 0.9509776532649994, | |
| 4343 | + "t": 20.45910620689392 | |
| 4344 | + }, | |
| 4345 | + { | |
| 4346 | + "passes": 67, | |
| 4347 | + "val_top1": 0.79730224609375, | |
| 4348 | + "val_nll": 0.9473835825920105, | |
| 4349 | + "t": 20.766166925430298 | |
| 4350 | + }, | |
| 4351 | + { | |
| 4352 | + "passes": 68, | |
| 4353 | + "val_top1": 0.79766845703125, | |
| 4354 | + "val_nll": 0.9438688457012177, | |
| 4355 | + "t": 21.066509008407593 | |
| 4356 | + }, | |
| 4357 | + { | |
| 4358 | + "passes": 69, | |
| 4359 | + "val_top1": 0.798187255859375, | |
| 4360 | + "val_nll": 0.9404307901859283, | |
| 4361 | + "t": 21.37212896347046 | |
| 4362 | + }, | |
| 4363 | + { | |
| 4364 | + "passes": 70, | |
| 4365 | + "val_top1": 0.798431396484375, | |
| 4366 | + "val_nll": 0.9370671808719635, | |
| 4367 | + "t": 21.684207916259766 | |
| 4368 | + }, | |
| 4369 | + { | |
| 4370 | + "passes": 71, | |
| 4371 | + "val_top1": 0.798797607421875, | |
| 4372 | + "val_nll": 0.9337758123874664, | |
| 4373 | + "t": 21.98958158493042 | |
| 4374 | + }, | |
| 4375 | + { | |
| 4376 | + "passes": 72, | |
| 4377 | + "val_top1": 0.799072265625, | |
| 4378 | + "val_nll": 0.9305544197559357, | |
| 4379 | + "t": 22.29796814918518 | |
| 4380 | + }, | |
| 4381 | + { | |
| 4382 | + "passes": 73, | |
| 4383 | + "val_top1": 0.799530029296875, | |
| 4384 | + "val_nll": 0.9274011254310608, | |
| 4385 | + "t": 22.60299587249756 | |
| 4386 | + }, | |
| 4387 | + { | |
| 4388 | + "passes": 74, | |
| 4389 | + "val_top1": 0.79974365234375, | |
| 4390 | + "val_nll": 0.9243137836456299, | |
| 4391 | + "t": 22.918752908706665 | |
| 4392 | + }, | |
| 4393 | + { | |
| 4394 | + "passes": 75, | |
| 4395 | + "val_top1": 0.800323486328125, | |
| 4396 | + "val_nll": 0.9212905168533325, | |
| 4397 | + "t": 23.221410512924194 | |
| 4398 | + }, | |
| 4399 | + { | |
| 4400 | + "passes": 76, | |
| 4401 | + "val_top1": 0.800689697265625, | |
| 4402 | + "val_nll": 0.9183295667171478, | |
| 4403 | + "t": 23.521507024765015 | |
| 4404 | + }, | |
| 4405 | + { | |
| 4406 | + "passes": 77, | |
| 4407 | + "val_top1": 0.80084228515625, | |
| 4408 | + "val_nll": 0.9154290556907654, | |
| 4409 | + "t": 23.83139729499817 | |
| 4410 | + }, | |
| 4411 | + { | |
| 4412 | + "passes": 78, | |
| 4413 | + "val_top1": 0.800994873046875, | |
| 4414 | + "val_nll": 0.9125873744487762, | |
| 4415 | + "t": 24.13364577293396 | |
| 4416 | + }, | |
| 4417 | + { | |
| 4418 | + "passes": 79, | |
| 4419 | + "val_top1": 0.801177978515625, | |
| 4420 | + "val_nll": 0.9098027944564819, | |
| 4421 | + "t": 24.440791130065918 | |
| 4422 | + }, | |
| 4423 | + { | |
| 4424 | + "passes": 80, | |
| 4425 | + "val_top1": 0.801513671875, | |
| 4426 | + "val_nll": 0.9070738255977631, | |
| 4427 | + "t": 24.746602058410645 | |
| 4428 | + }, | |
| 4429 | + { | |
| 4430 | + "passes": 81, | |
| 4431 | + "val_top1": 0.80194091796875, | |
| 4432 | + "val_nll": 0.9043988585472107, | |
| 4433 | + "t": 25.06902813911438 | |
| 4434 | + }, | |
| 4435 | + { | |
| 4436 | + "passes": 82, | |
| 4437 | + "val_top1": 0.80230712890625, | |
| 4438 | + "val_nll": 0.901776522397995, | |
| 4439 | + "t": 25.374982118606567 | |
| 4440 | + }, | |
| 4441 | + { | |
| 4442 | + "passes": 83, | |
| 4443 | + "val_top1": 0.802581787109375, | |
| 4444 | + "val_nll": 0.899205356836319, | |
| 4445 | + "t": 25.681367874145508 | |
| 4446 | + }, | |
| 4447 | + { | |
| 4448 | + "passes": 84, | |
| 4449 | + "val_top1": 0.80279541015625, | |
| 4450 | + "val_nll": 0.8966840207576752, | |
| 4451 | + "t": 25.98829674720764 | |
| 4452 | + }, | |
| 4453 | + { | |
| 4454 | + "passes": 85, | |
| 4455 | + "val_top1": 0.803192138671875, | |
| 4456 | + "val_nll": 0.8942111730575562, | |
| 4457 | + "t": 26.301114320755005 | |
| 4458 | + }, | |
| 4459 | + { | |
| 4460 | + "passes": 86, | |
| 4461 | + "val_top1": 0.8033447265625, | |
| 4462 | + "val_nll": 0.8917855024337769, | |
| 4463 | + "t": 26.612481832504272 | |
| 4464 | + }, | |
| 4465 | + { | |
| 4466 | + "passes": 87, | |
| 4467 | + "val_top1": 0.803680419921875, | |
| 4468 | + "val_nll": 0.8894058465957642, | |
| 4469 | + "t": 26.921722650527954 | |
| 4470 | + }, | |
| 4471 | + { | |
| 4472 | + "passes": 88, | |
| 4473 | + "val_top1": 0.803680419921875, | |
| 4474 | + "val_nll": 0.8870710730552673, | |
| 4475 | + "t": 27.22886323928833 | |
| 4476 | + }, | |
| 4477 | + { | |
| 4478 | + "passes": 89, | |
| 4479 | + "val_top1": 0.803741455078125, | |
| 4480 | + "val_nll": 0.8847799003124237, | |
| 4481 | + "t": 27.544464111328125 | |
| 4482 | + }, | |
| 4483 | + { | |
| 4484 | + "passes": 90, | |
| 4485 | + "val_top1": 0.80401611328125, | |
| 4486 | + "val_nll": 0.8825313448905945, | |
| 4487 | + "t": 27.852416038513184 | |
| 4488 | + }, | |
| 4489 | + { | |
| 4490 | + "passes": 91, | |
| 4491 | + "val_top1": 0.804168701171875, | |
| 4492 | + "val_nll": 0.8803242444992065, | |
| 4493 | + "t": 28.15663504600525 | |
| 4494 | + }, | |
| 4495 | + { | |
| 4496 | + "passes": 92, | |
| 4497 | + "val_top1": 0.804290771484375, | |
| 4498 | + "val_nll": 0.8781576752662659, | |
| 4499 | + "t": 28.462807178497314 | |
| 4500 | + }, | |
| 4501 | + { | |
| 4502 | + "passes": 93, | |
| 4503 | + "val_top1": 0.804443359375, | |
| 4504 | + "val_nll": 0.8760305047035217, | |
| 4505 | + "t": 28.77134418487549 | |
| 4506 | + }, | |
| 4507 | + { | |
| 4508 | + "passes": 94, | |
| 4509 | + "val_top1": 0.80438232421875, | |
| 4510 | + "val_nll": 0.8739418983459473, | |
| 4511 | + "t": 29.07902240753174 | |
| 4512 | + }, | |
| 4513 | + { | |
| 4514 | + "passes": 95, | |
| 4515 | + "val_top1": 0.80450439453125, | |
| 4516 | + "val_nll": 0.8718908429145813, | |
| 4517 | + "t": 29.398370265960693 | |
| 4518 | + }, | |
| 4519 | + { | |
| 4520 | + "passes": 96, | |
| 4521 | + "val_top1": 0.804718017578125, | |
| 4522 | + "val_nll": 0.8698764443397522, | |
| 4523 | + "t": 29.71891975402832 | |
| 4524 | + }, | |
| 4525 | + { | |
| 4526 | + "passes": 97, | |
| 4527 | + "val_top1": 0.804840087890625, | |
| 4528 | + "val_nll": 0.8678978383541107, | |
| 4529 | + "t": 30.03132152557373 | |
| 4530 | + }, | |
| 4531 | + { | |
| 4532 | + "passes": 98, | |
| 4533 | + "val_top1": 0.805023193359375, | |
| 4534 | + "val_nll": 0.8659542202949524, | |
| 4535 | + "t": 30.34870982170105 | |
| 4536 | + }, | |
| 4537 | + { | |
| 4538 | + "passes": 99, | |
| 4539 | + "val_top1": 0.805267333984375, | |
| 4540 | + "val_nll": 0.8640446662902832, | |
| 4541 | + "t": 30.66001534461975 | |
| 4542 | + }, | |
| 4543 | + { | |
| 4544 | + "passes": 100, | |
| 4545 | + "val_top1": 0.80535888671875, | |
| 4546 | + "val_nll": 0.8621684610843658, | |
| 4547 | + "t": 30.971494436264038 | |
| 4548 | + } | |
| 4549 | + ], | |
| 4550 | + "reach": {} | |
| 4551 | + }, | |
| 4552 | + "0.0001": { | |
| 4553 | + "hist": [ | |
| 4554 | + { | |
| 4555 | + "passes": 1, | |
| 4556 | + "val_top1": 0.7171630859375, | |
| 4557 | + "val_nll": 1.840061366558075, | |
| 4558 | + "t": 0.31090712547302246 | |
| 4559 | + }, | |
| 4560 | + { | |
| 4561 | + "passes": 2, | |
| 4562 | + "val_top1": 0.72137451171875, | |
| 4563 | + "val_nll": 1.7820461988449097, | |
| 4564 | + "t": 0.6258399486541748 | |
| 4565 | + }, | |
| 4566 | + { | |
| 4567 | + "passes": 3, | |
| 4568 | + "val_top1": 0.726318359375, | |
| 4569 | + "val_nll": 1.730879306793213, | |
| 4570 | + "t": 0.9422051906585693 | |
| 4571 | + }, | |
| 4572 | + { | |
| 4573 | + "passes": 4, | |
| 4574 | + "val_top1": 0.732269287109375, | |
| 4575 | + "val_nll": 1.685384750366211, | |
| 4576 | + "t": 1.2582182884216309 | |
| 4577 | + }, | |
| 4578 | + { | |
| 4579 | + "passes": 5, | |
| 4580 | + "val_top1": 0.736236572265625, | |
| 4581 | + "val_nll": 1.6444870829582214, | |
| 4582 | + "t": 1.5767700672149658 | |
| 4583 | + }, | |
| 4584 | + { | |
| 4585 | + "passes": 6, | |
| 4586 | + "val_top1": 0.7398681640625, | |
| 4587 | + "val_nll": 1.6073894500732422, | |
| 4588 | + "t": 1.902235507965088 | |
| 4589 | + }, | |
| 4590 | + { | |
| 4591 | + "passes": 7, | |
| 4592 | + "val_top1": 0.742950439453125, | |
| 4593 | + "val_nll": 1.573502242565155, | |
| 4594 | + "t": 2.226020097732544 | |
| 4595 | + }, | |
| 4596 | + { | |
| 4597 | + "passes": 8, | |
| 4598 | + "val_top1": 0.745941162109375, | |
| 4599 | + "val_nll": 1.5423616170883179, | |
| 4600 | + "t": 2.5519418716430664 | |
| 4601 | + }, | |
| 4602 | + { | |
| 4603 | + "passes": 9, | |
| 4604 | + "val_top1": 0.748565673828125, | |
| 4605 | + "val_nll": 1.5135891437530518, | |
| 4606 | + "t": 2.8700995445251465 | |
| 4607 | + }, | |
| 4608 | + { | |
| 4609 | + "passes": 10, | |
| 4610 | + "val_top1": 0.750885009765625, | |
| 4611 | + "val_nll": 1.4868741035461426, | |
| 4612 | + "t": 3.1855292320251465 | |
| 4613 | + }, | |
| 4614 | + { | |
| 4615 | + "passes": 11, | |
| 4616 | + "val_top1": 0.7530517578125, | |
| 4617 | + "val_nll": 1.4619603753089905, | |
| 4618 | + "t": 3.4996864795684814 | |
| 4619 | + }, | |
| 4620 | + { | |
| 4621 | + "passes": 12, | |
| 4622 | + "val_top1": 0.754730224609375, | |
| 4623 | + "val_nll": 1.4386367201805115, | |
| 4624 | + "t": 3.815659999847412 | |
| 4625 | + }, | |
| 4626 | + { | |
| 4627 | + "passes": 13, | |
| 4628 | + "val_top1": 0.75665283203125, | |
| 4629 | + "val_nll": 1.416727066040039, | |
| 4630 | + "t": 4.127549648284912 | |
| 4631 | + }, | |
| 4632 | + { | |
| 4633 | + "passes": 14, | |
| 4634 | + "val_top1": 0.758544921875, | |
| 4635 | + "val_nll": 1.396083414554596, | |
| 4636 | + "t": 4.465046167373657 | |
| 4637 | + }, | |
| 4638 | + { | |
| 4639 | + "passes": 15, | |
| 4640 | + "val_top1": 0.760345458984375, | |
| 4641 | + "val_nll": 1.3765810132026672, | |
| 4642 | + "t": 4.843322515487671 | |
| 4643 | + }, | |
| 4644 | + { | |
| 4645 | + "passes": 16, | |
| 4646 | + "val_top1": 0.7618408203125, | |
| 4647 | + "val_nll": 1.3581132292747498, | |
| 4648 | + "t": 5.284042119979858 | |
| 4649 | + }, | |
| 4650 | + { | |
| 4651 | + "passes": 17, | |
| 4652 | + "val_top1": 0.763214111328125, | |
| 4653 | + "val_nll": 1.340588092803955, | |
| 4654 | + "t": 5.598050117492676 | |
| 4655 | + }, | |
| 4656 | + { | |
| 4657 | + "passes": 18, | |
| 4658 | + "val_top1": 0.7647705078125, | |
| 4659 | + "val_nll": 1.3239262104034424, | |
| 4660 | + "t": 5.960745334625244 | |
| 4661 | + }, | |
| 4662 | + { | |
| 4663 | + "passes": 19, | |
| 4664 | + "val_top1": 0.766448974609375, | |
| 4665 | + "val_nll": 1.3080582022666931, | |
| 4666 | + "t": 6.312917947769165 | |
| 4667 | + }, | |
| 4668 | + { | |
| 4669 | + "passes": 20, | |
| 4670 | + "val_top1": 0.767822265625, | |
| 4671 | + "val_nll": 1.292922556400299, | |
| 4672 | + "t": 6.67238450050354 | |
| 4673 | + }, | |
| 4674 | + { | |
| 4675 | + "passes": 21, | |
| 4676 | + "val_top1": 0.769012451171875, | |
| 4677 | + "val_nll": 1.2784651517868042, | |
| 4678 | + "t": 7.073653936386108 | |
| 4679 | + }, | |
| 4680 | + { | |
| 4681 | + "passes": 22, | |
| 4682 | + "val_top1": 0.7701416015625, | |
| 4683 | + "val_nll": 1.2646377086639404, | |
| 4684 | + "t": 7.428007125854492 | |
| 4685 | + }, | |
| 4686 | + { | |
| 4687 | + "passes": 23, | |
| 4688 | + "val_top1": 0.7716064453125, | |
| 4689 | + "val_nll": 1.251396656036377, | |
| 4690 | + "t": 7.8042731285095215 | |
| 4691 | + }, | |
| 4692 | + { | |
| 4693 | + "passes": 24, | |
| 4694 | + "val_top1": 0.772857666015625, | |
| 4695 | + "val_nll": 1.2387029528617859, | |
| 4696 | + "t": 8.155561208724976 | |
| 4697 | + }, | |
| 4698 | + { | |
| 4699 | + "passes": 25, | |
| 4700 | + "val_top1": 0.773681640625, | |
| 4701 | + "val_nll": 1.2265211343765259, | |
| 4702 | + "t": 8.513139724731445 | |
| 4703 | + }, | |
| 4704 | + { | |
| 4705 | + "passes": 26, | |
| 4706 | + "val_top1": 0.774383544921875, | |
| 4707 | + "val_nll": 1.2148191332817078, | |
| 4708 | + "t": 8.884320974349976 | |
| 4709 | + }, | |
| 4710 | + { | |
| 4711 | + "passes": 27, | |
| 4712 | + "val_top1": 0.77520751953125, | |
| 4713 | + "val_nll": 1.2035675048828125, | |
| 4714 | + "t": 9.303600788116455 | |
| 4715 | + }, | |
| 4716 | + { | |
| 4717 | + "passes": 28, | |
| 4718 | + "val_top1": 0.7757568359375, | |
| 4719 | + "val_nll": 1.1927393674850464, | |
| 4720 | + "t": 9.675878524780273 | |
| 4721 | + }, | |
| 4722 | + { | |
| 4723 | + "passes": 29, | |
| 4724 | + "val_top1": 0.776580810546875, | |
| 4725 | + "val_nll": 1.182310402393341, | |
| 4726 | + "t": 10.040649652481079 | |
| 4727 | + }, | |
| 4728 | + { | |
| 4729 | + "passes": 30, | |
| 4730 | + "val_top1": 0.7774658203125, | |
| 4731 | + "val_nll": 1.172257900238037, | |
| 4732 | + "t": 10.4253568649292 | |
| 4733 | + }, | |
| 4734 | + { | |
| 4735 | + "passes": 31, | |
| 4736 | + "val_top1": 0.778076171875, | |
| 4737 | + "val_nll": 1.1625609397888184, | |
| 4738 | + "t": 10.834345817565918 | |
| 4739 | + }, | |
| 4740 | + { | |
| 4741 | + "passes": 32, | |
| 4742 | + "val_top1": 0.7786865234375, | |
| 4743 | + "val_nll": 1.153200626373291, | |
| 4744 | + "t": 11.473381519317627 | |
| 4745 | + }, | |
| 4746 | + { | |
| 4747 | + "passes": 33, | |
| 4748 | + "val_top1": 0.77923583984375, | |
| 4749 | + "val_nll": 1.144159197807312, | |
| 4750 | + "t": 11.929017543792725 | |
| 4751 | + }, | |
| 4752 | + { | |
| 4753 | + "passes": 34, | |
| 4754 | + "val_top1": 0.77996826171875, | |
| 4755 | + "val_nll": 1.1354200839996338, | |
| 4756 | + "t": 12.289294958114624 | |
| 4757 | + }, | |
| 4758 | + { | |
| 4759 | + "passes": 35, | |
| 4760 | + "val_top1": 0.780517578125, | |
| 4761 | + "val_nll": 1.1269682049751282, | |
| 4762 | + "t": 12.638285398483276 | |
| 4763 | + }, | |
| 4764 | + { | |
| 4765 | + "passes": 36, | |
| 4766 | + "val_top1": 0.781341552734375, | |
| 4767 | + "val_nll": 1.1187894344329834, | |
| 4768 | + "t": 12.997419834136963 | |
| 4769 | + }, | |
| 4770 | + { | |
| 4771 | + "passes": 37, | |
| 4772 | + "val_top1": 0.78192138671875, | |
| 4773 | + "val_nll": 1.1108705401420593, | |
| 4774 | + "t": 13.363916158676147 | |
| 4775 | + }, | |
| 4776 | + { | |
| 4777 | + "passes": 38, | |
| 4778 | + "val_top1": 0.782867431640625, | |
| 4779 | + "val_nll": 1.1031993627548218, | |
| 4780 | + "t": 13.709171056747437 | |
| 4781 | + }, | |
| 4782 | + { | |
| 4783 | + "passes": 39, | |
| 4784 | + "val_top1": 0.783477783203125, | |
| 4785 | + "val_nll": 1.0957640409469604, | |
| 4786 | + "t": 14.0568106174469 | |
| 4787 | + }, | |
| 4788 | + { | |
| 4789 | + "passes": 40, | |
| 4790 | + "val_top1": 0.784149169921875, | |
| 4791 | + "val_nll": 1.0885542631149292, | |
| 4792 | + "t": 14.573790550231934 | |
| 4793 | + }, | |
| 4794 | + { | |
| 4795 | + "passes": 41, | |
| 4796 | + "val_top1": 0.784942626953125, | |
| 4797 | + "val_nll": 1.0815598368644714, | |
| 4798 | + "t": 15.202930927276611 | |
| 4799 | + }, | |
| 4800 | + { | |
| 4801 | + "passes": 42, | |
| 4802 | + "val_top1": 0.78546142578125, | |
| 4803 | + "val_nll": 1.0747711658477783, | |
| 4804 | + "t": 15.743350267410278 | |
| 4805 | + }, | |
| 4806 | + { | |
| 4807 | + "passes": 43, | |
| 4808 | + "val_top1": 0.785980224609375, | |
| 4809 | + "val_nll": 1.0681793689727783, | |
| 4810 | + "t": 16.163809537887573 | |
| 4811 | + }, | |
| 4812 | + { | |
| 4813 | + "passes": 44, | |
| 4814 | + "val_top1": 0.78656005859375, | |
| 4815 | + "val_nll": 1.0617762804031372, | |
| 4816 | + "t": 16.622490882873535 | |
| 4817 | + }, | |
| 4818 | + { | |
| 4819 | + "passes": 45, | |
| 4820 | + "val_top1": 0.787353515625, | |
| 4821 | + "val_nll": 1.0555537343025208, | |
| 4822 | + "t": 17.22702956199646 | |
| 4823 | + }, | |
| 4824 | + { | |
| 4825 | + "passes": 46, | |
| 4826 | + "val_top1": 0.787841796875, | |
| 4827 | + "val_nll": 1.049504578113556, | |
| 4828 | + "t": 17.62533164024353 | |
| 4829 | + }, | |
| 4830 | + { | |
| 4831 | + "passes": 47, | |
| 4832 | + "val_top1": 0.78814697265625, | |
| 4833 | + "val_nll": 1.04362154006958, | |
| 4834 | + "t": 18.06823706626892 | |
| 4835 | + }, | |
| 4836 | + { | |
| 4837 | + "passes": 48, | |
| 4838 | + "val_top1": 0.788604736328125, | |
| 4839 | + "val_nll": 1.0378982424736023, | |
| 4840 | + "t": 18.490816354751587 | |
| 4841 | + }, | |
| 4842 | + { | |
| 4843 | + "passes": 49, | |
| 4844 | + "val_top1": 0.78948974609375, | |
| 4845 | + "val_nll": 1.032328188419342, | |
| 4846 | + "t": 18.91822862625122 | |
| 4847 | + }, | |
| 4848 | + { | |
| 4849 | + "passes": 50, | |
| 4850 | + "val_top1": 0.790008544921875, | |
| 4851 | + "val_nll": 1.0269056558609009, | |
| 4852 | + "t": 19.331230878829956 | |
| 4853 | + }, | |
| 4854 | + { | |
| 4855 | + "passes": 51, | |
| 4856 | + "val_top1": 0.79046630859375, | |
| 4857 | + "val_nll": 1.0216248631477356, | |
| 4858 | + "t": 19.742281436920166 | |
| 4859 | + }, | |
| 4860 | + { | |
| 4861 | + "passes": 52, | |
| 4862 | + "val_top1": 0.79058837890625, | |
| 4863 | + "val_nll": 1.0164805054664612, | |
| 4864 | + "t": 20.25202965736389 | |
| 4865 | + }, | |
| 4866 | + { | |
| 4867 | + "passes": 53, | |
| 4868 | + "val_top1": 0.791046142578125, | |
| 4869 | + "val_nll": 1.0114675760269165, | |
| 4870 | + "t": 20.757896661758423 | |
| 4871 | + }, | |
| 4872 | + { | |
| 4873 | + "passes": 54, | |
| 4874 | + "val_top1": 0.791534423828125, | |
| 4875 | + "val_nll": 1.0065811574459076, | |
| 4876 | + "t": 21.169495820999146 | |
| 4877 | + }, | |
| 4878 | + { | |
| 4879 | + "passes": 55, | |
| 4880 | + "val_top1": 0.791748046875, | |
| 4881 | + "val_nll": 1.0018167793750763, | |
| 4882 | + "t": 21.599422454833984 | |
| 4883 | + }, | |
| 4884 | + { | |
| 4885 | + "passes": 56, | |
| 4886 | + "val_top1": 0.792388916015625, | |
| 4887 | + "val_nll": 0.9971700608730316, | |
| 4888 | + "t": 22.022053003311157 | |
| 4889 | + }, | |
| 4890 | + { | |
| 4891 | + "passes": 57, | |
| 4892 | + "val_top1": 0.79278564453125, | |
| 4893 | + "val_nll": 0.9926368296146393, | |
| 4894 | + "t": 22.451666831970215 | |
| 4895 | + }, | |
| 4896 | + { | |
| 4897 | + "passes": 58, | |
| 4898 | + "val_top1": 0.793121337890625, | |
| 4899 | + "val_nll": 0.9882131516933441, | |
| 4900 | + "t": 22.928210973739624 | |
| 4901 | + }, | |
| 4902 | + { | |
| 4903 | + "passes": 59, | |
| 4904 | + "val_top1": 0.793670654296875, | |
| 4905 | + "val_nll": 0.9838951528072357, | |
| 4906 | + "t": 23.385522842407227 | |
| 4907 | + }, | |
| 4908 | + { | |
| 4909 | + "passes": 60, | |
| 4910 | + "val_top1": 0.794219970703125, | |
| 4911 | + "val_nll": 0.9796793460845947, | |
| 4912 | + "t": 23.915285110473633 | |
| 4913 | + }, | |
| 4914 | + { | |
| 4915 | + "passes": 61, | |
| 4916 | + "val_top1": 0.794403076171875, | |
| 4917 | + "val_nll": 0.9755622744560242, | |
| 4918 | + "t": 24.23824143409729 | |
| 4919 | + }, | |
| 4920 | + { | |
| 4921 | + "passes": 62, | |
| 4922 | + "val_top1": 0.794830322265625, | |
| 4923 | + "val_nll": 0.9715406894683838, | |
| 4924 | + "t": 24.659504413604736 | |
| 4925 | + }, | |
| 4926 | + { | |
| 4927 | + "passes": 63, | |
| 4928 | + "val_top1": 0.79534912109375, | |
| 4929 | + "val_nll": 0.9676113128662109, | |
| 4930 | + "t": 25.124927759170532 | |
| 4931 | + }, | |
| 4932 | + { | |
| 4933 | + "passes": 64, | |
| 4934 | + "val_top1": 0.795654296875, | |
| 4935 | + "val_nll": 0.9637711942195892, | |
| 4936 | + "t": 25.59023642539978 | |
| 4937 | + }, | |
| 4938 | + { | |
| 4939 | + "passes": 65, | |
| 4940 | + "val_top1": 0.7962646484375, | |
| 4941 | + "val_nll": 0.9600175619125366, | |
| 4942 | + "t": 26.14732575416565 | |
| 4943 | + }, | |
| 4944 | + { | |
| 4945 | + "passes": 66, | |
| 4946 | + "val_top1": 0.796295166015625, | |
| 4947 | + "val_nll": 0.9563476145267487, | |
| 4948 | + "t": 26.73953890800476 | |
| 4949 | + }, | |
| 4950 | + { | |
| 4951 | + "passes": 67, | |
| 4952 | + "val_top1": 0.796783447265625, | |
| 4953 | + "val_nll": 0.9527587294578552, | |
| 4954 | + "t": 27.335139274597168 | |
| 4955 | + }, | |
| 4956 | + { | |
| 4957 | + "passes": 68, | |
| 4958 | + "val_top1": 0.79718017578125, | |
| 4959 | + "val_nll": 0.9492482244968414, | |
| 4960 | + "t": 27.925781726837158 | |
| 4961 | + }, | |
| 4962 | + { | |
| 4963 | + "passes": 69, | |
| 4964 | + "val_top1": 0.797515869140625, | |
| 4965 | + "val_nll": 0.9458138644695282, | |
| 4966 | + "t": 28.53115224838257 | |
| 4967 | + }, | |
| 4968 | + { | |
| 4969 | + "passes": 70, | |
| 4970 | + "val_top1": 0.797882080078125, | |
| 4971 | + "val_nll": 0.9424532949924469, | |
| 4972 | + "t": 29.119372367858887 | |
| 4973 | + }, | |
| 4974 | + { | |
| 4975 | + "passes": 71, | |
| 4976 | + "val_top1": 0.798004150390625, | |
| 4977 | + "val_nll": 0.9391642212867737, | |
| 4978 | + "t": 29.703900814056396 | |
| 4979 | + }, | |
| 4980 | + { | |
| 4981 | + "passes": 72, | |
| 4982 | + "val_top1": 0.79833984375, | |
| 4983 | + "val_nll": 0.9359445571899414, | |
| 4984 | + "t": 30.115262746810913 | |
| 4985 | + }, | |
| 4986 | + { | |
| 4987 | + "passes": 73, | |
| 4988 | + "val_top1": 0.798675537109375, | |
| 4989 | + "val_nll": 0.9327922165393829, | |
| 4990 | + "t": 30.490920066833496 | |
| 4991 | + }, | |
| 4992 | + { | |
| 4993 | + "passes": 74, | |
| 4994 | + "val_top1": 0.799041748046875, | |
| 4995 | + "val_nll": 0.9297051727771759, | |
| 4996 | + "t": 30.84970760345459 | |
| 4997 | + }, | |
| 4998 | + { | |
| 4999 | + "passes": 75, | |
| 5000 | + "val_top1": 0.7994384765625, | |
| 5001 | + "val_nll": 0.926681637763977, | |
| 5002 | + "t": 31.292900562286377 | |
| 5003 | + }, | |
| 5004 | + { | |
| 5005 | + "passes": 76, | |
| 5006 | + "val_top1": 0.799530029296875, | |
| 5007 | + "val_nll": 0.9237198233604431, | |
| 5008 | + "t": 31.675628423690796 | |
| 5009 | + }, | |
| 5010 | + { | |
| 5011 | + "passes": 77, | |
| 5012 | + "val_top1": 0.79998779296875, | |
| 5013 | + "val_nll": 0.9208177626132965, | |
| 5014 | + "t": 32.061312198638916 | |
| 5015 | + }, | |
| 5016 | + { | |
| 5017 | + "passes": 78, | |
| 5018 | + "val_top1": 0.80035400390625, | |
| 5019 | + "val_nll": 0.9179739356040955, | |
| 5020 | + "t": 32.406317949295044 | |
| 5021 | + }, | |
| 5022 | + { | |
| 5023 | + "passes": 79, | |
| 5024 | + "val_top1": 0.800628662109375, | |
| 5025 | + "val_nll": 0.9151867032051086, | |
| 5026 | + "t": 32.96424984931946 | |
| 5027 | + }, | |
| 5028 | + { | |
| 5029 | + "passes": 80, | |
| 5030 | + "val_top1": 0.800811767578125, | |
| 5031 | + "val_nll": 0.9124543964862823, | |
| 5032 | + "t": 33.40139818191528 | |
| 5033 | + }, | |
| 5034 | + { | |
| 5035 | + "passes": 81, | |
| 5036 | + "val_top1": 0.800994873046875, | |
| 5037 | + "val_nll": 0.9097756147384644, | |
| 5038 | + "t": 33.87593173980713 | |
| 5039 | + }, | |
| 5040 | + { | |
| 5041 | + "passes": 82, | |
| 5042 | + "val_top1": 0.8013916015625, | |
| 5043 | + "val_nll": 0.9071488380432129, | |
| 5044 | + "t": 34.22423195838928 | |
| 5045 | + }, | |
| 5046 | + { | |
| 5047 | + "passes": 83, | |
| 5048 | + "val_top1": 0.80169677734375, | |
| 5049 | + "val_nll": 0.9045726656913757, | |
| 5050 | + "t": 34.582319498062134 | |
| 5051 | + }, | |
| 5052 | + { | |
| 5053 | + "passes": 84, | |
| 5054 | + "val_top1": 0.802032470703125, | |
| 5055 | + "val_nll": 0.9020457863807678, | |
| 5056 | + "t": 34.938427209854126 | |
| 5057 | + }, | |
| 5058 | + { | |
| 5059 | + "passes": 85, | |
| 5060 | + "val_top1": 0.802398681640625, | |
| 5061 | + "val_nll": 0.8995668292045593, | |
| 5062 | + "t": 35.30117630958557 | |
| 5063 | + }, | |
| 5064 | + { | |
| 5065 | + "passes": 86, | |
| 5066 | + "val_top1": 0.802520751953125, | |
| 5067 | + "val_nll": 0.89713454246521, | |
| 5068 | + "t": 35.654688119888306 | |
| 5069 | + }, | |
| 5070 | + { | |
| 5071 | + "passes": 87, | |
| 5072 | + "val_top1": 0.802581787109375, | |
| 5073 | + "val_nll": 0.894747793674469, | |
| 5074 | + "t": 35.99826145172119 | |
| 5075 | + }, | |
| 5076 | + { | |
| 5077 | + "passes": 88, | |
| 5078 | + "val_top1": 0.80279541015625, | |
| 5079 | + "val_nll": 0.8924053311347961, | |
| 5080 | + "t": 36.3412561416626 | |
| 5081 | + }, | |
| 5082 | + { | |
| 5083 | + "passes": 89, | |
| 5084 | + "val_top1": 0.803070068359375, | |
| 5085 | + "val_nll": 0.8901060223579407, | |
| 5086 | + "t": 36.772140979766846 | |
| 5087 | + }, | |
| 5088 | + { | |
| 5089 | + "passes": 90, | |
| 5090 | + "val_top1": 0.803253173828125, | |
| 5091 | + "val_nll": 0.8878487944602966, | |
| 5092 | + "t": 37.20362710952759 | |
| 5093 | + }, | |
| 5094 | + { | |
| 5095 | + "passes": 91, | |
| 5096 | + "val_top1": 0.80340576171875, | |
| 5097 | + "val_nll": 0.8856325745582581, | |
| 5098 | + "t": 37.63703989982605 | |
| 5099 | + }, | |
| 5100 | + { | |
| 5101 | + "passes": 92, | |
| 5102 | + "val_top1": 0.80352783203125, | |
| 5103 | + "val_nll": 0.8834563195705414, | |
| 5104 | + "t": 38.09126663208008 | |
| 5105 | + }, | |
| 5106 | + { | |
| 5107 | + "passes": 93, | |
| 5108 | + "val_top1": 0.803497314453125, | |
| 5109 | + "val_nll": 0.8813191056251526, | |
| 5110 | + "t": 38.49927091598511 | |
| 5111 | + }, | |
| 5112 | + { | |
| 5113 | + "passes": 94, | |
| 5114 | + "val_top1": 0.803619384765625, | |
| 5115 | + "val_nll": 0.8792198598384857, | |
| 5116 | + "t": 38.857909202575684 | |
| 5117 | + }, | |
| 5118 | + { | |
| 5119 | + "passes": 95, | |
| 5120 | + "val_top1": 0.803741455078125, | |
| 5121 | + "val_nll": 0.8771578073501587, | |
| 5122 | + "t": 39.238258838653564 | |
| 5123 | + }, | |
| 5124 | + { | |
| 5125 | + "passes": 96, | |
| 5126 | + "val_top1": 0.803741455078125, | |
| 5127 | + "val_nll": 0.8751318454742432, | |
| 5128 | + "t": 39.6103720664978 | |
| 5129 | + }, | |
| 5130 | + { | |
| 5131 | + "passes": 97, | |
| 5132 | + "val_top1": 0.803863525390625, | |
| 5133 | + "val_nll": 0.8731412589550018, | |
| 5134 | + "t": 39.976996421813965 | |
| 5135 | + }, | |
| 5136 | + { | |
| 5137 | + "passes": 98, | |
| 5138 | + "val_top1": 0.8040771484375, | |
| 5139 | + "val_nll": 0.8711851835250854, | |
| 5140 | + "t": 40.379446506500244 | |
| 5141 | + }, | |
| 5142 | + { | |
| 5143 | + "passes": 99, | |
| 5144 | + "val_top1": 0.804290771484375, | |
| 5145 | + "val_nll": 0.8692628145217896, | |
| 5146 | + "t": 40.74845862388611 | |
| 5147 | + }, | |
| 5148 | + { | |
| 5149 | + "passes": 100, | |
| 5150 | + "val_top1": 0.80462646484375, | |
| 5151 | + "val_nll": 0.8673732578754425, | |
| 5152 | + "t": 41.10993981361389 | |
| 5153 | + } | |
| 5154 | + ], | |
| 5155 | + "reach": {} | |
| 5156 | + } | |
| 5157 | + }, | |
| 5158 | + "val": { | |
| 5159 | + "top1": 0.80535888671875, | |
| 5160 | + "nll": 0.8621684610843658 | |
| 5161 | + }, | |
| 5162 | + "test": { | |
| 5163 | + "top1": 0.741058349609375, | |
| 5164 | + "nll": 1.2157341837882996 | |
| 5165 | + }, | |
| 5166 | + "reach": {} | |
| 5167 | + }, | |
| 5168 | + "ridge_B": { | |
| 5169 | + "lambda": 0.01, | |
| 5170 | + "val": { | |
| 5171 | + "auc": 0.9994366765022278, | |
| 5172 | + "bal_acc": 0.9896849989891052, | |
| 5173 | + "nll": 0.48664578795433044 | |
| 5174 | + }, | |
| 5175 | + "test": { | |
| 5176 | + "auc": 0.9988659024238586, | |
| 5177 | + "bal_acc": 0.9852329194545746, | |
| 5178 | + "nll": 0.4893731474876404 | |
| 5179 | + }, | |
| 5180 | + "note": "AUC and balanced accuracy only; ridge outputs are not log-odds, NLL is not meaningful" | |
| 5181 | + }, | |
| 5182 | + "irls_newton_B": { | |
| 5183 | + "lambda": 0.001, | |
| 5184 | + "steps": 12, | |
| 5185 | + "hist": [ | |
| 5186 | + { | |
| 5187 | + "step": 1, | |
| 5188 | + "grad_norm": 10.371554300332903, | |
| 5189 | + "step_norm": 0.8582114202983903 | |
| 5190 | + }, | |
| 5191 | + { | |
| 5192 | + "step": 2, | |
| 5193 | + "grad_norm": 2.517500762922126, | |
| 5194 | + "step_norm": 0.4725794244142267 | |
| 5195 | + }, | |
| 5196 | + { | |
| 5197 | + "step": 3, | |
| 5198 | + "grad_norm": 0.8945498569359184, | |
| 5199 | + "step_norm": 0.47308697743776335 | |
| 5200 | + }, | |
| 5201 | + { | |
| 5202 | + "step": 4, | |
| 5203 | + "grad_norm": 0.3314311750710903, | |
| 5204 | + "step_norm": 0.4744658240546774 | |
| 5205 | + }, | |
| 5206 | + { | |
| 5207 | + "step": 5, | |
| 5208 | + "grad_norm": 0.12567206350692006, | |
| 5209 | + "step_norm": 0.48024967253349915 | |
| 5210 | + }, | |
| 5211 | + { | |
| 5212 | + "step": 6, | |
| 5213 | + "grad_norm": 0.04838621227604825, | |
| 5214 | + "step_norm": 0.41773880805376046 | |
| 5215 | + }, | |
| 5216 | + { | |
| 5217 | + "step": 7, | |
| 5218 | + "grad_norm": 0.018237943429808383, | |
| 5219 | + "step_norm": 0.2775090987210407 | |
| 5220 | + }, | |
| 5221 | + { | |
| 5222 | + "step": 8, | |
| 5223 | + "grad_norm": 0.0059369187333816915, | |
| 5224 | + "step_norm": 0.12848027468307474 | |
| 5225 | + }, | |
| 5226 | + { | |
| 5227 | + "step": 9, | |
| 5228 | + "grad_norm": 0.0012289390404406908, | |
| 5229 | + "step_norm": 0.03616482151088371 | |
| 5230 | + }, | |
| 5231 | + { | |
| 5232 | + "step": 10, | |
| 5233 | + "grad_norm": 8.480076478608467e-05, | |
| 5234 | + "step_norm": 0.0029765901656176267 | |
| 5235 | + }, | |
| 5236 | + { | |
| 5237 | + "step": 11, | |
| 5238 | + "grad_norm": 5.072122041866689e-07, | |
| 5239 | + "step_norm": 2.0230670623909826e-05 | |
| 5240 | + }, | |
| 5241 | + { | |
| 5242 | + "step": 12, | |
| 5243 | + "grad_norm": 9.730615665645342e-09, | |
| 5244 | + "step_norm": 2.4042336367261116e-06 | |
| 5245 | + } | |
| 5246 | + ], | |
| 5247 | + "val": { | |
| 5248 | + "auc": 0.9997290968894958, | |
| 5249 | + "bal_acc": 0.9911797642707825, | |
| 5250 | + "nll": 0.018428625538945198 | |
| 5251 | + }, | |
| 5252 | + "test": { | |
| 5253 | + "auc": 0.9990363121032715, | |
| 5254 | + "bal_acc": 0.9869247376918793, | |
| 5255 | + "nll": 0.030377637594938278 | |
| 5256 | + } | |
| 5257 | + }, | |
| 5258 | + "adamw_bce_B": { | |
| 5259 | + "lr": 0.003, | |
| 5260 | + "epochs": 10, | |
| 5261 | + "val": { | |
| 5262 | + "auc": 0.9997110962867737, | |
| 5263 | + "bal_acc": 0.9913354814052582, | |
| 5264 | + "nll": 0.01890539564192295 | |
| 5265 | + }, | |
| 5266 | + "test": { | |
| 5267 | + "auc": 0.9989434480667114, | |
| 5268 | + "bal_acc": 0.9869814813137054, | |
| 5269 | + "nll": 0.03187776356935501 | |
| 5270 | + } | |
| 5271 | + }, | |
| 5272 | + "peak_gpu_bytes": 13198016512, | |
| 5273 | + "X_fit_bytes_fp32": 2148532224 | |
| 5274 | +} | |
| \ No newline at end of file |
evidence/math-training/e1-time.json
| new file mode 100644 | ||
| @@ -0,0 +1,174 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "e2217f03be0c2e3dfb1df637f9557be902aacc5c", | |
| 8 | + "code_dirty": false, | |
| 9 | + "command": ".venv/bin/python e1.py time", | |
| 10 | + "utc": "2026-10-20T19:23:00Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "target_val_top1": { | |
| 14 | + "ridge_quality": 0.712188720703125, | |
| 15 | + "best_ce_minus_0.5": 0.81268798828125 | |
| 16 | + }, | |
| 17 | + "repeats": [ | |
| 18 | + { | |
| 19 | + "ridge_gram_pass": 0.516312837600708, | |
| 20 | + "ridge_solve": 0.35632801055908203, | |
| 21 | + "ridge_total": 0.87264084815979, | |
| 22 | + "ridge_peak_gpu_bytes": 3718882304, | |
| 23 | + "adamw_ce": { | |
| 24 | + "reach": { | |
| 25 | + "ridge_quality": { | |
| 26 | + "epoch": 1, | |
| 27 | + "passes": 1, | |
| 28 | + "t": 0.4020500183105469 | |
| 29 | + }, | |
| 30 | + "best_ce_minus_0.5": { | |
| 31 | + "epoch": 3, | |
| 32 | + "passes": 3, | |
| 33 | + "t": 1.0197796821594238 | |
| 34 | + } | |
| 35 | + }, | |
| 36 | + "total": 1.0208752155303955, | |
| 37 | + "peak_gpu_bytes": 3679215616 | |
| 38 | + }, | |
| 39 | + "adamw_mse": { | |
| 40 | + "reach": {}, | |
| 41 | + "total": 10.292843103408813, | |
| 42 | + "peak_gpu_bytes": 3679215616 | |
| 43 | + }, | |
| 44 | + "lbfgs_ce": { | |
| 45 | + "reach": { | |
| 46 | + "ridge_quality": { | |
| 47 | + "passes": 45, | |
| 48 | + "t": 10.63459825515747 | |
| 49 | + }, | |
| 50 | + "best_ce_minus_0.5": { | |
| 51 | + "passes": 193, | |
| 52 | + "t": 45.60171604156494 | |
| 53 | + } | |
| 54 | + }, | |
| 55 | + "total": 45.60191869735718, | |
| 56 | + "peak_gpu_bytes": 4130725888 | |
| 57 | + }, | |
| 58 | + "bohning_warm": { | |
| 59 | + "reach": { | |
| 60 | + "ridge_quality": { | |
| 61 | + "passes": 1, | |
| 62 | + "t": 0.30106472969055176 | |
| 63 | + } | |
| 64 | + }, | |
| 65 | + "total": 30.08704161643982, | |
| 66 | + "peak_gpu_bytes": 3761029632 | |
| 67 | + } | |
| 68 | + }, | |
| 69 | + { | |
| 70 | + "ridge_gram_pass": 0.33038759231567383, | |
| 71 | + "ridge_solve": 0.04432535171508789, | |
| 72 | + "ridge_total": 0.3747129440307617, | |
| 73 | + "ridge_peak_gpu_bytes": 3811260928, | |
| 74 | + "adamw_ce": { | |
| 75 | + "reach": { | |
| 76 | + "ridge_quality": { | |
| 77 | + "epoch": 1, | |
| 78 | + "passes": 1, | |
| 79 | + "t": 0.33089733123779297 | |
| 80 | + }, | |
| 81 | + "best_ce_minus_0.5": { | |
| 82 | + "epoch": 3, | |
| 83 | + "passes": 3, | |
| 84 | + "t": 0.9435324668884277 | |
| 85 | + } | |
| 86 | + }, | |
| 87 | + "total": 0.9439282417297363, | |
| 88 | + "peak_gpu_bytes": 3679232000 | |
| 89 | + }, | |
| 90 | + "adamw_mse": { | |
| 91 | + "reach": {}, | |
| 92 | + "total": 10.474548578262329, | |
| 93 | + "peak_gpu_bytes": 3679232000 | |
| 94 | + }, | |
| 95 | + "lbfgs_ce": { | |
| 96 | + "reach": { | |
| 97 | + "ridge_quality": { | |
| 98 | + "passes": 45, | |
| 99 | + "t": 11.001100063323975 | |
| 100 | + }, | |
| 101 | + "best_ce_minus_0.5": { | |
| 102 | + "passes": 193, | |
| 103 | + "t": 47.38723349571228 | |
| 104 | + } | |
| 105 | + }, | |
| 106 | + "total": 47.3874135017395, | |
| 107 | + "peak_gpu_bytes": 4130725888 | |
| 108 | + }, | |
| 109 | + "bohning_warm": { | |
| 110 | + "reach": { | |
| 111 | + "ridge_quality": { | |
| 112 | + "passes": 1, | |
| 113 | + "t": 0.3129692077636719 | |
| 114 | + } | |
| 115 | + }, | |
| 116 | + "total": 30.442291736602783, | |
| 117 | + "peak_gpu_bytes": 3761029632 | |
| 118 | + } | |
| 119 | + }, | |
| 120 | + { | |
| 121 | + "ridge_gram_pass": 0.2820768356323242, | |
| 122 | + "ridge_solve": 0.042493581771850586, | |
| 123 | + "ridge_total": 0.3245704174041748, | |
| 124 | + "ridge_peak_gpu_bytes": 3811260928, | |
| 125 | + "adamw_ce": { | |
| 126 | + "reach": { | |
| 127 | + "ridge_quality": { | |
| 128 | + "epoch": 1, | |
| 129 | + "passes": 1, | |
| 130 | + "t": 0.30312037467956543 | |
| 131 | + }, | |
| 132 | + "best_ce_minus_0.5": { | |
| 133 | + "epoch": 3, | |
| 134 | + "passes": 3, | |
| 135 | + "t": 0.9192757606506348 | |
| 136 | + } | |
| 137 | + }, | |
| 138 | + "total": 0.9195609092712402, | |
| 139 | + "peak_gpu_bytes": 3679232000 | |
| 140 | + }, | |
| 141 | + "adamw_mse": { | |
| 142 | + "reach": {}, | |
| 143 | + "total": 10.378367185592651, | |
| 144 | + "peak_gpu_bytes": 3679232000 | |
| 145 | + }, | |
| 146 | + "lbfgs_ce": { | |
| 147 | + "reach": { | |
| 148 | + "ridge_quality": { | |
| 149 | + "passes": 45, | |
| 150 | + "t": 10.641895532608032 | |
| 151 | + }, | |
| 152 | + "best_ce_minus_0.5": { | |
| 153 | + "passes": 193, | |
| 154 | + "t": 46.00484538078308 | |
| 155 | + } | |
| 156 | + }, | |
| 157 | + "total": 46.005011320114136, | |
| 158 | + "peak_gpu_bytes": 4130725888 | |
| 159 | + }, | |
| 160 | + "bohning_warm": { | |
| 161 | + "reach": { | |
| 162 | + "ridge_quality": { | |
| 163 | + "passes": 1, | |
| 164 | + "t": 0.305103063583374 | |
| 165 | + } | |
| 166 | + }, | |
| 167 | + "total": 30.139273166656494, | |
| 168 | + "peak_gpu_bytes": 3761029632 | |
| 169 | + } | |
| 170 | + } | |
| 171 | + ], | |
| 172 | + "note": "times include per-epoch/per-step val evaluation for the iterative methods; ridge has none", | |
| 173 | + "X_fit_bytes_fp32": 2148532224 | |
| 174 | +} | |
| \ No newline at end of file |
evidence/math-training/e2-check.json
| new file mode 100644 | ||
| @@ -0,0 +1,19 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "e416c649f48100b494c6b2e668eb2b0ece4c5164", | |
| 8 | + "code_dirty": true, | |
| 9 | + "command": ".venv/bin/python e2.py check", | |
| 10 | + "utc": "2026-10-20T19:07:01Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "fourier_forward_rel_err": 0.0, | |
| 14 | + "fourier_grad_x_rel_err": 0.0, | |
| 15 | + "fourier_grad_c_rel_err": 1.3046094693436316e-07, | |
| 16 | + "phm_structured_vs_dense_rel_err": 1.2523192083335744e-07, | |
| 17 | + "phm_dense_rank": 48, | |
| 18 | + "phm_rank_bound_n_squared_times_r": 48 | |
| 19 | +} | |
| \ No newline at end of file |
evidence/math-training/e2-time.json
| new file mode 100644 | ||
| @@ -0,0 +1,96 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "8fd40e8d9b50753b931a1a352d39c6377a42ba2f", | |
| 8 | + "code_dirty": false, | |
| 9 | + "command": ".venv/bin/python e2.py time", | |
| 10 | + "utc": "2026-10-21T01:39:40Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "note": "batch 4 x up to 256 tokens, one optimizer step per timed step; 'none' = forward only, frozen", | |
| 14 | + "repeats": { | |
| 15 | + "none": [ | |
| 16 | + { | |
| 17 | + "step_s_median_after_warmup": 0.05374741554260254, | |
| 18 | + "peak_gpu_bytes": 3747109376, | |
| 19 | + "trainable": 0, | |
| 20 | + "tokens_per_step": 566 | |
| 21 | + }, | |
| 22 | + { | |
| 23 | + "step_s_median_after_warmup": 0.053975820541381836, | |
| 24 | + "peak_gpu_bytes": 3747109376, | |
| 25 | + "trainable": 0, | |
| 26 | + "tokens_per_step": 566 | |
| 27 | + }, | |
| 28 | + { | |
| 29 | + "step_s_median_after_warmup": 0.053768157958984375, | |
| 30 | + "peak_gpu_bytes": 3747109376, | |
| 31 | + "trainable": 0, | |
| 32 | + "tokens_per_step": 566 | |
| 33 | + } | |
| 34 | + ], | |
| 35 | + "lora": [ | |
| 36 | + { | |
| 37 | + "step_s_median_after_warmup": 0.18573665618896484, | |
| 38 | + "peak_gpu_bytes": 5875804672, | |
| 39 | + "trainable": 9043968, | |
| 40 | + "tokens_per_step": 566 | |
| 41 | + }, | |
| 42 | + { | |
| 43 | + "step_s_median_after_warmup": 0.18805670738220215, | |
| 44 | + "peak_gpu_bytes": 5876066816, | |
| 45 | + "trainable": 9043968, | |
| 46 | + "tokens_per_step": 566 | |
| 47 | + }, | |
| 48 | + { | |
| 49 | + "step_s_median_after_warmup": 0.18674111366271973, | |
| 50 | + "peak_gpu_bytes": 5876066816, | |
| 51 | + "trainable": 9043968, | |
| 52 | + "tokens_per_step": 566 | |
| 53 | + } | |
| 54 | + ], | |
| 55 | + "phm": [ | |
| 56 | + { | |
| 57 | + "step_s_median_after_warmup": 0.2072763442993164, | |
| 58 | + "peak_gpu_bytes": 5939497472, | |
| 59 | + "trainable": 9045504, | |
| 60 | + "tokens_per_step": 566 | |
| 61 | + }, | |
| 62 | + { | |
| 63 | + "step_s_median_after_warmup": 0.20131397247314453, | |
| 64 | + "peak_gpu_bytes": 5939497472, | |
| 65 | + "trainable": 9045504, | |
| 66 | + "tokens_per_step": 566 | |
| 67 | + }, | |
| 68 | + { | |
| 69 | + "step_s_median_after_warmup": 0.20836615562438965, | |
| 70 | + "peak_gpu_bytes": 5939497472, | |
| 71 | + "trainable": 9045504, | |
| 72 | + "tokens_per_step": 566 | |
| 73 | + } | |
| 74 | + ], | |
| 75 | + "fourier": [ | |
| 76 | + { | |
| 77 | + "step_s_median_after_warmup": 1.829050064086914, | |
| 78 | + "peak_gpu_bytes": 6117921280, | |
| 79 | + "trainable": 9043968, | |
| 80 | + "tokens_per_step": 566 | |
| 81 | + }, | |
| 82 | + { | |
| 83 | + "step_s_median_after_warmup": 1.8351824283599854, | |
| 84 | + "peak_gpu_bytes": 6117921280, | |
| 85 | + "trainable": 9043968, | |
| 86 | + "tokens_per_step": 566 | |
| 87 | + }, | |
| 88 | + { | |
| 89 | + "step_s_median_after_warmup": 1.827620029449463, | |
| 90 | + "peak_gpu_bytes": 6117921280, | |
| 91 | + "trainable": 9043968, | |
| 92 | + "tokens_per_step": 566 | |
| 93 | + } | |
| 94 | + ] | |
| 95 | + } | |
| 96 | +} | |
| \ No newline at end of file |
evidence/math-training/e2-train-fourier-0.0001-0.json
| new file mode 100644 | ||
| @@ -0,0 +1,63 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "bc276319c60429927f145b4d39ab2581771c2c88", | |
| 8 | + "code_dirty": false, | |
| 9 | + "command": ".venv/bin/python e2.py train fourier 1e-4 0", | |
| 10 | + "utc": "2026-10-20T23:58:21Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "method": "fourier", | |
| 14 | + "lr": 0.0001, | |
| 15 | + "seed": 0, | |
| 16 | + "steps": 300, | |
| 17 | + "batch": 8, | |
| 18 | + "trainable_params": 9043968, | |
| 19 | + "val_nll_frozen": 0.5346099340729554, | |
| 20 | + "curve": [ | |
| 21 | + { | |
| 22 | + "step": 50, | |
| 23 | + "train_nll": 0.4484556705579845, | |
| 24 | + "val_nll": 0.4113345407251975, | |
| 25 | + "t": 239.93383955955505 | |
| 26 | + }, | |
| 27 | + { | |
| 28 | + "step": 100, | |
| 29 | + "train_nll": 0.27055372718636317, | |
| 30 | + "val_nll": 0.4060700329635223, | |
| 31 | + "t": 465.93740129470825 | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "step": 150, | |
| 35 | + "train_nll": 0.4312992352750631, | |
| 36 | + "val_nll": 0.4040842321459689, | |
| 37 | + "t": 708.5319628715515 | |
| 38 | + }, | |
| 39 | + { | |
| 40 | + "step": 200, | |
| 41 | + "train_nll": 0.3042254453716856, | |
| 42 | + "val_nll": 0.4001161977775035, | |
| 43 | + "t": 950.2624697685242 | |
| 44 | + }, | |
| 45 | + { | |
| 46 | + "step": 250, | |
| 47 | + "train_nll": 0.4094652607493157, | |
| 48 | + "val_nll": 0.3987666991279914, | |
| 49 | + "t": 1205.5328698158264 | |
| 50 | + }, | |
| 51 | + { | |
| 52 | + "step": 300, | |
| 53 | + "train_nll": 0.4219691136500219, | |
| 54 | + "val_nll": 0.396477918433434, | |
| 55 | + "t": 1468.8469433784485 | |
| 56 | + } | |
| 57 | + ], | |
| 58 | + "val_nll": 0.396477918433434, | |
| 59 | + "test_nll": 0.4462970060499021, | |
| 60 | + "test_nll_frozen": 0.5882042940487741, | |
| 61 | + "peak_gpu_bytes": 6827453952, | |
| 62 | + "seconds_unlocked": 1503.1183841228485 | |
| 63 | +} | |
| \ No newline at end of file |
evidence/math-training/e2-train-fourier-0.0001-1.json
| new file mode 100644 | ||
| @@ -0,0 +1,63 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "bc276319c60429927f145b4d39ab2581771c2c88", | |
| 8 | + "code_dirty": false, | |
| 9 | + "command": ".venv/bin/python e2.py train fourier 0.0001 1", | |
| 10 | + "utc": "2026-10-21T01:06:34Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "method": "fourier", | |
| 14 | + "lr": 0.0001, | |
| 15 | + "seed": 1, | |
| 16 | + "steps": 300, | |
| 17 | + "batch": 8, | |
| 18 | + "trainable_params": 9043968, | |
| 19 | + "val_nll_frozen": 0.5346099340729554, | |
| 20 | + "curve": [ | |
| 21 | + { | |
| 22 | + "step": 50, | |
| 23 | + "train_nll": 0.3066893302247115, | |
| 24 | + "val_nll": 0.4118188031845376, | |
| 25 | + "t": 239.52157473564148 | |
| 26 | + }, | |
| 27 | + { | |
| 28 | + "step": 100, | |
| 29 | + "train_nll": 0.5606917849012242, | |
| 30 | + "val_nll": 0.4056274790710676, | |
| 31 | + "t": 521.6297812461853 | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "step": 150, | |
| 35 | + "train_nll": 0.48227966369812564, | |
| 36 | + "val_nll": 0.4004537734701731, | |
| 37 | + "t": 756.6830122470856 | |
| 38 | + }, | |
| 39 | + { | |
| 40 | + "step": 200, | |
| 41 | + "train_nll": 0.4722475002612575, | |
| 42 | + "val_nll": 0.39778335469185644, | |
| 43 | + "t": 1015.7681112289429 | |
| 44 | + }, | |
| 45 | + { | |
| 46 | + "step": 250, | |
| 47 | + "train_nll": 0.3129810831162079, | |
| 48 | + "val_nll": 0.3965707485950569, | |
| 49 | + "t": 1246.510652065277 | |
| 50 | + }, | |
| 51 | + { | |
| 52 | + "step": 300, | |
| 53 | + "train_nll": 0.3376809216420585, | |
| 54 | + "val_nll": 0.39745024023800535, | |
| 55 | + "t": 1478.1094892024994 | |
| 56 | + } | |
| 57 | + ], | |
| 58 | + "val_nll": 0.39745024023800535, | |
| 59 | + "test_nll": 0.4510017951467503, | |
| 60 | + "test_nll_frozen": 0.5882042940487741, | |
| 61 | + "peak_gpu_bytes": 6826733056, | |
| 62 | + "seconds_unlocked": 1509.4302780628204 | |
| 63 | +} | |
| \ No newline at end of file |
evidence/math-training/e2-train-fourier-0.001-0.json
| new file mode 100644 | ||
| @@ -0,0 +1,63 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "bc276319c60429927f145b4d39ab2581771c2c88", | |
| 8 | + "code_dirty": false, | |
| 9 | + "command": ".venv/bin/python e2.py train fourier 1e-3 0", | |
| 10 | + "utc": "2026-10-21T00:27:20Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "method": "fourier", | |
| 14 | + "lr": 0.001, | |
| 15 | + "seed": 0, | |
| 16 | + "steps": 300, | |
| 17 | + "batch": 8, | |
| 18 | + "trainable_params": 9043968, | |
| 19 | + "val_nll_frozen": 0.5346099340729554, | |
| 20 | + "curve": [ | |
| 21 | + { | |
| 22 | + "step": 50, | |
| 23 | + "train_nll": 0.5351048140819544, | |
| 24 | + "val_nll": 0.5404006066304601, | |
| 25 | + "t": 255.3403389453888 | |
| 26 | + }, | |
| 27 | + { | |
| 28 | + "step": 100, | |
| 29 | + "train_nll": 0.40149387330499314, | |
| 30 | + "val_nll": 0.5239220138606528, | |
| 31 | + "t": 519.9554395675659 | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "step": 150, | |
| 35 | + "train_nll": 0.5475285879109452, | |
| 36 | + "val_nll": 0.5147194751611873, | |
| 37 | + "t": 800.3388020992279 | |
| 38 | + }, | |
| 39 | + { | |
| 40 | + "step": 200, | |
| 41 | + "train_nll": 0.38064749053030306, | |
| 42 | + "val_nll": 0.49656254492550533, | |
| 43 | + "t": 1050.6621079444885 | |
| 44 | + }, | |
| 45 | + { | |
| 46 | + "step": 250, | |
| 47 | + "train_nll": 0.5236953082994574, | |
| 48 | + "val_nll": 0.495010036993204, | |
| 49 | + "t": 1307.6025245189667 | |
| 50 | + }, | |
| 51 | + { | |
| 52 | + "step": 300, | |
| 53 | + "train_nll": 0.5005342862703702, | |
| 54 | + "val_nll": 0.5013920839444412, | |
| 55 | + "t": 1552.7264008522034 | |
| 56 | + } | |
| 57 | + ], | |
| 58 | + "val_nll": 0.5013920839444412, | |
| 59 | + "test_nll": 0.5187092910219055, | |
| 60 | + "test_nll_frozen": 0.5882042940487741, | |
| 61 | + "peak_gpu_bytes": 6827453952, | |
| 62 | + "seconds_unlocked": 1586.0252776145935 | |
| 63 | +} | |
| \ No newline at end of file |
evidence/math-training/e2-train-fourier-1e-05-0.json
| new file mode 100644 | ||
| @@ -0,0 +1,63 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "4cc51b8b22b5462984f4a3c8f68baf41486120f4", | |
| 8 | + "code_dirty": true, | |
| 9 | + "command": ".venv/bin/python e2.py train fourier 1e-5 0", | |
| 10 | + "utc": "2026-10-20T21:54:50Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "method": "fourier", | |
| 14 | + "lr": 1e-05, | |
| 15 | + "seed": 0, | |
| 16 | + "steps": 300, | |
| 17 | + "batch": 8, | |
| 18 | + "trainable_params": 9043968, | |
| 19 | + "val_nll_frozen": 0.5346099340729554, | |
| 20 | + "curve": [ | |
| 21 | + { | |
| 22 | + "step": 50, | |
| 23 | + "train_nll": 0.4550790949230269, | |
| 24 | + "val_nll": 0.42329790238731413, | |
| 25 | + "t": 229.91461849212646 | |
| 26 | + }, | |
| 27 | + { | |
| 28 | + "step": 100, | |
| 29 | + "train_nll": 0.27328304844048185, | |
| 30 | + "val_nll": 0.41389862627788104, | |
| 31 | + "t": 460.56278681755066 | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "step": 150, | |
| 35 | + "train_nll": 0.4335326774905332, | |
| 36 | + "val_nll": 0.40969247357109667, | |
| 37 | + "t": 692.6237189769745 | |
| 38 | + }, | |
| 39 | + { | |
| 40 | + "step": 200, | |
| 41 | + "train_nll": 0.30547111742424243, | |
| 42 | + "val_nll": 0.4059054014071213, | |
| 43 | + "t": 921.2686007022858 | |
| 44 | + }, | |
| 45 | + { | |
| 46 | + "step": 250, | |
| 47 | + "train_nll": 0.40774283145590295, | |
| 48 | + "val_nll": 0.40411525751844213, | |
| 49 | + "t": 1156.1196196079254 | |
| 50 | + }, | |
| 51 | + { | |
| 52 | + "step": 300, | |
| 53 | + "train_nll": 0.4197157365339738, | |
| 54 | + "val_nll": 0.4016843025746399, | |
| 55 | + "t": 1387.205927848816 | |
| 56 | + } | |
| 57 | + ], | |
| 58 | + "val_nll": 0.4016843025746399, | |
| 59 | + "test_nll": 0.45775569706153646, | |
| 60 | + "test_nll_frozen": 0.5882042940487741, | |
| 61 | + "peak_gpu_bytes": 6827453952, | |
| 62 | + "seconds_unlocked": 1418.366622209549 | |
| 63 | +} | |
| \ No newline at end of file |
evidence/math-training/e2-train-lora-0.0001-0.json
| new file mode 100644 | ||
| @@ -0,0 +1,63 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "e2217f03be0c2e3dfb1df637f9557be902aacc5c", | |
| 8 | + "code_dirty": false, | |
| 9 | + "command": ".venv/bin/python e2.py train lora 1e-4 0", | |
| 10 | + "utc": "2026-10-20T19:41:50Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "method": "lora", | |
| 14 | + "lr": 0.0001, | |
| 15 | + "seed": 0, | |
| 16 | + "steps": 300, | |
| 17 | + "batch": 8, | |
| 18 | + "trainable_params": 9043968, | |
| 19 | + "val_nll_frozen": 0.5346099340729554, | |
| 20 | + "curve": [ | |
| 21 | + { | |
| 22 | + "step": 50, | |
| 23 | + "train_nll": 0.4467458062528158, | |
| 24 | + "val_nll": 0.41302604953241173, | |
| 25 | + "t": 67.22935819625854 | |
| 26 | + }, | |
| 27 | + { | |
| 28 | + "step": 100, | |
| 29 | + "train_nll": 0.26205833813616336, | |
| 30 | + "val_nll": 0.4033247501415834, | |
| 31 | + "t": 132.19342637062073 | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "step": 150, | |
| 35 | + "train_nll": 0.4242350322672028, | |
| 36 | + "val_nll": 0.3987090469984317, | |
| 37 | + "t": 200.3003363609314 | |
| 38 | + }, | |
| 39 | + { | |
| 40 | + "step": 200, | |
| 41 | + "train_nll": 0.30397488680752843, | |
| 42 | + "val_nll": 0.3951858913038743, | |
| 43 | + "t": 263.8887495994568 | |
| 44 | + }, | |
| 45 | + { | |
| 46 | + "step": 250, | |
| 47 | + "train_nll": 0.4061978591743923, | |
| 48 | + "val_nll": 0.39441136787726533, | |
| 49 | + "t": 334.9159531593323 | |
| 50 | + }, | |
| 51 | + { | |
| 52 | + "step": 300, | |
| 53 | + "train_nll": 0.4088097114067573, | |
| 54 | + "val_nll": 0.3900513130953764, | |
| 55 | + "t": 400.9096415042877 | |
| 56 | + } | |
| 57 | + ], | |
| 58 | + "val_nll": 0.3900513130953764, | |
| 59 | + "test_nll": 0.44629420535585657, | |
| 60 | + "test_nll_frozen": 0.5882042940487741, | |
| 61 | + "peak_gpu_bytes": 6748263936, | |
| 62 | + "seconds_unlocked": 416.3579742908478 | |
| 63 | +} | |
| \ No newline at end of file |
evidence/math-training/e2-train-lora-0.0003-0.json
| new file mode 100644 | ||
| @@ -0,0 +1,63 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "e2217f03be0c2e3dfb1df637f9557be902aacc5c", | |
| 8 | + "code_dirty": false, | |
| 9 | + "command": ".venv/bin/python e2.py train lora 3e-4 0", | |
| 10 | + "utc": "2026-10-20T19:49:38Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "method": "lora", | |
| 14 | + "lr": 0.0003, | |
| 15 | + "seed": 0, | |
| 16 | + "steps": 300, | |
| 17 | + "batch": 8, | |
| 18 | + "trainable_params": 9043968, | |
| 19 | + "val_nll_frozen": 0.5346099340729554, | |
| 20 | + "curve": [ | |
| 21 | + { | |
| 22 | + "step": 50, | |
| 23 | + "train_nll": 0.44130752783459104, | |
| 24 | + "val_nll": 0.40553646362758483, | |
| 25 | + "t": 66.0609564781189 | |
| 26 | + }, | |
| 27 | + { | |
| 28 | + "step": 100, | |
| 29 | + "train_nll": 0.2643918335892772, | |
| 30 | + "val_nll": 0.3999423397021666, | |
| 31 | + "t": 132.9893765449524 | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "step": 150, | |
| 35 | + "train_nll": 0.42343991301780526, | |
| 36 | + "val_nll": 0.39569852535432154, | |
| 37 | + "t": 200.1251883506775 | |
| 38 | + }, | |
| 39 | + { | |
| 40 | + "step": 200, | |
| 41 | + "train_nll": 0.2915336192737926, | |
| 42 | + "val_nll": 0.39163253931662406, | |
| 43 | + "t": 264.9190557003021 | |
| 44 | + }, | |
| 45 | + { | |
| 46 | + "step": 250, | |
| 47 | + "train_nll": 0.40311645889680003, | |
| 48 | + "val_nll": 0.39068357287552274, | |
| 49 | + "t": 332.52023911476135 | |
| 50 | + }, | |
| 51 | + { | |
| 52 | + "step": 300, | |
| 53 | + "train_nll": 0.40755664623462473, | |
| 54 | + "val_nll": 0.38659000166995816, | |
| 55 | + "t": 401.1885201931 | |
| 56 | + } | |
| 57 | + ], | |
| 58 | + "val_nll": 0.38659000166995816, | |
| 59 | + "test_nll": 0.44124207895986217, | |
| 60 | + "test_nll_frozen": 0.5882042940487741, | |
| 61 | + "peak_gpu_bytes": 6748263936, | |
| 62 | + "seconds_unlocked": 418.68974781036377 | |
| 63 | +} | |
| \ No newline at end of file |
evidence/math-training/e2-train-lora-0.0003-1.json
| new file mode 100644 | ||
| @@ -0,0 +1,63 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "bc276319c60429927f145b4d39ab2581771c2c88", | |
| 8 | + "code_dirty": false, | |
| 9 | + "command": ".venv/bin/python e2.py train lora 0.0003 1", | |
| 10 | + "utc": "2026-10-21T00:33:24Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "method": "lora", | |
| 14 | + "lr": 0.0003, | |
| 15 | + "seed": 1, | |
| 16 | + "steps": 300, | |
| 17 | + "batch": 8, | |
| 18 | + "trainable_params": 9043968, | |
| 19 | + "val_nll_frozen": 0.5346099340729554, | |
| 20 | + "curve": [ | |
| 21 | + { | |
| 22 | + "step": 50, | |
| 23 | + "train_nll": 0.30581256435506016, | |
| 24 | + "val_nll": 0.4073894070196329, | |
| 25 | + "t": 36.412519454956055 | |
| 26 | + }, | |
| 27 | + { | |
| 28 | + "step": 100, | |
| 29 | + "train_nll": 0.5505628646559017, | |
| 30 | + "val_nll": 0.40072419642338525, | |
| 31 | + "t": 72.10468602180481 | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "step": 150, | |
| 35 | + "train_nll": 0.46349061527845253, | |
| 36 | + "val_nll": 0.39450872190113845, | |
| 37 | + "t": 108.44616889953613 | |
| 38 | + }, | |
| 39 | + { | |
| 40 | + "step": 200, | |
| 41 | + "train_nll": 0.46615758241322647, | |
| 42 | + "val_nll": 0.3914039057054484, | |
| 43 | + "t": 145.06040477752686 | |
| 44 | + }, | |
| 45 | + { | |
| 46 | + "step": 250, | |
| 47 | + "train_nll": 0.29865390350247706, | |
| 48 | + "val_nll": 0.38914314990415894, | |
| 49 | + "t": 181.12251496315002 | |
| 50 | + }, | |
| 51 | + { | |
| 52 | + "step": 300, | |
| 53 | + "train_nll": 0.33018325665675174, | |
| 54 | + "val_nll": 0.38842845726722236, | |
| 55 | + "t": 218.2499680519104 | |
| 56 | + } | |
| 57 | + ], | |
| 58 | + "val_nll": 0.38842845726722236, | |
| 59 | + "test_nll": 0.44546368537252157, | |
| 60 | + "test_nll_frozen": 0.5882042940487741, | |
| 61 | + "peak_gpu_bytes": 6752195584, | |
| 62 | + "seconds_unlocked": 227.46677470207214 | |
| 63 | +} | |
| \ No newline at end of file |
evidence/math-training/e2-train-lora-0.001-0.json
| new file mode 100644 | ||
| @@ -0,0 +1,63 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "e2217f03be0c2e3dfb1df637f9557be902aacc5c", | |
| 8 | + "code_dirty": false, | |
| 9 | + "command": ".venv/bin/python e2.py train lora 1e-3 0", | |
| 10 | + "utc": "2026-10-20T19:54:18Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "method": "lora", | |
| 14 | + "lr": 0.001, | |
| 15 | + "seed": 0, | |
| 16 | + "steps": 300, | |
| 17 | + "batch": 8, | |
| 18 | + "trainable_params": 9043968, | |
| 19 | + "val_nll_frozen": 0.5346099340729554, | |
| 20 | + "curve": [ | |
| 21 | + { | |
| 22 | + "step": 50, | |
| 23 | + "train_nll": 0.4454889060004198, | |
| 24 | + "val_nll": 0.408864501953125, | |
| 25 | + "t": 36.77828574180603 | |
| 26 | + }, | |
| 27 | + { | |
| 28 | + "step": 100, | |
| 29 | + "train_nll": 0.2688188916854276, | |
| 30 | + "val_nll": 0.40543617991621167, | |
| 31 | + "t": 72.29484820365906 | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "step": 150, | |
| 35 | + "train_nll": 0.4340527089748126, | |
| 36 | + "val_nll": 0.4045923917976011, | |
| 37 | + "t": 107.03128957748413 | |
| 38 | + }, | |
| 39 | + { | |
| 40 | + "step": 200, | |
| 41 | + "train_nll": 0.3001940085671165, | |
| 42 | + "val_nll": 0.4025348984955855, | |
| 43 | + "t": 141.8751084804535 | |
| 44 | + }, | |
| 45 | + { | |
| 46 | + "step": 250, | |
| 47 | + "train_nll": 0.4195905572057889, | |
| 48 | + "val_nll": 0.40244782469795537, | |
| 49 | + "t": 177.5803325176239 | |
| 50 | + }, | |
| 51 | + { | |
| 52 | + "step": 300, | |
| 53 | + "train_nll": 0.4129501937271713, | |
| 54 | + "val_nll": 0.4063319695341543, | |
| 55 | + "t": 213.99383807182312 | |
| 56 | + } | |
| 57 | + ], | |
| 58 | + "val_nll": 0.4063319695341543, | |
| 59 | + "test_nll": 0.4498590581333836, | |
| 60 | + "test_nll_frozen": 0.5882042940487741, | |
| 61 | + "peak_gpu_bytes": 6748263936, | |
| 62 | + "seconds_unlocked": 223.3344600200653 | |
| 63 | +} | |
| \ No newline at end of file |
evidence/math-training/e2-train-lora64-0.0003-0.json
| new file mode 100644 | ||
| @@ -0,0 +1,63 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "bc276319c60429927f145b4d39ab2581771c2c88", | |
| 8 | + "code_dirty": false, | |
| 9 | + "command": ".venv/bin/python e2.py train lora64 0.0003 0", | |
| 10 | + "utc": "2026-10-21T01:15:40Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "method": "lora64", | |
| 14 | + "lr": 0.0003, | |
| 15 | + "seed": 0, | |
| 16 | + "steps": 300, | |
| 17 | + "batch": 8, | |
| 18 | + "trainable_params": 72351744, | |
| 19 | + "val_nll_frozen": 0.5346099340729554, | |
| 20 | + "curve": [ | |
| 21 | + { | |
| 22 | + "step": 50, | |
| 23 | + "train_nll": 0.44133496565712543, | |
| 24 | + "val_nll": 0.40560163374549835, | |
| 25 | + "t": 37.924198627471924 | |
| 26 | + }, | |
| 27 | + { | |
| 28 | + "step": 100, | |
| 29 | + "train_nll": 0.2639649078136182, | |
| 30 | + "val_nll": 0.3995234538365474, | |
| 31 | + "t": 75.1670389175415 | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "step": 150, | |
| 35 | + "train_nll": 0.42304830189288173, | |
| 36 | + "val_nll": 0.3955248651327254, | |
| 37 | + "t": 110.50887703895569 | |
| 38 | + }, | |
| 39 | + { | |
| 40 | + "step": 200, | |
| 41 | + "train_nll": 0.29296900893702654, | |
| 42 | + "val_nll": 0.3913723598324233, | |
| 43 | + "t": 146.14180612564087 | |
| 44 | + }, | |
| 45 | + { | |
| 46 | + "step": 250, | |
| 47 | + "train_nll": 0.4032546153779572, | |
| 48 | + "val_nll": 0.3909297324255053, | |
| 49 | + "t": 186.9684751033783 | |
| 50 | + }, | |
| 51 | + { | |
| 52 | + "step": 300, | |
| 53 | + "train_nll": 0.4067617258230051, | |
| 54 | + "val_nll": 0.3864179896244772, | |
| 55 | + "t": 227.2753608226776 | |
| 56 | + } | |
| 57 | + ], | |
| 58 | + "val_nll": 0.3864179896244772, | |
| 59 | + "test_nll": 0.4412422083562692, | |
| 60 | + "test_nll_frozen": 0.5882042940487741, | |
| 61 | + "peak_gpu_bytes": 7938756608, | |
| 62 | + "seconds_unlocked": 236.57416009902954 | |
| 63 | +} | |
| \ No newline at end of file |
evidence/math-training/e2-train-phm-0.0001-0.json
| new file mode 100644 | ||
| @@ -0,0 +1,63 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "e2217f03be0c2e3dfb1df637f9557be902aacc5c", | |
| 8 | + "code_dirty": false, | |
| 9 | + "command": ".venv/bin/python e2.py train phm 1e-4 0", | |
| 10 | + "utc": "2026-10-20T20:01:39Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "method": "phm", | |
| 14 | + "lr": 0.0001, | |
| 15 | + "seed": 0, | |
| 16 | + "steps": 300, | |
| 17 | + "batch": 8, | |
| 18 | + "trainable_params": 9045504, | |
| 19 | + "val_nll_frozen": 0.5346099340729554, | |
| 20 | + "curve": [ | |
| 21 | + { | |
| 22 | + "step": 50, | |
| 23 | + "train_nll": 0.4524896304229296, | |
| 24 | + "val_nll": 0.4188524805232052, | |
| 25 | + "t": 68.85932159423828 | |
| 26 | + }, | |
| 27 | + { | |
| 28 | + "step": 100, | |
| 29 | + "train_nll": 0.26641796199420026, | |
| 30 | + "val_nll": 0.4088602353914963, | |
| 31 | + "t": 139.8768982887268 | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "step": 150, | |
| 35 | + "train_nll": 0.4297039540920001, | |
| 36 | + "val_nll": 0.40401117510600604, | |
| 37 | + "t": 216.96056699752808 | |
| 38 | + }, | |
| 39 | + { | |
| 40 | + "step": 200, | |
| 41 | + "train_nll": 0.3049261844519413, | |
| 42 | + "val_nll": 0.40023839651341775, | |
| 43 | + "t": 289.8225963115692 | |
| 44 | + }, | |
| 45 | + { | |
| 46 | + "step": 250, | |
| 47 | + "train_nll": 0.4052684414001401, | |
| 48 | + "val_nll": 0.39827642345782993, | |
| 49 | + "t": 335.39924478530884 | |
| 50 | + }, | |
| 51 | + { | |
| 52 | + "step": 300, | |
| 53 | + "train_nll": 0.41432148783833356, | |
| 54 | + "val_nll": 0.39470411653766846, | |
| 55 | + "t": 377.20321249961853 | |
| 56 | + } | |
| 57 | + ], | |
| 58 | + "val_nll": 0.39470411653766846, | |
| 59 | + "test_nll": 0.45131172125247443, | |
| 60 | + "test_nll_frozen": 0.5882042940487741, | |
| 61 | + "peak_gpu_bytes": 6833714688, | |
| 62 | + "seconds_unlocked": 386.62408900260925 | |
| 63 | +} | |
| \ No newline at end of file |
evidence/math-training/e2-train-phm-0.0003-0.json
| new file mode 100644 | ||
| @@ -0,0 +1,63 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "e2217f03be0c2e3dfb1df637f9557be902aacc5c", | |
| 8 | + "code_dirty": false, | |
| 9 | + "command": ".venv/bin/python e2.py train phm 3e-4 0", | |
| 10 | + "utc": "2026-10-20T20:08:43Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "method": "phm", | |
| 14 | + "lr": 0.0003, | |
| 15 | + "seed": 0, | |
| 16 | + "steps": 300, | |
| 17 | + "batch": 8, | |
| 18 | + "trainable_params": 9045504, | |
| 19 | + "val_nll_frozen": 0.5346099340729554, | |
| 20 | + "curve": [ | |
| 21 | + { | |
| 22 | + "step": 50, | |
| 23 | + "train_nll": 0.4443734545226491, | |
| 24 | + "val_nll": 0.4081460995585502, | |
| 25 | + "t": 41.004597425460815 | |
| 26 | + }, | |
| 27 | + { | |
| 28 | + "step": 100, | |
| 29 | + "train_nll": 0.2620701389458343, | |
| 30 | + "val_nll": 0.40102133326193656, | |
| 31 | + "t": 83.49594354629517 | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "step": 150, | |
| 35 | + "train_nll": 0.4226692414488028, | |
| 36 | + "val_nll": 0.39686868320167284, | |
| 37 | + "t": 148.284405708313 | |
| 38 | + }, | |
| 39 | + { | |
| 40 | + "step": 200, | |
| 41 | + "train_nll": 0.30107172185724435, | |
| 42 | + "val_nll": 0.3930311265683086, | |
| 43 | + "t": 217.96270418167114 | |
| 44 | + }, | |
| 45 | + { | |
| 46 | + "step": 250, | |
| 47 | + "train_nll": 0.40692165720823287, | |
| 48 | + "val_nll": 0.39244947196648466, | |
| 49 | + "t": 291.45514845848083 | |
| 50 | + }, | |
| 51 | + { | |
| 52 | + "step": 300, | |
| 53 | + "train_nll": 0.40785622763467, | |
| 54 | + "val_nll": 0.3879680938153462, | |
| 55 | + "t": 369.61203789711 | |
| 56 | + } | |
| 57 | + ], | |
| 58 | + "val_nll": 0.3879680938153462, | |
| 59 | + "test_nll": 0.443659539058665, | |
| 60 | + "test_nll_frozen": 0.5882042940487741, | |
| 61 | + "peak_gpu_bytes": 6833714688, | |
| 62 | + "seconds_unlocked": 389.0041973590851 | |
| 63 | +} | |
| \ No newline at end of file |
evidence/math-training/e2-train-phm-0.0003-1.json
| new file mode 100644 | ||
| @@ -0,0 +1,63 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "bc276319c60429927f145b4d39ab2581771c2c88", | |
| 8 | + "code_dirty": false, | |
| 9 | + "command": ".venv/bin/python e2.py train phm 0.0003 1", | |
| 10 | + "utc": "2026-10-21T00:38:23Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "method": "phm", | |
| 14 | + "lr": 0.0003, | |
| 15 | + "seed": 1, | |
| 16 | + "steps": 300, | |
| 17 | + "batch": 8, | |
| 18 | + "trainable_params": 9045504, | |
| 19 | + "val_nll_frozen": 0.5346099340729554, | |
| 20 | + "curve": [ | |
| 21 | + { | |
| 22 | + "step": 50, | |
| 23 | + "train_nll": 0.3023203366969919, | |
| 24 | + "val_nll": 0.4092246860660142, | |
| 25 | + "t": 38.435707569122314 | |
| 26 | + }, | |
| 27 | + { | |
| 28 | + "step": 100, | |
| 29 | + "train_nll": 0.5562647274851545, | |
| 30 | + "val_nll": 0.40212276053162754, | |
| 31 | + "t": 75.17179465293884 | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "step": 150, | |
| 35 | + "train_nll": 0.47118451913357257, | |
| 36 | + "val_nll": 0.3963422815259061, | |
| 37 | + "t": 112.62030243873596 | |
| 38 | + }, | |
| 39 | + { | |
| 40 | + "step": 200, | |
| 41 | + "train_nll": 0.46851177145194306, | |
| 42 | + "val_nll": 0.393624511264957, | |
| 43 | + "t": 149.73442816734314 | |
| 44 | + }, | |
| 45 | + { | |
| 46 | + "step": 250, | |
| 47 | + "train_nll": 0.2993517225839864, | |
| 48 | + "val_nll": 0.39158819285112684, | |
| 49 | + "t": 187.47728371620178 | |
| 50 | + }, | |
| 51 | + { | |
| 52 | + "step": 300, | |
| 53 | + "train_nll": 0.32964494937681743, | |
| 54 | + "val_nll": 0.38917356810162057, | |
| 55 | + "t": 225.08803987503052 | |
| 56 | + } | |
| 57 | + ], | |
| 58 | + "val_nll": 0.38917356810162057, | |
| 59 | + "test_nll": 0.44542605880789843, | |
| 60 | + "test_nll_frozen": 0.5882042940487741, | |
| 61 | + "peak_gpu_bytes": 6837658624, | |
| 62 | + "seconds_unlocked": 234.24272918701172 | |
| 63 | +} | |
| \ No newline at end of file |
evidence/math-training/e2-train-phm-0.001-0.json
| new file mode 100644 | ||
| @@ -0,0 +1,63 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "e2217f03be0c2e3dfb1df637f9557be902aacc5c", | |
| 8 | + "code_dirty": false, | |
| 9 | + "command": ".venv/bin/python e2.py train phm 1e-3 0", | |
| 10 | + "utc": "2026-10-20T20:14:09Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "method": "phm", | |
| 14 | + "lr": 0.001, | |
| 15 | + "seed": 0, | |
| 16 | + "steps": 300, | |
| 17 | + "batch": 8, | |
| 18 | + "trainable_params": 9045504, | |
| 19 | + "val_nll_frozen": 0.5346099340729554, | |
| 20 | + "curve": [ | |
| 21 | + { | |
| 22 | + "step": 50, | |
| 23 | + "train_nll": 0.4417845799757331, | |
| 24 | + "val_nll": 0.40577203074175183, | |
| 25 | + "t": 38.4533417224884 | |
| 26 | + }, | |
| 27 | + { | |
| 28 | + "step": 100, | |
| 29 | + "train_nll": 0.26964209461940153, | |
| 30 | + "val_nll": 0.4009536913336431, | |
| 31 | + "t": 75.3078396320343 | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "step": 150, | |
| 35 | + "train_nll": 0.42387477916778227, | |
| 36 | + "val_nll": 0.3977815377047514, | |
| 37 | + "t": 113.83398079872131 | |
| 38 | + }, | |
| 39 | + { | |
| 40 | + "step": 200, | |
| 41 | + "train_nll": 0.29424118504379737, | |
| 42 | + "val_nll": 0.3939844367158457, | |
| 43 | + "t": 150.25128817558289 | |
| 44 | + }, | |
| 45 | + { | |
| 46 | + "step": 250, | |
| 47 | + "train_nll": 0.405799459988432, | |
| 48 | + "val_nll": 0.39208853501103624, | |
| 49 | + "t": 206.00016474723816 | |
| 50 | + }, | |
| 51 | + { | |
| 52 | + "step": 300, | |
| 53 | + "train_nll": 0.40777161071350526, | |
| 54 | + "val_nll": 0.38902426385702255, | |
| 55 | + "t": 267.34635043144226 | |
| 56 | + } | |
| 57 | + ], | |
| 58 | + "val_nll": 0.38902426385702255, | |
| 59 | + "test_nll": 0.44236643039380635, | |
| 60 | + "test_nll_frozen": 0.5882042940487741, | |
| 61 | + "peak_gpu_bytes": 6833714688, | |
| 62 | + "seconds_unlocked": 286.70818877220154 | |
| 63 | +} | |
| \ No newline at end of file |
evidence/math-training/e3-algebra.json
| new file mode 100644 | ||
| @@ -0,0 +1,958 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "2b78ff0c9f2a49994214b301e8f5360050a72256", | |
| 8 | + "code_dirty": true, | |
| 9 | + "command": ".venv/bin/python e3.py algebra", | |
| 10 | + "utc": "2026-10-20T18:40:05Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "per_layer": [ | |
| 14 | + { | |
| 15 | + "layer": 0, | |
| 16 | + "OV_heads_energy_dims": { | |
| 17 | + "0.95": 30, | |
| 18 | + "0.99": 32, | |
| 19 | + "0.999": 32 | |
| 20 | + }, | |
| 21 | + "OV_heads_energy_dims_random_control": { | |
| 22 | + "0.95": 31, | |
| 23 | + "0.99": 32, | |
| 24 | + "0.999": 32 | |
| 25 | + }, | |
| 26 | + "QK_heads_energy_dims": { | |
| 27 | + "0.95": 30, | |
| 28 | + "0.99": 32, | |
| 29 | + "0.999": 32 | |
| 30 | + }, | |
| 31 | + "QK_heads_energy_dims_random_control": { | |
| 32 | + "0.95": 31, | |
| 33 | + "0.99": 32, | |
| 34 | + "0.999": 32 | |
| 35 | + } | |
| 36 | + }, | |
| 37 | + { | |
| 38 | + "layer": 1, | |
| 39 | + "OV_heads_energy_dims": { | |
| 40 | + "0.95": 30, | |
| 41 | + "0.99": 32, | |
| 42 | + "0.999": 32 | |
| 43 | + }, | |
| 44 | + "OV_heads_energy_dims_random_control": { | |
| 45 | + "0.95": 31, | |
| 46 | + "0.99": 32, | |
| 47 | + "0.999": 32 | |
| 48 | + }, | |
| 49 | + "QK_heads_energy_dims": { | |
| 50 | + "0.95": 31, | |
| 51 | + "0.99": 32, | |
| 52 | + "0.999": 32 | |
| 53 | + }, | |
| 54 | + "QK_heads_energy_dims_random_control": { | |
| 55 | + "0.95": 31, | |
| 56 | + "0.99": 32, | |
| 57 | + "0.999": 32 | |
| 58 | + }, | |
| 59 | + "virtual_head_closure_residual": { | |
| 60 | + "median": 0.9990465348061744, | |
| 61 | + "min": 0.8652342936444424, | |
| 62 | + "max": 0.9999306032388702 | |
| 63 | + }, | |
| 64 | + "virtual_head_closure_residual_random_control": { | |
| 65 | + "median": 0.9999674869810655, | |
| 66 | + "min": 0.9988743436480289, | |
| 67 | + "max": 0.9999938519434292 | |
| 68 | + }, | |
| 69 | + "growth": { | |
| 70 | + "n_basis": 64, | |
| 71 | + "n_basis_plus_products": 320, | |
| 72 | + "dims_basis": { | |
| 73 | + "0.95": 59, | |
| 74 | + "0.99": 63, | |
| 75 | + "0.999": 64 | |
| 76 | + }, | |
| 77 | + "dims_with_products": { | |
| 78 | + "0.95": 295, | |
| 79 | + "0.99": 314, | |
| 80 | + "0.999": 320 | |
| 81 | + }, | |
| 82 | + "dims_with_products_random_control": { | |
| 83 | + "0.95": 303, | |
| 84 | + "0.99": 317, | |
| 85 | + "0.999": 320 | |
| 86 | + } | |
| 87 | + } | |
| 88 | + }, | |
| 89 | + { | |
| 90 | + "layer": 2, | |
| 91 | + "OV_heads_energy_dims": { | |
| 92 | + "0.95": 30, | |
| 93 | + "0.99": 32, | |
| 94 | + "0.999": 32 | |
| 95 | + }, | |
| 96 | + "OV_heads_energy_dims_random_control": { | |
| 97 | + "0.95": 31, | |
| 98 | + "0.99": 32, | |
| 99 | + "0.999": 32 | |
| 100 | + }, | |
| 101 | + "QK_heads_energy_dims": { | |
| 102 | + "0.95": 31, | |
| 103 | + "0.99": 32, | |
| 104 | + "0.999": 32 | |
| 105 | + }, | |
| 106 | + "QK_heads_energy_dims_random_control": { | |
| 107 | + "0.95": 31, | |
| 108 | + "0.99": 32, | |
| 109 | + "0.999": 32 | |
| 110 | + }, | |
| 111 | + "virtual_head_closure_residual": { | |
| 112 | + "median": 0.9990919049097464, | |
| 113 | + "min": 0.7621611944090413, | |
| 114 | + "max": 0.9999838800663572 | |
| 115 | + }, | |
| 116 | + "virtual_head_closure_residual_random_control": { | |
| 117 | + "median": 0.9999848170600162, | |
| 118 | + "min": 0.999899927070856, | |
| 119 | + "max": 0.999994136228129 | |
| 120 | + } | |
| 121 | + }, | |
| 122 | + { | |
| 123 | + "layer": 3, | |
| 124 | + "OV_heads_energy_dims": { | |
| 125 | + "0.95": 31, | |
| 126 | + "0.99": 32, | |
| 127 | + "0.999": 32 | |
| 128 | + }, | |
| 129 | + "OV_heads_energy_dims_random_control": { | |
| 130 | + "0.95": 31, | |
| 131 | + "0.99": 32, | |
| 132 | + "0.999": 32 | |
| 133 | + }, | |
| 134 | + "QK_heads_energy_dims": { | |
| 135 | + "0.95": 31, | |
| 136 | + "0.99": 32, | |
| 137 | + "0.999": 32 | |
| 138 | + }, | |
| 139 | + "QK_heads_energy_dims_random_control": { | |
| 140 | + "0.95": 31, | |
| 141 | + "0.99": 32, | |
| 142 | + "0.999": 32 | |
| 143 | + }, | |
| 144 | + "virtual_head_closure_residual": { | |
| 145 | + "median": 0.9985590502416894, | |
| 146 | + "min": 0.7988928791802603, | |
| 147 | + "max": 0.9999792461154439 | |
| 148 | + }, | |
| 149 | + "virtual_head_closure_residual_random_control": { | |
| 150 | + "median": 0.9999858020858203, | |
| 151 | + "min": 0.9999248805313344, | |
| 152 | + "max": 0.9999938442506985 | |
| 153 | + } | |
| 154 | + }, | |
| 155 | + { | |
| 156 | + "layer": 4, | |
| 157 | + "OV_heads_energy_dims": { | |
| 158 | + "0.95": 30, | |
| 159 | + "0.99": 32, | |
| 160 | + "0.999": 32 | |
| 161 | + }, | |
| 162 | + "OV_heads_energy_dims_random_control": { | |
| 163 | + "0.95": 31, | |
| 164 | + "0.99": 32, | |
| 165 | + "0.999": 32 | |
| 166 | + }, | |
| 167 | + "QK_heads_energy_dims": { | |
| 168 | + "0.95": 31, | |
| 169 | + "0.99": 32, | |
| 170 | + "0.999": 32 | |
| 171 | + }, | |
| 172 | + "QK_heads_energy_dims_random_control": { | |
| 173 | + "0.95": 31, | |
| 174 | + "0.99": 32, | |
| 175 | + "0.999": 32 | |
| 176 | + }, | |
| 177 | + "virtual_head_closure_residual": { | |
| 178 | + "median": 0.9988946371623135, | |
| 179 | + "min": 0.8872704351940883, | |
| 180 | + "max": 0.9999649151216785 | |
| 181 | + }, | |
| 182 | + "virtual_head_closure_residual_random_control": { | |
| 183 | + "median": 0.9999853973329044, | |
| 184 | + "min": 0.9998697332999755, | |
| 185 | + "max": 0.99999548766203 | |
| 186 | + } | |
| 187 | + }, | |
| 188 | + { | |
| 189 | + "layer": 5, | |
| 190 | + "OV_heads_energy_dims": { | |
| 191 | + "0.95": 31, | |
| 192 | + "0.99": 32, | |
| 193 | + "0.999": 32 | |
| 194 | + }, | |
| 195 | + "OV_heads_energy_dims_random_control": { | |
| 196 | + "0.95": 31, | |
| 197 | + "0.99": 32, | |
| 198 | + "0.999": 32 | |
| 199 | + }, | |
| 200 | + "QK_heads_energy_dims": { | |
| 201 | + "0.95": 31, | |
| 202 | + "0.99": 32, | |
| 203 | + "0.999": 32 | |
| 204 | + }, | |
| 205 | + "QK_heads_energy_dims_random_control": { | |
| 206 | + "0.95": 31, | |
| 207 | + "0.99": 32, | |
| 208 | + "0.999": 32 | |
| 209 | + }, | |
| 210 | + "virtual_head_closure_residual": { | |
| 211 | + "median": 0.9989362466336021, | |
| 212 | + "min": 0.8567391488865611, | |
| 213 | + "max": 0.9999879741640367 | |
| 214 | + }, | |
| 215 | + "virtual_head_closure_residual_random_control": { | |
| 216 | + "median": 0.9999855710768282, | |
| 217 | + "min": 0.9999332823830294, | |
| 218 | + "max": 0.9999945851243198 | |
| 219 | + } | |
| 220 | + }, | |
| 221 | + { | |
| 222 | + "layer": 6, | |
| 223 | + "OV_heads_energy_dims": { | |
| 224 | + "0.95": 30, | |
| 225 | + "0.99": 32, | |
| 226 | + "0.999": 32 | |
| 227 | + }, | |
| 228 | + "OV_heads_energy_dims_random_control": { | |
| 229 | + "0.95": 31, | |
| 230 | + "0.99": 32, | |
| 231 | + "0.999": 32 | |
| 232 | + }, | |
| 233 | + "QK_heads_energy_dims": { | |
| 234 | + "0.95": 31, | |
| 235 | + "0.99": 32, | |
| 236 | + "0.999": 32 | |
| 237 | + }, | |
| 238 | + "QK_heads_energy_dims_random_control": { | |
| 239 | + "0.95": 31, | |
| 240 | + "0.99": 32, | |
| 241 | + "0.999": 32 | |
| 242 | + }, | |
| 243 | + "virtual_head_closure_residual": { | |
| 244 | + "median": 0.9989671144206126, | |
| 245 | + "min": 0.9536741576622674, | |
| 246 | + "max": 0.9999737946242473 | |
| 247 | + }, | |
| 248 | + "virtual_head_closure_residual_random_control": { | |
| 249 | + "median": 0.9999846976545179, | |
| 250 | + "min": 0.9999344894062672, | |
| 251 | + "max": 0.9999949493329008 | |
| 252 | + }, | |
| 253 | + "growth": { | |
| 254 | + "n_basis": 64, | |
| 255 | + "n_basis_plus_products": 320, | |
| 256 | + "dims_basis": { | |
| 257 | + "0.95": 61, | |
| 258 | + "0.99": 64, | |
| 259 | + "0.999": 64 | |
| 260 | + }, | |
| 261 | + "dims_with_products": { | |
| 262 | + "0.95": 299, | |
| 263 | + "0.99": 316, | |
| 264 | + "0.999": 320 | |
| 265 | + }, | |
| 266 | + "dims_with_products_random_control": { | |
| 267 | + "0.95": 304, | |
| 268 | + "0.99": 317, | |
| 269 | + "0.999": 320 | |
| 270 | + } | |
| 271 | + } | |
| 272 | + }, | |
| 273 | + { | |
| 274 | + "layer": 7, | |
| 275 | + "OV_heads_energy_dims": { | |
| 276 | + "0.95": 30, | |
| 277 | + "0.99": 32, | |
| 278 | + "0.999": 32 | |
| 279 | + }, | |
| 280 | + "OV_heads_energy_dims_random_control": { | |
| 281 | + "0.95": 31, | |
| 282 | + "0.99": 32, | |
| 283 | + "0.999": 32 | |
| 284 | + }, | |
| 285 | + "QK_heads_energy_dims": { | |
| 286 | + "0.95": 30, | |
| 287 | + "0.99": 32, | |
| 288 | + "0.999": 32 | |
| 289 | + }, | |
| 290 | + "QK_heads_energy_dims_random_control": { | |
| 291 | + "0.95": 31, | |
| 292 | + "0.99": 32, | |
| 293 | + "0.999": 32 | |
| 294 | + }, | |
| 295 | + "virtual_head_closure_residual": { | |
| 296 | + "median": 0.9973090807425221, | |
| 297 | + "min": 0.8811968776132452, | |
| 298 | + "max": 0.9999623096832857 | |
| 299 | + }, | |
| 300 | + "virtual_head_closure_residual_random_control": { | |
| 301 | + "median": 0.9999858875349009, | |
| 302 | + "min": 0.9996723095284015, | |
| 303 | + "max": 0.9999942452414714 | |
| 304 | + } | |
| 305 | + }, | |
| 306 | + { | |
| 307 | + "layer": 8, | |
| 308 | + "OV_heads_energy_dims": { | |
| 309 | + "0.95": 30, | |
| 310 | + "0.99": 32, | |
| 311 | + "0.999": 32 | |
| 312 | + }, | |
| 313 | + "OV_heads_energy_dims_random_control": { | |
| 314 | + "0.95": 31, | |
| 315 | + "0.99": 32, | |
| 316 | + "0.999": 32 | |
| 317 | + }, | |
| 318 | + "QK_heads_energy_dims": { | |
| 319 | + "0.95": 31, | |
| 320 | + "0.99": 32, | |
| 321 | + "0.999": 32 | |
| 322 | + }, | |
| 323 | + "QK_heads_energy_dims_random_control": { | |
| 324 | + "0.95": 31, | |
| 325 | + "0.99": 32, | |
| 326 | + "0.999": 32 | |
| 327 | + }, | |
| 328 | + "virtual_head_closure_residual": { | |
| 329 | + "median": 0.9943357937829564, | |
| 330 | + "min": 0.8696964334519788, | |
| 331 | + "max": 0.9999520385994036 | |
| 332 | + }, | |
| 333 | + "virtual_head_closure_residual_random_control": { | |
| 334 | + "median": 0.9999873136519519, | |
| 335 | + "min": 0.9995011521092766, | |
| 336 | + "max": 0.9999955537412775 | |
| 337 | + } | |
| 338 | + }, | |
| 339 | + { | |
| 340 | + "layer": 9, | |
| 341 | + "OV_heads_energy_dims": { | |
| 342 | + "0.95": 31, | |
| 343 | + "0.99": 32, | |
| 344 | + "0.999": 32 | |
| 345 | + }, | |
| 346 | + "OV_heads_energy_dims_random_control": { | |
| 347 | + "0.95": 31, | |
| 348 | + "0.99": 32, | |
| 349 | + "0.999": 32 | |
| 350 | + }, | |
| 351 | + "QK_heads_energy_dims": { | |
| 352 | + "0.95": 31, | |
| 353 | + "0.99": 32, | |
| 354 | + "0.999": 32 | |
| 355 | + }, | |
| 356 | + "QK_heads_energy_dims_random_control": { | |
| 357 | + "0.95": 31, | |
| 358 | + "0.99": 32, | |
| 359 | + "0.999": 32 | |
| 360 | + }, | |
| 361 | + "virtual_head_closure_residual": { | |
| 362 | + "median": 0.9930794351253291, | |
| 363 | + "min": 0.8548162164439489, | |
| 364 | + "max": 0.9999800590350404 | |
| 365 | + }, | |
| 366 | + "virtual_head_closure_residual_random_control": { | |
| 367 | + "median": 0.9999862016157001, | |
| 368 | + "min": 0.9999499576153934, | |
| 369 | + "max": 0.999994302116321 | |
| 370 | + } | |
| 371 | + }, | |
| 372 | + { | |
| 373 | + "layer": 10, | |
| 374 | + "OV_heads_energy_dims": { | |
| 375 | + "0.95": 30, | |
| 376 | + "0.99": 32, | |
| 377 | + "0.999": 32 | |
| 378 | + }, | |
| 379 | + "OV_heads_energy_dims_random_control": { | |
| 380 | + "0.95": 31, | |
| 381 | + "0.99": 32, | |
| 382 | + "0.999": 32 | |
| 383 | + }, | |
| 384 | + "QK_heads_energy_dims": { | |
| 385 | + "0.95": 27, | |
| 386 | + "0.99": 30, | |
| 387 | + "0.999": 32 | |
| 388 | + }, | |
| 389 | + "QK_heads_energy_dims_random_control": { | |
| 390 | + "0.95": 31, | |
| 391 | + "0.99": 32, | |
| 392 | + "0.999": 32 | |
| 393 | + }, | |
| 394 | + "virtual_head_closure_residual": { | |
| 395 | + "median": 0.9933683857135527, | |
| 396 | + "min": 0.9125457612957522, | |
| 397 | + "max": 0.9999746789932935 | |
| 398 | + }, | |
| 399 | + "virtual_head_closure_residual_random_control": { | |
| 400 | + "median": 0.999985940880085, | |
| 401 | + "min": 0.9998684652603106, | |
| 402 | + "max": 0.9999943605241572 | |
| 403 | + } | |
| 404 | + }, | |
| 405 | + { | |
| 406 | + "layer": 11, | |
| 407 | + "OV_heads_energy_dims": { | |
| 408 | + "0.95": 30, | |
| 409 | + "0.99": 32, | |
| 410 | + "0.999": 32 | |
| 411 | + }, | |
| 412 | + "OV_heads_energy_dims_random_control": { | |
| 413 | + "0.95": 31, | |
| 414 | + "0.99": 32, | |
| 415 | + "0.999": 32 | |
| 416 | + }, | |
| 417 | + "QK_heads_energy_dims": { | |
| 418 | + "0.95": 30, | |
| 419 | + "0.99": 32, | |
| 420 | + "0.999": 32 | |
| 421 | + }, | |
| 422 | + "QK_heads_energy_dims_random_control": { | |
| 423 | + "0.95": 31, | |
| 424 | + "0.99": 32, | |
| 425 | + "0.999": 32 | |
| 426 | + }, | |
| 427 | + "virtual_head_closure_residual": { | |
| 428 | + "median": 0.9947317202662354, | |
| 429 | + "min": 0.8415855099150555, | |
| 430 | + "max": 0.9999264736476858 | |
| 431 | + }, | |
| 432 | + "virtual_head_closure_residual_random_control": { | |
| 433 | + "median": 0.999985431423039, | |
| 434 | + "min": 0.9998636989430474, | |
| 435 | + "max": 0.9999939651286696 | |
| 436 | + } | |
| 437 | + }, | |
| 438 | + { | |
| 439 | + "layer": 12, | |
| 440 | + "OV_heads_energy_dims": { | |
| 441 | + "0.95": 30, | |
| 442 | + "0.99": 32, | |
| 443 | + "0.999": 32 | |
| 444 | + }, | |
| 445 | + "OV_heads_energy_dims_random_control": { | |
| 446 | + "0.95": 31, | |
| 447 | + "0.99": 32, | |
| 448 | + "0.999": 32 | |
| 449 | + }, | |
| 450 | + "QK_heads_energy_dims": { | |
| 451 | + "0.95": 29, | |
| 452 | + "0.99": 31, | |
| 453 | + "0.999": 32 | |
| 454 | + }, | |
| 455 | + "QK_heads_energy_dims_random_control": { | |
| 456 | + "0.95": 31, | |
| 457 | + "0.99": 32, | |
| 458 | + "0.999": 32 | |
| 459 | + }, | |
| 460 | + "virtual_head_closure_residual": { | |
| 461 | + "median": 0.99133522557087, | |
| 462 | + "min": 0.8421847587345173, | |
| 463 | + "max": 0.9999073267669084 | |
| 464 | + }, | |
| 465 | + "virtual_head_closure_residual_random_control": { | |
| 466 | + "median": 0.9999862686802592, | |
| 467 | + "min": 0.9999437945342639, | |
| 468 | + "max": 0.999994730500735 | |
| 469 | + }, | |
| 470 | + "growth": { | |
| 471 | + "n_basis": 64, | |
| 472 | + "n_basis_plus_products": 320, | |
| 473 | + "dims_basis": { | |
| 474 | + "0.95": 59, | |
| 475 | + "0.99": 63, | |
| 476 | + "0.999": 64 | |
| 477 | + }, | |
| 478 | + "dims_with_products": { | |
| 479 | + "0.95": 289, | |
| 480 | + "0.99": 312, | |
| 481 | + "0.999": 319 | |
| 482 | + }, | |
| 483 | + "dims_with_products_random_control": { | |
| 484 | + "0.95": 304, | |
| 485 | + "0.99": 317, | |
| 486 | + "0.999": 320 | |
| 487 | + } | |
| 488 | + } | |
| 489 | + }, | |
| 490 | + { | |
| 491 | + "layer": 13, | |
| 492 | + "OV_heads_energy_dims": { | |
| 493 | + "0.95": 30, | |
| 494 | + "0.99": 32, | |
| 495 | + "0.999": 32 | |
| 496 | + }, | |
| 497 | + "OV_heads_energy_dims_random_control": { | |
| 498 | + "0.95": 31, | |
| 499 | + "0.99": 32, | |
| 500 | + "0.999": 32 | |
| 501 | + }, | |
| 502 | + "QK_heads_energy_dims": { | |
| 503 | + "0.95": 30, | |
| 504 | + "0.99": 32, | |
| 505 | + "0.999": 32 | |
| 506 | + }, | |
| 507 | + "QK_heads_energy_dims_random_control": { | |
| 508 | + "0.95": 31, | |
| 509 | + "0.99": 32, | |
| 510 | + "0.999": 32 | |
| 511 | + }, | |
| 512 | + "virtual_head_closure_residual": { | |
| 513 | + "median": 0.9934202078403689, | |
| 514 | + "min": 0.7961315868956114, | |
| 515 | + "max": 0.999940681317358 | |
| 516 | + }, | |
| 517 | + "virtual_head_closure_residual_random_control": { | |
| 518 | + "median": 0.9999863497239377, | |
| 519 | + "min": 0.9999220422678028, | |
| 520 | + "max": 0.9999948443263414 | |
| 521 | + } | |
| 522 | + }, | |
| 523 | + { | |
| 524 | + "layer": 14, | |
| 525 | + "OV_heads_energy_dims": { | |
| 526 | + "0.95": 30, | |
| 527 | + "0.99": 32, | |
| 528 | + "0.999": 32 | |
| 529 | + }, | |
| 530 | + "OV_heads_energy_dims_random_control": { | |
| 531 | + "0.95": 31, | |
| 532 | + "0.99": 32, | |
| 533 | + "0.999": 32 | |
| 534 | + }, | |
| 535 | + "QK_heads_energy_dims": { | |
| 536 | + "0.95": 30, | |
| 537 | + "0.99": 32, | |
| 538 | + "0.999": 32 | |
| 539 | + }, | |
| 540 | + "QK_heads_energy_dims_random_control": { | |
| 541 | + "0.95": 31, | |
| 542 | + "0.99": 32, | |
| 543 | + "0.999": 32 | |
| 544 | + }, | |
| 545 | + "virtual_head_closure_residual": { | |
| 546 | + "median": 0.993223164849067, | |
| 547 | + "min": 0.8385413474663496, | |
| 548 | + "max": 0.9999001945254566 | |
| 549 | + }, | |
| 550 | + "virtual_head_closure_residual_random_control": { | |
| 551 | + "median": 0.9999863769991116, | |
| 552 | + "min": 0.9999293023114085, | |
| 553 | + "max": 0.9999949215591675 | |
| 554 | + } | |
| 555 | + }, | |
| 556 | + { | |
| 557 | + "layer": 15, | |
| 558 | + "OV_heads_energy_dims": { | |
| 559 | + "0.95": 29, | |
| 560 | + "0.99": 32, | |
| 561 | + "0.999": 32 | |
| 562 | + }, | |
| 563 | + "OV_heads_energy_dims_random_control": { | |
| 564 | + "0.95": 31, | |
| 565 | + "0.99": 32, | |
| 566 | + "0.999": 32 | |
| 567 | + }, | |
| 568 | + "QK_heads_energy_dims": { | |
| 569 | + "0.95": 30, | |
| 570 | + "0.99": 32, | |
| 571 | + "0.999": 32 | |
| 572 | + }, | |
| 573 | + "QK_heads_energy_dims_random_control": { | |
| 574 | + "0.95": 31, | |
| 575 | + "0.99": 32, | |
| 576 | + "0.999": 32 | |
| 577 | + }, | |
| 578 | + "virtual_head_closure_residual": { | |
| 579 | + "median": 0.9950312767608445, | |
| 580 | + "min": 0.7674863860689247, | |
| 581 | + "max": 0.9999409264361045 | |
| 582 | + }, | |
| 583 | + "virtual_head_closure_residual_random_control": { | |
| 584 | + "median": 0.9999863758767502, | |
| 585 | + "min": 0.9999335756836062, | |
| 586 | + "max": 0.9999952000059958 | |
| 587 | + } | |
| 588 | + }, | |
| 589 | + { | |
| 590 | + "layer": 16, | |
| 591 | + "OV_heads_energy_dims": { | |
| 592 | + "0.95": 30, | |
| 593 | + "0.99": 32, | |
| 594 | + "0.999": 32 | |
| 595 | + }, | |
| 596 | + "OV_heads_energy_dims_random_control": { | |
| 597 | + "0.95": 31, | |
| 598 | + "0.99": 32, | |
| 599 | + "0.999": 32 | |
| 600 | + }, | |
| 601 | + "QK_heads_energy_dims": { | |
| 602 | + "0.95": 30, | |
| 603 | + "0.99": 32, | |
| 604 | + "0.999": 32 | |
| 605 | + }, | |
| 606 | + "QK_heads_energy_dims_random_control": { | |
| 607 | + "0.95": 31, | |
| 608 | + "0.99": 32, | |
| 609 | + "0.999": 32 | |
| 610 | + }, | |
| 611 | + "virtual_head_closure_residual": { | |
| 612 | + "median": 0.9963090768438099, | |
| 613 | + "min": 0.6130767952020874, | |
| 614 | + "max": 0.999927442821986 | |
| 615 | + }, | |
| 616 | + "virtual_head_closure_residual_random_control": { | |
| 617 | + "median": 0.999986177712023, | |
| 618 | + "min": 0.9999362342546474, | |
| 619 | + "max": 0.999994203582049 | |
| 620 | + } | |
| 621 | + }, | |
| 622 | + { | |
| 623 | + "layer": 17, | |
| 624 | + "OV_heads_energy_dims": { | |
| 625 | + "0.95": 29, | |
| 626 | + "0.99": 31, | |
| 627 | + "0.999": 32 | |
| 628 | + }, | |
| 629 | + "OV_heads_energy_dims_random_control": { | |
| 630 | + "0.95": 31, | |
| 631 | + "0.99": 32, | |
| 632 | + "0.999": 32 | |
| 633 | + }, | |
| 634 | + "QK_heads_energy_dims": { | |
| 635 | + "0.95": 30, | |
| 636 | + "0.99": 32, | |
| 637 | + "0.999": 32 | |
| 638 | + }, | |
| 639 | + "QK_heads_energy_dims_random_control": { | |
| 640 | + "0.95": 31, | |
| 641 | + "0.99": 32, | |
| 642 | + "0.999": 32 | |
| 643 | + }, | |
| 644 | + "virtual_head_closure_residual": { | |
| 645 | + "median": 0.9985490422433989, | |
| 646 | + "min": 0.8341180749209964, | |
| 647 | + "max": 0.9999790443452102 | |
| 648 | + }, | |
| 649 | + "virtual_head_closure_residual_random_control": { | |
| 650 | + "median": 0.9999866455752009, | |
| 651 | + "min": 0.9999421134780074, | |
| 652 | + "max": 0.9999949247893116 | |
| 653 | + } | |
| 654 | + }, | |
| 655 | + { | |
| 656 | + "layer": 18, | |
| 657 | + "OV_heads_energy_dims": { | |
| 658 | + "0.95": 30, | |
| 659 | + "0.99": 32, | |
| 660 | + "0.999": 32 | |
| 661 | + }, | |
| 662 | + "OV_heads_energy_dims_random_control": { | |
| 663 | + "0.95": 31, | |
| 664 | + "0.99": 32, | |
| 665 | + "0.999": 32 | |
| 666 | + }, | |
| 667 | + "QK_heads_energy_dims": { | |
| 668 | + "0.95": 30, | |
| 669 | + "0.99": 32, | |
| 670 | + "0.999": 32 | |
| 671 | + }, | |
| 672 | + "QK_heads_energy_dims_random_control": { | |
| 673 | + "0.95": 31, | |
| 674 | + "0.99": 32, | |
| 675 | + "0.999": 32 | |
| 676 | + }, | |
| 677 | + "virtual_head_closure_residual": { | |
| 678 | + "median": 0.998135634159075, | |
| 679 | + "min": 0.7765794369424142, | |
| 680 | + "max": 0.9999426720233459 | |
| 681 | + }, | |
| 682 | + "virtual_head_closure_residual_random_control": { | |
| 683 | + "median": 0.999985848299329, | |
| 684 | + "min": 0.9999269664433492, | |
| 685 | + "max": 0.9999947918618407 | |
| 686 | + }, | |
| 687 | + "growth": { | |
| 688 | + "n_basis": 64, | |
| 689 | + "n_basis_plus_products": 320, | |
| 690 | + "dims_basis": { | |
| 691 | + "0.95": 58, | |
| 692 | + "0.99": 62, | |
| 693 | + "0.999": 64 | |
| 694 | + }, | |
| 695 | + "dims_with_products": { | |
| 696 | + "0.95": 290, | |
| 697 | + "0.99": 311, | |
| 698 | + "0.999": 319 | |
| 699 | + }, | |
| 700 | + "dims_with_products_random_control": { | |
| 701 | + "0.95": 304, | |
| 702 | + "0.99": 317, | |
| 703 | + "0.999": 320 | |
| 704 | + } | |
| 705 | + } | |
| 706 | + }, | |
| 707 | + { | |
| 708 | + "layer": 19, | |
| 709 | + "OV_heads_energy_dims": { | |
| 710 | + "0.95": 31, | |
| 711 | + "0.99": 32, | |
| 712 | + "0.999": 32 | |
| 713 | + }, | |
| 714 | + "OV_heads_energy_dims_random_control": { | |
| 715 | + "0.95": 31, | |
| 716 | + "0.99": 32, | |
| 717 | + "0.999": 32 | |
| 718 | + }, | |
| 719 | + "QK_heads_energy_dims": { | |
| 720 | + "0.95": 30, | |
| 721 | + "0.99": 32, | |
| 722 | + "0.999": 32 | |
| 723 | + }, | |
| 724 | + "QK_heads_energy_dims_random_control": { | |
| 725 | + "0.95": 31, | |
| 726 | + "0.99": 32, | |
| 727 | + "0.999": 32 | |
| 728 | + }, | |
| 729 | + "virtual_head_closure_residual": { | |
| 730 | + "median": 0.9983654813782968, | |
| 731 | + "min": 0.9103165168498213, | |
| 732 | + "max": 0.9999530595386197 | |
| 733 | + }, | |
| 734 | + "virtual_head_closure_residual_random_control": { | |
| 735 | + "median": 0.9999868530769184, | |
| 736 | + "min": 0.9999244919862232, | |
| 737 | + "max": 0.9999957583338211 | |
| 738 | + } | |
| 739 | + }, | |
| 740 | + { | |
| 741 | + "layer": 20, | |
| 742 | + "OV_heads_energy_dims": { | |
| 743 | + "0.95": 30, | |
| 744 | + "0.99": 32, | |
| 745 | + "0.999": 32 | |
| 746 | + }, | |
| 747 | + "OV_heads_energy_dims_random_control": { | |
| 748 | + "0.95": 31, | |
| 749 | + "0.99": 32, | |
| 750 | + "0.999": 32 | |
| 751 | + }, | |
| 752 | + "QK_heads_energy_dims": { | |
| 753 | + "0.95": 29, | |
| 754 | + "0.99": 32, | |
| 755 | + "0.999": 32 | |
| 756 | + }, | |
| 757 | + "QK_heads_energy_dims_random_control": { | |
| 758 | + "0.95": 31, | |
| 759 | + "0.99": 32, | |
| 760 | + "0.999": 32 | |
| 761 | + }, | |
| 762 | + "virtual_head_closure_residual": { | |
| 763 | + "median": 0.9985739536183472, | |
| 764 | + "min": 0.8956071195876196, | |
| 765 | + "max": 0.9999889987888024 | |
| 766 | + }, | |
| 767 | + "virtual_head_closure_residual_random_control": { | |
| 768 | + "median": 0.9999842493979402, | |
| 769 | + "min": 0.9999160192752597, | |
| 770 | + "max": 0.9999949807574805 | |
| 771 | + } | |
| 772 | + }, | |
| 773 | + { | |
| 774 | + "layer": 21, | |
| 775 | + "OV_heads_energy_dims": { | |
| 776 | + "0.95": 31, | |
| 777 | + "0.99": 32, | |
| 778 | + "0.999": 32 | |
| 779 | + }, | |
| 780 | + "OV_heads_energy_dims_random_control": { | |
| 781 | + "0.95": 31, | |
| 782 | + "0.99": 32, | |
| 783 | + "0.999": 32 | |
| 784 | + }, | |
| 785 | + "QK_heads_energy_dims": { | |
| 786 | + "0.95": 27, | |
| 787 | + "0.99": 31, | |
| 788 | + "0.999": 32 | |
| 789 | + }, | |
| 790 | + "QK_heads_energy_dims_random_control": { | |
| 791 | + "0.95": 31, | |
| 792 | + "0.99": 32, | |
| 793 | + "0.999": 32 | |
| 794 | + }, | |
| 795 | + "virtual_head_closure_residual": { | |
| 796 | + "median": 0.998695346224477, | |
| 797 | + "min": 0.8580836834389076, | |
| 798 | + "max": 0.999987215648217 | |
| 799 | + }, | |
| 800 | + "virtual_head_closure_residual_random_control": { | |
| 801 | + "median": 0.9999858992093611, | |
| 802 | + "min": 0.9997661682873977, | |
| 803 | + "max": 0.9999944648710121 | |
| 804 | + } | |
| 805 | + }, | |
| 806 | + { | |
| 807 | + "layer": 22, | |
| 808 | + "OV_heads_energy_dims": { | |
| 809 | + "0.95": 31, | |
| 810 | + "0.99": 32, | |
| 811 | + "0.999": 32 | |
| 812 | + }, | |
| 813 | + "OV_heads_energy_dims_random_control": { | |
| 814 | + "0.95": 31, | |
| 815 | + "0.99": 32, | |
| 816 | + "0.999": 32 | |
| 817 | + }, | |
| 818 | + "QK_heads_energy_dims": { | |
| 819 | + "0.95": 28, | |
| 820 | + "0.99": 32, | |
| 821 | + "0.999": 32 | |
| 822 | + }, | |
| 823 | + "QK_heads_energy_dims_random_control": { | |
| 824 | + "0.95": 31, | |
| 825 | + "0.99": 32, | |
| 826 | + "0.999": 32 | |
| 827 | + }, | |
| 828 | + "virtual_head_closure_residual": { | |
| 829 | + "median": 0.9969427136052582, | |
| 830 | + "min": 0.8078581196603635, | |
| 831 | + "max": 0.9999674146148996 | |
| 832 | + }, | |
| 833 | + "virtual_head_closure_residual_random_control": { | |
| 834 | + "median": 0.9999862771292047, | |
| 835 | + "min": 0.9997078200426057, | |
| 836 | + "max": 0.9999950921416457 | |
| 837 | + } | |
| 838 | + }, | |
| 839 | + { | |
| 840 | + "layer": 23, | |
| 841 | + "OV_heads_energy_dims": { | |
| 842 | + "0.95": 30, | |
| 843 | + "0.99": 32, | |
| 844 | + "0.999": 32 | |
| 845 | + }, | |
| 846 | + "OV_heads_energy_dims_random_control": { | |
| 847 | + "0.95": 31, | |
| 848 | + "0.99": 32, | |
| 849 | + "0.999": 32 | |
| 850 | + }, | |
| 851 | + "QK_heads_energy_dims": { | |
| 852 | + "0.95": 30, | |
| 853 | + "0.99": 32, | |
| 854 | + "0.999": 32 | |
| 855 | + }, | |
| 856 | + "QK_heads_energy_dims_random_control": { | |
| 857 | + "0.95": 31, | |
| 858 | + "0.99": 32, | |
| 859 | + "0.999": 32 | |
| 860 | + }, | |
| 861 | + "virtual_head_closure_residual": { | |
| 862 | + "median": 0.9947613805700254, | |
| 863 | + "min": 0.7982891922516028, | |
| 864 | + "max": 0.9999684895865449 | |
| 865 | + }, | |
| 866 | + "virtual_head_closure_residual_random_control": { | |
| 867 | + "median": 0.9999856436691367, | |
| 868 | + "min": 0.9997697955634057, | |
| 869 | + "max": 0.9999945120599403 | |
| 870 | + }, | |
| 871 | + "growth": { | |
| 872 | + "n_basis": 64, | |
| 873 | + "n_basis_plus_products": 320, | |
| 874 | + "dims_basis": { | |
| 875 | + "0.95": 60, | |
| 876 | + "0.99": 63, | |
| 877 | + "0.999": 64 | |
| 878 | + }, | |
| 879 | + "dims_with_products": { | |
| 880 | + "0.95": 291, | |
| 881 | + "0.99": 311, | |
| 882 | + "0.999": 319 | |
| 883 | + }, | |
| 884 | + "dims_with_products_random_control": { | |
| 885 | + "0.95": 304, | |
| 886 | + "0.99": 317, | |
| 887 | + "0.999": 320 | |
| 888 | + } | |
| 889 | + } | |
| 890 | + } | |
| 891 | + ], | |
| 892 | + "notes": "items normalized to unit Frobenius norm before every Gram; energy = eigenvalue mass of the Gram", | |
| 893 | + "positive_control_IQ_closure_residual_max": 0.0002720370606253906, | |
| 894 | + "across_depth": { | |
| 895 | + "q_proj": { | |
| 896 | + "energy_dims_of_24": { | |
| 897 | + "0.95": 23, | |
| 898 | + "0.99": 24, | |
| 899 | + "0.999": 24 | |
| 900 | + }, | |
| 901 | + "mean_abs_cosine_offdiag": 0.0007691911414967499 | |
| 902 | + }, | |
| 903 | + "k_proj": { | |
| 904 | + "energy_dims_of_24": { | |
| 905 | + "0.95": 23, | |
| 906 | + "0.99": 24, | |
| 907 | + "0.999": 24 | |
| 908 | + }, | |
| 909 | + "mean_abs_cosine_offdiag": 0.000609082111425422 | |
| 910 | + }, | |
| 911 | + "v_proj": { | |
| 912 | + "energy_dims_of_24": { | |
| 913 | + "0.95": 23, | |
| 914 | + "0.99": 24, | |
| 915 | + "0.999": 24 | |
| 916 | + }, | |
| 917 | + "mean_abs_cosine_offdiag": 0.00040141280883092446 | |
| 918 | + }, | |
| 919 | + "o_proj": { | |
| 920 | + "energy_dims_of_24": { | |
| 921 | + "0.95": 23, | |
| 922 | + "0.99": 24, | |
| 923 | + "0.999": 24 | |
| 924 | + }, | |
| 925 | + "mean_abs_cosine_offdiag": 0.00045345801059125813 | |
| 926 | + }, | |
| 927 | + "gate_proj": { | |
| 928 | + "energy_dims_of_24": { | |
| 929 | + "0.95": 23, | |
| 930 | + "0.99": 24, | |
| 931 | + "0.999": 24 | |
| 932 | + }, | |
| 933 | + "mean_abs_cosine_offdiag": 0.001523317310507675 | |
| 934 | + }, | |
| 935 | + "up_proj": { | |
| 936 | + "energy_dims_of_24": { | |
| 937 | + "0.95": 23, | |
| 938 | + "0.99": 24, | |
| 939 | + "0.999": 24 | |
| 940 | + }, | |
| 941 | + "mean_abs_cosine_offdiag": 0.0001895664760850459 | |
| 942 | + }, | |
| 943 | + "down_proj": { | |
| 944 | + "energy_dims_of_24": { | |
| 945 | + "0.95": 23, | |
| 946 | + "0.99": 24, | |
| 947 | + "0.999": 24 | |
| 948 | + }, | |
| 949 | + "mean_abs_cosine_offdiag": 0.00020398774779386113 | |
| 950 | + } | |
| 951 | + }, | |
| 952 | + "apply_cost_per_token_flops": { | |
| 953 | + "dense_d_by_d": 8388608, | |
| 954 | + "one_OV_head_factored": 524288, | |
| 955 | + "virtual_head_factored": 532480, | |
| 956 | + "coefficients_over_r_dense_basis_elements": "r * 2 * d^2 (worse than dense for r > 1 unless each B_k is structured)" | |
| 957 | + } | |
| 958 | +} | |
| \ No newline at end of file |
evidence/math-training/e3-nonlin.json
| new file mode 100644 | ||
| @@ -0,0 +1,233 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "e2217f03be0c2e3dfb1df637f9557be902aacc5c", | |
| 8 | + "code_dirty": false, | |
| 9 | + "command": ".venv/bin/python e3.py nonlin", | |
| 10 | + "utc": "2026-10-20T19:28:43Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "heldout_nll_full_model": 1.1756526835578538, | |
| 14 | + "per_layer": [ | |
| 15 | + { | |
| 16 | + "layer": 0, | |
| 17 | + "tokens_fit": 15037, | |
| 18 | + "tokens_eval": 7331, | |
| 19 | + "linear_fit_rel_residual_heldout": 1.093602180480957, | |
| 20 | + "linear_fit_rel_residual_fit": 0.18322260677814484, | |
| 21 | + "heldout_nll_with_this_mlp_linearized": 1.6792866821037924, | |
| 22 | + "nll_increase": 0.5036339985459386 | |
| 23 | + }, | |
| 24 | + { | |
| 25 | + "layer": 1, | |
| 26 | + "tokens_fit": 15037, | |
| 27 | + "tokens_eval": 7331, | |
| 28 | + "linear_fit_rel_residual_heldout": 0.32023999094963074, | |
| 29 | + "linear_fit_rel_residual_fit": 0.23468588292598724, | |
| 30 | + "heldout_nll_with_this_mlp_linearized": 1.966630721415958, | |
| 31 | + "nll_increase": 0.7909780378581042 | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "layer": 2, | |
| 35 | + "tokens_fit": 15037, | |
| 36 | + "tokens_eval": 7331, | |
| 37 | + "linear_fit_rel_residual_heldout": 0.6407136917114258, | |
| 38 | + "linear_fit_rel_residual_fit": 0.3714005947113037, | |
| 39 | + "heldout_nll_with_this_mlp_linearized": 1.1735411567986216, | |
| 40 | + "nll_increase": -0.0021115267592322073 | |
| 41 | + }, | |
| 42 | + { | |
| 43 | + "layer": 3, | |
| 44 | + "tokens_fit": 15037, | |
| 45 | + "tokens_eval": 7331, | |
| 46 | + "linear_fit_rel_residual_heldout": 0.6078696250915527, | |
| 47 | + "linear_fit_rel_residual_fit": 0.36648258566856384, | |
| 48 | + "heldout_nll_with_this_mlp_linearized": 1.1770627622561205, | |
| 49 | + "nll_increase": 0.0014100786982667035 | |
| 50 | + }, | |
| 51 | + { | |
| 52 | + "layer": 4, | |
| 53 | + "tokens_fit": 15037, | |
| 54 | + "tokens_eval": 7331, | |
| 55 | + "linear_fit_rel_residual_heldout": 0.6115131974220276, | |
| 56 | + "linear_fit_rel_residual_fit": 0.3906556963920593, | |
| 57 | + "heldout_nll_with_this_mlp_linearized": 1.173121721128789, | |
| 58 | + "nll_increase": -0.002530962429064809 | |
| 59 | + }, | |
| 60 | + { | |
| 61 | + "layer": 5, | |
| 62 | + "tokens_fit": 15037, | |
| 63 | + "tokens_eval": 7331, | |
| 64 | + "linear_fit_rel_residual_heldout": 0.6364412903785706, | |
| 65 | + "linear_fit_rel_residual_fit": 0.4186154305934906, | |
| 66 | + "heldout_nll_with_this_mlp_linearized": 1.1903656303040564, | |
| 67 | + "nll_increase": 0.014712946746202604 | |
| 68 | + }, | |
| 69 | + { | |
| 70 | + "layer": 6, | |
| 71 | + "tokens_fit": 15037, | |
| 72 | + "tokens_eval": 7331, | |
| 73 | + "linear_fit_rel_residual_heldout": 0.6341589689254761, | |
| 74 | + "linear_fit_rel_residual_fit": 0.4321514368057251, | |
| 75 | + "heldout_nll_with_this_mlp_linearized": 1.1641916189480181, | |
| 76 | + "nll_increase": -0.011461064609835647 | |
| 77 | + }, | |
| 78 | + { | |
| 79 | + "layer": 7, | |
| 80 | + "tokens_fit": 15037, | |
| 81 | + "tokens_eval": 7331, | |
| 82 | + "linear_fit_rel_residual_heldout": 0.0841650441288948, | |
| 83 | + "linear_fit_rel_residual_fit": 0.06209689378738403, | |
| 84 | + "heldout_nll_with_this_mlp_linearized": 1.4548797084215557, | |
| 85 | + "nll_increase": 0.2792270248637019 | |
| 86 | + }, | |
| 87 | + { | |
| 88 | + "layer": 8, | |
| 89 | + "tokens_fit": 15037, | |
| 90 | + "tokens_eval": 7331, | |
| 91 | + "linear_fit_rel_residual_heldout": 0.5959340333938599, | |
| 92 | + "linear_fit_rel_residual_fit": 0.4181574285030365, | |
| 93 | + "heldout_nll_with_this_mlp_linearized": 1.177989532257235, | |
| 94 | + "nll_increase": 0.002336848699381111 | |
| 95 | + }, | |
| 96 | + { | |
| 97 | + "layer": 9, | |
| 98 | + "tokens_fit": 15037, | |
| 99 | + "tokens_eval": 7331, | |
| 100 | + "linear_fit_rel_residual_heldout": 0.5791919231414795, | |
| 101 | + "linear_fit_rel_residual_fit": 0.41058239340782166, | |
| 102 | + "heldout_nll_with_this_mlp_linearized": 1.1665453274477953, | |
| 103 | + "nll_increase": -0.009107356110058529 | |
| 104 | + }, | |
| 105 | + { | |
| 106 | + "layer": 10, | |
| 107 | + "tokens_fit": 15037, | |
| 108 | + "tokens_eval": 7331, | |
| 109 | + "linear_fit_rel_residual_heldout": 0.573920488357544, | |
| 110 | + "linear_fit_rel_residual_fit": 0.416637122631073, | |
| 111 | + "heldout_nll_with_this_mlp_linearized": 1.1668677899657969, | |
| 112 | + "nll_increase": -0.00878489359205692 | |
| 113 | + }, | |
| 114 | + { | |
| 115 | + "layer": 11, | |
| 116 | + "tokens_fit": 15037, | |
| 117 | + "tokens_eval": 7331, | |
| 118 | + "linear_fit_rel_residual_heldout": 0.5821214318275452, | |
| 119 | + "linear_fit_rel_residual_fit": 0.4281195402145386, | |
| 120 | + "heldout_nll_with_this_mlp_linearized": 1.15429871668624, | |
| 121 | + "nll_increase": -0.02135396687161384 | |
| 122 | + }, | |
| 123 | + { | |
| 124 | + "layer": 12, | |
| 125 | + "tokens_fit": 15037, | |
| 126 | + "tokens_eval": 7331, | |
| 127 | + "linear_fit_rel_residual_heldout": 0.6317298412322998, | |
| 128 | + "linear_fit_rel_residual_fit": 0.4664536118507385, | |
| 129 | + "heldout_nll_with_this_mlp_linearized": 1.1655581166528082, | |
| 130 | + "nll_increase": -0.010094566905045621 | |
| 131 | + }, | |
| 132 | + { | |
| 133 | + "layer": 13, | |
| 134 | + "tokens_fit": 15037, | |
| 135 | + "tokens_eval": 7331, | |
| 136 | + "linear_fit_rel_residual_heldout": 0.6349923610687256, | |
| 137 | + "linear_fit_rel_residual_fit": 0.4728669226169586, | |
| 138 | + "heldout_nll_with_this_mlp_linearized": 1.1676120488605386, | |
| 139 | + "nll_increase": -0.008040634697315197 | |
| 140 | + }, | |
| 141 | + { | |
| 142 | + "layer": 14, | |
| 143 | + "tokens_fit": 15037, | |
| 144 | + "tokens_eval": 7331, | |
| 145 | + "linear_fit_rel_residual_heldout": 0.626116931438446, | |
| 146 | + "linear_fit_rel_residual_fit": 0.464733749628067, | |
| 147 | + "heldout_nll_with_this_mlp_linearized": 1.1756410474493382, | |
| 148 | + "nll_increase": -1.1636108515622468e-05 | |
| 149 | + }, | |
| 150 | + { | |
| 151 | + "layer": 15, | |
| 152 | + "tokens_fit": 15037, | |
| 153 | + "tokens_eval": 7331, | |
| 154 | + "linear_fit_rel_residual_heldout": 0.6561360359191895, | |
| 155 | + "linear_fit_rel_residual_fit": 0.48900657892227173, | |
| 156 | + "heldout_nll_with_this_mlp_linearized": 1.176013168525408, | |
| 157 | + "nll_increase": 0.0003604849675542532 | |
| 158 | + }, | |
| 159 | + { | |
| 160 | + "layer": 16, | |
| 161 | + "tokens_fit": 15037, | |
| 162 | + "tokens_eval": 7331, | |
| 163 | + "linear_fit_rel_residual_heldout": 0.680796205997467, | |
| 164 | + "linear_fit_rel_residual_fit": 0.5120365023612976, | |
| 165 | + "heldout_nll_with_this_mlp_linearized": 1.1915885601951464, | |
| 166 | + "nll_increase": 0.015935876637292568 | |
| 167 | + }, | |
| 168 | + { | |
| 169 | + "layer": 17, | |
| 170 | + "tokens_fit": 15037, | |
| 171 | + "tokens_eval": 7331, | |
| 172 | + "linear_fit_rel_residual_heldout": 0.6996240615844727, | |
| 173 | + "linear_fit_rel_residual_fit": 0.5291376113891602, | |
| 174 | + "heldout_nll_with_this_mlp_linearized": 1.2163302084494154, | |
| 175 | + "nll_increase": 0.04067752489156162 | |
| 176 | + }, | |
| 177 | + { | |
| 178 | + "layer": 18, | |
| 179 | + "tokens_fit": 15037, | |
| 180 | + "tokens_eval": 7331, | |
| 181 | + "linear_fit_rel_residual_heldout": 0.6950899958610535, | |
| 182 | + "linear_fit_rel_residual_fit": 0.531206488609314, | |
| 183 | + "heldout_nll_with_this_mlp_linearized": 1.214632207221446, | |
| 184 | + "nll_increase": 0.03897952366359214 | |
| 185 | + }, | |
| 186 | + { | |
| 187 | + "layer": 19, | |
| 188 | + "tokens_fit": 15037, | |
| 189 | + "tokens_eval": 7331, | |
| 190 | + "linear_fit_rel_residual_heldout": 0.7332715392112732, | |
| 191 | + "linear_fit_rel_residual_fit": 0.5558183789253235, | |
| 192 | + "heldout_nll_with_this_mlp_linearized": 1.191774419821955, | |
| 193 | + "nll_increase": 0.016121736264101294 | |
| 194 | + }, | |
| 195 | + { | |
| 196 | + "layer": 20, | |
| 197 | + "tokens_fit": 15037, | |
| 198 | + "tokens_eval": 7331, | |
| 199 | + "linear_fit_rel_residual_heldout": 0.7791457176208496, | |
| 200 | + "linear_fit_rel_residual_fit": 0.5871586799621582, | |
| 201 | + "heldout_nll_with_this_mlp_linearized": 1.191386627670244, | |
| 202 | + "nll_increase": 0.015733944112390263 | |
| 203 | + }, | |
| 204 | + { | |
| 205 | + "layer": 21, | |
| 206 | + "tokens_fit": 15037, | |
| 207 | + "tokens_eval": 7331, | |
| 208 | + "linear_fit_rel_residual_heldout": 0.780479907989502, | |
| 209 | + "linear_fit_rel_residual_fit": 0.5852652192115784, | |
| 210 | + "heldout_nll_with_this_mlp_linearized": 1.2004733234092118, | |
| 211 | + "nll_increase": 0.024820639851357962 | |
| 212 | + }, | |
| 213 | + { | |
| 214 | + "layer": 22, | |
| 215 | + "tokens_fit": 15037, | |
| 216 | + "tokens_eval": 7331, | |
| 217 | + "linear_fit_rel_residual_heldout": 0.3277125060558319, | |
| 218 | + "linear_fit_rel_residual_fit": 0.25426793098449707, | |
| 219 | + "heldout_nll_with_this_mlp_linearized": 3.4711043112334554, | |
| 220 | + "nll_increase": 2.2954516276756016 | |
| 221 | + }, | |
| 222 | + { | |
| 223 | + "layer": 23, | |
| 224 | + "tokens_fit": 15037, | |
| 225 | + "tokens_eval": 7331, | |
| 226 | + "linear_fit_rel_residual_heldout": 0.31013911962509155, | |
| 227 | + "linear_fit_rel_residual_fit": 0.2435382902622223, | |
| 228 | + "heldout_nll_with_this_mlp_linearized": 1.3641300162175543, | |
| 229 | + "nll_increase": 0.18847733265970046 | |
| 230 | + } | |
| 231 | + ], | |
| 232 | + "fit": "GSM8K train[0:80] all positions; eval GSM8K test[0:40]; least squares with bias, ridge 1e-6 * mean diag" | |
| 233 | +} | |
| \ No newline at end of file |
evidence/math-training/e3-toy.json
| new file mode 100644 | ||
| @@ -0,0 +1,42 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "2b78ff0c9f2a49994214b301e8f5360050a72256", | |
| 8 | + "code_dirty": true, | |
| 9 | + "command": ".venv/bin/python e3.py toy", | |
| 10 | + "utc": "2026-10-20T18:33:10Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "Q2_equals_Q_plus_I_exact": true, | |
| 14 | + "eigenvalues": [ | |
| 15 | + -0.6180339887498948, | |
| 16 | + 1.618033988749895 | |
| 17 | + ], | |
| 18 | + "eigen_match_golden": true, | |
| 19 | + "product_rule_exact_200_random_rationals": true, | |
| 20 | + "relu_witness": { | |
| 21 | + "v": [ | |
| 22 | + "1", | |
| 23 | + "-2" | |
| 24 | + ], | |
| 25 | + "Q_relu_v": [ | |
| 26 | + "1", | |
| 27 | + "1" | |
| 28 | + ], | |
| 29 | + "relu_Q_v": [ | |
| 30 | + "0", | |
| 31 | + "1" | |
| 32 | + ] | |
| 33 | + }, | |
| 34 | + "relu_breaks_commutation": true, | |
| 35 | + "chunked_G_H_exact": true, | |
| 36 | + "ridge_solution_exact": [ | |
| 37 | + "-1338234/14757343", | |
| 38 | + "-985472/14757343", | |
| 39 | + "6721094/14757343" | |
| 40 | + ], | |
| 41 | + "ridge_gradient_exact_zero": true | |
| 42 | +} | |
| \ No newline at end of file |
evidence/math-training/e4-subspace.json
| new file mode 100644 | ||
| @@ -0,0 +1,797 @@ | ||
| 1 | +{ | |
| 2 | + "chip": "GB10 (DGX Spark)", | |
| 3 | + "torch_device": "NVIDIA GB10", | |
| 4 | + "host": "spark-b87b", | |
| 5 | + "model": "/home/drakestapleton/models/SmolLM2-1.7B-Instruct-31b70e2e869a", | |
| 6 | + "model_sha256": "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8", | |
| 7 | + "code_sha": "e2217f03be0c2e3dfb1df637f9557be902aacc5c", | |
| 8 | + "code_dirty": false, | |
| 9 | + "command": ".venv/bin/python e4.py", | |
| 10 | + "utc": "2026-10-20T19:33:56Z", | |
| 11 | + "torch": "2.14.0+cu130", | |
| 12 | + "numpy": "2.5.3", | |
| 13 | + "per_layer": [ | |
| 14 | + { | |
| 15 | + "layer": 0, | |
| 16 | + "tokens": 14957, | |
| 17 | + "energy_dims": { | |
| 18 | + "0.95": 468, | |
| 19 | + "0.99": 1020, | |
| 20 | + "0.999": 1692 | |
| 21 | + }, | |
| 22 | + "outlier_dims": [ | |
| 23 | + 209, | |
| 24 | + 227 | |
| 25 | + ], | |
| 26 | + "energy_dims_without_outlier_dims": { | |
| 27 | + "0.95": 657, | |
| 28 | + "0.99": 1209, | |
| 29 | + "0.999": 1798 | |
| 30 | + }, | |
| 31 | + "share_of_uncentered_energy_in_outlier_dims": 0.5122101870687759 | |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "layer": 1, | |
| 35 | + "tokens": 14957, | |
| 36 | + "energy_dims": { | |
| 37 | + "0.95": 1, | |
| 38 | + "0.99": 1, | |
| 39 | + "0.999": 417 | |
| 40 | + }, | |
| 41 | + "outlier_dims": [ | |
| 42 | + 161, | |
| 43 | + 227, | |
| 44 | + 749 | |
| 45 | + ], | |
| 46 | + "energy_dims_without_outlier_dims": { | |
| 47 | + "0.95": 717, | |
| 48 | + "0.99": 1372, | |
| 49 | + "0.999": 1905 | |
| 50 | + }, | |
| 51 | + "share_of_uncentered_energy_in_outlier_dims": 0.9895771684350237 | |
| 52 | + }, | |
| 53 | + { | |
| 54 | + "layer": 2, | |
| 55 | + "tokens": 14957, | |
| 56 | + "energy_dims": { | |
| 57 | + "0.95": 1, | |
| 58 | + "0.99": 31, | |
| 59 | + "0.999": 793 | |
| 60 | + }, | |
| 61 | + "outlier_dims": [ | |
| 62 | + 161, | |
| 63 | + 227, | |
| 64 | + 749 | |
| 65 | + ], | |
| 66 | + "energy_dims_without_outlier_dims": { | |
| 67 | + "0.95": 811, | |
| 68 | + "0.99": 1471, | |
| 69 | + "0.999": 1938 | |
| 70 | + }, | |
| 71 | + "share_of_uncentered_energy_in_outlier_dims": 0.9788209674497375 | |
| 72 | + }, | |
| 73 | + { | |
| 74 | + "layer": 3, | |
| 75 | + "tokens": 14957, | |
| 76 | + "energy_dims": { | |
| 77 | + "0.95": 1, | |
| 78 | + "0.99": 132, | |
| 79 | + "0.999": 1056 | |
| 80 | + }, | |
| 81 | + "outlier_dims": [ | |
| 82 | + 161, | |
| 83 | + 227, | |
| 84 | + 749 | |
| 85 | + ], | |
| 86 | + "energy_dims_without_outlier_dims": { | |
| 87 | + "0.95": 812, | |
| 88 | + "0.99": 1477, | |
| 89 | + "0.999": 1941 | |
| 90 | + }, | |
| 91 | + "share_of_uncentered_energy_in_outlier_dims": 0.9620186370602501 | |
| 92 | + }, | |
| 93 | + { | |
| 94 | + "layer": 4, | |
| 95 | + "tokens": 14957, | |
| 96 | + "energy_dims": { | |
| 97 | + "0.95": 2, | |
| 98 | + "0.99": 266, | |
| 99 | + "0.999": 1297 | |
| 100 | + }, | |
| 101 | + "outlier_dims": [ | |
| 102 | + 161, | |
| 103 | + 227, | |
| 104 | + 749 | |
| 105 | + ], | |
| 106 | + "energy_dims_without_outlier_dims": { | |
| 107 | + "0.95": 867, | |
| 108 | + "0.99": 1535, | |
| 109 | + "0.999": 1958 | |
| 110 | + }, | |
| 111 | + "share_of_uncentered_energy_in_outlier_dims": 0.9438454555228899 | |
| 112 | + }, | |
| 113 | + { | |
| 114 | + "layer": 5, | |
| 115 | + "tokens": 14957, | |
| 116 | + "energy_dims": { | |
| 117 | + "0.95": 14, | |
| 118 | + "0.99": 419, | |
| 119 | + "0.999": 1471 | |
| 120 | + }, | |
| 121 | + "outlier_dims": [ | |
| 122 | + 161, | |
| 123 | + 227, | |
| 124 | + 749 | |
| 125 | + ], | |
| 126 | + "energy_dims_without_outlier_dims": { | |
| 127 | + "0.95": 896, | |
| 128 | + "0.99": 1566, | |
| 129 | + "0.999": 1966 | |
| 130 | + }, | |
| 131 | + "share_of_uncentered_energy_in_outlier_dims": 0.9209949030778274 | |
| 132 | + }, | |
| 133 | + { | |
| 134 | + "layer": 6, | |
| 135 | + "tokens": 14957, | |
| 136 | + "energy_dims": { | |
| 137 | + "0.95": 46, | |
| 138 | + "0.99": 616, | |
| 139 | + "0.999": 1621 | |
| 140 | + }, | |
| 141 | + "outlier_dims": [ | |
| 142 | + 161, | |
| 143 | + 227, | |
| 144 | + 749 | |
| 145 | + ], | |
| 146 | + "energy_dims_without_outlier_dims": { | |
| 147 | + "0.95": 937, | |
| 148 | + "0.99": 1601, | |
| 149 | + "0.999": 1974 | |
| 150 | + }, | |
| 151 | + "share_of_uncentered_energy_in_outlier_dims": 0.8908346599878901 | |
| 152 | + }, | |
| 153 | + { | |
| 154 | + "layer": 7, | |
| 155 | + "tokens": 14957, | |
| 156 | + "energy_dims": { | |
| 157 | + "0.95": 985, | |
| 158 | + "0.99": 1637, | |
| 159 | + "0.999": 1984 | |
| 160 | + }, | |
| 161 | + "outlier_dims": [ | |
| 162 | + 227, | |
| 163 | + 749 | |
| 164 | + ], | |
| 165 | + "energy_dims_without_outlier_dims": { | |
| 166 | + "0.95": 997, | |
| 167 | + "0.99": 1643, | |
| 168 | + "0.999": 1984 | |
| 169 | + }, | |
| 170 | + "share_of_uncentered_energy_in_outlier_dims": 0.3626312277283606 | |
| 171 | + }, | |
| 172 | + { | |
| 173 | + "layer": 8, | |
| 174 | + "tokens": 14957, | |
| 175 | + "energy_dims": { | |
| 176 | + "0.95": 962, | |
| 177 | + "0.99": 1614, | |
| 178 | + "0.999": 1977 | |
| 179 | + }, | |
| 180 | + "outlier_dims": [ | |
| 181 | + 227, | |
| 182 | + 749 | |
| 183 | + ], | |
| 184 | + "energy_dims_without_outlier_dims": { | |
| 185 | + "0.95": 968, | |
| 186 | + "0.99": 1617, | |
| 187 | + "0.999": 1976 | |
| 188 | + }, | |
| 189 | + "share_of_uncentered_energy_in_outlier_dims": 0.3909905599494293 | |
| 190 | + }, | |
| 191 | + { | |
| 192 | + "layer": 9, | |
| 193 | + "tokens": 14957, | |
| 194 | + "energy_dims": { | |
| 195 | + "0.95": 924, | |
| 196 | + "0.99": 1588, | |
| 197 | + "0.999": 1971 | |
| 198 | + }, | |
| 199 | + "outlier_dims": [ | |
| 200 | + 227, | |
| 201 | + 749 | |
| 202 | + ], | |
| 203 | + "energy_dims_without_outlier_dims": { | |
| 204 | + "0.95": 932, | |
| 205 | + "0.99": 1592, | |
| 206 | + "0.999": 1970 | |
| 207 | + }, | |
| 208 | + "share_of_uncentered_energy_in_outlier_dims": 0.32886622719876285 | |
| 209 | + }, | |
| 210 | + { | |
| 211 | + "layer": 10, | |
| 212 | + "tokens": 14957, | |
| 213 | + "energy_dims": { | |
| 214 | + "0.95": 927, | |
| 215 | + "0.99": 1591, | |
| 216 | + "0.999": 1971 | |
| 217 | + }, | |
| 218 | + "outlier_dims": [ | |
| 219 | + 227, | |
| 220 | + 749 | |
| 221 | + ], | |
| 222 | + "energy_dims_without_outlier_dims": { | |
| 223 | + "0.95": 937, | |
| 224 | + "0.99": 1596, | |
| 225 | + "0.999": 1971 | |
| 226 | + }, | |
| 227 | + "share_of_uncentered_energy_in_outlier_dims": 0.30366635196822345 | |
| 228 | + }, | |
| 229 | + { | |
| 230 | + "layer": 11, | |
| 231 | + "tokens": 14957, | |
| 232 | + "energy_dims": { | |
| 233 | + "0.95": 964, | |
| 234 | + "0.99": 1617, | |
| 235 | + "0.999": 1978 | |
| 236 | + }, | |
| 237 | + "outlier_dims": [ | |
| 238 | + 227, | |
| 239 | + 749 | |
| 240 | + ], | |
| 241 | + "energy_dims_without_outlier_dims": { | |
| 242 | + "0.95": 974, | |
| 243 | + "0.99": 1622, | |
| 244 | + "0.999": 1977 | |
| 245 | + }, | |
| 246 | + "share_of_uncentered_energy_in_outlier_dims": 0.3043451905083139 | |
| 247 | + }, | |
| 248 | + { | |
| 249 | + "layer": 12, | |
| 250 | + "tokens": 14957, | |
| 251 | + "energy_dims": { | |
| 252 | + "0.95": 1025, | |
| 253 | + "0.99": 1659, | |
| 254 | + "0.999": 1988 | |
| 255 | + }, | |
| 256 | + "outlier_dims": [ | |
| 257 | + 227, | |
| 258 | + 749 | |
| 259 | + ], | |
| 260 | + "energy_dims_without_outlier_dims": { | |
| 261 | + "0.95": 1036, | |
| 262 | + "0.99": 1664, | |
| 263 | + "0.999": 1988 | |
| 264 | + }, | |
| 265 | + "share_of_uncentered_energy_in_outlier_dims": 0.3097948865572973 | |
| 266 | + }, | |
| 267 | + { | |
| 268 | + "layer": 13, | |
| 269 | + "tokens": 14957, | |
| 270 | + "energy_dims": { | |
| 271 | + "0.95": 1075, | |
| 272 | + "0.99": 1692, | |
| 273 | + "0.999": 1994 | |
| 274 | + }, | |
| 275 | + "outlier_dims": [ | |
| 276 | + 227, | |
| 277 | + 749 | |
| 278 | + ], | |
| 279 | + "energy_dims_without_outlier_dims": { | |
| 280 | + "0.95": 1088, | |
| 281 | + "0.99": 1697, | |
| 282 | + "0.999": 1994 | |
| 283 | + }, | |
| 284 | + "share_of_uncentered_energy_in_outlier_dims": 0.31226691537535733 | |
| 285 | + }, | |
| 286 | + { | |
| 287 | + "layer": 14, | |
| 288 | + "tokens": 14957, | |
| 289 | + "energy_dims": { | |
| 290 | + "0.95": 1096, | |
| 291 | + "0.99": 1704, | |
| 292 | + "0.999": 1997 | |
| 293 | + }, | |
| 294 | + "outlier_dims": [ | |
| 295 | + 227, | |
| 296 | + 749 | |
| 297 | + ], | |
| 298 | + "energy_dims_without_outlier_dims": { | |
| 299 | + "0.95": 1110, | |
| 300 | + "0.99": 1710, | |
| 301 | + "0.999": 1996 | |
| 302 | + }, | |
| 303 | + "share_of_uncentered_energy_in_outlier_dims": 0.30886364634703917 | |
| 304 | + }, | |
| 305 | + { | |
| 306 | + "layer": 15, | |
| 307 | + "tokens": 14957, | |
| 308 | + "energy_dims": { | |
| 309 | + "0.95": 1131, | |
| 310 | + "0.99": 1725, | |
| 311 | + "0.999": 2001 | |
| 312 | + }, | |
| 313 | + "outlier_dims": [ | |
| 314 | + 227, | |
| 315 | + 749 | |
| 316 | + ], | |
| 317 | + "energy_dims_without_outlier_dims": { | |
| 318 | + "0.95": 1146, | |
| 319 | + "0.99": 1731, | |
| 320 | + "0.999": 2000 | |
| 321 | + }, | |
| 322 | + "share_of_uncentered_energy_in_outlier_dims": 0.2929399747494517 | |
| 323 | + }, | |
| 324 | + { | |
| 325 | + "layer": 16, | |
| 326 | + "tokens": 14957, | |
| 327 | + "energy_dims": { | |
| 328 | + "0.95": 1170, | |
| 329 | + "0.99": 1746, | |
| 330 | + "0.999": 2005 | |
| 331 | + }, | |
| 332 | + "outlier_dims": [ | |
| 333 | + 227, | |
| 334 | + 749 | |
| 335 | + ], | |
| 336 | + "energy_dims_without_outlier_dims": { | |
| 337 | + "0.95": 1189, | |
| 338 | + "0.99": 1753, | |
| 339 | + "0.999": 2004 | |
| 340 | + }, | |
| 341 | + "share_of_uncentered_energy_in_outlier_dims": 0.28985386829061255 | |
| 342 | + }, | |
| 343 | + { | |
| 344 | + "layer": 17, | |
| 345 | + "tokens": 14957, | |
| 346 | + "energy_dims": { | |
| 347 | + "0.95": 1203, | |
| 348 | + "0.99": 1762, | |
| 349 | + "0.999": 2007 | |
| 350 | + }, | |
| 351 | + "outlier_dims": [ | |
| 352 | + 749 | |
| 353 | + ], | |
| 354 | + "energy_dims_without_outlier_dims": { | |
| 355 | + "0.95": 1216, | |
| 356 | + "0.99": 1768, | |
| 357 | + "0.999": 2008 | |
| 358 | + }, | |
| 359 | + "share_of_uncentered_energy_in_outlier_dims": 0.22900764389170505 | |
| 360 | + }, | |
| 361 | + { | |
| 362 | + "layer": 18, | |
| 363 | + "tokens": 14957, | |
| 364 | + "energy_dims": { | |
| 365 | + "0.95": 1210, | |
| 366 | + "0.99": 1764, | |
| 367 | + "0.999": 2007 | |
| 368 | + }, | |
| 369 | + "outlier_dims": [ | |
| 370 | + 749 | |
| 371 | + ], | |
| 372 | + "energy_dims_without_outlier_dims": { | |
| 373 | + "0.95": 1228, | |
| 374 | + "0.99": 1772, | |
| 375 | + "0.999": 2008 | |
| 376 | + }, | |
| 377 | + "share_of_uncentered_energy_in_outlier_dims": 0.2686510927484983 | |
| 378 | + }, | |
| 379 | + { | |
| 380 | + "layer": 19, | |
| 381 | + "tokens": 14957, | |
| 382 | + "energy_dims": { | |
| 383 | + "0.95": 1250, | |
| 384 | + "0.99": 1785, | |
| 385 | + "0.999": 2011 | |
| 386 | + }, | |
| 387 | + "outlier_dims": [ | |
| 388 | + 749 | |
| 389 | + ], | |
| 390 | + "energy_dims_without_outlier_dims": { | |
| 391 | + "0.95": 1271, | |
| 392 | + "0.99": 1793, | |
| 393 | + "0.999": 2011 | |
| 394 | + }, | |
| 395 | + "share_of_uncentered_energy_in_outlier_dims": 0.3520854845166915 | |
| 396 | + }, | |
| 397 | + { | |
| 398 | + "layer": 20, | |
| 399 | + "tokens": 14957, | |
| 400 | + "energy_dims": { | |
| 401 | + "0.95": 1319, | |
| 402 | + "0.99": 1817, | |
| 403 | + "0.999": 2017 | |
| 404 | + }, | |
| 405 | + "outlier_dims": [ | |
| 406 | + 749 | |
| 407 | + ], | |
| 408 | + "energy_dims_without_outlier_dims": { | |
| 409 | + "0.95": 1340, | |
| 410 | + "0.99": 1825, | |
| 411 | + "0.999": 2017 | |
| 412 | + }, | |
| 413 | + "share_of_uncentered_energy_in_outlier_dims": 0.4310281244655413 | |
| 414 | + }, | |
| 415 | + { | |
| 416 | + "layer": 21, | |
| 417 | + "tokens": 14957, | |
| 418 | + "energy_dims": { | |
| 419 | + "0.95": 1372, | |
| 420 | + "0.99": 1840, | |
| 421 | + "0.999": 2020 | |
| 422 | + }, | |
| 423 | + "outlier_dims": [ | |
| 424 | + 749 | |
| 425 | + ], | |
| 426 | + "energy_dims_without_outlier_dims": { | |
| 427 | + "0.95": 1392, | |
| 428 | + "0.99": 1847, | |
| 429 | + "0.999": 2021 | |
| 430 | + }, | |
| 431 | + "share_of_uncentered_energy_in_outlier_dims": 0.49413729059524886 | |
| 432 | + }, | |
| 433 | + { | |
| 434 | + "layer": 22, | |
| 435 | + "tokens": 14957, | |
| 436 | + "energy_dims": { | |
| 437 | + "0.95": 1391, | |
| 438 | + "0.99": 1848, | |
| 439 | + "0.999": 2021 | |
| 440 | + }, | |
| 441 | + "outlier_dims": [ | |
| 442 | + 749 | |
| 443 | + ], | |
| 444 | + "energy_dims_without_outlier_dims": { | |
| 445 | + "0.95": 1404, | |
| 446 | + "0.99": 1852, | |
| 447 | + "0.999": 2021 | |
| 448 | + }, | |
| 449 | + "share_of_uncentered_energy_in_outlier_dims": 0.5666537325636681 | |
| 450 | + }, | |
| 451 | + { | |
| 452 | + "layer": 23, | |
| 453 | + "tokens": 14957, | |
| 454 | + "energy_dims": { | |
| 455 | + "0.95": 1082, | |
| 456 | + "0.99": 1706, | |
| 457 | + "0.999": 1993 | |
| 458 | + }, | |
| 459 | + "outlier_dims": [ | |
| 460 | + 749 | |
| 461 | + ], | |
| 462 | + "energy_dims_without_outlier_dims": { | |
| 463 | + "0.95": 1156, | |
| 464 | + "0.99": 1740, | |
| 465 | + "0.999": 1998 | |
| 466 | + }, | |
| 467 | + "share_of_uncentered_energy_in_outlier_dims": 0.4084261047827233 | |
| 468 | + } | |
| 469 | + ], | |
| 470 | + "consecutive_overlap_k64": [ | |
| 471 | + 0.5909035205841064, | |
| 472 | + 0.6665818691253662, | |
| 473 | + 0.7203221321105957, | |
| 474 | + 0.7474995255470276, | |
| 475 | + 0.7726089954376221, | |
| 476 | + 0.7743415832519531, | |
| 477 | + 0.7730801105499268, | |
| 478 | + 0.7375953197479248, | |
| 479 | + 0.7184196710586548, | |
| 480 | + 0.7087395787239075, | |
| 481 | + 0.7654553651809692, | |
| 482 | + 0.7504642009735107, | |
| 483 | + 0.7797842025756836, | |
| 484 | + 0.7442257404327393, | |
| 485 | + 0.699998140335083, | |
| 486 | + 0.6785849928855896, | |
| 487 | + 0.6855767965316772, | |
| 488 | + 0.6410493850708008, | |
| 489 | + 0.7029748558998108, | |
| 490 | + 0.7807345986366272, | |
| 491 | + 0.7774302959442139, | |
| 492 | + 0.7775859832763672, | |
| 493 | + 0.45247727632522583 | |
| 494 | + ], | |
| 495 | + "first_last_overlap_k64": 0.04873122274875641, | |
| 496 | + "consecutive_overlap_k256": [ | |
| 497 | + 0.5791348218917847, | |
| 498 | + 0.6052981615066528, | |
| 499 | + 0.663759708404541, | |
| 500 | + 0.6886452436447144, | |
| 501 | + 0.714330792427063, | |
| 502 | + 0.7173071503639221, | |
| 503 | + 0.7094722986221313, | |
| 504 | + 0.6813358664512634, | |
| 505 | + 0.6732624173164368, | |
| 506 | + 0.6682383418083191, | |
| 507 | + 0.709286093711853, | |
| 508 | + 0.6979447603225708, | |
| 509 | + 0.7173097133636475, | |
| 510 | + 0.6933025121688843, | |
| 511 | + 0.658082902431488, | |
| 512 | + 0.634993851184845, | |
| 513 | + 0.6276764869689941, | |
| 514 | + 0.6366953253746033, | |
| 515 | + 0.6777245998382568, | |
| 516 | + 0.7240496873855591, | |
| 517 | + 0.7366058230400085, | |
| 518 | + 0.7434660196304321, | |
| 519 | + 0.583238959312439 | |
| 520 | + ], | |
| 521 | + "first_last_overlap_k256": 0.1377461850643158, | |
| 522 | + "consecutive_overlap_k1024": [ | |
| 523 | + 0.6656155586242676, | |
| 524 | + 0.683817982673645, | |
| 525 | + 0.7208028435707092, | |
| 526 | + 0.7317236661911011, | |
| 527 | + 0.750130832195282, | |
| 528 | + 0.7504730224609375, | |
| 529 | + 0.7453213930130005, | |
| 530 | + 0.7253022193908691, | |
| 531 | + 0.7259275317192078, | |
| 532 | + 0.724860668182373, | |
| 533 | + 0.7428025603294373, | |
| 534 | + 0.7411999702453613, | |
| 535 | + 0.7492762804031372, | |
| 536 | + 0.7363269329071045, | |
| 537 | + 0.7251591682434082, | |
| 538 | + 0.7158455848693848, | |
| 539 | + 0.7173327803611755, | |
| 540 | + 0.7266428470611572, | |
| 541 | + 0.7481583952903748, | |
| 542 | + 0.7687187194824219, | |
| 543 | + 0.7781727313995361, | |
| 544 | + 0.7940627932548523, | |
| 545 | + 0.7626407742500305 | |
| 546 | + ], | |
| 547 | + "first_last_overlap_k1024": 0.5017068386077881, | |
| 548 | + "heldout_nll_full": 1.1744016658587804, | |
| 549 | + "all_boundaries_pca": [ | |
| 550 | + { | |
| 551 | + "k": 64, | |
| 552 | + "nll": 5.8997404218586595, | |
| 553 | + "nll_increase": 4.725338755999879, | |
| 554 | + "top1_agreement_with_full": 0.24386229598134687 | |
| 555 | + }, | |
| 556 | + { | |
| 557 | + "k": 128, | |
| 558 | + "nll": 4.944652004343968, | |
| 559 | + "nll_increase": 3.770250338485188, | |
| 560 | + "top1_agreement_with_full": 0.36881086270744756 | |
| 561 | + }, | |
| 562 | + { | |
| 563 | + "k": 256, | |
| 564 | + "nll": 3.840675656417158, | |
| 565 | + "nll_increase": 2.666273990558378, | |
| 566 | + "top1_agreement_with_full": 0.4705801673295844 | |
| 567 | + }, | |
| 568 | + { | |
| 569 | + "k": 512, | |
| 570 | + "nll": 2.76866382205949, | |
| 571 | + "nll_increase": 1.5942621562007095, | |
| 572 | + "top1_agreement_with_full": 0.5986833081881772 | |
| 573 | + }, | |
| 574 | + { | |
| 575 | + "k": 1024, | |
| 576 | + "nll": 1.7829521889713398, | |
| 577 | + "nll_increase": 0.6085505231125594, | |
| 578 | + "top1_agreement_with_full": 0.7214373885612398 | |
| 579 | + }, | |
| 580 | + { | |
| 581 | + "k": 1536, | |
| 582 | + "nll": 1.3135795912417574, | |
| 583 | + "nll_increase": 0.13917792538297702, | |
| 584 | + "top1_agreement_with_full": 0.819777808256755 | |
| 585 | + }, | |
| 586 | + { | |
| 587 | + "k": 2048, | |
| 588 | + "nll": 1.17554714761142, | |
| 589 | + "nll_increase": 0.001145481752639732, | |
| 590 | + "top1_agreement_with_full": 0.9931422301467563 | |
| 591 | + } | |
| 592 | + ], | |
| 593 | + "all_boundaries_random_subspace_control": [ | |
| 594 | + { | |
| 595 | + "k": 512, | |
| 596 | + "nll_increase": 8.45471441080305, | |
| 597 | + "top1_agreement_with_full": 0.06693183376765875 | |
| 598 | + }, | |
| 599 | + { | |
| 600 | + "k": 1024, | |
| 601 | + "nll_increase": 7.035836939327086, | |
| 602 | + "top1_agreement_with_full": 0.06693183376765875 | |
| 603 | + }, | |
| 604 | + { | |
| 605 | + "k": 1536, | |
| 606 | + "nll_increase": 6.849333040443832, | |
| 607 | + "top1_agreement_with_full": 0.06693183376765875 | |
| 608 | + } | |
| 609 | + ], | |
| 610 | + "one_boundary_at_k256": [ | |
| 611 | + { | |
| 612 | + "layer": 0, | |
| 613 | + "k": 256, | |
| 614 | + "nll_increase": 0.10238408355650108, | |
| 615 | + "top1_agreement_with_full": 0.84158551639007 | |
| 616 | + }, | |
| 617 | + { | |
| 618 | + "layer": 1, | |
| 619 | + "k": 256, | |
| 620 | + "nll_increase": 0.09349713334002585, | |
| 621 | + "top1_agreement_with_full": 0.8411740501988754 | |
| 622 | + }, | |
| 623 | + { | |
| 624 | + "layer": 2, | |
| 625 | + "k": 256, | |
| 626 | + "nll_increase": 0.0832399643754258, | |
| 627 | + "top1_agreement_with_full": 0.844740090522562 | |
| 628 | + }, | |
| 629 | + { | |
| 630 | + "layer": 3, | |
| 631 | + "k": 256, | |
| 632 | + "nll_increase": 0.07388293944240965, | |
| 633 | + "top1_agreement_with_full": 0.8480318200521191 | |
| 634 | + }, | |
| 635 | + { | |
| 636 | + "layer": 4, | |
| 637 | + "k": 256, | |
| 638 | + "nll_increase": 0.05587662867011223, | |
| 639 | + "top1_agreement_with_full": 0.8473460430667947 | |
| 640 | + }, | |
| 641 | + { | |
| 642 | + "layer": 5, | |
| 643 | + "k": 256, | |
| 644 | + "nll_increase": 0.06148022902942185, | |
| 645 | + "top1_agreement_with_full": 0.844740090522562 | |
| 646 | + }, | |
| 647 | + { | |
| 648 | + "layer": 6, | |
| 649 | + "k": 256, | |
| 650 | + "nll_increase": 0.05652784787812282, | |
| 651 | + "top1_agreement_with_full": 0.8439171581401728 | |
| 652 | + }, | |
| 653 | + { | |
| 654 | + "layer": 7, | |
| 655 | + "k": 256, | |
| 656 | + "nll_increase": 0.05050762983821011, | |
| 657 | + "top1_agreement_with_full": 0.8421341379783295 | |
| 658 | + }, | |
| 659 | + { | |
| 660 | + "layer": 8, | |
| 661 | + "k": 256, | |
| 662 | + "nll_increase": 0.036582416246137006, | |
| 663 | + "top1_agreement_with_full": 0.8437800027431079 | |
| 664 | + }, | |
| 665 | + { | |
| 666 | + "layer": 9, | |
| 667 | + "k": 256, | |
| 668 | + "nll_increase": 0.04204203022669217, | |
| 669 | + "top1_agreement_with_full": 0.8411740501988754 | |
| 670 | + }, | |
| 671 | + { | |
| 672 | + "layer": 10, | |
| 673 | + "k": 256, | |
| 674 | + "nll_increase": 0.0385593617833897, | |
| 675 | + "top1_agreement_with_full": 0.84158551639007 | |
| 676 | + }, | |
| 677 | + { | |
| 678 | + "layer": 11, | |
| 679 | + "k": 256, | |
| 680 | + "nll_increase": 0.028012374189390066, | |
| 681 | + "top1_agreement_with_full": 0.8277328212865176 | |
| 682 | + }, | |
| 683 | + { | |
| 684 | + "layer": 12, | |
| 685 | + "k": 256, | |
| 686 | + "nll_increase": 0.06456374546543353, | |
| 687 | + "top1_agreement_with_full": 0.8168975449183925 | |
| 688 | + }, | |
| 689 | + { | |
| 690 | + "layer": 13, | |
| 691 | + "k": 256, | |
| 692 | + "nll_increase": 0.09876250488214278, | |
| 693 | + "top1_agreement_with_full": 0.8104512412563435 | |
| 694 | + }, | |
| 695 | + { | |
| 696 | + "layer": 14, | |
| 697 | + "k": 256, | |
| 698 | + "nll_increase": 0.11926948234485901, | |
| 699 | + "top1_agreement_with_full": 0.8004388972706076 | |
| 700 | + }, | |
| 701 | + { | |
| 702 | + "layer": 15, | |
| 703 | + "k": 256, | |
| 704 | + "nll_increase": 0.1874789838486126, | |
| 705 | + "top1_agreement_with_full": 0.7928953504320395 | |
| 706 | + }, | |
| 707 | + { | |
| 708 | + "layer": 16, | |
| 709 | + "k": 256, | |
| 710 | + "nll_increase": 0.2443992218155704, | |
| 711 | + "top1_agreement_with_full": 0.7810999862844603 | |
| 712 | + }, | |
| 713 | + { | |
| 714 | + "layer": 17, | |
| 715 | + "k": 256, | |
| 716 | + "nll_increase": 0.40219847653370255, | |
| 717 | + "top1_agreement_with_full": 0.7651899602249349 | |
| 718 | + }, | |
| 719 | + { | |
| 720 | + "layer": 18, | |
| 721 | + "k": 256, | |
| 722 | + "nll_increase": 0.40478588873884536, | |
| 723 | + "top1_agreement_with_full": 0.7779454121519682 | |
| 724 | + }, | |
| 725 | + { | |
| 726 | + "layer": 19, | |
| 727 | + "k": 256, | |
| 728 | + "nll_increase": 0.4711284331375476, | |
| 729 | + "top1_agreement_with_full": 0.7702647099163352 | |
| 730 | + }, | |
| 731 | + { | |
| 732 | + "layer": 20, | |
| 733 | + "k": 256, | |
| 734 | + "nll_increase": 0.5102921442605555, | |
| 735 | + "top1_agreement_with_full": 0.7684816897544918 | |
| 736 | + }, | |
| 737 | + { | |
| 738 | + "layer": 21, | |
| 739 | + "k": 256, | |
| 740 | + "nll_increase": 0.5007139192067649, | |
| 741 | + "top1_agreement_with_full": 0.7741050610341517 | |
| 742 | + }, | |
| 743 | + { | |
| 744 | + "layer": 22, | |
| 745 | + "k": 256, | |
| 746 | + "nll_increase": 0.6565717865354386, | |
| 747 | + "top1_agreement_with_full": 0.7682073789603621 | |
| 748 | + }, | |
| 749 | + { | |
| 750 | + "layer": 23, | |
| 751 | + "k": 256, | |
| 752 | + "nll_increase": 0.7400036284567446, | |
| 753 | + "top1_agreement_with_full": 0.7322726649293649 | |
| 754 | + } | |
| 755 | + ], | |
| 756 | + "fold_check": { | |
| 757 | + "layer": 12, | |
| 758 | + "k": 512, | |
| 759 | + "rel_err_folded_vs_direct_fp32": 2.876832922993344e-07 | |
| 760 | + }, | |
| 761 | + "decode_bytes": { | |
| 762 | + "full_weight_bytes_per_token": 3422552064, | |
| 763 | + "table": [ | |
| 764 | + { | |
| 765 | + "k": 256, | |
| 766 | + "weight_bytes_per_token": 430964736.0, | |
| 767 | + "ms_at_245GBps_weights_only": 1.7583220563035495, | |
| 768 | + "kv_bytes_per_token_at_ctx_1024_unchanged": 201326592 | |
| 769 | + }, | |
| 770 | + { | |
| 771 | + "k": 512, | |
| 772 | + "weight_bytes_per_token": 868220928.0, | |
| 773 | + "ms_at_245GBps_weights_only": 3.542313047735618, | |
| 774 | + "kv_bytes_per_token_at_ctx_1024_unchanged": 201326592 | |
| 775 | + }, | |
| 776 | + { | |
| 777 | + "k": 1024, | |
| 778 | + "weight_bytes_per_token": 1761607680.0, | |
| 779 | + "ms_at_245GBps_weights_only": 7.187301835985313, | |
| 780 | + "kv_bytes_per_token_at_ctx_1024_unchanged": 201326592 | |
| 781 | + }, | |
| 782 | + { | |
| 783 | + "k": 1536, | |
| 784 | + "weight_bytes_per_token": 2680160256.0, | |
| 785 | + "ms_at_245GBps_weights_only": 10.934966364749082, | |
| 786 | + "kv_bytes_per_token_at_ctx_1024_unchanged": 201326592 | |
| 787 | + }, | |
| 788 | + { | |
| 789 | + "k": 2048, | |
| 790 | + "weight_bytes_per_token": 3623878656.0, | |
| 791 | + "ms_at_245GBps_weights_only": 14.785306634026927, | |
| 792 | + "kv_bytes_per_token_at_ctx_1024_unchanged": 201326592 | |
| 793 | + } | |
| 794 | + ], | |
| 795 | + "note": "weights only, bf16, one decode token; KV-cache reads do not shrink with k" | |
| 796 | + } | |
| 797 | +} | |
| \ No newline at end of file |
evidence/own-fp4/.gitignore
| new file mode 100644 | ||
| @@ -0,0 +1,3 @@ | ||
| 1 | +*.cubin | |
| 2 | +*.err | |
| 3 | +__pycache__/ |
evidence/own-fp4/asm/MATRIX.txt
| new file mode 100644 | ||
| @@ -0,0 +1,35 @@ | ||
| 1 | +# GB10 (sm_121a) assembler acceptance matrix, 2026-10-20T18:45:55Z, Build cuda_13.0.r13.0/compiler.36424714_0 | |
| 2 | +# command: ptxas -arch=sm_121a X.ptx; nvdisasm -hex X.cubin. Source PTX and SASS beside this file. | |
| 3 | +ACCEPT c_rn_e2m1x2 :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|F2FP.SATFINITE.E2M1.F32.PACK_AB_MERGE_C R4, R4, R5, RZ| | |
| 4 | +ACCEPT c_rn_e4m3x2 :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|F2FP.SATFINITE.E4M3.F32.PACK_AB_MERGE_C R4, R4, R5, RZ| | |
| 5 | +ACCEPT c_rp_ue8m0x2 :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|F2FP.SATFINITE.E8.F32.PACK_AB_MERGE_C.RP R4, R4, R5, RZ| | |
| 6 | +REJECT c_rs_e2m1x4 :: ptxas c_rs_e2m1x4.ptx, line 7; error : Feature '.rs' not supported on .target 'sm_121a' | |
| 7 | +REJECT c_rs_e4m3x4 :: ptxas c_rs_e4m3x4.ptx, line 7; error : Feature '.rs' not supported on .target 'sm_121a' | |
| 8 | +ACCEPT c_rz_ue8m0x2 :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|F2FP.SATFINITE.E8.F32.PACK_AB_MERGE_C.RZ R4, R4, R5, RZ| | |
| 9 | +ACCEPT f8f6f4_e2m1 :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|QMMA.16832.F32.E2M1.E2M1 R4, R4, R8, R12| | |
| 10 | +ACCEPT f8f6f4_e2m1xe4m3 :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|QMMA.16832.F32.E2M1.E4M3 R4, R4, R8, R12| | |
| 11 | +ACCEPT f8f6f4_e4m3 :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|QMMA.16832.F32.E4M3.E4M3 R4, R4, R8, R12| | |
| 12 | +ACCEPT f8f6f4_f16acc :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK| | |
| 13 | +REJECT mxf4_1x :: ptxas mxf4_1x.ptx, line 8; error : Modifier '.scale_vec::1X' cannot be combined with modifier '.kind::mxf4' | |
| 14 | +ACCEPT mxf4_2x :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|OMMA.SF.16864.F32.E2M1.E2M1.E8 R4, R4, R8, R12, R10, R11, URZ| | |
| 15 | +ACCEPT mxf8f6f4_e2m1 :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|QMMA.SF.16832.F32.E2M1.E2M1.E8 R4, R4, R8, R12, R10, R11, URZ| | |
| 16 | +REJECT nvf4_2x_ue4m3 :: ptxas nvf4_2x_ue4m3.ptx, line 8; error : Illegal modifier '.scale_vec::2X' for instruction 'mma' with type '.ue4m3' | |
| 17 | +ACCEPT nvf4_2x_ue8m0 :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|OMMA.SF.16864.F32.E2M1.E2M1.E8 R4, R4, R8, R12, R10, R11, URZ| | |
| 18 | +ACCEPT nvf4_4x_ue4m3 :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|OMMA.SF.16864.F32.E2M1.E2M1.UE4M3.4X R4, R4, R8, R12, R10, R11, URZ| | |
| 19 | +REJECT nvf4_4x_ue8m0 :: ptxas nvf4_4x_ue8m0.ptx, line 8; error : Illegal modifier '.scale_vec::4X' for instruction 'mma' with type '.ue8m0' | |
| 20 | +ACCEPT rs_sm_100a :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|F2FP.SATFINITE.E2M1.F32.PACK_AB_MERGE_C.RS R0, R4, R5, R0| | |
| 21 | +ACCEPT rs_sm_103a :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|F2FP.SATFINITE.E2M1.F32.PACK_AB_MERGE_C.RS R0, R4, R5, R0| | |
| 22 | +REJECT rs_sm_120a :: ptxas rs_sm_120a.ptx, line 7; error : Feature '.rs' not supported on .target 'sm_120a' | |
| 23 | +REJECT rs_sm_121a :: ptxas rs_sm_121a.ptx, line 7; error : Feature '.rs' not supported on .target 'sm_121a' | |
| 24 | +ACCEPT s4 :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|IMMA.16832.S8.S8 R8, R8.ROW, R12.COL, RZ| | |
| 25 | +ACCEPT s8 :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|IMMA.16832.S8.S8 R4, R4.ROW, R8.COL, R4| | |
| 26 | +ACCEPT sp_nvf4 :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|OMMA.SF.SP.168128.F32.E2M1.E2M1.UE4M3.4X R4, R4, R8, R12, R18, R17, URZ, 0x0| | |
| 27 | +REJECT tcgen05_alloc :: ptxas tcgen05_alloc.ptx, line 8; error : Instruction 'tcgen05.alloc' not supported on .target 'sm_121a' | |
| 28 | +ACCEPT v_base :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|OMMA.SF.16864.F32.E2M1.E2M1.E8 R4, R4, R8, R12, R10, R11, URZ| | |
| 29 | +REJECT v_bida1 :: | |
| 30 | +REJECT v_bidb1 :: | |
| 31 | +ACCEPT v_nv :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|OMMA.SF.16864.F32.E2M1.E2M1.UE4M3.4X R4, R4, R8, R12, R10, R11, URZ| | |
| 32 | +ACCEPT v_nvsame :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|OMMA.SF.16864.F32.E2M1.E2M1.UE4M3.4X R4, R4, R8, R12, R0, R0, URZ| | |
| 33 | +ACCEPT v_same :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|OMMA.SF.16864.F32.E2M1.E2M1.E8 R4, R4, R8, R12, R0, R0, URZ| | |
| 34 | +ACCEPT v_tida1 :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|OMMA.SF.16864.F32.E2M1.E2M1.E8 R4, R4, R8, R12, R10, R11, UR6| | |
| 35 | +ACCEPT v_tidb1 :: //----- nvinfo : EIATTR_SPARSE_MMA_MASK|OMMA.SF.16864.F32.E2M1.E2M1.E8 R4, R4, R8, R12, R10, R11, UR6| |
evidence/own-fp4/asm/c_rn_e2m1x2.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rn.satfinite.e2m1x2.f32 q, f0, f1; cvt.u32.u8 r0, q; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
evidence/own-fp4/asm/c_rn_e4m3x2.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rn.satfinite.e4m3x2.f32 h, f0, f1; cvt.u32.u16 r0, h; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
evidence/own-fp4/asm/c_rp_ue8m0x2.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rp.satfinite.ue8m0x2.f32 h, f0, f1; cvt.u32.u16 r0, h; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
evidence/own-fp4/asm/c_rs_e2m1x4.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rs.satfinite.e2m1x4.f32 h, {f0,f1,f2,f3}, r1; cvt.u32.u16 r0, h; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
evidence/own-fp4/asm/c_rs_e4m3x4.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rs.satfinite.e4m3x4.f32 r0, {f0,f1,f2,f3}, r1; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
evidence/own-fp4/asm/c_rz_ue8m0x2.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rz.satfinite.ue8m0x2.f32 h, f0, f1; cvt.u32.u16 r0, h; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
evidence/own-fp4/asm/f8f6f4_e2m1.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k32.row.col.kind::f8f6f4.f32.e2m1.e2m1.f32 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/f8f6f4_e2m1.sass
| new file mode 100644 | ||
| @@ -0,0 +1,282 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x24, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x00000012 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x02, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0000 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x00000090 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ LDG.E.64 R8, desc[UR4][R2.64+0x10] ; /* 0x0000100402087981 */ | |
| 216 | + /* 0x001ea8000c1e1b00 */ | |
| 217 | + /*0040*/ LDG.E.128 R4, desc[UR4][R2.64] ; /* 0x0000000402047981 */ | |
| 218 | + /* 0x000ea8000c1e1d00 */ | |
| 219 | + /*0050*/ LDG.E.128 R12, desc[UR4][R2.64+0x20] ; /* 0x00002004020c7981 */ | |
| 220 | + /* 0x000ea4000c1e1d00 */ | |
| 221 | + /*0060*/ QMMA.16832.F32.E2M1.E2M1 R4, R4, R8, R12 ; /* 0x000000080404727a */ | |
| 222 | + /* 0x004fde000028ec0c */ | |
| 223 | + /*0070*/ NOP ; /* 0x0000000000007918 */ | |
| 224 | + /* 0x000fda0000000000 */ | |
| 225 | + /*0080*/ STG.E.128 desc[UR4][R2.64], R4 ; /* 0x0000000402007986 */ | |
| 226 | + /* 0x000fe2000c101d04 */ | |
| 227 | + /*0090*/ EXIT ; /* 0x000000000000794d */ | |
| 228 | + /* 0x000fea0003800000 */ | |
| 229 | +.L_x_0: | |
| 230 | + /*00a0*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 231 | + /* 0x000fc0000383ffff */ | |
| 232 | + /*00b0*/ NOP; /* 0x0000000000007918 */ | |
| 233 | + /* 0x000fc00000000000 */ | |
| 234 | + /*00c0*/ NOP; /* 0x0000000000007918 */ | |
| 235 | + /* 0x000fc00000000000 */ | |
| 236 | + /*00d0*/ NOP; /* 0x0000000000007918 */ | |
| 237 | + /* 0x000fc00000000000 */ | |
| 238 | + /*00e0*/ NOP; /* 0x0000000000007918 */ | |
| 239 | + /* 0x000fc00000000000 */ | |
| 240 | + /*00f0*/ NOP; /* 0x0000000000007918 */ | |
| 241 | + /* 0x000fc00000000000 */ | |
| 242 | + /*0100*/ NOP; /* 0x0000000000007918 */ | |
| 243 | + /* 0x000fc00000000000 */ | |
| 244 | + /*0110*/ NOP; /* 0x0000000000007918 */ | |
| 245 | + /* 0x000fc00000000000 */ | |
| 246 | + /*0120*/ NOP; /* 0x0000000000007918 */ | |
| 247 | + /* 0x000fc00000000000 */ | |
| 248 | + /*0130*/ NOP; /* 0x0000000000007918 */ | |
| 249 | + /* 0x000fc00000000000 */ | |
| 250 | + /*0140*/ NOP; /* 0x0000000000007918 */ | |
| 251 | + /* 0x000fc00000000000 */ | |
| 252 | + /*0150*/ NOP; /* 0x0000000000007918 */ | |
| 253 | + /* 0x000fc00000000000 */ | |
| 254 | + /*0160*/ NOP; /* 0x0000000000007918 */ | |
| 255 | + /* 0x000fc00000000000 */ | |
| 256 | + /*0170*/ NOP; /* 0x0000000000007918 */ | |
| 257 | + /* 0x000fc00000000000 */ | |
| 258 | +.L_x_1: | |
| 259 | + | |
| 260 | + | |
| 261 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 262 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 263 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 264 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 265 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 266 | +__nv_reservedSMEM_offset_0_alias: | |
| 267 | + .zero 0 | |
| 268 | + .zero 64 | |
| 269 | + | |
| 270 | + | |
| 271 | +//--------------------- .nv.constant0.k -------------------------- | |
| 272 | + .section .nv.constant0.k,"a",@progbits | |
| 273 | + .sectionflags @"" | |
| 274 | + .align 4 | |
| 275 | +.nv.constant0.k: | |
| 276 | + .zero 904 | |
| 277 | + | |
| 278 | + | |
| 279 | +//--------------------- SYMBOLS -------------------------- | |
| 280 | + | |
| 281 | + .type .nv.reservedSmem.offset0,@object | |
| 282 | + .size .nv.reservedSmem.offset0,0x4 |
evidence/own-fp4/asm/f8f6f4_e2m1xe4m3.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k32.row.col.kind::f8f6f4.f32.e2m1.e4m3.f32 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/f8f6f4_e2m1xe4m3.sass
| new file mode 100644 | ||
| @@ -0,0 +1,282 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x24, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x00000012 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x02, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0000 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x00000090 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ LDG.E.64 R8, desc[UR4][R2.64+0x10] ; /* 0x0000100402087981 */ | |
| 216 | + /* 0x001ea8000c1e1b00 */ | |
| 217 | + /*0040*/ LDG.E.128 R4, desc[UR4][R2.64] ; /* 0x0000000402047981 */ | |
| 218 | + /* 0x000ea8000c1e1d00 */ | |
| 219 | + /*0050*/ LDG.E.128 R12, desc[UR4][R2.64+0x20] ; /* 0x00002004020c7981 */ | |
| 220 | + /* 0x000ea4000c1e1d00 */ | |
| 221 | + /*0060*/ QMMA.16832.F32.E2M1.E4M3 R4, R4, R8, R12 ; /* 0x000000080404727a */ | |
| 222 | + /* 0x004fde0000086c0c */ | |
| 223 | + /*0070*/ NOP ; /* 0x0000000000007918 */ | |
| 224 | + /* 0x000fda0000000000 */ | |
| 225 | + /*0080*/ STG.E.128 desc[UR4][R2.64], R4 ; /* 0x0000000402007986 */ | |
| 226 | + /* 0x000fe2000c101d04 */ | |
| 227 | + /*0090*/ EXIT ; /* 0x000000000000794d */ | |
| 228 | + /* 0x000fea0003800000 */ | |
| 229 | +.L_x_0: | |
| 230 | + /*00a0*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 231 | + /* 0x000fc0000383ffff */ | |
| 232 | + /*00b0*/ NOP; /* 0x0000000000007918 */ | |
| 233 | + /* 0x000fc00000000000 */ | |
| 234 | + /*00c0*/ NOP; /* 0x0000000000007918 */ | |
| 235 | + /* 0x000fc00000000000 */ | |
| 236 | + /*00d0*/ NOP; /* 0x0000000000007918 */ | |
| 237 | + /* 0x000fc00000000000 */ | |
| 238 | + /*00e0*/ NOP; /* 0x0000000000007918 */ | |
| 239 | + /* 0x000fc00000000000 */ | |
| 240 | + /*00f0*/ NOP; /* 0x0000000000007918 */ | |
| 241 | + /* 0x000fc00000000000 */ | |
| 242 | + /*0100*/ NOP; /* 0x0000000000007918 */ | |
| 243 | + /* 0x000fc00000000000 */ | |
| 244 | + /*0110*/ NOP; /* 0x0000000000007918 */ | |
| 245 | + /* 0x000fc00000000000 */ | |
| 246 | + /*0120*/ NOP; /* 0x0000000000007918 */ | |
| 247 | + /* 0x000fc00000000000 */ | |
| 248 | + /*0130*/ NOP; /* 0x0000000000007918 */ | |
| 249 | + /* 0x000fc00000000000 */ | |
| 250 | + /*0140*/ NOP; /* 0x0000000000007918 */ | |
| 251 | + /* 0x000fc00000000000 */ | |
| 252 | + /*0150*/ NOP; /* 0x0000000000007918 */ | |
| 253 | + /* 0x000fc00000000000 */ | |
| 254 | + /*0160*/ NOP; /* 0x0000000000007918 */ | |
| 255 | + /* 0x000fc00000000000 */ | |
| 256 | + /*0170*/ NOP; /* 0x0000000000007918 */ | |
| 257 | + /* 0x000fc00000000000 */ | |
| 258 | +.L_x_1: | |
| 259 | + | |
| 260 | + | |
| 261 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 262 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 263 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 264 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 265 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 266 | +__nv_reservedSMEM_offset_0_alias: | |
| 267 | + .zero 0 | |
| 268 | + .zero 64 | |
| 269 | + | |
| 270 | + | |
| 271 | +//--------------------- .nv.constant0.k -------------------------- | |
| 272 | + .section .nv.constant0.k,"a",@progbits | |
| 273 | + .sectionflags @"" | |
| 274 | + .align 4 | |
| 275 | +.nv.constant0.k: | |
| 276 | + .zero 904 | |
| 277 | + | |
| 278 | + | |
| 279 | +//--------------------- SYMBOLS -------------------------- | |
| 280 | + | |
| 281 | + .type .nv.reservedSmem.offset0,@object | |
| 282 | + .size .nv.reservedSmem.offset0,0x4 |
evidence/own-fp4/asm/f8f6f4_e4m3.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k32.row.col.kind::f8f6f4.f32.e4m3.e4m3.f32 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/f8f6f4_e4m3.sass
| new file mode 100644 | ||
| @@ -0,0 +1,282 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x24, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x00000012 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x02, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0000 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x00000090 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ LDG.E.64 R8, desc[UR4][R2.64+0x10] ; /* 0x0000100402087981 */ | |
| 216 | + /* 0x001ea8000c1e1b00 */ | |
| 217 | + /*0040*/ LDG.E.128 R4, desc[UR4][R2.64] ; /* 0x0000000402047981 */ | |
| 218 | + /* 0x000ea8000c1e1d00 */ | |
| 219 | + /*0050*/ LDG.E.128 R12, desc[UR4][R2.64+0x20] ; /* 0x00002004020c7981 */ | |
| 220 | + /* 0x000ea4000c1e1d00 */ | |
| 221 | + /*0060*/ QMMA.16832.F32.E4M3.E4M3 R4, R4, R8, R12 ; /* 0x000000080404727a */ | |
| 222 | + /* 0x004fde0000002c0c */ | |
| 223 | + /*0070*/ NOP ; /* 0x0000000000007918 */ | |
| 224 | + /* 0x000fda0000000000 */ | |
| 225 | + /*0080*/ STG.E.128 desc[UR4][R2.64], R4 ; /* 0x0000000402007986 */ | |
| 226 | + /* 0x000fe2000c101d04 */ | |
| 227 | + /*0090*/ EXIT ; /* 0x000000000000794d */ | |
| 228 | + /* 0x000fea0003800000 */ | |
| 229 | +.L_x_0: | |
| 230 | + /*00a0*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 231 | + /* 0x000fc0000383ffff */ | |
| 232 | + /*00b0*/ NOP; /* 0x0000000000007918 */ | |
| 233 | + /* 0x000fc00000000000 */ | |
| 234 | + /*00c0*/ NOP; /* 0x0000000000007918 */ | |
| 235 | + /* 0x000fc00000000000 */ | |
| 236 | + /*00d0*/ NOP; /* 0x0000000000007918 */ | |
| 237 | + /* 0x000fc00000000000 */ | |
| 238 | + /*00e0*/ NOP; /* 0x0000000000007918 */ | |
| 239 | + /* 0x000fc00000000000 */ | |
| 240 | + /*00f0*/ NOP; /* 0x0000000000007918 */ | |
| 241 | + /* 0x000fc00000000000 */ | |
| 242 | + /*0100*/ NOP; /* 0x0000000000007918 */ | |
| 243 | + /* 0x000fc00000000000 */ | |
| 244 | + /*0110*/ NOP; /* 0x0000000000007918 */ | |
| 245 | + /* 0x000fc00000000000 */ | |
| 246 | + /*0120*/ NOP; /* 0x0000000000007918 */ | |
| 247 | + /* 0x000fc00000000000 */ | |
| 248 | + /*0130*/ NOP; /* 0x0000000000007918 */ | |
| 249 | + /* 0x000fc00000000000 */ | |
| 250 | + /*0140*/ NOP; /* 0x0000000000007918 */ | |
| 251 | + /* 0x000fc00000000000 */ | |
| 252 | + /*0150*/ NOP; /* 0x0000000000007918 */ | |
| 253 | + /* 0x000fc00000000000 */ | |
| 254 | + /*0160*/ NOP; /* 0x0000000000007918 */ | |
| 255 | + /* 0x000fc00000000000 */ | |
| 256 | + /*0170*/ NOP; /* 0x0000000000007918 */ | |
| 257 | + /* 0x000fc00000000000 */ | |
| 258 | +.L_x_1: | |
| 259 | + | |
| 260 | + | |
| 261 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 262 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 263 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 264 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 265 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 266 | +__nv_reservedSMEM_offset_0_alias: | |
| 267 | + .zero 0 | |
| 268 | + .zero 64 | |
| 269 | + | |
| 270 | + | |
| 271 | +//--------------------- .nv.constant0.k -------------------------- | |
| 272 | + .section .nv.constant0.k,"a",@progbits | |
| 273 | + .sectionflags @"" | |
| 274 | + .align 4 | |
| 275 | +.nv.constant0.k: | |
| 276 | + .zero 904 | |
| 277 | + | |
| 278 | + | |
| 279 | +//--------------------- SYMBOLS -------------------------- | |
| 280 | + | |
| 281 | + .type .nv.reservedSmem.offset0,@object | |
| 282 | + .size .nv.reservedSmem.offset0,0x4 |
evidence/own-fp4/asm/f8f6f4_f16acc.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k32.row.col.kind::f8f6f4.f16.e2m1.e2m1.f16 {a0,a1},{a0,a1,a2,a3},{b0,b1},{a2,a3}; mov.b32 d0,0f00000000; mov.b32 d1,0f00000000; mov.b32 d2,0f00000000; mov.b32 d3,0f00000000; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/f8f6f4_f16acc.sass
| new file mode 100644 | ||
| @@ -0,0 +1,266 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x00000006 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x01, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0000 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x00000040 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ STG.E.128 desc[UR4][R2.64], RZ ; /* 0x000000ff02007986 */ | |
| 216 | + /* 0x001fe2000c101d04 */ | |
| 217 | + /*0040*/ EXIT ; /* 0x000000000000794d */ | |
| 218 | + /* 0x000fea0003800000 */ | |
| 219 | +.L_x_0: | |
| 220 | + /*0050*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 221 | + /* 0x000fc0000383ffff */ | |
| 222 | + /*0060*/ NOP; /* 0x0000000000007918 */ | |
| 223 | + /* 0x000fc00000000000 */ | |
| 224 | + /*0070*/ NOP; /* 0x0000000000007918 */ | |
| 225 | + /* 0x000fc00000000000 */ | |
| 226 | + /*0080*/ NOP; /* 0x0000000000007918 */ | |
| 227 | + /* 0x000fc00000000000 */ | |
| 228 | + /*0090*/ NOP; /* 0x0000000000007918 */ | |
| 229 | + /* 0x000fc00000000000 */ | |
| 230 | + /*00a0*/ NOP; /* 0x0000000000007918 */ | |
| 231 | + /* 0x000fc00000000000 */ | |
| 232 | + /*00b0*/ NOP; /* 0x0000000000007918 */ | |
| 233 | + /* 0x000fc00000000000 */ | |
| 234 | + /*00c0*/ NOP; /* 0x0000000000007918 */ | |
| 235 | + /* 0x000fc00000000000 */ | |
| 236 | + /*00d0*/ NOP; /* 0x0000000000007918 */ | |
| 237 | + /* 0x000fc00000000000 */ | |
| 238 | + /*00e0*/ NOP; /* 0x0000000000007918 */ | |
| 239 | + /* 0x000fc00000000000 */ | |
| 240 | + /*00f0*/ NOP; /* 0x0000000000007918 */ | |
| 241 | + /* 0x000fc00000000000 */ | |
| 242 | +.L_x_1: | |
| 243 | + | |
| 244 | + | |
| 245 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 246 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 247 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 248 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 249 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 250 | +__nv_reservedSMEM_offset_0_alias: | |
| 251 | + .zero 0 | |
| 252 | + .zero 64 | |
| 253 | + | |
| 254 | + | |
| 255 | +//--------------------- .nv.constant0.k -------------------------- | |
| 256 | + .section .nv.constant0.k,"a",@progbits | |
| 257 | + .sectionflags @"" | |
| 258 | + .align 4 | |
| 259 | +.nv.constant0.k: | |
| 260 | + .zero 904 | |
| 261 | + | |
| 262 | + | |
| 263 | +//--------------------- SYMBOLS -------------------------- | |
| 264 | + | |
| 265 | + .type .nv.reservedSmem.offset0,@object | |
| 266 | + .size .nv.reservedSmem.offset0,0x4 |
evidence/own-fp4/asm/mxf4_1x.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4.block_scale.scale_vec::1X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/mxf4_2x.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/mxf4_2x.sass
| new file mode 100644 | ||
| @@ -0,0 +1,282 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x28, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x00000012 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x02, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0000 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x000000a0 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ LDG.E.64 R8, desc[UR4][R2.64+0x10] ; /* 0x0000100402087981 */ | |
| 216 | + /* 0x001ea8000c1e1b00 */ | |
| 217 | + /*0040*/ LDG.E.64 R10, desc[UR4][R2.64+0x30] ; /* 0x00003004020a7981 */ | |
| 218 | + /* 0x000ea8000c1e1b00 */ | |
| 219 | + /*0050*/ LDG.E.128 R4, desc[UR4][R2.64] ; /* 0x0000000402047981 */ | |
| 220 | + /* 0x000ea8000c1e1d00 */ | |
| 221 | + /*0060*/ LDG.E.128 R12, desc[UR4][R2.64+0x20] ; /* 0x00002004020c7981 */ | |
| 222 | + /* 0x000ea4000c1e1d00 */ | |
| 223 | + /*0070*/ OMMA.SF.16864.F32.E2M1.E2M1.E8 R4, R4, R8, R12, R10, R11, URZ ; /* 0x70b00a080404747f */ | |
| 224 | + /* 0x004fde0000083e0c */ | |
| 225 | + /*0080*/ NOP ; /* 0x0000000000007918 */ | |
| 226 | + /* 0x000fda0000000000 */ | |
| 227 | + /*0090*/ STG.E.128 desc[UR4][R2.64], R4 ; /* 0x0000000402007986 */ | |
| 228 | + /* 0x000fe2000c101d04 */ | |
| 229 | + /*00a0*/ EXIT ; /* 0x000000000000794d */ | |
| 230 | + /* 0x000fea0003800000 */ | |
| 231 | +.L_x_0: | |
| 232 | + /*00b0*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 233 | + /* 0x000fc0000383ffff */ | |
| 234 | + /*00c0*/ NOP; /* 0x0000000000007918 */ | |
| 235 | + /* 0x000fc00000000000 */ | |
| 236 | + /*00d0*/ NOP; /* 0x0000000000007918 */ | |
| 237 | + /* 0x000fc00000000000 */ | |
| 238 | + /*00e0*/ NOP; /* 0x0000000000007918 */ | |
| 239 | + /* 0x000fc00000000000 */ | |
| 240 | + /*00f0*/ NOP; /* 0x0000000000007918 */ | |
| 241 | + /* 0x000fc00000000000 */ | |
| 242 | + /*0100*/ NOP; /* 0x0000000000007918 */ | |
| 243 | + /* 0x000fc00000000000 */ | |
| 244 | + /*0110*/ NOP; /* 0x0000000000007918 */ | |
| 245 | + /* 0x000fc00000000000 */ | |
| 246 | + /*0120*/ NOP; /* 0x0000000000007918 */ | |
| 247 | + /* 0x000fc00000000000 */ | |
| 248 | + /*0130*/ NOP; /* 0x0000000000007918 */ | |
| 249 | + /* 0x000fc00000000000 */ | |
| 250 | + /*0140*/ NOP; /* 0x0000000000007918 */ | |
| 251 | + /* 0x000fc00000000000 */ | |
| 252 | + /*0150*/ NOP; /* 0x0000000000007918 */ | |
| 253 | + /* 0x000fc00000000000 */ | |
| 254 | + /*0160*/ NOP; /* 0x0000000000007918 */ | |
| 255 | + /* 0x000fc00000000000 */ | |
| 256 | + /*0170*/ NOP; /* 0x0000000000007918 */ | |
| 257 | + /* 0x000fc00000000000 */ | |
| 258 | +.L_x_1: | |
| 259 | + | |
| 260 | + | |
| 261 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 262 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 263 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 264 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 265 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 266 | +__nv_reservedSMEM_offset_0_alias: | |
| 267 | + .zero 0 | |
| 268 | + .zero 64 | |
| 269 | + | |
| 270 | + | |
| 271 | +//--------------------- .nv.constant0.k -------------------------- | |
| 272 | + .section .nv.constant0.k,"a",@progbits | |
| 273 | + .sectionflags @"" | |
| 274 | + .align 4 | |
| 275 | +.nv.constant0.k: | |
| 276 | + .zero 904 | |
| 277 | + | |
| 278 | + | |
| 279 | +//--------------------- SYMBOLS -------------------------- | |
| 280 | + | |
| 281 | + .type .nv.reservedSmem.offset0,@object | |
| 282 | + .size .nv.reservedSmem.offset0,0x4 |
evidence/own-fp4/asm/mxf8f6f4_e2m1.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k32.row.col.kind::mxf8f6f4.block_scale.scale_vec::1X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/mxf8f6f4_e2m1.sass
| new file mode 100644 | ||
| @@ -0,0 +1,282 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x28, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x00000012 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x02, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0000 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x000000a0 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ LDG.E.64 R8, desc[UR4][R2.64+0x10] ; /* 0x0000100402087981 */ | |
| 216 | + /* 0x001ea8000c1e1b00 */ | |
| 217 | + /*0040*/ LDG.E.64 R10, desc[UR4][R2.64+0x30] ; /* 0x00003004020a7981 */ | |
| 218 | + /* 0x000ea8000c1e1b00 */ | |
| 219 | + /*0050*/ LDG.E.128 R4, desc[UR4][R2.64] ; /* 0x0000000402047981 */ | |
| 220 | + /* 0x000ea8000c1e1d00 */ | |
| 221 | + /*0060*/ LDG.E.128 R12, desc[UR4][R2.64+0x20] ; /* 0x00002004020c7981 */ | |
| 222 | + /* 0x000ea4000c1e1d00 */ | |
| 223 | + /*0070*/ QMMA.SF.16832.F32.E2M1.E2M1.E8 R4, R4, R8, R12, R10, R11, URZ ; /* 0x70b00a080404747a */ | |
| 224 | + /* 0x004fde000028fe0c */ | |
| 225 | + /*0080*/ NOP ; /* 0x0000000000007918 */ | |
| 226 | + /* 0x000fda0000000000 */ | |
| 227 | + /*0090*/ STG.E.128 desc[UR4][R2.64], R4 ; /* 0x0000000402007986 */ | |
| 228 | + /* 0x000fe2000c101d04 */ | |
| 229 | + /*00a0*/ EXIT ; /* 0x000000000000794d */ | |
| 230 | + /* 0x000fea0003800000 */ | |
| 231 | +.L_x_0: | |
| 232 | + /*00b0*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 233 | + /* 0x000fc0000383ffff */ | |
| 234 | + /*00c0*/ NOP; /* 0x0000000000007918 */ | |
| 235 | + /* 0x000fc00000000000 */ | |
| 236 | + /*00d0*/ NOP; /* 0x0000000000007918 */ | |
| 237 | + /* 0x000fc00000000000 */ | |
| 238 | + /*00e0*/ NOP; /* 0x0000000000007918 */ | |
| 239 | + /* 0x000fc00000000000 */ | |
| 240 | + /*00f0*/ NOP; /* 0x0000000000007918 */ | |
| 241 | + /* 0x000fc00000000000 */ | |
| 242 | + /*0100*/ NOP; /* 0x0000000000007918 */ | |
| 243 | + /* 0x000fc00000000000 */ | |
| 244 | + /*0110*/ NOP; /* 0x0000000000007918 */ | |
| 245 | + /* 0x000fc00000000000 */ | |
| 246 | + /*0120*/ NOP; /* 0x0000000000007918 */ | |
| 247 | + /* 0x000fc00000000000 */ | |
| 248 | + /*0130*/ NOP; /* 0x0000000000007918 */ | |
| 249 | + /* 0x000fc00000000000 */ | |
| 250 | + /*0140*/ NOP; /* 0x0000000000007918 */ | |
| 251 | + /* 0x000fc00000000000 */ | |
| 252 | + /*0150*/ NOP; /* 0x0000000000007918 */ | |
| 253 | + /* 0x000fc00000000000 */ | |
| 254 | + /*0160*/ NOP; /* 0x0000000000007918 */ | |
| 255 | + /* 0x000fc00000000000 */ | |
| 256 | + /*0170*/ NOP; /* 0x0000000000007918 */ | |
| 257 | + /* 0x000fc00000000000 */ | |
| 258 | +.L_x_1: | |
| 259 | + | |
| 260 | + | |
| 261 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 262 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 263 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 264 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 265 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 266 | +__nv_reservedSMEM_offset_0_alias: | |
| 267 | + .zero 0 | |
| 268 | + .zero 64 | |
| 269 | + | |
| 270 | + | |
| 271 | +//--------------------- .nv.constant0.k -------------------------- | |
| 272 | + .section .nv.constant0.k,"a",@progbits | |
| 273 | + .sectionflags @"" | |
| 274 | + .align 4 | |
| 275 | +.nv.constant0.k: | |
| 276 | + .zero 904 | |
| 277 | + | |
| 278 | + | |
| 279 | +//--------------------- SYMBOLS -------------------------- | |
| 280 | + | |
| 281 | + .type .nv.reservedSmem.offset0,@object | |
| 282 | + .size .nv.reservedSmem.offset0,0x4 |
evidence/own-fp4/asm/nvf4_2x_ue4m3.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4nvf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue4m3 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/nvf4_2x_ue8m0.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4nvf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/nvf4_2x_ue8m0.sass
| new file mode 100644 | ||
| @@ -0,0 +1,282 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x28, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x00000012 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x02, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0000 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x000000a0 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ LDG.E.64 R8, desc[UR4][R2.64+0x10] ; /* 0x0000100402087981 */ | |
| 216 | + /* 0x001ea8000c1e1b00 */ | |
| 217 | + /*0040*/ LDG.E.64 R10, desc[UR4][R2.64+0x30] ; /* 0x00003004020a7981 */ | |
| 218 | + /* 0x000ea8000c1e1b00 */ | |
| 219 | + /*0050*/ LDG.E.128 R4, desc[UR4][R2.64] ; /* 0x0000000402047981 */ | |
| 220 | + /* 0x000ea8000c1e1d00 */ | |
| 221 | + /*0060*/ LDG.E.128 R12, desc[UR4][R2.64+0x20] ; /* 0x00002004020c7981 */ | |
| 222 | + /* 0x000ea4000c1e1d00 */ | |
| 223 | + /*0070*/ OMMA.SF.16864.F32.E2M1.E2M1.E8 R4, R4, R8, R12, R10, R11, URZ ; /* 0x70b00a080404747f */ | |
| 224 | + /* 0x004fde0000083e0c */ | |
| 225 | + /*0080*/ NOP ; /* 0x0000000000007918 */ | |
| 226 | + /* 0x000fda0000000000 */ | |
| 227 | + /*0090*/ STG.E.128 desc[UR4][R2.64], R4 ; /* 0x0000000402007986 */ | |
| 228 | + /* 0x000fe2000c101d04 */ | |
| 229 | + /*00a0*/ EXIT ; /* 0x000000000000794d */ | |
| 230 | + /* 0x000fea0003800000 */ | |
| 231 | +.L_x_0: | |
| 232 | + /*00b0*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 233 | + /* 0x000fc0000383ffff */ | |
| 234 | + /*00c0*/ NOP; /* 0x0000000000007918 */ | |
| 235 | + /* 0x000fc00000000000 */ | |
| 236 | + /*00d0*/ NOP; /* 0x0000000000007918 */ | |
| 237 | + /* 0x000fc00000000000 */ | |
| 238 | + /*00e0*/ NOP; /* 0x0000000000007918 */ | |
| 239 | + /* 0x000fc00000000000 */ | |
| 240 | + /*00f0*/ NOP; /* 0x0000000000007918 */ | |
| 241 | + /* 0x000fc00000000000 */ | |
| 242 | + /*0100*/ NOP; /* 0x0000000000007918 */ | |
| 243 | + /* 0x000fc00000000000 */ | |
| 244 | + /*0110*/ NOP; /* 0x0000000000007918 */ | |
| 245 | + /* 0x000fc00000000000 */ | |
| 246 | + /*0120*/ NOP; /* 0x0000000000007918 */ | |
| 247 | + /* 0x000fc00000000000 */ | |
| 248 | + /*0130*/ NOP; /* 0x0000000000007918 */ | |
| 249 | + /* 0x000fc00000000000 */ | |
| 250 | + /*0140*/ NOP; /* 0x0000000000007918 */ | |
| 251 | + /* 0x000fc00000000000 */ | |
| 252 | + /*0150*/ NOP; /* 0x0000000000007918 */ | |
| 253 | + /* 0x000fc00000000000 */ | |
| 254 | + /*0160*/ NOP; /* 0x0000000000007918 */ | |
| 255 | + /* 0x000fc00000000000 */ | |
| 256 | + /*0170*/ NOP; /* 0x0000000000007918 */ | |
| 257 | + /* 0x000fc00000000000 */ | |
| 258 | +.L_x_1: | |
| 259 | + | |
| 260 | + | |
| 261 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 262 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 263 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 264 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 265 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 266 | +__nv_reservedSMEM_offset_0_alias: | |
| 267 | + .zero 0 | |
| 268 | + .zero 64 | |
| 269 | + | |
| 270 | + | |
| 271 | +//--------------------- .nv.constant0.k -------------------------- | |
| 272 | + .section .nv.constant0.k,"a",@progbits | |
| 273 | + .sectionflags @"" | |
| 274 | + .align 4 | |
| 275 | +.nv.constant0.k: | |
| 276 | + .zero 904 | |
| 277 | + | |
| 278 | + | |
| 279 | +//--------------------- SYMBOLS -------------------------- | |
| 280 | + | |
| 281 | + .type .nv.reservedSmem.offset0,@object | |
| 282 | + .size .nv.reservedSmem.offset0,0x4 |
evidence/own-fp4/asm/nvf4_4x_ue4m3.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4nvf4.block_scale.scale_vec::4X.f32.e2m1.e2m1.f32.ue4m3 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/nvf4_4x_ue4m3.sass
| new file mode 100644 | ||
| @@ -0,0 +1,282 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x28, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x00000012 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x02, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0000 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x000000a0 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ LDG.E.64 R8, desc[UR4][R2.64+0x10] ; /* 0x0000100402087981 */ | |
| 216 | + /* 0x001ea8000c1e1b00 */ | |
| 217 | + /*0040*/ LDG.E.64 R10, desc[UR4][R2.64+0x30] ; /* 0x00003004020a7981 */ | |
| 218 | + /* 0x000ea8000c1e1b00 */ | |
| 219 | + /*0050*/ LDG.E.128 R4, desc[UR4][R2.64] ; /* 0x0000000402047981 */ | |
| 220 | + /* 0x000ea8000c1e1d00 */ | |
| 221 | + /*0060*/ LDG.E.128 R12, desc[UR4][R2.64+0x20] ; /* 0x00002004020c7981 */ | |
| 222 | + /* 0x000ea4000c1e1d00 */ | |
| 223 | + /*0070*/ OMMA.SF.16864.F32.E2M1.E2M1.UE4M3.4X R4, R4, R8, R12, R10, R11, URZ ; /* 0x70b00a080404747f */ | |
| 224 | + /* 0x004fde0000043e0c */ | |
| 225 | + /*0080*/ NOP ; /* 0x0000000000007918 */ | |
| 226 | + /* 0x000fda0000000000 */ | |
| 227 | + /*0090*/ STG.E.128 desc[UR4][R2.64], R4 ; /* 0x0000000402007986 */ | |
| 228 | + /* 0x000fe2000c101d04 */ | |
| 229 | + /*00a0*/ EXIT ; /* 0x000000000000794d */ | |
| 230 | + /* 0x000fea0003800000 */ | |
| 231 | +.L_x_0: | |
| 232 | + /*00b0*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 233 | + /* 0x000fc0000383ffff */ | |
| 234 | + /*00c0*/ NOP; /* 0x0000000000007918 */ | |
| 235 | + /* 0x000fc00000000000 */ | |
| 236 | + /*00d0*/ NOP; /* 0x0000000000007918 */ | |
| 237 | + /* 0x000fc00000000000 */ | |
| 238 | + /*00e0*/ NOP; /* 0x0000000000007918 */ | |
| 239 | + /* 0x000fc00000000000 */ | |
| 240 | + /*00f0*/ NOP; /* 0x0000000000007918 */ | |
| 241 | + /* 0x000fc00000000000 */ | |
| 242 | + /*0100*/ NOP; /* 0x0000000000007918 */ | |
| 243 | + /* 0x000fc00000000000 */ | |
| 244 | + /*0110*/ NOP; /* 0x0000000000007918 */ | |
| 245 | + /* 0x000fc00000000000 */ | |
| 246 | + /*0120*/ NOP; /* 0x0000000000007918 */ | |
| 247 | + /* 0x000fc00000000000 */ | |
| 248 | + /*0130*/ NOP; /* 0x0000000000007918 */ | |
| 249 | + /* 0x000fc00000000000 */ | |
| 250 | + /*0140*/ NOP; /* 0x0000000000007918 */ | |
| 251 | + /* 0x000fc00000000000 */ | |
| 252 | + /*0150*/ NOP; /* 0x0000000000007918 */ | |
| 253 | + /* 0x000fc00000000000 */ | |
| 254 | + /*0160*/ NOP; /* 0x0000000000007918 */ | |
| 255 | + /* 0x000fc00000000000 */ | |
| 256 | + /*0170*/ NOP; /* 0x0000000000007918 */ | |
| 257 | + /* 0x000fc00000000000 */ | |
| 258 | +.L_x_1: | |
| 259 | + | |
| 260 | + | |
| 261 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 262 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 263 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 264 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 265 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 266 | +__nv_reservedSMEM_offset_0_alias: | |
| 267 | + .zero 0 | |
| 268 | + .zero 64 | |
| 269 | + | |
| 270 | + | |
| 271 | +//--------------------- .nv.constant0.k -------------------------- | |
| 272 | + .section .nv.constant0.k,"a",@progbits | |
| 273 | + .sectionflags @"" | |
| 274 | + .align 4 | |
| 275 | +.nv.constant0.k: | |
| 276 | + .zero 904 | |
| 277 | + | |
| 278 | + | |
| 279 | +//--------------------- SYMBOLS -------------------------- | |
| 280 | + | |
| 281 | + .type .nv.reservedSmem.offset0,@object | |
| 282 | + .size .nv.reservedSmem.offset0,0x4 |
evidence/own-fp4/asm/nvf4_4x_ue8m0.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4nvf4.block_scale.scale_vec::4X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/rs_sm_100a.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_100a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rs.satfinite.e2m1x4.f32 h, {f0,f1,f2,f3}, r1; cvt.u32.u16 r0, h; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
evidence/own-fp4/asm/rs_sm_103a.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_103a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rs.satfinite.e2m1x4.f32 h, {f0,f1,f2,f3}, r1; cvt.u32.u16 r0, h; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
evidence/own-fp4/asm/rs_sm_120a.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_120a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rs.satfinite.e2m1x4.f32 h, {f0,f1,f2,f3}, r1; cvt.u32.u16 r0, h; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
evidence/own-fp4/asm/rs_sm_121a.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rs.satfinite.e2m1x4.f32 h, {f0,f1,f2,f3}, r1; cvt.u32.u16 r0, h; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
evidence/own-fp4/asm/s4.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.s32.s4.s4.s32 {a0,a1,a2,a3},{a0,a1,a2,a3},{b0,b1},{a0,a1,a2,a3}; mov.b32 d0,a0; mov.b32 d1,a1; mov.b32 d2,a2; mov.b32 d3,a3; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/s4.sass
| new file mode 100644 | ||
| @@ -0,0 +1,700 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x14, 0x00, 0x00, 0x00, 0x0c, 0x81, 0x80 | |
| 16 | + /*005c*/ .byte 0x80, 0x28, 0x00, 0x04, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 17 | + /*006c*/ .byte 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff | |
| 18 | + /*007c*/ .byte 0x03, 0x00, 0x04, 0x7c, 0x80, 0x82, 0x80, 0x28, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x08, 0xff | |
| 19 | + /*008c*/ .byte 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x08, 0x80, 0x80, 0x80, 0x28, 0x16, 0x80, 0x82 | |
| 20 | + /*009c*/ .byte 0x80, 0x28, 0x10, 0x03 | |
| 21 | + /*00a0*/ .dword k | |
| 22 | + /*00a8*/ .byte 0x92, 0x80, 0x80, 0x80, 0x28, 0x00, 0x22, 0x00, 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00 | |
| 23 | + /*00b8*/ .byte 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 24 | + /*00c4*/ .dword (k + $__internal_0_$__cuda_sm_9x_mma_sub_byte_internal_m16n8k64_s4_s4@srel) | |
| 25 | + /*00cc*/ .byte 0xe0, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xd8, 0x02, 0x00, 0x00, 0x09, 0x80, 0x80 | |
| 26 | + /*00dc*/ .byte 0x80, 0x28, 0x82, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 27 | + | |
| 28 | + | |
| 29 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 30 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 31 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 32 | + .tkinfo | |
| 33 | + /*0018*/ .word 0x00000002 | |
| 34 | + /*0030*/ .string "" | |
| 35 | + /*0030*/ .string "ptxas" | |
| 36 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 37 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 38 | + /*0030*/ .string "-arch sm_121a " | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 43 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 44 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 45 | + /*0018*/ .short 0x0002 | |
| 46 | + /*001a*/ .short 0x0079 | |
| 47 | + /*001c*/ .short 0x0082 | |
| 48 | + .zero 2 | |
| 49 | + | |
| 50 | + | |
| 51 | +//--------------------- .nv.info -------------------------- | |
| 52 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 53 | + .align 4 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 57 | + .align 4 | |
| 58 | + /*0000*/ .byte 0x04, 0x2f | |
| 59 | + /*0002*/ .short (.L_1 - .L_0) | |
| 60 | + .align 4 | |
| 61 | +.L_0: | |
| 62 | + /*0004*/ .word index@(k) | |
| 63 | + /*0008*/ .word 0x0000001c | |
| 64 | + | |
| 65 | + | |
| 66 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 67 | + .align 4 | |
| 68 | +.L_1: | |
| 69 | + /*000c*/ .byte 0x04, 0x11 | |
| 70 | + /*000e*/ .short (.L_3 - .L_2) | |
| 71 | + .align 4 | |
| 72 | +.L_2: | |
| 73 | + /*0010*/ .word index@($__internal_0_$__cuda_sm_9x_mma_sub_byte_internal_m16n8k64_s4_s4) | |
| 74 | + /*0014*/ .word 0x00000000 | |
| 75 | + | |
| 76 | + | |
| 77 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 78 | + .align 4 | |
| 79 | +.L_3: | |
| 80 | + /*0018*/ .byte 0x04, 0x11 | |
| 81 | + /*001a*/ .short (.L_5 - .L_4) | |
| 82 | + .align 4 | |
| 83 | +.L_4: | |
| 84 | + /*001c*/ .word index@(k) | |
| 85 | + /*0020*/ .word 0x00000000 | |
| 86 | + | |
| 87 | + | |
| 88 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 89 | + .align 4 | |
| 90 | +.L_5: | |
| 91 | + /*0024*/ .byte 0x04, 0x12 | |
| 92 | + /*0026*/ .short (.L_7 - .L_6) | |
| 93 | + .align 4 | |
| 94 | +.L_6: | |
| 95 | + /*0028*/ .word index@(k) | |
| 96 | + /*002c*/ .word 0x00000000 | |
| 97 | +.L_7: | |
| 98 | + | |
| 99 | + | |
| 100 | +//--------------------- .nv.compat -------------------------- | |
| 101 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 102 | + .align 4 | |
| 103 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x01, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 104 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 105 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 106 | + | |
| 107 | + | |
| 108 | +//--------------------- .nv.info.k -------------------------- | |
| 109 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 110 | + .sectionflags @"" | |
| 111 | + .align 4 | |
| 112 | + | |
| 113 | + | |
| 114 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 115 | + .align 4 | |
| 116 | + /*0000*/ .byte 0x04, 0x37 | |
| 117 | + /*0002*/ .short (.L_9 - .L_8) | |
| 118 | +.L_8: | |
| 119 | + /*0004*/ .word 0x00000082 | |
| 120 | + | |
| 121 | + | |
| 122 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 123 | + .align 4 | |
| 124 | +.L_9: | |
| 125 | + /*0008*/ .byte 0x04, 0x17 | |
| 126 | + /*000a*/ .short (.L_11 - .L_10) | |
| 127 | +.L_10: | |
| 128 | + /*000c*/ .word 0x00000000 | |
| 129 | + /*0010*/ .short 0x0000 | |
| 130 | + /*0012*/ .short 0x0000 | |
| 131 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 132 | + | |
| 133 | + | |
| 134 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 135 | + .align 4 | |
| 136 | +.L_11: | |
| 137 | + /*0018*/ .byte 0x03, 0x50 | |
| 138 | + /*001a*/ .short 0x0000 | |
| 139 | + | |
| 140 | + | |
| 141 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 142 | + .align 4 | |
| 143 | + /*001c*/ .byte 0x03, 0x1b | |
| 144 | + /*001e*/ .short 0x00ff | |
| 145 | + | |
| 146 | + | |
| 147 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 148 | + .align 4 | |
| 149 | + /*0020*/ .byte 0x03, 0x5f | |
| 150 | + /*0022*/ .short 0x0101 | |
| 151 | + | |
| 152 | + | |
| 153 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 154 | + .align 4 | |
| 155 | + /*0024*/ .byte 0x02, 0x4a | |
| 156 | + .zero 1 | |
| 157 | + .zero 1 | |
| 158 | + | |
| 159 | + | |
| 160 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 161 | + .align 4 | |
| 162 | + /*0028*/ .byte 0x04, 0x1c | |
| 163 | + /*002a*/ .short (.L_13 - .L_12) | |
| 164 | + | |
| 165 | + | |
| 166 | + // ....[0].... | |
| 167 | +.L_12: | |
| 168 | + /*002c*/ .word 0x00000090 | |
| 169 | + | |
| 170 | + | |
| 171 | + //----- nvinfo : EIATTR_CRS_STACK_SIZE | |
| 172 | + .align 4 | |
| 173 | +.L_13: | |
| 174 | + /*0030*/ .byte 0x04, 0x1e | |
| 175 | + /*0032*/ .short (.L_15 - .L_14) | |
| 176 | +.L_14: | |
| 177 | + /*0034*/ .word 0x00000000 | |
| 178 | + | |
| 179 | + | |
| 180 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 181 | + .align 4 | |
| 182 | +.L_15: | |
| 183 | + /*0038*/ .byte 0x03, 0x19 | |
| 184 | + /*003a*/ .short 0x0008 | |
| 185 | + | |
| 186 | + | |
| 187 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 188 | + .align 4 | |
| 189 | + /*003c*/ .byte 0x04, 0x0a | |
| 190 | + /*003e*/ .short (.L_17 - .L_16) | |
| 191 | + .align 4 | |
| 192 | +.L_16: | |
| 193 | + /*0040*/ .word index@(.nv.constant0.k) | |
| 194 | + /*0044*/ .short 0x0380 | |
| 195 | + /*0046*/ .short 0x0008 | |
| 196 | + | |
| 197 | + | |
| 198 | + //----- nvinfo : EIATTR_SW_WAR | |
| 199 | + .align 4 | |
| 200 | +.L_17: | |
| 201 | + /*0048*/ .byte 0x04, 0x36 | |
| 202 | + /*004a*/ .short (.L_19 - .L_18) | |
| 203 | +.L_18: | |
| 204 | + /*004c*/ .word 0x00000000 | |
| 205 | +.L_19: | |
| 206 | + | |
| 207 | + | |
| 208 | +//--------------------- .nv.callgraph -------------------------- | |
| 209 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 210 | + .align 4 | |
| 211 | + .sectionentsize 8 | |
| 212 | + .align 4 | |
| 213 | + /*0000*/ .word 0x00000000 | |
| 214 | + .align 4 | |
| 215 | + /*0004*/ .word 0xffffffff | |
| 216 | + .align 4 | |
| 217 | + /*0008*/ .word 0x00000000 | |
| 218 | + .align 4 | |
| 219 | + /*000c*/ .word 0xfffffffe | |
| 220 | + .align 4 | |
| 221 | + /*0010*/ .word 0x00000000 | |
| 222 | + .align 4 | |
| 223 | + /*0014*/ .word 0xfffffffd | |
| 224 | + .align 4 | |
| 225 | + /*0018*/ .word 0x00000000 | |
| 226 | + .align 4 | |
| 227 | + /*001c*/ .word 0xfffffffc | |
| 228 | + | |
| 229 | + | |
| 230 | +//--------------------- .text.k -------------------------- | |
| 231 | + .section .text.k,"ax",@progbits | |
| 232 | + .align 128 | |
| 233 | + .global k | |
| 234 | + .type k,@function | |
| 235 | + .size k,(.L_x_1 - k) | |
| 236 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 237 | +k: | |
| 238 | +.text.k: | |
| 239 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 240 | + /* 0x000fe20000000800 */ | |
| 241 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 242 | + /* 0x000e2e0008000a00 */ | |
| 243 | + /*0020*/ LDC.64 R8, c[0x0][0x380] ; /* 0x0000e000ff087b82 */ | |
| 244 | + /* 0x000e240000000a00 */ | |
| 245 | + /*0030*/ LDG.E.64 R2, desc[UR4][R8.64+0x10] ; /* 0x0000100408027981 */ | |
| 246 | + /* 0x001168000c1e1b00 */ | |
| 247 | + /*0040*/ LDG.E.128 R4, desc[UR4][R8.64] ; /* 0x0000000408047981 */ | |
| 248 | + /* 0x000162000c1e1d00 */ | |
| 249 | + /*0050*/ MOV R0, 0x70 ; /* 0x0000007000007802 */ | |
| 250 | + /* 0x000fce0000000f00 */ | |
| 251 | + /*0060*/ CALL.REL.NOINC `($__internal_0_$__cuda_sm_9x_mma_sub_byte_internal_m16n8k64_s4_s4) ; /* 0x00000000000c7944 */ | |
| 252 | + /* 0x021fea0003c00000 */ | |
| 253 | + /*0070*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 254 | + /* 0x000e240000000a00 */ | |
| 255 | + /*0080*/ STG.E.128 desc[UR4][R2.64], R8 ; /* 0x0000000802007986 */ | |
| 256 | + /* 0x001fe2000c101d04 */ | |
| 257 | + /*0090*/ EXIT ; /* 0x000000000000794d */ | |
| 258 | + /* 0x000fea0003800000 */ | |
| 259 | + .weak $__internal_0_$__cuda_sm_9x_mma_sub_byte_internal_m16n8k64_s4_s4 | |
| 260 | + .type $__internal_0_$__cuda_sm_9x_mma_sub_byte_internal_m16n8k64_s4_s4,@function | |
| 261 | + .size $__internal_0_$__cuda_sm_9x_mma_sub_byte_internal_m16n8k64_s4_s4,(.L_x_1 - $__internal_0_$__cuda_sm_9x_mma_sub_byte_internal_m16n8k64_s4_s4) | |
| 262 | +$__internal_0_$__cuda_sm_9x_mma_sub_byte_internal_m16n8k64_s4_s4: | |
| 263 | + /*00a0*/ LOP3.LUT R13, R2.reuse, 0xf00, RZ, 0xc0, !PT ; /* 0x00000f00020d7812 */ | |
| 264 | + /* 0x040fe200078ec0ff */ | |
| 265 | + /*00b0*/ IMAD.SHL.U32 R12, R2, 0x10000000, RZ ; /* 0x10000000020c7824 */ | |
| 266 | + /* 0x000fe200078e00ff */ | |
| 267 | + /*00c0*/ LOP3.LUT R15, R3.reuse, 0xf00, RZ, 0xc0, !PT ; /* 0x00000f00030f7812 */ | |
| 268 | + /* 0x040fe200078ec0ff */ | |
| 269 | + /*00d0*/ IMAD.SHL.U32 R14, R3, 0x10000000, RZ ; /* 0x10000000030e7824 */ | |
| 270 | + /* 0x000fe200078e00ff */ | |
| 271 | + /*00e0*/ LOP3.LUT R11, R5.reuse, 0xf00, RZ, 0xc0, !PT ; /* 0x00000f00050b7812 */ | |
| 272 | + /* 0x040fe200078ec0ff */ | |
| 273 | + /*00f0*/ IMAD.SHL.U32 R10, R5, 0x10000000, RZ ; /* 0x10000000050a7824 */ | |
| 274 | + /* 0x000fe200078e00ff */ | |
| 275 | + /*0100*/ LOP3.LUT R9, R4.reuse, 0xf00, RZ, 0xc0, !PT ; /* 0x00000f0004097812 */ | |
| 276 | + /* 0x040fe200078ec0ff */ | |
| 277 | + /*0110*/ IMAD.SHL.U32 R8, R4, 0x10000000, RZ ; /* 0x1000000004087824 */ | |
| 278 | + /* 0x000fe200078e00ff */ | |
| 279 | + /*0120*/ SHF.R.S32.HI R12, RZ, 0x1c, R12 ; /* 0x0000001cff0c7819 */ | |
| 280 | + /* 0x000fe2000001140c */ | |
| 281 | + /*0130*/ IMAD.SHL.U32 R13, R13, 0x100000, RZ ; /* 0x001000000d0d7824 */ | |
| 282 | + /* 0x000fe200078e00ff */ | |
| 283 | + /*0140*/ SHF.R.S32.HI R14, RZ, 0x1c, R14 ; /* 0x0000001cff0e7819 */ | |
| 284 | + /* 0x000fe2000001140e */ | |
| 285 | + /*0150*/ IMAD.SHL.U32 R15, R15, 0x100000, RZ ; /* 0x001000000f0f7824 */ | |
| 286 | + /* 0x000fe200078e00ff */ | |
| 287 | + /*0160*/ SHF.R.S32.HI R10, RZ, 0x1c, R10 ; /* 0x0000001cff0a7819 */ | |
| 288 | + /* 0x000fe2000001140a */ | |
| 289 | + /*0170*/ IMAD.SHL.U32 R11, R11, 0x100000, RZ ; /* 0x001000000b0b7824 */ | |
| 290 | + /* 0x000fe200078e00ff */ | |
| 291 | + /*0180*/ SHF.R.S32.HI R8, RZ, 0x1c, R8 ; /* 0x0000001cff087819 */ | |
| 292 | + /* 0x000fe20000011408 */ | |
| 293 | + /*0190*/ IMAD.SHL.U32 R9, R9, 0x100000, RZ ; /* 0x0010000009097824 */ | |
| 294 | + /* 0x000fe200078e00ff */ | |
| 295 | + /*01a0*/ LOP3.LUT R12, R12, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff0c0c7812 */ | |
| 296 | + /* 0x000fc400078ec0ff */ | |
| 297 | + /*01b0*/ SHF.R.S32.HI R13, RZ, 0x14, R13 ; /* 0x00000014ff0d7819 */ | |
| 298 | + /* 0x000fe4000001140d */ | |
| 299 | + /*01c0*/ LOP3.LUT R14, R14, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff0e0e7812 */ | |
| 300 | + /* 0x000fe400078ec0ff */ | |
| 301 | + /*01d0*/ SHF.R.S32.HI R15, RZ, 0x14, R15 ; /* 0x00000014ff0f7819 */ | |
| 302 | + /* 0x000fe4000001140f */ | |
| 303 | + /*01e0*/ LOP3.LUT R10, R10, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff0a0a7812 */ | |
| 304 | + /* 0x000fe400078ec0ff */ | |
| 305 | + /*01f0*/ SHF.R.S32.HI R11, RZ, 0x14, R11 ; /* 0x00000014ff0b7819 */ | |
| 306 | + /* 0x000fe4000001140b */ | |
| 307 | + /*0200*/ LOP3.LUT R8, R8, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff08087812 */ | |
| 308 | + /* 0x000fc400078ec0ff */ | |
| 309 | + /*0210*/ SHF.R.S32.HI R9, RZ, 0x14, R9 ; /* 0x00000014ff097819 */ | |
| 310 | + /* 0x000fe40000011409 */ | |
| 311 | + /*0220*/ LOP3.LUT R16, R2, 0xf0, RZ, 0xc0, !PT ; /* 0x000000f002107812 */ | |
| 312 | + /* 0x000fe400078ec0ff */ | |
| 313 | + /*0230*/ LOP3.LUT R12, R12, 0xff00, R13, 0xf8, !PT ; /* 0x0000ff000c0c7812 */ | |
| 314 | + /* 0x000fe400078ef80d */ | |
| 315 | + /*0240*/ LOP3.LUT R13, R14, 0xff00, R15, 0xf8, !PT ; /* 0x0000ff000e0d7812 */ | |
| 316 | + /* 0x000fe200078ef80f */ | |
| 317 | + /*0250*/ IMAD.SHL.U32 R17, R16, 0x1000000, RZ ; /* 0x0100000010117824 */ | |
| 318 | + /* 0x000fe200078e00ff */ | |
| 319 | + /*0260*/ LOP3.LUT R11, R10, 0xff00, R11, 0xf8, !PT ; /* 0x0000ff000a0b7812 */ | |
| 320 | + /* 0x000fe200078ef80b */ | |
| 321 | + /*0270*/ IMAD.SHL.U32 R14, R7.reuse, 0x10000000, RZ ; /* 0x10000000070e7824 */ | |
| 322 | + /* 0x040fe200078e00ff */ | |
| 323 | + /*0280*/ LOP3.LUT R15, R7, 0xf00, RZ, 0xc0, !PT ; /* 0x00000f00070f7812 */ | |
| 324 | + /* 0x000fc400078ec0ff */ | |
| 325 | + /*0290*/ LOP3.LUT R9, R8, 0xff00, R9, 0xf8, !PT ; /* 0x0000ff0008097812 */ | |
| 326 | + /* 0x000fe200078ef809 */ | |
| 327 | + /*02a0*/ IMAD.SHL.U32 R8, R6, 0x10000000, RZ ; /* 0x1000000006087824 */ | |
| 328 | + /* 0x000fe200078e00ff */ | |
| 329 | + /*02b0*/ LOP3.LUT R18, R2, 0xf000, RZ, 0xc0, !PT ; /* 0x0000f00002127812 */ | |
| 330 | + /* 0x000fe200078ec0ff */ | |
| 331 | + /*02c0*/ IMAD.SHL.U32 R16, R15, 0x100000, RZ ; /* 0x001000000f107824 */ | |
| 332 | + /* 0x000fe200078e00ff */ | |
| 333 | + /*02d0*/ LOP3.LUT R10, R6, 0xf00, RZ, 0xc0, !PT ; /* 0x00000f00060a7812 */ | |
| 334 | + /* 0x000fe400078ec0ff */ | |
| 335 | + /*02e0*/ LOP3.LUT R20, R2, 0xf0000, RZ, 0xc0, !PT ; /* 0x000f000002147812 */ | |
| 336 | + /* 0x000fe200078ec0ff */ | |
| 337 | + /*02f0*/ IMAD.U32 R19, R18, 0x10000, RZ ; /* 0x0001000012137824 */ | |
| 338 | + /* 0x000fe200078e00ff */ | |
| 339 | + /*0300*/ SHF.R.S32.HI R8, RZ, 0x1c, R8 ; /* 0x0000001cff087819 */ | |
| 340 | + /* 0x000fe20000011408 */ | |
| 341 | + /*0310*/ IMAD.SHL.U32 R10, R10, 0x100000, RZ ; /* 0x001000000a0a7824 */ | |
| 342 | + /* 0x000fe200078e00ff */ | |
| 343 | + /*0320*/ SHF.R.S32.HI R18, RZ, 0x1c, R17 ; /* 0x0000001cff127819 */ | |
| 344 | + /* 0x000fe20000011411 */ | |
| 345 | + /*0330*/ IMAD.SHL.U32 R20, R20, 0x1000, RZ ; /* 0x0000100014147824 */ | |
| 346 | + /* 0x000fe200078e00ff */ | |
| 347 | + /*0340*/ SHF.R.S32.HI R14, RZ, 0x1c, R14 ; /* 0x0000001cff0e7819 */ | |
| 348 | + /* 0x000fc4000001140e */ | |
| 349 | + /*0350*/ SHF.R.S32.HI R17, RZ, 0x14, R16 ; /* 0x00000014ff117819 */ | |
| 350 | + /* 0x000fe40000011410 */ | |
| 351 | + /*0360*/ SHF.R.S32.HI R19, RZ, 0x14, R19 ; /* 0x00000014ff137819 */ | |
| 352 | + /* 0x000fe40000011413 */ | |
| 353 | + /*0370*/ LOP3.LUT R8, R8, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff08087812 */ | |
| 354 | + /* 0x000fe400078ec0ff */ | |
| 355 | + /*0380*/ SHF.R.S32.HI R15, RZ, 0x14, R10 ; /* 0x00000014ff0f7819 */ | |
| 356 | + /* 0x000fe4000001140a */ | |
| 357 | + /*0390*/ LOP3.LUT R16, R18, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff12107812 */ | |
| 358 | + /* 0x000fe400078ec0ff */ | |
| 359 | + /*03a0*/ LOP3.LUT R14, R14, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff0e0e7812 */ | |
| 360 | + /* 0x000fc400078ec0ff */ | |
| 361 | + /*03b0*/ SHF.R.S32.HI R21, RZ, 0xc, R20 ; /* 0x0000000cff157819 */ | |
| 362 | + /* 0x000fe40000011414 */ | |
| 363 | + /*03c0*/ LOP3.LUT R10, R8, 0xff00, R15, 0xf8, !PT ; /* 0x0000ff00080a7812 */ | |
| 364 | + /* 0x000fe400078ef80f */ | |
| 365 | + /*03d0*/ LOP3.LUT R16, R16, 0xff00, R19, 0xf8, !PT ; /* 0x0000ff0010107812 */ | |
| 366 | + /* 0x000fe400078ef813 */ | |
| 367 | + /*03e0*/ LOP3.LUT R8, R14, 0xff00, R17, 0xf8, !PT ; /* 0x0000ff000e087812 */ | |
| 368 | + /* 0x000fe400078ef811 */ | |
| 369 | + /*03f0*/ LOP3.LUT R19, R3, 0xf0, RZ, 0xc0, !PT ; /* 0x000000f003137812 */ | |
| 370 | + /* 0x000fe400078ec0ff */ | |
| 371 | + /*0400*/ LOP3.LUT R14, R4, 0xf0, RZ, 0xc0, !PT ; /* 0x000000f0040e7812 */ | |
| 372 | + /* 0x000fc400078ec0ff */ | |
| 373 | + /*0410*/ LOP3.LUT R17, R5, 0xf0, RZ, 0xc0, !PT ; /* 0x000000f005117812 */ | |
| 374 | + /* 0x000fe200078ec0ff */ | |
| 375 | + /*0420*/ IMAD.SHL.U32 R19, R19, 0x1000000, RZ ; /* 0x0100000013137824 */ | |
| 376 | + /* 0x000fe200078e00ff */ | |
| 377 | + /*0430*/ LOP3.LUT R12, R12, 0xff0000, R21, 0xf8, !PT ; /* 0x00ff00000c0c7812 */ | |
| 378 | + /* 0x000fe200078ef815 */ | |
| 379 | + /*0440*/ IMAD.SHL.U32 R14, R14, 0x1000000, RZ ; /* 0x010000000e0e7824 */ | |
| 380 | + /* 0x000fe200078e00ff */ | |
| 381 | + /*0450*/ LOP3.LUT R21, R3, 0xf0000, RZ, 0xc0, !PT ; /* 0x000f000003157812 */ | |
| 382 | + /* 0x000fe200078ec0ff */ | |
| 383 | + /*0460*/ IMAD.SHL.U32 R17, R17, 0x1000000, RZ ; /* 0x0100000011117824 */ | |
| 384 | + /* 0x000fe200078e00ff */ | |
| 385 | + /*0470*/ LOP3.LUT R20, R3, 0xf000, RZ, 0xc0, !PT ; /* 0x0000f00003147812 */ | |
| 386 | + /* 0x000fe400078ec0ff */ | |
| 387 | + /*0480*/ LOP3.LUT R18, R5, 0xf000, RZ, 0xc0, !PT ; /* 0x0000f00005127812 */ | |
| 388 | + /* 0x000fe200078ec0ff */ | |
| 389 | + /*0490*/ IMAD.SHL.U32 R21, R21, 0x1000, RZ ; /* 0x0000100015157824 */ | |
| 390 | + /* 0x000fe200078e00ff */ | |
| 391 | + /*04a0*/ LOP3.LUT R15, R4, 0xf000, RZ, 0xc0, !PT ; /* 0x0000f000040f7812 */ | |
| 392 | + /* 0x000fe200078ec0ff */ | |
| 393 | + /*04b0*/ IMAD.U32 R20, R20, 0x10000, RZ ; /* 0x0001000014147824 */ | |
| 394 | + /* 0x000fe200078e00ff */ | |
| 395 | + /*04c0*/ SHF.R.S32.HI R19, RZ, 0x1c, R19 ; /* 0x0000001cff137819 */ | |
| 396 | + /* 0x000fe20000011413 */ | |
| 397 | + /*04d0*/ IMAD.U32 R18, R18, 0x10000, RZ ; /* 0x0001000012127824 */ | |
| 398 | + /* 0x000fe200078e00ff */ | |
| 399 | + /*04e0*/ SHF.R.S32.HI R14, RZ, 0x1c, R14 ; /* 0x0000001cff0e7819 */ | |
| 400 | + /* 0x000fe2000001140e */ | |
| 401 | + /*04f0*/ IMAD.U32 R15, R15, 0x10000, RZ ; /* 0x000100000f0f7824 */ | |
| 402 | + /* 0x000fe200078e00ff */ | |
| 403 | + /*0500*/ SHF.R.S32.HI R17, RZ, 0x1c, R17 ; /* 0x0000001cff117819 */ | |
| 404 | + /* 0x000fc40000011411 */ | |
| 405 | + /*0510*/ SHF.R.S32.HI R22, RZ, 0xc, R21 ; /* 0x0000000cff167819 */ | |
| 406 | + /* 0x000fe40000011415 */ | |
| 407 | + /*0520*/ SHF.R.S32.HI R20, RZ, 0x14, R20 ; /* 0x00000014ff147819 */ | |
| 408 | + /* 0x000fe40000011414 */ | |
| 409 | + /*0530*/ LOP3.LUT R19, R19, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff13137812 */ | |
| 410 | + /* 0x000fe400078ec0ff */ | |
| 411 | + /*0540*/ SHF.R.S32.HI R21, RZ, 0x14, R18 ; /* 0x00000014ff157819 */ | |
| 412 | + /* 0x000fe40000011412 */ | |
| 413 | + /*0550*/ SHF.R.S32.HI R15, RZ, 0x14, R15 ; /* 0x00000014ff0f7819 */ | |
| 414 | + /* 0x000fe4000001140f */ | |
| 415 | + /*0560*/ LOP3.LUT R14, R14, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff0e0e7812 */ | |
| 416 | + /* 0x000fc400078ec0ff */ | |
| 417 | + /*0570*/ LOP3.LUT R18, R17, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff11127812 */ | |
| 418 | + /* 0x000fe400078ec0ff */ | |
| 419 | + /*0580*/ LOP3.LUT R17, R19, 0xff00, R20, 0xf8, !PT ; /* 0x0000ff0013117812 */ | |
| 420 | + /* 0x000fe400078ef814 */ | |
| 421 | + /*0590*/ LOP3.LUT R19, R14, 0xff00, R15, 0xf8, !PT ; /* 0x0000ff000e137812 */ | |
| 422 | + /* 0x000fe400078ef80f */ | |
| 423 | + /*05a0*/ LOP3.LUT R18, R18, 0xff00, R21, 0xf8, !PT ; /* 0x0000ff0012127812 */ | |
| 424 | + /* 0x000fe400078ef815 */ | |
| 425 | + /*05b0*/ LOP3.LUT R14, R6, 0xf0, RZ, 0xc0, !PT ; /* 0x000000f0060e7812 */ | |
| 426 | + /* 0x000fe400078ec0ff */ | |
| 427 | + /*05c0*/ LOP3.LUT R21, R7, 0xf0, RZ, 0xc0, !PT ; /* 0x000000f007157812 */ | |
| 428 | + /* 0x000fc400078ec0ff */ | |
| 429 | + /*05d0*/ LOP3.LUT R13, R13, 0xff0000, R22, 0xf8, !PT ; /* 0x00ff00000d0d7812 */ | |
| 430 | + /* 0x000fe200078ef816 */ | |
| 431 | + /*05e0*/ IMAD.SHL.U32 R15, R14, 0x1000000, RZ ; /* 0x010000000e0f7824 */ | |
| 432 | + /* 0x000fe200078e00ff */ | |
| 433 | + /*05f0*/ LOP3.LUT R20, R6, 0xf000, RZ, 0xc0, !PT ; /* 0x0000f00006147812 */ | |
| 434 | + /* 0x000fe200078ec0ff */ | |
| 435 | + /*0600*/ IMAD.SHL.U32 R21, R21, 0x1000000, RZ ; /* 0x0100000015157824 */ | |
| 436 | + /* 0x000fe200078e00ff */ | |
| 437 | + /*0610*/ LOP3.LUT R22, R7, 0xf000, RZ, 0xc0, !PT ; /* 0x0000f00007167812 */ | |
| 438 | + /* 0x000fe400078ec0ff */ | |
| 439 | + /*0620*/ SHF.R.S32.HI R15, RZ, 0x1c, R15 ; /* 0x0000001cff0f7819 */ | |
| 440 | + /* 0x000fe2000001140f */ | |
| 441 | + /*0630*/ IMAD.U32 R20, R20, 0x10000, RZ ; /* 0x0001000014147824 */ | |
| 442 | + /* 0x000fe200078e00ff */ | |
| 443 | + /*0640*/ LOP3.LUT R14, R4, 0xf0000, RZ, 0xc0, !PT ; /* 0x000f0000040e7812 */ | |
| 444 | + /* 0x000fe200078ec0ff */ | |
| 445 | + /*0650*/ IMAD.U32 R23, R22, 0x10000, RZ ; /* 0x0001000016177824 */ | |
| 446 | + /* 0x000fe200078e00ff */ | |
| 447 | + /*0660*/ SHF.R.S32.HI R22, RZ, 0x1c, R21 ; /* 0x0000001cff167819 */ | |
| 448 | + /* 0x000fc40000011415 */ | |
| 449 | + /*0670*/ LOP3.LUT R21, R5, 0xf0000, RZ, 0xc0, !PT ; /* 0x000f000005157812 */ | |
| 450 | + /* 0x000fe400078ec0ff */ | |
| 451 | + /*0680*/ SHF.R.S32.HI R20, RZ, 0x14, R20 ; /* 0x00000014ff147819 */ | |
| 452 | + /* 0x000fe40000011414 */ | |
| 453 | + /*0690*/ LOP3.LUT R15, R15, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff0f0f7812 */ | |
| 454 | + /* 0x000fe200078ec0ff */ | |
| 455 | + /*06a0*/ IMAD.SHL.U32 R21, R21, 0x1000, RZ ; /* 0x0000100015157824 */ | |
| 456 | + /* 0x000fe200078e00ff */ | |
| 457 | + /*06b0*/ SHF.R.S32.HI R23, RZ, 0x14, R23 ; /* 0x00000014ff177819 */ | |
| 458 | + /* 0x000fe40000011417 */ | |
| 459 | + /*06c0*/ LOP3.LUT R22, R22, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff16167812 */ | |
| 460 | + /* 0x000fe400078ec0ff */ | |
| 461 | + /*06d0*/ LOP3.LUT R15, R15, 0xff00, R20, 0xf8, !PT ; /* 0x0000ff000f0f7812 */ | |
| 462 | + /* 0x000fe200078ef814 */ | |
| 463 | + /*06e0*/ IMAD.SHL.U32 R20, R14, 0x1000, RZ ; /* 0x000010000e147824 */ | |
| 464 | + /* 0x000fe200078e00ff */ | |
| 465 | + /*06f0*/ LOP3.LUT R14, R22, 0xff00, R23, 0xf8, !PT ; /* 0x0000ff00160e7812 */ | |
| 466 | + /* 0x000fc400078ef817 */ | |
| 467 | + /*0700*/ SHF.R.S32.HI R22, RZ, 0xc, R21 ; /* 0x0000000cff167819 */ | |
| 468 | + /* 0x000fe40000011415 */ | |
| 469 | + /*0710*/ LOP3.LUT R21, R7, 0xf0000, RZ, 0xc0, !PT ; /* 0x000f000007157812 */ | |
| 470 | + /* 0x000fe400078ec0ff */ | |
| 471 | + /*0720*/ SHF.R.S32.HI R20, RZ, 0xc, R20 ; /* 0x0000000cff147819 */ | |
| 472 | + /* 0x000fe40000011414 */ | |
| 473 | + /*0730*/ LOP3.LUT R23, R6, 0xf0000, RZ, 0xc0, !PT ; /* 0x000f000006177812 */ | |
| 474 | + /* 0x000fe200078ec0ff */ | |
| 475 | + /*0740*/ IMAD.SHL.U32 R21, R21, 0x1000, RZ ; /* 0x0000100015157824 */ | |
| 476 | + /* 0x000fe200078e00ff */ | |
| 477 | + /*0750*/ LOP3.LUT R9, R9, 0xff0000, R20, 0xf8, !PT ; /* 0x00ff000009097812 */ | |
| 478 | + /* 0x000fe400078ef814 */ | |
| 479 | + /*0760*/ LOP3.LUT R20, R2, 0xf00000, RZ, 0xc0, !PT ; /* 0x00f0000002147812 */ | |
| 480 | + /* 0x000fe200078ec0ff */ | |
| 481 | + /*0770*/ IMAD.SHL.U32 R23, R23, 0x1000, RZ ; /* 0x0000100017177824 */ | |
| 482 | + /* 0x000fe200078e00ff */ | |
| 483 | + /*0780*/ SHF.R.S32.HI R21, RZ, 0xc, R21 ; /* 0x0000000cff157819 */ | |
| 484 | + /* 0x000fc40000011415 */ | |
| 485 | + /*0790*/ LOP3.LUT R11, R11, 0xff0000, R22, 0xf8, !PT ; /* 0x00ff00000b0b7812 */ | |
| 486 | + /* 0x000fe200078ef816 */ | |
| 487 | + /*07a0*/ IMAD.SHL.U32 R22, R20, 0x100, RZ ; /* 0x0000010014167824 */ | |
| 488 | + /* 0x000fe200078e00ff */ | |
| 489 | + /*07b0*/ LOP3.LUT R20, R8, 0xff0000, R21, 0xf8, !PT ; /* 0x00ff000008147812 */ | |
| 490 | + /* 0x000fe400078ef815 */ | |
| 491 | + /*07c0*/ SHF.R.S32.HI R23, RZ, 0xc, R23 ; /* 0x0000000cff177819 */ | |
| 492 | + /* 0x000fe40000011417 */ | |
| 493 | + /*07d0*/ LOP3.LUT R24, R3, 0xf00000, RZ, 0xc0, !PT ; /* 0x00f0000003187812 */ | |
| 494 | + /* 0x000fe400078ec0ff */ | |
| 495 | + /*07e0*/ LOP3.LUT R8, R4, 0xf00000, RZ, 0xc0, !PT ; /* 0x00f0000004087812 */ | |
| 496 | + /* 0x000fe400078ec0ff */ | |
| 497 | + /*07f0*/ LOP3.LUT R21, R5, 0xf00000, RZ, 0xc0, !PT ; /* 0x00f0000005157812 */ | |
| 498 | + /* 0x000fe200078ec0ff */ | |
| 499 | + /*0800*/ IMAD.SHL.U32 R24, R24, 0x100, RZ ; /* 0x0000010018187824 */ | |
| 500 | + /* 0x000fe200078e00ff */ | |
| 501 | + /*0810*/ LOP3.LUT R10, R10, 0xff0000, R23, 0xf8, !PT ; /* 0x00ff00000a0a7812 */ | |
| 502 | + /* 0x000fe200078ef817 */ | |
| 503 | + /*0820*/ IMAD.SHL.U32 R8, R8, 0x100, RZ ; /* 0x0000010008087824 */ | |
| 504 | + /* 0x000fe200078e00ff */ | |
| 505 | + /*0830*/ SHF.R.S32.HI R23, RZ, 0xc, R22 ; /* 0x0000000cff177819 */ | |
| 506 | + /* 0x000fe20000011416 */ | |
| 507 | + /*0840*/ IMAD.SHL.U32 R21, R21, 0x100, RZ ; /* 0x0000010015157824 */ | |
| 508 | + /* 0x000fe200078e00ff */ | |
| 509 | + /*0850*/ LOP3.LUT R22, R2, 0xf000000, RZ, 0xc0, !PT ; /* 0x0f00000002167812 */ | |
| 510 | + /* 0x000fc400078ec0ff */ | |
| 511 | + /*0860*/ LOP3.LUT R16, R16, 0xff0000, R23, 0xf8, !PT ; /* 0x00ff000010107812 */ | |
| 512 | + /* 0x000fe400078ef817 */ | |
| 513 | + /*0870*/ SHF.R.S32.HI R24, RZ, 0xc, R24 ; /* 0x0000000cff187819 */ | |
| 514 | + /* 0x000fe20000011418 */ | |
| 515 | + /*0880*/ IMAD.SHL.U32 R22, R22, 0x10, RZ ; /* 0x0000001016167824 */ | |
| 516 | + /* 0x000fe200078e00ff */ | |
| 517 | + /*0890*/ SHF.R.S32.HI R8, RZ, 0xc, R8 ; /* 0x0000000cff087819 */ | |
| 518 | + /* 0x000fe40000011408 */ | |
| 519 | + /*08a0*/ LOP3.LUT R23, R3, 0xf000000, RZ, 0xc0, !PT ; /* 0x0f00000003177812 */ | |
| 520 | + /* 0x000fe400078ec0ff */ | |
| 521 | + /*08b0*/ SHF.R.S32.HI R21, RZ, 0xc, R21 ; /* 0x0000000cff157819 */ | |
| 522 | + /* 0x000fe40000011415 */ | |
| 523 | + /*08c0*/ LOP3.LUT R17, R17, 0xff0000, R24, 0xf8, !PT ; /* 0x00ff000011117812 */ | |
| 524 | + /* 0x000fe200078ef818 */ | |
| 525 | + /*08d0*/ IMAD.SHL.U32 R24, R23, 0x10, RZ ; /* 0x0000001017187824 */ | |
| 526 | + /* 0x000fe200078e00ff */ | |
| 527 | + /*08e0*/ LOP3.LUT R19, R19, 0xff0000, R8, 0xf8, !PT ; /* 0x00ff000013137812 */ | |
| 528 | + /* 0x000fc400078ef808 */ | |
| 529 | + /*08f0*/ LOP3.LUT R18, R18, 0xff0000, R21, 0xf8, !PT ; /* 0x00ff000012127812 */ | |
| 530 | + /* 0x000fe400078ef815 */ | |
| 531 | + /*0900*/ LOP3.LUT R8, R4, 0xf000000, RZ, 0xc0, !PT ; /* 0x0f00000004087812 */ | |
| 532 | + /* 0x000fe400078ec0ff */ | |
| 533 | + /*0910*/ LOP3.LUT R21, R5, 0xf000000, RZ, 0xc0, !PT ; /* 0x0f00000005157812 */ | |
| 534 | + /* 0x000fe400078ec0ff */ | |
| 535 | + /*0920*/ SHF.R.S32.HI R23, RZ, 0x4, R22 ; /* 0x00000004ff177819 */ | |
| 536 | + /* 0x000fe20000011416 */ | |
| 537 | + /*0930*/ IMAD.SHL.U32 R8, R8, 0x10, RZ ; /* 0x0000001008087824 */ | |
| 538 | + /* 0x000fe200078e00ff */ | |
| 539 | + /*0940*/ SHF.R.S32.HI R24, RZ, 0x4, R24 ; /* 0x00000004ff187819 */ | |
| 540 | + /* 0x000fe20000011418 */ | |
| 541 | + /*0950*/ IMAD.SHL.U32 R21, R21, 0x10, RZ ; /* 0x0000001015157824 */ | |
| 542 | + /* 0x000fe200078e00ff */ | |
| 543 | + /*0960*/ LOP3.LUT R12, R12, 0xff000000, R23, 0xf8, !PT ; /* 0xff0000000c0c7812 */ | |
| 544 | + /* 0x000fc400078ef817 */ | |
| 545 | + /*0970*/ LOP3.LUT R13, R13, 0xff000000, R24, 0xf8, !PT ; /* 0xff0000000d0d7812 */ | |
| 546 | + /* 0x000fe400078ef818 */ | |
| 547 | + /*0980*/ LOP3.LUT R23, R6, 0xf000000, RZ, 0xc0, !PT ; /* 0x0f00000006177812 */ | |
| 548 | + /* 0x000fe400078ec0ff */ | |
| 549 | + /*0990*/ SHF.R.S32.HI R8, RZ, 0x4, R8 ; /* 0x00000004ff087819 */ | |
| 550 | + /* 0x000fe40000011408 */ | |
| 551 | + /*09a0*/ LOP3.LUT R24, R7, 0xf000000, RZ, 0xc0, !PT ; /* 0x0f00000007187812 */ | |
| 552 | + /* 0x000fe200078ec0ff */ | |
| 553 | + /*09b0*/ IMAD.SHL.U32 R23, R23, 0x10, RZ ; /* 0x0000001017177824 */ | |
| 554 | + /* 0x000fe200078e00ff */ | |
| 555 | + /*09c0*/ SHF.R.S32.HI R22, RZ, 0x4, R21 ; /* 0x00000004ff167819 */ | |
| 556 | + /* 0x000fe40000011415 */ | |
| 557 | + /*09d0*/ LOP3.LUT R8, R9, 0xff000000, R8, 0xf8, !PT ; /* 0xff00000009087812 */ | |
| 558 | + /* 0x000fe200078ef808 */ | |
| 559 | + /*09e0*/ IMAD.SHL.U32 R24, R24, 0x10, RZ ; /* 0x0000001018187824 */ | |
| 560 | + /* 0x000fe200078e00ff */ | |
| 561 | + /*09f0*/ LOP3.LUT R9, R11, 0xff000000, R22, 0xf8, !PT ; /* 0xff0000000b097812 */ | |
| 562 | + /* 0x000fc400078ef816 */ | |
| 563 | + /*0a00*/ LOP3.LUT R11, R6, 0xf00000, RZ, 0xc0, !PT ; /* 0x00f00000060b7812 */ | |
| 564 | + /* 0x000fe400078ec0ff */ | |
| 565 | + /*0a10*/ LOP3.LUT R22, R7, 0xf00000, RZ, 0xc0, !PT ; /* 0x00f0000007167812 */ | |
| 566 | + /* 0x000fe400078ec0ff */ | |
| 567 | + /*0a20*/ SHF.R.S32.HI R23, RZ, 0x4, R23 ; /* 0x00000004ff177819 */ | |
| 568 | + /* 0x000fe20000011417 */ | |
| 569 | + /*0a30*/ IMAD.SHL.U32 R21, R11, 0x100, RZ ; /* 0x000001000b157824 */ | |
| 570 | + /* 0x000fe200078e00ff */ | |
| 571 | + /*0a40*/ SHF.R.S32.HI R25, RZ, 0x4, R24 ; /* 0x00000004ff197819 */ | |
| 572 | + /* 0x000fe20000011418 */ | |
| 573 | + /*0a50*/ IMAD.SHL.U32 R22, R22, 0x100, RZ ; /* 0x0000010016167824 */ | |
| 574 | + /* 0x000fe200078e00ff */ | |
| 575 | + /*0a60*/ LOP3.LUT R10, R10, 0xff000000, R23, 0xf8, !PT ; /* 0xff0000000a0a7812 */ | |
| 576 | + /* 0x000fe400078ef817 */ | |
| 577 | + /*0a70*/ LOP3.LUT R2, R2, 0xf0000000, RZ, 0xc0, !PT ; /* 0xf000000002027812 */ | |
| 578 | + /* 0x000fc400078ec0ff */ | |
| 579 | + /*0a80*/ LOP3.LUT R11, R20, 0xff000000, R25, 0xf8, !PT ; /* 0xff000000140b7812 */ | |
| 580 | + /* 0x000fe400078ef819 */ | |
| 581 | + /*0a90*/ LOP3.LUT R23, R3, 0xf0000000, RZ, 0xc0, !PT ; /* 0xf000000003177812 */ | |
| 582 | + /* 0x000fe400078ec0ff */ | |
| 583 | + /*0aa0*/ SHF.R.S32.HI R20, RZ, 0xc, R21 ; /* 0x0000000cff147819 */ | |
| 584 | + /* 0x000fe40000011415 */ | |
| 585 | + /*0ab0*/ SHF.R.S32.HI R21, RZ, 0x4, R2 ; /* 0x00000004ff157819 */ | |
| 586 | + /* 0x000fe20000011402 */ | |
| 587 | + /*0ac0*/ IMMA.16832.S8.S8 R8, R8.ROW, R12.COL, RZ ; /* 0x0000000c08087237 */ | |
| 588 | + /* 0x000fe20000405cff */ | |
| 589 | + /*0ad0*/ SHF.R.S32.HI R3, RZ, 0xc, R22 ; /* 0x0000000cff037819 */ | |
| 590 | + /* 0x000fe40000011416 */ | |
| 591 | + /*0ae0*/ SHF.R.S32.HI R2, RZ, 0x4, R23 ; /* 0x00000004ff027819 */ | |
| 592 | + /* 0x000fc40000011417 */ | |
| 593 | + /*0af0*/ LOP3.LUT R15, R15, 0xff0000, R20, 0xf8, !PT ; /* 0x00ff00000f0f7812 */ | |
| 594 | + /* 0x000fe400078ef814 */ | |
| 595 | + /*0b00*/ LOP3.LUT R20, R14, 0xff0000, R3, 0xf8, !PT ; /* 0x00ff00000e147812 */ | |
| 596 | + /* 0x000fe400078ef803 */ | |
| 597 | + /*0b10*/ LOP3.LUT R17, R17, 0xff000000, R2, 0xf8, !PT ; /* 0xff00000011117812 */ | |
| 598 | + /* 0x000fe400078ef802 */ | |
| 599 | + /*0b20*/ LOP3.LUT R12, R6, 0xf0000000, RZ, 0xc0, !PT ; /* 0xf0000000060c7812 */ | |
| 600 | + /* 0x000fe400078ec0ff */ | |
| 601 | + /*0b30*/ LOP3.LUT R2, R4, 0xf0000000, RZ, 0xc0, !PT ; /* 0xf000000004027812 */ | |
| 602 | + /* 0x000fe400078ec0ff */ | |
| 603 | + /*0b40*/ LOP3.LUT R3, R5, 0xf0000000, RZ, 0xc0, !PT ; /* 0xf000000005037812 */ | |
| 604 | + /* 0x000fc400078ec0ff */ | |
| 605 | + /*0b50*/ LOP3.LUT R13, R7, 0xf0000000, RZ, 0xc0, !PT ; /* 0xf0000000070d7812 */ | |
| 606 | + /* 0x000fe400078ec0ff */ | |
| 607 | + /*0b60*/ LOP3.LUT R16, R16, 0xff000000, R21, 0xf8, !PT ; /* 0xff00000010107812 */ | |
| 608 | + /* 0x000fe400078ef815 */ | |
| 609 | + /*0b70*/ SHF.R.S32.HI R14, RZ, 0x4, R12 ; /* 0x00000004ff0e7819 */ | |
| 610 | + /* 0x000fe4000001140c */ | |
| 611 | + /*0b80*/ SHF.R.S32.HI R2, RZ, 0x4, R2 ; /* 0x00000004ff027819 */ | |
| 612 | + /* 0x000fe40000011402 */ | |
| 613 | + /*0b90*/ SHF.R.S32.HI R3, RZ, 0x4, R3 ; /* 0x00000004ff037819 */ | |
| 614 | + /* 0x000fe40000011403 */ | |
| 615 | + /*0ba0*/ SHF.R.S32.HI R21, RZ, 0x4, R13 ; /* 0x00000004ff157819 */ | |
| 616 | + /* 0x000fc4000001140d */ | |
| 617 | + /*0bb0*/ LOP3.LUT R14, R15, 0xff000000, R14, 0xf8, !PT ; /* 0xff0000000f0e7812 */ | |
| 618 | + /* 0x000fe400078ef80e */ | |
| 619 | + /*0bc0*/ LOP3.LUT R12, R19, 0xff000000, R2, 0xf8, !PT ; /* 0xff000000130c7812 */ | |
| 620 | + /* 0x000fe400078ef802 */ | |
| 621 | + /*0bd0*/ LOP3.LUT R13, R18, 0xff000000, R3, 0xf8, !PT ; /* 0xff000000120d7812 */ | |
| 622 | + /* 0x000fe400078ef803 */ | |
| 623 | + /*0be0*/ LOP3.LUT R15, R20, 0xff000000, R21, 0xf8, !PT ; /* 0xff000000140f7812 */ | |
| 624 | + /* 0x000fe200078ef815 */ | |
| 625 | + /*0bf0*/ MOV R2, R0 ; /* 0x0000000000027202 */ | |
| 626 | + /* 0x000fe20000000f00 */ | |
| 627 | + /*0c00*/ MOV R3, 0x0 ; /* 0x0000000000037802 */ | |
| 628 | + /* 0x000fca0000000f00 */ | |
| 629 | + /*0c10*/ IMMA.16832.S8.S8 R12, R12.ROW, R16.COL, RZ ; /* 0x000000100c0c7237 */ | |
| 630 | + /* 0x000fde0000405cff */ | |
| 631 | + /*0c20*/ NOP ; /* 0x0000000000007918 */ | |
| 632 | + /* 0x000fd60000000000 */ | |
| 633 | + /*0c30*/ IADD3 R8, PT, PT, R4, R8, R12 ; /* 0x0000000804087210 */ | |
| 634 | + /* 0x000fe40007ffe00c */ | |
| 635 | + /*0c40*/ IADD3 R9, PT, PT, R5, R9, R13 ; /* 0x0000000905097210 */ | |
| 636 | + /* 0x000fe40007ffe00d */ | |
| 637 | + /*0c50*/ IADD3 R10, PT, PT, R6, R10, R14 ; /* 0x0000000a060a7210 */ | |
| 638 | + /* 0x000fe40007ffe00e */ | |
| 639 | + /*0c60*/ IADD3 R11, PT, PT, R7, R11, R15 ; /* 0x0000000b070b7210 */ | |
| 640 | + /* 0x000fe20007ffe00f */ | |
| 641 | + /*0c70*/ RET.REL.NODEC R2 `(k) ; /* 0xfffffff002e07950 */ | |
| 642 | + /* 0x000fec0003c3ffff */ | |
| 643 | +.L_x_0: | |
| 644 | + /*0c80*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 645 | + /* 0x000fc0000383ffff */ | |
| 646 | + /*0c90*/ NOP; /* 0x0000000000007918 */ | |
| 647 | + /* 0x000fc00000000000 */ | |
| 648 | + /*0ca0*/ NOP; /* 0x0000000000007918 */ | |
| 649 | + /* 0x000fc00000000000 */ | |
| 650 | + /*0cb0*/ NOP; /* 0x0000000000007918 */ | |
| 651 | + /* 0x000fc00000000000 */ | |
| 652 | + /*0cc0*/ NOP; /* 0x0000000000007918 */ | |
| 653 | + /* 0x000fc00000000000 */ | |
| 654 | + /*0cd0*/ NOP; /* 0x0000000000007918 */ | |
| 655 | + /* 0x000fc00000000000 */ | |
| 656 | + /*0ce0*/ NOP; /* 0x0000000000007918 */ | |
| 657 | + /* 0x000fc00000000000 */ | |
| 658 | + /*0cf0*/ NOP; /* 0x0000000000007918 */ | |
| 659 | + /* 0x000fc00000000000 */ | |
| 660 | + /*0d00*/ NOP; /* 0x0000000000007918 */ | |
| 661 | + /* 0x000fc00000000000 */ | |
| 662 | + /*0d10*/ NOP; /* 0x0000000000007918 */ | |
| 663 | + /* 0x000fc00000000000 */ | |
| 664 | + /*0d20*/ NOP; /* 0x0000000000007918 */ | |
| 665 | + /* 0x000fc00000000000 */ | |
| 666 | + /*0d30*/ NOP; /* 0x0000000000007918 */ | |
| 667 | + /* 0x000fc00000000000 */ | |
| 668 | + /*0d40*/ NOP; /* 0x0000000000007918 */ | |
| 669 | + /* 0x000fc00000000000 */ | |
| 670 | + /*0d50*/ NOP; /* 0x0000000000007918 */ | |
| 671 | + /* 0x000fc00000000000 */ | |
| 672 | + /*0d60*/ NOP; /* 0x0000000000007918 */ | |
| 673 | + /* 0x000fc00000000000 */ | |
| 674 | + /*0d70*/ NOP; /* 0x0000000000007918 */ | |
| 675 | + /* 0x000fc00000000000 */ | |
| 676 | +.L_x_1: | |
| 677 | + | |
| 678 | + | |
| 679 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 680 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 681 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 682 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 683 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 684 | +__nv_reservedSMEM_offset_0_alias: | |
| 685 | + .zero 0 | |
| 686 | + .zero 64 | |
| 687 | + | |
| 688 | + | |
| 689 | +//--------------------- .nv.constant0.k -------------------------- | |
| 690 | + .section .nv.constant0.k,"a",@progbits | |
| 691 | + .sectionflags @"" | |
| 692 | + .align 4 | |
| 693 | +.nv.constant0.k: | |
| 694 | + .zero 904 | |
| 695 | + | |
| 696 | + | |
| 697 | +//--------------------- SYMBOLS -------------------------- | |
| 698 | + | |
| 699 | + .type .nv.reservedSmem.offset0,@object | |
| 700 | + .size .nv.reservedSmem.offset0,0x4 |
evidence/own-fp4/asm/s8.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k32.row.col.s32.s8.s8.s32 {a0,a1,a2,a3},{a0,a1,a2,a3},{b0,b1},{a0,a1,a2,a3}; mov.b32 d0,a0; mov.b32 d1,a1; mov.b32 d2,a2; mov.b32 d3,a3; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/s8.sass
| new file mode 100644 | ||
| @@ -0,0 +1,282 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x20, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x0000000c | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x01, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0000 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x00000080 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ LDG.E.64 R8, desc[UR4][R2.64+0x10] ; /* 0x0000100402087981 */ | |
| 216 | + /* 0x001ea8000c1e1b00 */ | |
| 217 | + /*0040*/ LDG.E.128 R4, desc[UR4][R2.64] ; /* 0x0000000402047981 */ | |
| 218 | + /* 0x000ea4000c1e1d00 */ | |
| 219 | + /*0050*/ IMMA.16832.S8.S8 R4, R4.ROW, R8.COL, R4 ; /* 0x0000000804047237 */ | |
| 220 | + /* 0x004fde0000405c04 */ | |
| 221 | + /*0060*/ NOP ; /* 0x0000000000007918 */ | |
| 222 | + /* 0x000fd60000000000 */ | |
| 223 | + /*0070*/ STG.E.128 desc[UR4][R2.64], R4 ; /* 0x0000000402007986 */ | |
| 224 | + /* 0x000fe2000c101d04 */ | |
| 225 | + /*0080*/ EXIT ; /* 0x000000000000794d */ | |
| 226 | + /* 0x000fea0003800000 */ | |
| 227 | +.L_x_0: | |
| 228 | + /*0090*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 229 | + /* 0x000fc0000383ffff */ | |
| 230 | + /*00a0*/ NOP; /* 0x0000000000007918 */ | |
| 231 | + /* 0x000fc00000000000 */ | |
| 232 | + /*00b0*/ NOP; /* 0x0000000000007918 */ | |
| 233 | + /* 0x000fc00000000000 */ | |
| 234 | + /*00c0*/ NOP; /* 0x0000000000007918 */ | |
| 235 | + /* 0x000fc00000000000 */ | |
| 236 | + /*00d0*/ NOP; /* 0x0000000000007918 */ | |
| 237 | + /* 0x000fc00000000000 */ | |
| 238 | + /*00e0*/ NOP; /* 0x0000000000007918 */ | |
| 239 | + /* 0x000fc00000000000 */ | |
| 240 | + /*00f0*/ NOP; /* 0x0000000000007918 */ | |
| 241 | + /* 0x000fc00000000000 */ | |
| 242 | + /*0100*/ NOP; /* 0x0000000000007918 */ | |
| 243 | + /* 0x000fc00000000000 */ | |
| 244 | + /*0110*/ NOP; /* 0x0000000000007918 */ | |
| 245 | + /* 0x000fc00000000000 */ | |
| 246 | + /*0120*/ NOP; /* 0x0000000000007918 */ | |
| 247 | + /* 0x000fc00000000000 */ | |
| 248 | + /*0130*/ NOP; /* 0x0000000000007918 */ | |
| 249 | + /* 0x000fc00000000000 */ | |
| 250 | + /*0140*/ NOP; /* 0x0000000000007918 */ | |
| 251 | + /* 0x000fc00000000000 */ | |
| 252 | + /*0150*/ NOP; /* 0x0000000000007918 */ | |
| 253 | + /* 0x000fc00000000000 */ | |
| 254 | + /*0160*/ NOP; /* 0x0000000000007918 */ | |
| 255 | + /* 0x000fc00000000000 */ | |
| 256 | + /*0170*/ NOP; /* 0x0000000000007918 */ | |
| 257 | + /* 0x000fc00000000000 */ | |
| 258 | +.L_x_1: | |
| 259 | + | |
| 260 | + | |
| 261 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 262 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 263 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 264 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 265 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 266 | +__nv_reservedSMEM_offset_0_alias: | |
| 267 | + .zero 0 | |
| 268 | + .zero 64 | |
| 269 | + | |
| 270 | + | |
| 271 | +//--------------------- .nv.constant0.k -------------------------- | |
| 272 | + .section .nv.constant0.k,"a",@progbits | |
| 273 | + .sectionflags @"" | |
| 274 | + .align 4 | |
| 275 | +.nv.constant0.k: | |
| 276 | + .zero 904 | |
| 277 | + | |
| 278 | + | |
| 279 | +//--------------------- SYMBOLS -------------------------- | |
| 280 | + | |
| 281 | + .type .nv.reservedSmem.offset0,@object | |
| 282 | + .size .nv.reservedSmem.offset0,0x4 |
evidence/own-fp4/asm/sp_nvf4.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sp::ordered_metadata.sync.aligned.m16n8k128.row.col.kind::mxf4nvf4.block_scale.scale_vec::4X.f32.e2m1.e2m1.f32.ue4m3 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1,b0,b1},{c0,c1,c2,c3},sa,0x0,sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/sp_nvf4.sass
| new file mode 100644 | ||
| @@ -0,0 +1,282 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x38, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x00000016 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x03, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0080 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x000000e0 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ LDG.E.64 R16, desc[UR4][R2.64+0x30] ; /* 0x0000300402107981 */ | |
| 216 | + /* 0x001ea8000c1e1b00 */ | |
| 217 | + /*0040*/ LDG.E.64 R8, desc[UR4][R2.64+0x10] ; /* 0x0000100402087981 */ | |
| 218 | + /* 0x000ee8000c1e1b00 */ | |
| 219 | + /*0050*/ LDG.E.128 R4, desc[UR4][R2.64] ; /* 0x0000000402047981 */ | |
| 220 | + /* 0x000f28000c1e1d00 */ | |
| 221 | + /*0060*/ LDG.E.128 R12, desc[UR4][R2.64+0x20] ; /* 0x00002004020c7981 */ | |
| 222 | + /* 0x000f22000c1e1d00 */ | |
| 223 | + /*0070*/ MOV R18, R16.reuse ; /* 0x0000001000127202 */ | |
| 224 | + /* 0x084fe20000000f00 */ | |
| 225 | + /*0080*/ MOV R19, R16 ; /* 0x0000001000137202 */ | |
| 226 | + /* 0x000fe20000000f00 */ | |
| 227 | + /*0090*/ MOV R10, R8 ; /* 0x00000008000a7202 */ | |
| 228 | + /* 0x008fe20000000f00 */ | |
| 229 | + /*00a0*/ MOV R11, R9 ; /* 0x00000009000b7202 */ | |
| 230 | + /* 0x000fce0000000f00 */ | |
| 231 | + /*00b0*/ OMMA.SF.SP.168128.F32.E2M1.E2M1.UE4M3.4X R4, R4, R8, R12, R18, R17, URZ, 0x0 ; /* 0x711012080404747f */ | |
| 232 | + /* 0x010fde0000053e0c */ | |
| 233 | + /*00c0*/ NOP ; /* 0x0000000000007918 */ | |
| 234 | + /* 0x000fda0000000000 */ | |
| 235 | + /*00d0*/ STG.E.128 desc[UR4][R2.64], R4 ; /* 0x0000000402007986 */ | |
| 236 | + /* 0x000fe2000c101d04 */ | |
| 237 | + /*00e0*/ EXIT ; /* 0x000000000000794d */ | |
| 238 | + /* 0x000fea0003800000 */ | |
| 239 | +.L_x_0: | |
| 240 | + /*00f0*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 241 | + /* 0x000fc0000383ffff */ | |
| 242 | + /*0100*/ NOP; /* 0x0000000000007918 */ | |
| 243 | + /* 0x000fc00000000000 */ | |
| 244 | + /*0110*/ NOP; /* 0x0000000000007918 */ | |
| 245 | + /* 0x000fc00000000000 */ | |
| 246 | + /*0120*/ NOP; /* 0x0000000000007918 */ | |
| 247 | + /* 0x000fc00000000000 */ | |
| 248 | + /*0130*/ NOP; /* 0x0000000000007918 */ | |
| 249 | + /* 0x000fc00000000000 */ | |
| 250 | + /*0140*/ NOP; /* 0x0000000000007918 */ | |
| 251 | + /* 0x000fc00000000000 */ | |
| 252 | + /*0150*/ NOP; /* 0x0000000000007918 */ | |
| 253 | + /* 0x000fc00000000000 */ | |
| 254 | + /*0160*/ NOP; /* 0x0000000000007918 */ | |
| 255 | + /* 0x000fc00000000000 */ | |
| 256 | + /*0170*/ NOP; /* 0x0000000000007918 */ | |
| 257 | + /* 0x000fc00000000000 */ | |
| 258 | +.L_x_1: | |
| 259 | + | |
| 260 | + | |
| 261 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 262 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 263 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 264 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 265 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 266 | +__nv_reservedSMEM_offset_0_alias: | |
| 267 | + .zero 0 | |
| 268 | + .zero 64 | |
| 269 | + | |
| 270 | + | |
| 271 | +//--------------------- .nv.constant0.k -------------------------- | |
| 272 | + .section .nv.constant0.k,"a",@progbits | |
| 273 | + .sectionflags @"" | |
| 274 | + .align 4 | |
| 275 | +.nv.constant0.k: | |
| 276 | + .zero 904 | |
| 277 | + | |
| 278 | + | |
| 279 | +//--------------------- SYMBOLS -------------------------- | |
| 280 | + | |
| 281 | + .type .nv.reservedSmem.offset0,@object | |
| 282 | + .size .nv.reservedSmem.offset0,0x4 |
evidence/own-fp4/asm/tcgen05_alloc.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + tcgen05.alloc.cta_group::1.sync.aligned.shared::cta.b32 [rp], 32; mov.f32 d0,c0; mov.f32 d1,c1; mov.f32 d2,c2; mov.f32 d3,c3; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/v_base.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/v_bida1.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{1,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/v_bidb1.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{1,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/v_nv.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4nvf4.block_scale.scale_vec::4X.f32.e2m1.e2m1.f32.ue4m3 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/v_nvsame.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4nvf4.block_scale.scale_vec::4X.f32.e2m1.e2m1.f32.ue4m3 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sb,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/v_same.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sb,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/v_tida1.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,1},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/asm/v_tidb1.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,1}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
evidence/own-fp4/omma-peak/context.txt
| new file mode 100644 | ||
| @@ -0,0 +1,6 @@ | ||
| 1 | +2026-10-20T19:15:13Z | |
| 2 | +0f42a6cfa8e5a74452cd0fa2f9787e53b427a0a8 | |
| 3 | + 14:15:13 up 2 days, 9:22, 37 users, load average: 64.14, 67.47, 62.98 | |
| 4 | +name, clocks.current.sm [MHz], clocks.max.sm [MHz], temperature.gpu, power.draw [W] | |
| 5 | +NVIDIA GB10, 2405 MHz, 3003 MHz, 61, 13.92 W | |
| 6 | + 14:15:35 up 2 days, 9:23, 38 users, load average: 59.75, 66.21, 62.68 |
evidence/own-fp4/omma-peak/gpu-omma-peak.txt
| new file mode 100644 | ||
| @@ -0,0 +1,16 @@ | ||
| 1 | +OMMA selftest: E2M1 QMMA, QMMA.SF E8, OMMA.SF E8 2X, OMMA.SF UE4M3 4X match the ptxas oracle bits (scale reg R4), HMMA untouched | |
| 2 | +QMMA selftest: QMMA.16832.F32.E4M3.E4M3 and F2FP.SATFINITE.E4M3.F32.PACK_AB_MERGE_C match the oracle bits, HMMA untouched | |
| 3 | +launch failed: marker wait timed out (latched) | |
| 4 | +upload failed: alloc without open device | |
| 5 | +upload failed: alloc without open device | |
| 6 | +upload failed: alloc without open device | |
| 7 | +upload failed: alloc without open device | |
| 8 | +upload failed: alloc without open device | |
| 9 | +BEST FP8 QMMA.16832.E4M3 (control) 0.00 TFLOPS (0.000 of FP8 control) | |
| 10 | +BEST FP4 QMMA.16832.E2M1 (no block scale) 0.00 TFLOPS (0.000 of FP8 control) | |
| 11 | +BEST FP4 QMMA.SF.16832.E2M1 E8 x1 (k32) 0.00 TFLOPS (0.000 of FP8 control) | |
| 12 | +BEST MXFP4 OMMA.SF.16864 E8 2X (32/scale) 0.00 TFLOPS (0.000 of FP8 control) | |
| 13 | +BEST MXFP4 OMMA.SF.16864 E8 2X scale 1.0 0.00 TFLOPS (0.000 of FP8 control) | |
| 14 | +BEST NVFP4 OMMA.SF.16864 UE4M3 4X (16/sc) 0.00 TFLOPS (0.000 of FP8 control) | |
| 15 | +GPU_OMMA_PEAK: FAIL | |
| 16 | +## rc=1 |
evidence/own-fp4/omma-peak/measure.sh
| new file mode 100755 | ||
| @@ -0,0 +1,9 @@ | ||
| 1 | +#!/bin/sh | |
| 2 | +# L284 OMMA peak: pause my own training (race.sh child) for the window, run the chip probe under the GB10 lock, resume. | |
| 3 | +P=$(pgrep -f "train.py --recipe" | head -1) | |
| 4 | +[ -n "$P" ] && kill -STOP $P | |
| 5 | +cd /home/drakestapleton/workspace/omega-own-fp4-omma | |
| 6 | +{ date -u +%FT%TZ; git rev-parse HEAD; git status --short | head; uptime; nvidia-smi --query-gpu=name,clocks.sm,clocks.max.sm,temperature.gpu,power.draw --format=csv; } > /home/drakestapleton/workspace/aien-train-own-fp4/evidence/own-fp4/omma-peak/context.txt 2>&1 | |
| 7 | +flock /tmp/aien-gb10.lock build/gpu_omma_peak_test > /home/drakestapleton/workspace/aien-train-own-fp4/evidence/own-fp4/omma-peak/gpu-omma-peak.txt 2>&1; echo "## rc=$?" >> /home/drakestapleton/workspace/aien-train-own-fp4/evidence/own-fp4/omma-peak/gpu-omma-peak.txt | |
| 8 | +uptime >> /home/drakestapleton/workspace/aien-train-own-fp4/evidence/own-fp4/omma-peak/context.txt | |
| 9 | +[ -n "$P" ] && kill -CONT $P |
evidence/own-fp4/outlier/README.md
| new file mode 100644 | ||
| @@ -0,0 +1,6 @@ | ||
| 1 | +# Outlier study (L284 Part 2b), ORACLE | |
| 2 | +Source: Wgrad operands (X, dY; first 4096 tokens of a 16384-token batch) of layers b0.fc1, b2.qkv, b3.proj, b4.fc2 of the | |
| 3 | +BF16 baseline run (streams/own-fp4/train.py --recipe bf16 --seed 0 --dump_steps 200,1500,2999), data SearchQA/TinyLlama | |
| 4 | +tokens. Command: CUDA_VISIBLE_DEVICES= ~/.venv/bin/python -I streams/own-fp4/outlier_study.py RUN_DIR rows.json (CPU, | |
| 5 | +torch 2.14.0). Metric: |dW_q - dW| / |dW| (Frobenius) with dW = dY^T X in FP32; X nearest, dY stochastic (one draw). | |
| 6 | +Files: rows.json (every case, also X and dY operand errors), summary.txt (means), per_case.txt (per case). |
evidence/own-fp4/outlier/per_case.txt
| new file mode 100644 | ||
| @@ -0,0 +1,24 @@ | ||
| 1 | +nv 200 b0.fc1 none=0.1246 signs_only=0.1244 h16_fixed=0.1229 rht16=0.1255 rht128=0.1253 diag_pow2=0.1211 diag+rht16=0.1203 | |
| 2 | +nv 200 b2.qkv none=0.0589 signs_only=0.0593 h16_fixed=0.0621 rht16=0.0625 rht128=0.0614 diag_pow2=0.0550 diag+rht16=0.0549 | |
| 3 | +nv 200 b3.proj none=0.1125 signs_only=0.1127 h16_fixed=0.1061 rht16=0.1063 rht128=0.1094 diag_pow2=0.1079 diag+rht16=0.1041 | |
| 4 | +nv 200 b4.fc2 none=0.1101 signs_only=0.1089 h16_fixed=0.1137 rht16=0.1135 rht128=0.1148 diag_pow2=0.1055 diag+rht16=0.1050 | |
| 5 | +nv 1500 b0.fc1 none=0.1627 signs_only=0.1625 h16_fixed=0.1622 rht16=0.1649 rht128=0.1623 diag_pow2=0.1569 diag+rht16=0.1596 | |
| 6 | +nv 1500 b2.qkv none=0.1549 signs_only=0.1487 h16_fixed=0.1353 rht16=0.1481 rht128=0.1519 diag_pow2=0.1417 diag+rht16=0.1384 | |
| 7 | +nv 1500 b3.proj none=0.1589 signs_only=0.1600 h16_fixed=0.1571 rht16=0.1613 rht128=0.1644 diag_pow2=0.1526 diag+rht16=0.1468 | |
| 8 | +nv 1500 b4.fc2 none=0.1625 signs_only=0.1623 h16_fixed=0.1870 rht16=0.1862 rht128=0.1875 diag_pow2=0.1474 diag+rht16=0.1505 | |
| 9 | +nv 2999 b0.fc1 none=0.1703 signs_only=0.1741 h16_fixed=0.1700 rht16=0.1712 rht128=0.1713 diag_pow2=0.1637 diag+rht16=0.1591 | |
| 10 | +nv 2999 b2.qkv none=0.1449 signs_only=0.1478 h16_fixed=0.1445 rht16=0.1553 rht128=0.1549 diag_pow2=0.1452 diag+rht16=0.1350 | |
| 11 | +nv 2999 b3.proj none=0.1661 signs_only=0.1666 h16_fixed=0.1664 rht16=0.1707 rht128=0.1729 diag_pow2=0.1577 diag+rht16=0.1539 | |
| 12 | +nv 2999 b4.fc2 none=0.1701 signs_only=0.1681 h16_fixed=0.1926 rht16=0.1934 rht128=0.1909 diag_pow2=0.1437 diag+rht16=0.1439 | |
| 13 | +mx 200 b0.fc1 none=0.1597 signs_only=0.1613 h16_fixed=0.1490 rht16=0.1465 rht128=0.1470 diag_pow2=0.1565 diag+rht16=0.1417 | |
| 14 | +mx 200 b2.qkv none=0.0893 signs_only=0.0892 h16_fixed=0.1062 rht16=0.0808 rht128=0.0772 diag_pow2=0.0845 diag+rht16=0.0748 | |
| 15 | +mx 200 b3.proj none=0.1364 signs_only=0.1363 h16_fixed=0.1450 rht16=0.1322 rht128=0.1280 diag_pow2=0.1347 diag+rht16=0.1280 | |
| 16 | +mx 200 b4.fc2 none=0.1434 signs_only=0.1441 h16_fixed=0.1391 rht16=0.1344 rht128=0.1345 diag_pow2=0.1401 diag+rht16=0.1233 | |
| 17 | +mx 1500 b0.fc1 none=0.2092 signs_only=0.2096 h16_fixed=0.2050 rht16=0.1899 rht128=0.1909 diag_pow2=0.2052 diag+rht16=0.1863 | |
| 18 | +mx 1500 b2.qkv none=0.1941 signs_only=0.1953 h16_fixed=0.1945 rht16=0.1767 rht128=0.1711 diag_pow2=0.1894 diag+rht16=0.1621 | |
| 19 | +mx 1500 b3.proj none=0.1958 signs_only=0.1957 h16_fixed=0.2005 rht16=0.1895 rht128=0.1905 diag_pow2=0.1867 diag+rht16=0.1733 | |
| 20 | +mx 1500 b4.fc2 none=0.2231 signs_only=0.2235 h16_fixed=0.2117 rht16=0.2101 rht128=0.2145 diag_pow2=0.2049 diag+rht16=0.1730 | |
| 21 | +mx 2999 b0.fc1 none=0.2277 signs_only=0.2236 h16_fixed=0.2255 rht16=0.2031 rht128=0.1969 diag_pow2=0.2180 diag+rht16=0.1878 | |
| 22 | +mx 2999 b2.qkv none=0.1984 signs_only=0.1971 h16_fixed=0.2174 rht16=0.1801 rht128=0.1747 diag_pow2=0.1899 diag+rht16=0.1627 | |
| 23 | +mx 2999 b3.proj none=0.2061 signs_only=0.2071 h16_fixed=0.2116 rht16=0.1986 rht128=0.1976 diag_pow2=0.1960 diag+rht16=0.1782 | |
| 24 | +mx 2999 b4.fc2 none=0.2356 signs_only=0.2356 h16_fixed=0.2166 rht16=0.2141 rht128=0.2188 diag_pow2=0.2064 diag+rht16=0.1639 |
evidence/own-fp4/outlier/rows.json
| new file mode 100644 | ||
| @@ -0,0 +1,1682 @@ | ||
| 1 | +[ | |
| 2 | +{ | |
| 3 | +"step": 1500, | |
| 4 | +"layer": "b0.fc1", | |
| 5 | +"transform": "none", | |
| 6 | +"fmt": "nv", | |
| 7 | +"dw_rel_err": 0.16268011927604675, | |
| 8 | +"x_rel_err": 0.0992177352309227, | |
| 9 | +"dy_rel_err": 0.13441893458366394, | |
| 10 | +"cost_mac_per_elem": 0 | |
| 11 | +}, | |
| 12 | +{ | |
| 13 | +"step": 1500, | |
| 14 | +"layer": "b0.fc1", | |
| 15 | +"transform": "none", | |
| 16 | +"fmt": "mx", | |
| 17 | +"dw_rel_err": 0.20923897624015808, | |
| 18 | +"x_rel_err": 0.1119551733136177, | |
| 19 | +"dy_rel_err": 0.18586480617523193, | |
| 20 | +"cost_mac_per_elem": 0 | |
| 21 | +}, | |
| 22 | +{ | |
| 23 | +"step": 1500, | |
| 24 | +"layer": "b0.fc1", | |
| 25 | +"transform": "signs_only", | |
| 26 | +"fmt": "nv", | |
| 27 | +"dw_rel_err": 0.1625203937292099, | |
| 28 | +"x_rel_err": 0.0992177352309227, | |
| 29 | +"dy_rel_err": 0.13451319932937622, | |
| 30 | +"cost_mac_per_elem": 0 | |
| 31 | +}, | |
| 32 | +{ | |
| 33 | +"step": 1500, | |
| 34 | +"layer": "b0.fc1", | |
| 35 | +"transform": "signs_only", | |
| 36 | +"fmt": "mx", | |
| 37 | +"dw_rel_err": 0.20959697663784027, | |
| 38 | +"x_rel_err": 0.1119551733136177, | |
| 39 | +"dy_rel_err": 0.1856246143579483, | |
| 40 | +"cost_mac_per_elem": 0 | |
| 41 | +}, | |
| 42 | +{ | |
| 43 | +"step": 1500, | |
| 44 | +"layer": "b0.fc1", | |
| 45 | +"transform": "h16_fixed", | |
| 46 | +"fmt": "nv", | |
| 47 | +"dw_rel_err": 0.1621628999710083, | |
| 48 | +"x_rel_err": 0.0910380631685257, | |
| 49 | +"dy_rel_err": 0.14011117815971375, | |
| 50 | +"cost_mac_per_elem": 16 | |
| 51 | +}, | |
| 52 | +{ | |
| 53 | +"step": 1500, | |
| 54 | +"layer": "b0.fc1", | |
| 55 | +"transform": "h16_fixed", | |
| 56 | +"fmt": "mx", | |
| 57 | +"dw_rel_err": 0.20500732958316803, | |
| 58 | +"x_rel_err": 0.1376449465751648, | |
| 59 | +"dy_rel_err": 0.1581621617078781, | |
| 60 | +"cost_mac_per_elem": 16 | |
| 61 | +}, | |
| 62 | +{ | |
| 63 | +"step": 1500, | |
| 64 | +"layer": "b0.fc1", | |
| 65 | +"transform": "rht16", | |
| 66 | +"fmt": "nv", | |
| 67 | +"dw_rel_err": 0.16491736471652985, | |
| 68 | +"x_rel_err": 0.09271378070116043, | |
| 69 | +"dy_rel_err": 0.14065949618816376, | |
| 70 | +"cost_mac_per_elem": 16 | |
| 71 | +}, | |
| 72 | +{ | |
| 73 | +"step": 1500, | |
| 74 | +"layer": "b0.fc1", | |
| 75 | +"transform": "rht16", | |
| 76 | +"fmt": "mx", | |
| 77 | +"dw_rel_err": 0.18994975090026855, | |
| 78 | +"x_rel_err": 0.11714775860309601, | |
| 79 | +"dy_rel_err": 0.1580916941165924, | |
| 80 | +"cost_mac_per_elem": 16 | |
| 81 | +}, | |
| 82 | +{ | |
| 83 | +"step": 1500, | |
| 84 | +"layer": "b0.fc1", | |
| 85 | +"transform": "rht128", | |
| 86 | +"fmt": "nv", | |
| 87 | +"dw_rel_err": 0.16230270266532898, | |
| 88 | +"x_rel_err": 0.09501214325428009, | |
| 89 | +"dy_rel_err": 0.13794124126434326, | |
| 90 | +"cost_mac_per_elem": 128 | |
| 91 | +}, | |
| 92 | +{ | |
| 93 | +"step": 1500, | |
| 94 | +"layer": "b0.fc1", | |
| 95 | +"transform": "rht128", | |
| 96 | +"fmt": "mx", | |
| 97 | +"dw_rel_err": 0.19090616703033447, | |
| 98 | +"x_rel_err": 0.11569471657276154, | |
| 99 | +"dy_rel_err": 0.1569720208644867, | |
| 100 | +"cost_mac_per_elem": 128 | |
| 101 | +}, | |
| 102 | +{ | |
| 103 | +"step": 1500, | |
| 104 | +"layer": "b0.fc1", | |
| 105 | +"transform": "diag_pow2", | |
| 106 | +"fmt": "nv", | |
| 107 | +"dw_rel_err": 0.15693733096122742, | |
| 108 | +"x_rel_err": 0.09498948603868484, | |
| 109 | +"dy_rel_err": 0.13539287447929382, | |
| 110 | +"cost_mac_per_elem": 1 | |
| 111 | +}, | |
| 112 | +{ | |
| 113 | +"step": 1500, | |
| 114 | +"layer": "b0.fc1", | |
| 115 | +"transform": "diag_pow2", | |
| 116 | +"fmt": "mx", | |
| 117 | +"dw_rel_err": 0.20520830154418945, | |
| 118 | +"x_rel_err": 0.11689390987157822, | |
| 119 | +"dy_rel_err": 0.17805713415145874, | |
| 120 | +"cost_mac_per_elem": 1 | |
| 121 | +}, | |
| 122 | +{ | |
| 123 | +"step": 1500, | |
| 124 | +"layer": "b0.fc1", | |
| 125 | +"transform": "diag+rht16", | |
| 126 | +"fmt": "nv", | |
| 127 | +"dw_rel_err": 0.1596493124961853, | |
| 128 | +"x_rel_err": 0.094263456761837, | |
| 129 | +"dy_rel_err": 0.13949938118457794, | |
| 130 | +"cost_mac_per_elem": 17 | |
| 131 | +}, | |
| 132 | +{ | |
| 133 | +"step": 1500, | |
| 134 | +"layer": "b0.fc1", | |
| 135 | +"transform": "diag+rht16", | |
| 136 | +"fmt": "mx", | |
| 137 | +"dw_rel_err": 0.1863459050655365, | |
| 138 | +"x_rel_err": 0.11714804917573929, | |
| 139 | +"dy_rel_err": 0.15806135535240173, | |
| 140 | +"cost_mac_per_elem": 17 | |
| 141 | +}, | |
| 142 | +{ | |
| 143 | +"step": 1500, | |
| 144 | +"layer": "b2.qkv", | |
| 145 | +"transform": "none", | |
| 146 | +"fmt": "nv", | |
| 147 | +"dw_rel_err": 0.15494191646575928, | |
| 148 | +"x_rel_err": 0.10507724434137344, | |
| 149 | +"dy_rel_err": 0.13053090870380402, | |
| 150 | +"cost_mac_per_elem": 0 | |
| 151 | +}, | |
| 152 | +{ | |
| 153 | +"step": 1500, | |
| 154 | +"layer": "b2.qkv", | |
| 155 | +"transform": "none", | |
| 156 | +"fmt": "mx", | |
| 157 | +"dw_rel_err": 0.19414857029914856, | |
| 158 | +"x_rel_err": 0.11214782297611237, | |
| 159 | +"dy_rel_err": 0.18886853754520416, | |
| 160 | +"cost_mac_per_elem": 0 | |
| 161 | +}, | |
| 162 | +{ | |
| 163 | +"step": 1500, | |
| 164 | +"layer": "b2.qkv", | |
| 165 | +"transform": "signs_only", | |
| 166 | +"fmt": "nv", | |
| 167 | +"dw_rel_err": 0.14868754148483276, | |
| 168 | +"x_rel_err": 0.10507724434137344, | |
| 169 | +"dy_rel_err": 0.1302424669265747, | |
| 170 | +"cost_mac_per_elem": 0 | |
| 171 | +}, | |
| 172 | +{ | |
| 173 | +"step": 1500, | |
| 174 | +"layer": "b2.qkv", | |
| 175 | +"transform": "signs_only", | |
| 176 | +"fmt": "mx", | |
| 177 | +"dw_rel_err": 0.19525834918022156, | |
| 178 | +"x_rel_err": 0.11214782297611237, | |
| 179 | +"dy_rel_err": 0.18981494009494781, | |
| 180 | +"cost_mac_per_elem": 0 | |
| 181 | +}, | |
| 182 | +{ | |
| 183 | +"step": 1500, | |
| 184 | +"layer": "b2.qkv", | |
| 185 | +"transform": "h16_fixed", | |
| 186 | +"fmt": "nv", | |
| 187 | +"dw_rel_err": 0.1352817565202713, | |
| 188 | +"x_rel_err": 0.09176025539636612, | |
| 189 | +"dy_rel_err": 0.13861793279647827, | |
| 190 | +"cost_mac_per_elem": 16 | |
| 191 | +}, | |
| 192 | +{ | |
| 193 | +"step": 1500, | |
| 194 | +"layer": "b2.qkv", | |
| 195 | +"transform": "h16_fixed", | |
| 196 | +"fmt": "mx", | |
| 197 | +"dw_rel_err": 0.1945464313030243, | |
| 198 | +"x_rel_err": 0.1424816995859146, | |
| 199 | +"dy_rel_err": 0.15992219746112823, | |
| 200 | +"cost_mac_per_elem": 16 | |
| 201 | +}, | |
| 202 | +{ | |
| 203 | +"step": 1500, | |
| 204 | +"layer": "b2.qkv", | |
| 205 | +"transform": "rht16", | |
| 206 | +"fmt": "nv", | |
| 207 | +"dw_rel_err": 0.14808999001979828, | |
| 208 | +"x_rel_err": 0.08830435574054718, | |
| 209 | +"dy_rel_err": 0.13909149169921875, | |
| 210 | +"cost_mac_per_elem": 16 | |
| 211 | +}, | |
| 212 | +{ | |
| 213 | +"step": 1500, | |
| 214 | +"layer": "b2.qkv", | |
| 215 | +"transform": "rht16", | |
| 216 | +"fmt": "mx", | |
| 217 | +"dw_rel_err": 0.17673750221729279, | |
| 218 | +"x_rel_err": 0.11618838459253311, | |
| 219 | +"dy_rel_err": 0.15872928500175476, | |
| 220 | +"cost_mac_per_elem": 16 | |
| 221 | +}, | |
| 222 | +{ | |
| 223 | +"step": 1500, | |
| 224 | +"layer": "b2.qkv", | |
| 225 | +"transform": "rht128", | |
| 226 | +"fmt": "nv", | |
| 227 | +"dw_rel_err": 0.15193797647953033, | |
| 228 | +"x_rel_err": 0.09450461715459824, | |
| 229 | +"dy_rel_err": 0.1385464370250702, | |
| 230 | +"cost_mac_per_elem": 128 | |
| 231 | +}, | |
| 232 | +{ | |
| 233 | +"step": 1500, | |
| 234 | +"layer": "b2.qkv", | |
| 235 | +"transform": "rht128", | |
| 236 | +"fmt": "mx", | |
| 237 | +"dw_rel_err": 0.17112909257411957, | |
| 238 | +"x_rel_err": 0.11466638743877411, | |
| 239 | +"dy_rel_err": 0.15653640031814575, | |
| 240 | +"cost_mac_per_elem": 128 | |
| 241 | +}, | |
| 242 | +{ | |
| 243 | +"step": 1500, | |
| 244 | +"layer": "b2.qkv", | |
| 245 | +"transform": "diag_pow2", | |
| 246 | +"fmt": "nv", | |
| 247 | +"dw_rel_err": 0.141684889793396, | |
| 248 | +"x_rel_err": 0.09687764197587967, | |
| 249 | +"dy_rel_err": 0.1328626573085785, | |
| 250 | +"cost_mac_per_elem": 1 | |
| 251 | +}, | |
| 252 | +{ | |
| 253 | +"step": 1500, | |
| 254 | +"layer": "b2.qkv", | |
| 255 | +"transform": "diag_pow2", | |
| 256 | +"fmt": "mx", | |
| 257 | +"dw_rel_err": 0.18944218754768372, | |
| 258 | +"x_rel_err": 0.11691027879714966, | |
| 259 | +"dy_rel_err": 0.1827799379825592, | |
| 260 | +"cost_mac_per_elem": 1 | |
| 261 | +}, | |
| 262 | +{ | |
| 263 | +"step": 1500, | |
| 264 | +"layer": "b2.qkv", | |
| 265 | +"transform": "diag+rht16", | |
| 266 | +"fmt": "nv", | |
| 267 | +"dw_rel_err": 0.1383984088897705, | |
| 268 | +"x_rel_err": 0.09328018128871918, | |
| 269 | +"dy_rel_err": 0.13928480446338654, | |
| 270 | +"cost_mac_per_elem": 17 | |
| 271 | +}, | |
| 272 | +{ | |
| 273 | +"step": 1500, | |
| 274 | +"layer": "b2.qkv", | |
| 275 | +"transform": "diag+rht16", | |
| 276 | +"fmt": "mx", | |
| 277 | +"dw_rel_err": 0.16206610202789307, | |
| 278 | +"x_rel_err": 0.11683643609285355, | |
| 279 | +"dy_rel_err": 0.15834279358386993, | |
| 280 | +"cost_mac_per_elem": 17 | |
| 281 | +}, | |
| 282 | +{ | |
| 283 | +"step": 1500, | |
| 284 | +"layer": "b3.proj", | |
| 285 | +"transform": "none", | |
| 286 | +"fmt": "nv", | |
| 287 | +"dw_rel_err": 0.15885205566883087, | |
| 288 | +"x_rel_err": 0.09748835861682892, | |
| 289 | +"dy_rel_err": 0.13526131212711334, | |
| 290 | +"cost_mac_per_elem": 0 | |
| 291 | +}, | |
| 292 | +{ | |
| 293 | +"step": 1500, | |
| 294 | +"layer": "b3.proj", | |
| 295 | +"transform": "none", | |
| 296 | +"fmt": "mx", | |
| 297 | +"dw_rel_err": 0.19580522179603577, | |
| 298 | +"x_rel_err": 0.11460953205823898, | |
| 299 | +"dy_rel_err": 0.17360422015190125, | |
| 300 | +"cost_mac_per_elem": 0 | |
| 301 | +}, | |
| 302 | +{ | |
| 303 | +"step": 1500, | |
| 304 | +"layer": "b3.proj", | |
| 305 | +"transform": "signs_only", | |
| 306 | +"fmt": "nv", | |
| 307 | +"dw_rel_err": 0.15996570885181427, | |
| 308 | +"x_rel_err": 0.09748835861682892, | |
| 309 | +"dy_rel_err": 0.13541394472122192, | |
| 310 | +"cost_mac_per_elem": 0 | |
| 311 | +}, | |
| 312 | +{ | |
| 313 | +"step": 1500, | |
| 314 | +"layer": "b3.proj", | |
| 315 | +"transform": "signs_only", | |
| 316 | +"fmt": "mx", | |
| 317 | +"dw_rel_err": 0.1956533044576645, | |
| 318 | +"x_rel_err": 0.11460953205823898, | |
| 319 | +"dy_rel_err": 0.17352093756198883, | |
| 320 | +"cost_mac_per_elem": 0 | |
| 321 | +}, | |
| 322 | +{ | |
| 323 | +"step": 1500, | |
| 324 | +"layer": "b3.proj", | |
| 325 | +"transform": "h16_fixed", | |
| 326 | +"fmt": "nv", | |
| 327 | +"dw_rel_err": 0.15706957876682281, | |
| 328 | +"x_rel_err": 0.09083899110555649, | |
| 329 | +"dy_rel_err": 0.13874024152755737, | |
| 330 | +"cost_mac_per_elem": 16 | |
| 331 | +}, | |
| 332 | +{ | |
| 333 | +"step": 1500, | |
| 334 | +"layer": "b3.proj", | |
| 335 | +"transform": "h16_fixed", | |
| 336 | +"fmt": "mx", | |
| 337 | +"dw_rel_err": 0.20045365393161774, | |
| 338 | +"x_rel_err": 0.14124275743961334, | |
| 339 | +"dy_rel_err": 0.15827669203281403, | |
| 340 | +"cost_mac_per_elem": 16 | |
| 341 | +}, | |
| 342 | +{ | |
| 343 | +"step": 1500, | |
| 344 | +"layer": "b3.proj", | |
| 345 | +"transform": "rht16", | |
| 346 | +"fmt": "nv", | |
| 347 | +"dw_rel_err": 0.16126468777656555, | |
| 348 | +"x_rel_err": 0.09408827126026154, | |
| 349 | +"dy_rel_err": 0.13861913979053497, | |
| 350 | +"cost_mac_per_elem": 16 | |
| 351 | +}, | |
| 352 | +{ | |
| 353 | +"step": 1500, | |
| 354 | +"layer": "b3.proj", | |
| 355 | +"transform": "rht16", | |
| 356 | +"fmt": "mx", | |
| 357 | +"dw_rel_err": 0.18950386345386505, | |
| 358 | +"x_rel_err": 0.11767502874135971, | |
| 359 | +"dy_rel_err": 0.15847671031951904, | |
| 360 | +"cost_mac_per_elem": 16 | |
| 361 | +}, | |
| 362 | +{ | |
| 363 | +"step": 1500, | |
| 364 | +"layer": "b3.proj", | |
| 365 | +"transform": "rht128", | |
| 366 | +"fmt": "nv", | |
| 367 | +"dw_rel_err": 0.16444149613380432, | |
| 368 | +"x_rel_err": 0.09518874436616898, | |
| 369 | +"dy_rel_err": 0.1377900391817093, | |
| 370 | +"cost_mac_per_elem": 128 | |
| 371 | +}, | |
| 372 | +{ | |
| 373 | +"step": 1500, | |
| 374 | +"layer": "b3.proj", | |
| 375 | +"transform": "rht128", | |
| 376 | +"fmt": "mx", | |
| 377 | +"dw_rel_err": 0.19051039218902588, | |
| 378 | +"x_rel_err": 0.11525551229715347, | |
| 379 | +"dy_rel_err": 0.15718473494052887, | |
| 380 | +"cost_mac_per_elem": 128 | |
| 381 | +}, | |
| 382 | +{ | |
| 383 | +"step": 1500, | |
| 384 | +"layer": "b3.proj", | |
| 385 | +"transform": "diag_pow2", | |
| 386 | +"fmt": "nv", | |
| 387 | +"dw_rel_err": 0.1525551676750183, | |
| 388 | +"x_rel_err": 0.09617443382740021, | |
| 389 | +"dy_rel_err": 0.13541774451732635, | |
| 390 | +"cost_mac_per_elem": 1 | |
| 391 | +}, | |
| 392 | +{ | |
| 393 | +"step": 1500, | |
| 394 | +"layer": "b3.proj", | |
| 395 | +"transform": "diag_pow2", | |
| 396 | +"fmt": "mx", | |
| 397 | +"dw_rel_err": 0.186651811003685, | |
| 398 | +"x_rel_err": 0.11753605306148529, | |
| 399 | +"dy_rel_err": 0.16667301952838898, | |
| 400 | +"cost_mac_per_elem": 1 | |
| 401 | +}, | |
| 402 | +{ | |
| 403 | +"step": 1500, | |
| 404 | +"layer": "b3.proj", | |
| 405 | +"transform": "diag+rht16", | |
| 406 | +"fmt": "nv", | |
| 407 | +"dw_rel_err": 0.14680390059947968, | |
| 408 | +"x_rel_err": 0.09481853246688843, | |
| 409 | +"dy_rel_err": 0.13791599869728088, | |
| 410 | +"cost_mac_per_elem": 17 | |
| 411 | +}, | |
| 412 | +{ | |
| 413 | +"step": 1500, | |
| 414 | +"layer": "b3.proj", | |
| 415 | +"transform": "diag+rht16", | |
| 416 | +"fmt": "mx", | |
| 417 | +"dw_rel_err": 0.1732863336801529, | |
| 418 | +"x_rel_err": 0.11728118360042572, | |
| 419 | +"dy_rel_err": 0.15804515779018402, | |
| 420 | +"cost_mac_per_elem": 17 | |
| 421 | +}, | |
| 422 | +{ | |
| 423 | +"step": 1500, | |
| 424 | +"layer": "b4.fc2", | |
| 425 | +"transform": "none", | |
| 426 | +"fmt": "nv", | |
| 427 | +"dw_rel_err": 0.16246654093265533, | |
| 428 | +"x_rel_err": 0.0905601754784584, | |
| 429 | +"dy_rel_err": 0.13517087697982788, | |
| 430 | +"cost_mac_per_elem": 0 | |
| 431 | +}, | |
| 432 | +{ | |
| 433 | +"step": 1500, | |
| 434 | +"layer": "b4.fc2", | |
| 435 | +"transform": "none", | |
| 436 | +"fmt": "mx", | |
| 437 | +"dw_rel_err": 0.2231450080871582, | |
| 438 | +"x_rel_err": 0.14892826974391937, | |
| 439 | +"dy_rel_err": 0.1716099977493286, | |
| 440 | +"cost_mac_per_elem": 0 | |
| 441 | +}, | |
| 442 | +{ | |
| 443 | +"step": 1500, | |
| 444 | +"layer": "b4.fc2", | |
| 445 | +"transform": "signs_only", | |
| 446 | +"fmt": "nv", | |
| 447 | +"dw_rel_err": 0.16233909130096436, | |
| 448 | +"x_rel_err": 0.0905601754784584, | |
| 449 | +"dy_rel_err": 0.13500705361366272, | |
| 450 | +"cost_mac_per_elem": 0 | |
| 451 | +}, | |
| 452 | +{ | |
| 453 | +"step": 1500, | |
| 454 | +"layer": "b4.fc2", | |
| 455 | +"transform": "signs_only", | |
| 456 | +"fmt": "mx", | |
| 457 | +"dw_rel_err": 0.2235053926706314, | |
| 458 | +"x_rel_err": 0.14892826974391937, | |
| 459 | +"dy_rel_err": 0.1716914176940918, | |
| 460 | +"cost_mac_per_elem": 0 | |
| 461 | +}, | |
| 462 | +{ | |
| 463 | +"step": 1500, | |
| 464 | +"layer": "b4.fc2", | |
| 465 | +"transform": "h16_fixed", | |
| 466 | +"fmt": "nv", | |
| 467 | +"dw_rel_err": 0.18699923157691956, | |
| 468 | +"x_rel_err": 0.10009808838367462, | |
| 469 | +"dy_rel_err": 0.13854767382144928, | |
| 470 | +"cost_mac_per_elem": 16 | |
| 471 | +}, | |
| 472 | +{ | |
| 473 | +"step": 1500, | |
| 474 | +"layer": "b4.fc2", | |
| 475 | +"transform": "h16_fixed", | |
| 476 | +"fmt": "mx", | |
| 477 | +"dw_rel_err": 0.2117498517036438, | |
| 478 | +"x_rel_err": 0.11857739835977554, | |
| 479 | +"dy_rel_err": 0.15813226997852325, | |
| 480 | +"cost_mac_per_elem": 16 | |
| 481 | +}, | |
| 482 | +{ | |
| 483 | +"step": 1500, | |
| 484 | +"layer": "b4.fc2", | |
| 485 | +"transform": "rht16", | |
| 486 | +"fmt": "nv", | |
| 487 | +"dw_rel_err": 0.18624548614025116, | |
| 488 | +"x_rel_err": 0.10086595267057419, | |
| 489 | +"dy_rel_err": 0.13882258534431458, | |
| 490 | +"cost_mac_per_elem": 16 | |
| 491 | +}, | |
| 492 | +{ | |
| 493 | +"step": 1500, | |
| 494 | +"layer": "b4.fc2", | |
| 495 | +"transform": "rht16", | |
| 496 | +"fmt": "mx", | |
| 497 | +"dw_rel_err": 0.21008826792240143, | |
| 498 | +"x_rel_err": 0.1160547286272049, | |
| 499 | +"dy_rel_err": 0.15799324214458466, | |
| 500 | +"cost_mac_per_elem": 16 | |
| 501 | +}, | |
| 502 | +{ | |
| 503 | +"step": 1500, | |
| 504 | +"layer": "b4.fc2", | |
| 505 | +"transform": "rht128", | |
| 506 | +"fmt": "nv", | |
| 507 | +"dw_rel_err": 0.18753057718276978, | |
| 508 | +"x_rel_err": 0.09653546661138535, | |
| 509 | +"dy_rel_err": 0.1375332772731781, | |
| 510 | +"cost_mac_per_elem": 128 | |
| 511 | +}, | |
| 512 | +{ | |
| 513 | +"step": 1500, | |
| 514 | +"layer": "b4.fc2", | |
| 515 | +"transform": "rht128", | |
| 516 | +"fmt": "mx", | |
| 517 | +"dw_rel_err": 0.2144932597875595, | |
| 518 | +"x_rel_err": 0.11386667191982269, | |
| 519 | +"dy_rel_err": 0.15705062448978424, | |
| 520 | +"cost_mac_per_elem": 128 | |
| 521 | +}, | |
| 522 | +{ | |
| 523 | +"step": 1500, | |
| 524 | +"layer": "b4.fc2", | |
| 525 | +"transform": "diag_pow2", | |
| 526 | +"fmt": "nv", | |
| 527 | +"dw_rel_err": 0.147396981716156, | |
| 528 | +"x_rel_err": 0.08907005935907364, | |
| 529 | +"dy_rel_err": 0.1355750411748886, | |
| 530 | +"cost_mac_per_elem": 1 | |
| 531 | +}, | |
| 532 | +{ | |
| 533 | +"step": 1500, | |
| 534 | +"layer": "b4.fc2", | |
| 535 | +"transform": "diag_pow2", | |
| 536 | +"fmt": "mx", | |
| 537 | +"dw_rel_err": 0.2048598974943161, | |
| 538 | +"x_rel_err": 0.1495252251625061, | |
| 539 | +"dy_rel_err": 0.1665458381175995, | |
| 540 | +"cost_mac_per_elem": 1 | |
| 541 | +}, | |
| 542 | +{ | |
| 543 | +"step": 1500, | |
| 544 | +"layer": "b4.fc2", | |
| 545 | +"transform": "diag+rht16", | |
| 546 | +"fmt": "nv", | |
| 547 | +"dw_rel_err": 0.15049289166927338, | |
| 548 | +"x_rel_err": 0.10176373273134232, | |
| 549 | +"dy_rel_err": 0.13791349530220032, | |
| 550 | +"cost_mac_per_elem": 17 | |
| 551 | +}, | |
| 552 | +{ | |
| 553 | +"step": 1500, | |
| 554 | +"layer": "b4.fc2", | |
| 555 | +"transform": "diag+rht16", | |
| 556 | +"fmt": "mx", | |
| 557 | +"dw_rel_err": 0.1730242520570755, | |
| 558 | +"x_rel_err": 0.11565279960632324, | |
| 559 | +"dy_rel_err": 0.1583985984325409, | |
| 560 | +"cost_mac_per_elem": 17 | |
| 561 | +}, | |
| 562 | +{ | |
| 563 | +"step": 200, | |
| 564 | +"layer": "b0.fc1", | |
| 565 | +"transform": "none", | |
| 566 | +"fmt": "nv", | |
| 567 | +"dw_rel_err": 0.12460912019014359, | |
| 568 | +"x_rel_err": 0.09718909859657288, | |
| 569 | +"dy_rel_err": 0.13469929993152618, | |
| 570 | +"cost_mac_per_elem": 0 | |
| 571 | +}, | |
| 572 | +{ | |
| 573 | +"step": 200, | |
| 574 | +"layer": "b0.fc1", | |
| 575 | +"transform": "none", | |
| 576 | +"fmt": "mx", | |
| 577 | +"dw_rel_err": 0.159711092710495, | |
| 578 | +"x_rel_err": 0.11320085823535919, | |
| 579 | +"dy_rel_err": 0.1792091280221939, | |
| 580 | +"cost_mac_per_elem": 0 | |
| 581 | +}, | |
| 582 | +{ | |
| 583 | +"step": 200, | |
| 584 | +"layer": "b0.fc1", | |
| 585 | +"transform": "signs_only", | |
| 586 | +"fmt": "nv", | |
| 587 | +"dw_rel_err": 0.12440433353185654, | |
| 588 | +"x_rel_err": 0.09718909859657288, | |
| 589 | +"dy_rel_err": 0.1345803290605545, | |
| 590 | +"cost_mac_per_elem": 0 | |
| 591 | +}, | |
| 592 | +{ | |
| 593 | +"step": 200, | |
| 594 | +"layer": "b0.fc1", | |
| 595 | +"transform": "signs_only", | |
| 596 | +"fmt": "mx", | |
| 597 | +"dw_rel_err": 0.16130197048187256, | |
| 598 | +"x_rel_err": 0.11320085823535919, | |
| 599 | +"dy_rel_err": 0.17930825054645538, | |
| 600 | +"cost_mac_per_elem": 0 | |
| 601 | +}, | |
| 602 | +{ | |
| 603 | +"step": 200, | |
| 604 | +"layer": "b0.fc1", | |
| 605 | +"transform": "h16_fixed", | |
| 606 | +"fmt": "nv", | |
| 607 | +"dw_rel_err": 0.12294633686542511, | |
| 608 | +"x_rel_err": 0.09076660871505737, | |
| 609 | +"dy_rel_err": 0.1397658884525299, | |
| 610 | +"cost_mac_per_elem": 16 | |
| 611 | +}, | |
| 612 | +{ | |
| 613 | +"step": 200, | |
| 614 | +"layer": "b0.fc1", | |
| 615 | +"transform": "h16_fixed", | |
| 616 | +"fmt": "mx", | |
| 617 | +"dw_rel_err": 0.1489855796098709, | |
| 618 | +"x_rel_err": 0.1289166659116745, | |
| 619 | +"dy_rel_err": 0.1577959507703781, | |
| 620 | +"cost_mac_per_elem": 16 | |
| 621 | +}, | |
| 622 | +{ | |
| 623 | +"step": 200, | |
| 624 | +"layer": "b0.fc1", | |
| 625 | +"transform": "rht16", | |
| 626 | +"fmt": "nv", | |
| 627 | +"dw_rel_err": 0.1254642903804779, | |
| 628 | +"x_rel_err": 0.09444750100374222, | |
| 629 | +"dy_rel_err": 0.13987156748771667, | |
| 630 | +"cost_mac_per_elem": 16 | |
| 631 | +}, | |
| 632 | +{ | |
| 633 | +"step": 200, | |
| 634 | +"layer": "b0.fc1", | |
| 635 | +"transform": "rht16", | |
| 636 | +"fmt": "mx", | |
| 637 | +"dw_rel_err": 0.14654450118541718, | |
| 638 | +"x_rel_err": 0.11645917594432831, | |
| 639 | +"dy_rel_err": 0.15774095058441162, | |
| 640 | +"cost_mac_per_elem": 16 | |
| 641 | +}, | |
| 642 | +{ | |
| 643 | +"step": 200, | |
| 644 | +"layer": "b0.fc1", | |
| 645 | +"transform": "rht128", | |
| 646 | +"fmt": "nv", | |
| 647 | +"dw_rel_err": 0.1252671331167221, | |
| 648 | +"x_rel_err": 0.09528088569641113, | |
| 649 | +"dy_rel_err": 0.13773873448371887, | |
| 650 | +"cost_mac_per_elem": 128 | |
| 651 | +}, | |
| 652 | +{ | |
| 653 | +"step": 200, | |
| 654 | +"layer": "b0.fc1", | |
| 655 | +"transform": "rht128", | |
| 656 | +"fmt": "mx", | |
| 657 | +"dw_rel_err": 0.1469806432723999, | |
| 658 | +"x_rel_err": 0.1153496578335762, | |
| 659 | +"dy_rel_err": 0.15738674998283386, | |
| 660 | +"cost_mac_per_elem": 128 | |
| 661 | +}, | |
| 662 | +{ | |
| 663 | +"step": 200, | |
| 664 | +"layer": "b0.fc1", | |
| 665 | +"transform": "diag_pow2", | |
| 666 | +"fmt": "nv", | |
| 667 | +"dw_rel_err": 0.12105969339609146, | |
| 668 | +"x_rel_err": 0.0941254049539566, | |
| 669 | +"dy_rel_err": 0.1353643536567688, | |
| 670 | +"cost_mac_per_elem": 1 | |
| 671 | +}, | |
| 672 | +{ | |
| 673 | +"step": 200, | |
| 674 | +"layer": "b0.fc1", | |
| 675 | +"transform": "diag_pow2", | |
| 676 | +"fmt": "mx", | |
| 677 | +"dw_rel_err": 0.1565157026052475, | |
| 678 | +"x_rel_err": 0.11850841343402863, | |
| 679 | +"dy_rel_err": 0.17350372672080994, | |
| 680 | +"cost_mac_per_elem": 1 | |
| 681 | +}, | |
| 682 | +{ | |
| 683 | +"step": 200, | |
| 684 | +"layer": "b0.fc1", | |
| 685 | +"transform": "diag+rht16", | |
| 686 | +"fmt": "nv", | |
| 687 | +"dw_rel_err": 0.12030434608459473, | |
| 688 | +"x_rel_err": 0.09493489563465118, | |
| 689 | +"dy_rel_err": 0.13893480598926544, | |
| 690 | +"cost_mac_per_elem": 17 | |
| 691 | +}, | |
| 692 | +{ | |
| 693 | +"step": 200, | |
| 694 | +"layer": "b0.fc1", | |
| 695 | +"transform": "diag+rht16", | |
| 696 | +"fmt": "mx", | |
| 697 | +"dw_rel_err": 0.14173699915409088, | |
| 698 | +"x_rel_err": 0.11626441776752472, | |
| 699 | +"dy_rel_err": 0.15786783397197723, | |
| 700 | +"cost_mac_per_elem": 17 | |
| 701 | +}, | |
| 702 | +{ | |
| 703 | +"step": 200, | |
| 704 | +"layer": "b2.qkv", | |
| 705 | +"transform": "none", | |
| 706 | +"fmt": "nv", | |
| 707 | +"dw_rel_err": 0.05890129506587982, | |
| 708 | +"x_rel_err": 0.09743941575288773, | |
| 709 | +"dy_rel_err": 0.13275982439517975, | |
| 710 | +"cost_mac_per_elem": 0 | |
| 711 | +}, | |
| 712 | +{ | |
| 713 | +"step": 200, | |
| 714 | +"layer": "b2.qkv", | |
| 715 | +"transform": "none", | |
| 716 | +"fmt": "mx", | |
| 717 | +"dw_rel_err": 0.08931710571050644, | |
| 718 | +"x_rel_err": 0.11291815340518951, | |
| 719 | +"dy_rel_err": 0.20099179446697235, | |
| 720 | +"cost_mac_per_elem": 0 | |
| 721 | +}, | |
| 722 | +{ | |
| 723 | +"step": 200, | |
| 724 | +"layer": "b2.qkv", | |
| 725 | +"transform": "signs_only", | |
| 726 | +"fmt": "nv", | |
| 727 | +"dw_rel_err": 0.05931221321225166, | |
| 728 | +"x_rel_err": 0.09743941575288773, | |
| 729 | +"dy_rel_err": 0.1321798861026764, | |
| 730 | +"cost_mac_per_elem": 0 | |
| 731 | +}, | |
| 732 | +{ | |
| 733 | +"step": 200, | |
| 734 | +"layer": "b2.qkv", | |
| 735 | +"transform": "signs_only", | |
| 736 | +"fmt": "mx", | |
| 737 | +"dw_rel_err": 0.08918926864862442, | |
| 738 | +"x_rel_err": 0.11291815340518951, | |
| 739 | +"dy_rel_err": 0.20097099244594574, | |
| 740 | +"cost_mac_per_elem": 0 | |
| 741 | +}, | |
| 742 | +{ | |
| 743 | +"step": 200, | |
| 744 | +"layer": "b2.qkv", | |
| 745 | +"transform": "h16_fixed", | |
| 746 | +"fmt": "nv", | |
| 747 | +"dw_rel_err": 0.06212620064616203, | |
| 748 | +"x_rel_err": 0.09146109968423843, | |
| 749 | +"dy_rel_err": 0.14012514054775238, | |
| 750 | +"cost_mac_per_elem": 16 | |
| 751 | +}, | |
| 752 | +{ | |
| 753 | +"step": 200, | |
| 754 | +"layer": "b2.qkv", | |
| 755 | +"transform": "h16_fixed", | |
| 756 | +"fmt": "mx", | |
| 757 | +"dw_rel_err": 0.10622064769268036, | |
| 758 | +"x_rel_err": 0.12636227905750275, | |
| 759 | +"dy_rel_err": 0.16085787117481232, | |
| 760 | +"cost_mac_per_elem": 16 | |
| 761 | +}, | |
| 762 | +{ | |
| 763 | +"step": 200, | |
| 764 | +"layer": "b2.qkv", | |
| 765 | +"transform": "rht16", | |
| 766 | +"fmt": "nv", | |
| 767 | +"dw_rel_err": 0.0624663420021534, | |
| 768 | +"x_rel_err": 0.09473592787981033, | |
| 769 | +"dy_rel_err": 0.14210864901542664, | |
| 770 | +"cost_mac_per_elem": 16 | |
| 771 | +}, | |
| 772 | +{ | |
| 773 | +"step": 200, | |
| 774 | +"layer": "b2.qkv", | |
| 775 | +"transform": "rht16", | |
| 776 | +"fmt": "mx", | |
| 777 | +"dw_rel_err": 0.08078739047050476, | |
| 778 | +"x_rel_err": 0.11616943031549454, | |
| 779 | +"dy_rel_err": 0.15717783570289612, | |
| 780 | +"cost_mac_per_elem": 16 | |
| 781 | +}, | |
| 782 | +{ | |
| 783 | +"step": 200, | |
| 784 | +"layer": "b2.qkv", | |
| 785 | +"transform": "rht128", | |
| 786 | +"fmt": "nv", | |
| 787 | +"dw_rel_err": 0.06138351559638977, | |
| 788 | +"x_rel_err": 0.09519487619400024, | |
| 789 | +"dy_rel_err": 0.13965937495231628, | |
| 790 | +"cost_mac_per_elem": 128 | |
| 791 | +}, | |
| 792 | +{ | |
| 793 | +"step": 200, | |
| 794 | +"layer": "b2.qkv", | |
| 795 | +"transform": "rht128", | |
| 796 | +"fmt": "mx", | |
| 797 | +"dw_rel_err": 0.07715924829244614, | |
| 798 | +"x_rel_err": 0.1153484508395195, | |
| 799 | +"dy_rel_err": 0.1550544798374176, | |
| 800 | +"cost_mac_per_elem": 128 | |
| 801 | +}, | |
| 802 | +{ | |
| 803 | +"step": 200, | |
| 804 | +"layer": "b2.qkv", | |
| 805 | +"transform": "diag_pow2", | |
| 806 | +"fmt": "nv", | |
| 807 | +"dw_rel_err": 0.054952215403318405, | |
| 808 | +"x_rel_err": 0.09359884262084961, | |
| 809 | +"dy_rel_err": 0.13514001667499542, | |
| 810 | +"cost_mac_per_elem": 1 | |
| 811 | +}, | |
| 812 | +{ | |
| 813 | +"step": 200, | |
| 814 | +"layer": "b2.qkv", | |
| 815 | +"transform": "diag_pow2", | |
| 816 | +"fmt": "mx", | |
| 817 | +"dw_rel_err": 0.08453577756881714, | |
| 818 | +"x_rel_err": 0.12136457860469818, | |
| 819 | +"dy_rel_err": 0.1861884891986847, | |
| 820 | +"cost_mac_per_elem": 1 | |
| 821 | +}, | |
| 822 | +{ | |
| 823 | +"step": 200, | |
| 824 | +"layer": "b2.qkv", | |
| 825 | +"transform": "diag+rht16", | |
| 826 | +"fmt": "nv", | |
| 827 | +"dw_rel_err": 0.0549350380897522, | |
| 828 | +"x_rel_err": 0.09525051712989807, | |
| 829 | +"dy_rel_err": 0.14042341709136963, | |
| 830 | +"cost_mac_per_elem": 17 | |
| 831 | +}, | |
| 832 | +{ | |
| 833 | +"step": 200, | |
| 834 | +"layer": "b2.qkv", | |
| 835 | +"transform": "diag+rht16", | |
| 836 | +"fmt": "mx", | |
| 837 | +"dw_rel_err": 0.07478693872690201, | |
| 838 | +"x_rel_err": 0.11609324812889099, | |
| 839 | +"dy_rel_err": 0.1578061878681183, | |
| 840 | +"cost_mac_per_elem": 17 | |
| 841 | +}, | |
| 842 | +{ | |
| 843 | +"step": 200, | |
| 844 | +"layer": "b3.proj", | |
| 845 | +"transform": "none", | |
| 846 | +"fmt": "nv", | |
| 847 | +"dw_rel_err": 0.11245045810937881, | |
| 848 | +"x_rel_err": 0.0995931550860405, | |
| 849 | +"dy_rel_err": 0.1362559050321579, | |
| 850 | +"cost_mac_per_elem": 0 | |
| 851 | +}, | |
| 852 | +{ | |
| 853 | +"step": 200, | |
| 854 | +"layer": "b3.proj", | |
| 855 | +"transform": "none", | |
| 856 | +"fmt": "mx", | |
| 857 | +"dw_rel_err": 0.13642267882823944, | |
| 858 | +"x_rel_err": 0.11298026144504547, | |
| 859 | +"dy_rel_err": 0.16361846029758453, | |
| 860 | +"cost_mac_per_elem": 0 | |
| 861 | +}, | |
| 862 | +{ | |
| 863 | +"step": 200, | |
| 864 | +"layer": "b3.proj", | |
| 865 | +"transform": "signs_only", | |
| 866 | +"fmt": "nv", | |
| 867 | +"dw_rel_err": 0.11269117891788483, | |
| 868 | +"x_rel_err": 0.0995931550860405, | |
| 869 | +"dy_rel_err": 0.13654197752475739, | |
| 870 | +"cost_mac_per_elem": 0 | |
| 871 | +}, | |
| 872 | +{ | |
| 873 | +"step": 200, | |
| 874 | +"layer": "b3.proj", | |
| 875 | +"transform": "signs_only", | |
| 876 | +"fmt": "mx", | |
| 877 | +"dw_rel_err": 0.13625846803188324, | |
| 878 | +"x_rel_err": 0.11298026144504547, | |
| 879 | +"dy_rel_err": 0.16368426382541656, | |
| 880 | +"cost_mac_per_elem": 0 | |
| 881 | +}, | |
| 882 | +{ | |
| 883 | +"step": 200, | |
| 884 | +"layer": "b3.proj", | |
| 885 | +"transform": "h16_fixed", | |
| 886 | +"fmt": "nv", | |
| 887 | +"dw_rel_err": 0.10607868432998657, | |
| 888 | +"x_rel_err": 0.09064269065856934, | |
| 889 | +"dy_rel_err": 0.1377907395362854, | |
| 890 | +"cost_mac_per_elem": 16 | |
| 891 | +}, | |
| 892 | +{ | |
| 893 | +"step": 200, | |
| 894 | +"layer": "b3.proj", | |
| 895 | +"transform": "h16_fixed", | |
| 896 | +"fmt": "mx", | |
| 897 | +"dw_rel_err": 0.14498312771320343, | |
| 898 | +"x_rel_err": 0.1461881697177887, | |
| 899 | +"dy_rel_err": 0.15798401832580566, | |
| 900 | +"cost_mac_per_elem": 16 | |
| 901 | +}, | |
| 902 | +{ | |
| 903 | +"step": 200, | |
| 904 | +"layer": "b3.proj", | |
| 905 | +"transform": "rht16", | |
| 906 | +"fmt": "nv", | |
| 907 | +"dw_rel_err": 0.10633912682533264, | |
| 908 | +"x_rel_err": 0.09185279160737991, | |
| 909 | +"dy_rel_err": 0.1381661295890808, | |
| 910 | +"cost_mac_per_elem": 16 | |
| 911 | +}, | |
| 912 | +{ | |
| 913 | +"step": 200, | |
| 914 | +"layer": "b3.proj", | |
| 915 | +"transform": "rht16", | |
| 916 | +"fmt": "mx", | |
| 917 | +"dw_rel_err": 0.13222815096378326, | |
| 918 | +"x_rel_err": 0.11829609423875809, | |
| 919 | +"dy_rel_err": 0.15751193463802338, | |
| 920 | +"cost_mac_per_elem": 16 | |
| 921 | +}, | |
| 922 | +{ | |
| 923 | +"step": 200, | |
| 924 | +"layer": "b3.proj", | |
| 925 | +"transform": "rht128", | |
| 926 | +"fmt": "nv", | |
| 927 | +"dw_rel_err": 0.10935422033071518, | |
| 928 | +"x_rel_err": 0.09520794451236725, | |
| 929 | +"dy_rel_err": 0.13740603625774384, | |
| 930 | +"cost_mac_per_elem": 128 | |
| 931 | +}, | |
| 932 | +{ | |
| 933 | +"step": 200, | |
| 934 | +"layer": "b3.proj", | |
| 935 | +"transform": "rht128", | |
| 936 | +"fmt": "mx", | |
| 937 | +"dw_rel_err": 0.12804754078388214, | |
| 938 | +"x_rel_err": 0.11508438736200333, | |
| 939 | +"dy_rel_err": 0.15711916983127594, | |
| 940 | +"cost_mac_per_elem": 128 | |
| 941 | +}, | |
| 942 | +{ | |
| 943 | +"step": 200, | |
| 944 | +"layer": "b3.proj", | |
| 945 | +"transform": "diag_pow2", | |
| 946 | +"fmt": "nv", | |
| 947 | +"dw_rel_err": 0.10792534798383713, | |
| 948 | +"x_rel_err": 0.09937916696071625, | |
| 949 | +"dy_rel_err": 0.13630427420139313, | |
| 950 | +"cost_mac_per_elem": 1 | |
| 951 | +}, | |
| 952 | +{ | |
| 953 | +"step": 200, | |
| 954 | +"layer": "b3.proj", | |
| 955 | +"transform": "diag_pow2", | |
| 956 | +"fmt": "mx", | |
| 957 | +"dw_rel_err": 0.13473044335842133, | |
| 958 | +"x_rel_err": 0.11435382813215256, | |
| 959 | +"dy_rel_err": 0.16384735703468323, | |
| 960 | +"cost_mac_per_elem": 1 | |
| 961 | +}, | |
| 962 | +{ | |
| 963 | +"step": 200, | |
| 964 | +"layer": "b3.proj", | |
| 965 | +"transform": "diag+rht16", | |
| 966 | +"fmt": "nv", | |
| 967 | +"dw_rel_err": 0.10412176698446274, | |
| 968 | +"x_rel_err": 0.09294964373111725, | |
| 969 | +"dy_rel_err": 0.1379515677690506, | |
| 970 | +"cost_mac_per_elem": 17 | |
| 971 | +}, | |
| 972 | +{ | |
| 973 | +"step": 200, | |
| 974 | +"layer": "b3.proj", | |
| 975 | +"transform": "diag+rht16", | |
| 976 | +"fmt": "mx", | |
| 977 | +"dw_rel_err": 0.12803608179092407, | |
| 978 | +"x_rel_err": 0.11804461479187012, | |
| 979 | +"dy_rel_err": 0.15782277286052704, | |
| 980 | +"cost_mac_per_elem": 17 | |
| 981 | +}, | |
| 982 | +{ | |
| 983 | +"step": 200, | |
| 984 | +"layer": "b4.fc2", | |
| 985 | +"transform": "none", | |
| 986 | +"fmt": "nv", | |
| 987 | +"dw_rel_err": 0.11008582264184952, | |
| 988 | +"x_rel_err": 0.09287641942501068, | |
| 989 | +"dy_rel_err": 0.13639795780181885, | |
| 990 | +"cost_mac_per_elem": 0 | |
| 991 | +}, | |
| 992 | +{ | |
| 993 | +"step": 200, | |
| 994 | +"layer": "b4.fc2", | |
| 995 | +"transform": "none", | |
| 996 | +"fmt": "mx", | |
| 997 | +"dw_rel_err": 0.14338995516300201, | |
| 998 | +"x_rel_err": 0.13665318489074707, | |
| 999 | +"dy_rel_err": 0.16124577820301056, | |
| 1000 | +"cost_mac_per_elem": 0 | |
| 1001 | +}, | |
| 1002 | +{ | |
| 1003 | +"step": 200, | |
| 1004 | +"layer": "b4.fc2", | |
| 1005 | +"transform": "signs_only", | |
| 1006 | +"fmt": "nv", | |
| 1007 | +"dw_rel_err": 0.10890021175146103, | |
| 1008 | +"x_rel_err": 0.09287641942501068, | |
| 1009 | +"dy_rel_err": 0.13619135320186615, | |
| 1010 | +"cost_mac_per_elem": 0 | |
| 1011 | +}, | |
| 1012 | +{ | |
| 1013 | +"step": 200, | |
| 1014 | +"layer": "b4.fc2", | |
| 1015 | +"transform": "signs_only", | |
| 1016 | +"fmt": "mx", | |
| 1017 | +"dw_rel_err": 0.14413127303123474, | |
| 1018 | +"x_rel_err": 0.13665318489074707, | |
| 1019 | +"dy_rel_err": 0.16125915944576263, | |
| 1020 | +"cost_mac_per_elem": 0 | |
| 1021 | +}, | |
| 1022 | +{ | |
| 1023 | +"step": 200, | |
| 1024 | +"layer": "b4.fc2", | |
| 1025 | +"transform": "h16_fixed", | |
| 1026 | +"fmt": "nv", | |
| 1027 | +"dw_rel_err": 0.11371147632598877, | |
| 1028 | +"x_rel_err": 0.0962495431303978, | |
| 1029 | +"dy_rel_err": 0.13771314918994904, | |
| 1030 | +"cost_mac_per_elem": 16 | |
| 1031 | +}, | |
| 1032 | +{ | |
| 1033 | +"step": 200, | |
| 1034 | +"layer": "b4.fc2", | |
| 1035 | +"transform": "h16_fixed", | |
| 1036 | +"fmt": "mx", | |
| 1037 | +"dw_rel_err": 0.1390572041273117, | |
| 1038 | +"x_rel_err": 0.12025625258684158, | |
| 1039 | +"dy_rel_err": 0.15713275969028473, | |
| 1040 | +"cost_mac_per_elem": 16 | |
| 1041 | +}, | |
| 1042 | +{ | |
| 1043 | +"step": 200, | |
| 1044 | +"layer": "b4.fc2", | |
| 1045 | +"transform": "rht16", | |
| 1046 | +"fmt": "nv", | |
| 1047 | +"dw_rel_err": 0.11347761750221252, | |
| 1048 | +"x_rel_err": 0.09726565331220627, | |
| 1049 | +"dy_rel_err": 0.13785889744758606, | |
| 1050 | +"cost_mac_per_elem": 16 | |
| 1051 | +}, | |
| 1052 | +{ | |
| 1053 | +"step": 200, | |
| 1054 | +"layer": "b4.fc2", | |
| 1055 | +"transform": "rht16", | |
| 1056 | +"fmt": "mx", | |
| 1057 | +"dw_rel_err": 0.1344061642885208, | |
| 1058 | +"x_rel_err": 0.11542923003435135, | |
| 1059 | +"dy_rel_err": 0.15706531703472137, | |
| 1060 | +"cost_mac_per_elem": 16 | |
| 1061 | +}, | |
| 1062 | +{ | |
| 1063 | +"step": 200, | |
| 1064 | +"layer": "b4.fc2", | |
| 1065 | +"transform": "rht128", | |
| 1066 | +"fmt": "nv", | |
| 1067 | +"dw_rel_err": 0.11481785029172897, | |
| 1068 | +"x_rel_err": 0.09542253613471985, | |
| 1069 | +"dy_rel_err": 0.13743004202842712, | |
| 1070 | +"cost_mac_per_elem": 128 | |
| 1071 | +}, | |
| 1072 | +{ | |
| 1073 | +"step": 200, | |
| 1074 | +"layer": "b4.fc2", | |
| 1075 | +"transform": "rht128", | |
| 1076 | +"fmt": "mx", | |
| 1077 | +"dw_rel_err": 0.1344721019268036, | |
| 1078 | +"x_rel_err": 0.11499619483947754, | |
| 1079 | +"dy_rel_err": 0.15696993470191956, | |
| 1080 | +"cost_mac_per_elem": 128 | |
| 1081 | +}, | |
| 1082 | +{ | |
| 1083 | +"step": 200, | |
| 1084 | +"layer": "b4.fc2", | |
| 1085 | +"transform": "diag_pow2", | |
| 1086 | +"fmt": "nv", | |
| 1087 | +"dw_rel_err": 0.10549797117710114, | |
| 1088 | +"x_rel_err": 0.09183882176876068, | |
| 1089 | +"dy_rel_err": 0.13693775236606598, | |
| 1090 | +"cost_mac_per_elem": 1 | |
| 1091 | +}, | |
| 1092 | +{ | |
| 1093 | +"step": 200, | |
| 1094 | +"layer": "b4.fc2", | |
| 1095 | +"transform": "diag_pow2", | |
| 1096 | +"fmt": "mx", | |
| 1097 | +"dw_rel_err": 0.14006568491458893, | |
| 1098 | +"x_rel_err": 0.13637493550777435, | |
| 1099 | +"dy_rel_err": 0.1609766185283661, | |
| 1100 | +"cost_mac_per_elem": 1 | |
| 1101 | +}, | |
| 1102 | +{ | |
| 1103 | +"step": 200, | |
| 1104 | +"layer": "b4.fc2", | |
| 1105 | +"transform": "diag+rht16", | |
| 1106 | +"fmt": "nv", | |
| 1107 | +"dw_rel_err": 0.10504070669412613, | |
| 1108 | +"x_rel_err": 0.09728661179542542, | |
| 1109 | +"dy_rel_err": 0.1375894695520401, | |
| 1110 | +"cost_mac_per_elem": 17 | |
| 1111 | +}, | |
| 1112 | +{ | |
| 1113 | +"step": 200, | |
| 1114 | +"layer": "b4.fc2", | |
| 1115 | +"transform": "diag+rht16", | |
| 1116 | +"fmt": "mx", | |
| 1117 | +"dw_rel_err": 0.12325773388147354, | |
| 1118 | +"x_rel_err": 0.1156148612499237, | |
| 1119 | +"dy_rel_err": 0.1572401523590088, | |
| 1120 | +"cost_mac_per_elem": 17 | |
| 1121 | +}, | |
| 1122 | +{ | |
| 1123 | +"step": 2999, | |
| 1124 | +"layer": "b0.fc1", | |
| 1125 | +"transform": "none", | |
| 1126 | +"fmt": "nv", | |
| 1127 | +"dw_rel_err": 0.17028701305389404, | |
| 1128 | +"x_rel_err": 0.1006157323718071, | |
| 1129 | +"dy_rel_err": 0.1338556557893753, | |
| 1130 | +"cost_mac_per_elem": 0 | |
| 1131 | +}, | |
| 1132 | +{ | |
| 1133 | +"step": 2999, | |
| 1134 | +"layer": "b0.fc1", | |
| 1135 | +"transform": "none", | |
| 1136 | +"fmt": "mx", | |
| 1137 | +"dw_rel_err": 0.22769612073898315, | |
| 1138 | +"x_rel_err": 0.11098220944404602, | |
| 1139 | +"dy_rel_err": 0.18900154531002045, | |
| 1140 | +"cost_mac_per_elem": 0 | |
| 1141 | +}, | |
| 1142 | +{ | |
| 1143 | +"step": 2999, | |
| 1144 | +"layer": "b0.fc1", | |
| 1145 | +"transform": "signs_only", | |
| 1146 | +"fmt": "nv", | |
| 1147 | +"dw_rel_err": 0.17408552765846252, | |
| 1148 | +"x_rel_err": 0.1006157323718071, | |
| 1149 | +"dy_rel_err": 0.13386450707912445, | |
| 1150 | +"cost_mac_per_elem": 0 | |
| 1151 | +}, | |
| 1152 | +{ | |
| 1153 | +"step": 2999, | |
| 1154 | +"layer": "b0.fc1", | |
| 1155 | +"transform": "signs_only", | |
| 1156 | +"fmt": "mx", | |
| 1157 | +"dw_rel_err": 0.22357356548309326, | |
| 1158 | +"x_rel_err": 0.11098220944404602, | |
| 1159 | +"dy_rel_err": 0.1891421377658844, | |
| 1160 | +"cost_mac_per_elem": 0 | |
| 1161 | +}, | |
| 1162 | +{ | |
| 1163 | +"step": 2999, | |
| 1164 | +"layer": "b0.fc1", | |
| 1165 | +"transform": "h16_fixed", | |
| 1166 | +"fmt": "nv", | |
| 1167 | +"dw_rel_err": 0.17002269625663757, | |
| 1168 | +"x_rel_err": 0.09158191084861755, | |
| 1169 | +"dy_rel_err": 0.14043864607810974, | |
| 1170 | +"cost_mac_per_elem": 16 | |
| 1171 | +}, | |
| 1172 | +{ | |
| 1173 | +"step": 2999, | |
| 1174 | +"layer": "b0.fc1", | |
| 1175 | +"transform": "h16_fixed", | |
| 1176 | +"fmt": "mx", | |
| 1177 | +"dw_rel_err": 0.22554810345172882, | |
| 1178 | +"x_rel_err": 0.13990670442581177, | |
| 1179 | +"dy_rel_err": 0.15837180614471436, | |
| 1180 | +"cost_mac_per_elem": 16 | |
| 1181 | +}, | |
| 1182 | +{ | |
| 1183 | +"step": 2999, | |
| 1184 | +"layer": "b0.fc1", | |
| 1185 | +"transform": "rht16", | |
| 1186 | +"fmt": "nv", | |
| 1187 | +"dw_rel_err": 0.17115624248981476, | |
| 1188 | +"x_rel_err": 0.09140235930681229, | |
| 1189 | +"dy_rel_err": 0.14106926321983337, | |
| 1190 | +"cost_mac_per_elem": 16 | |
| 1191 | +}, | |
| 1192 | +{ | |
| 1193 | +"step": 2999, | |
| 1194 | +"layer": "b0.fc1", | |
| 1195 | +"transform": "rht16", | |
| 1196 | +"fmt": "mx", | |
| 1197 | +"dw_rel_err": 0.20310187339782715, | |
| 1198 | +"x_rel_err": 0.11764136701822281, | |
| 1199 | +"dy_rel_err": 0.1578882336616516, | |
| 1200 | +"cost_mac_per_elem": 16 | |
| 1201 | +}, | |
| 1202 | +{ | |
| 1203 | +"step": 2999, | |
| 1204 | +"layer": "b0.fc1", | |
| 1205 | +"transform": "rht128", | |
| 1206 | +"fmt": "nv", | |
| 1207 | +"dw_rel_err": 0.1713009625673294, | |
| 1208 | +"x_rel_err": 0.0947982594370842, | |
| 1209 | +"dy_rel_err": 0.13793602585792542, | |
| 1210 | +"cost_mac_per_elem": 128 | |
| 1211 | +}, | |
| 1212 | +{ | |
| 1213 | +"step": 2999, | |
| 1214 | +"layer": "b0.fc1", | |
| 1215 | +"transform": "rht128", | |
| 1216 | +"fmt": "mx", | |
| 1217 | +"dw_rel_err": 0.19686484336853027, | |
| 1218 | +"x_rel_err": 0.11568468809127808, | |
| 1219 | +"dy_rel_err": 0.156669482588768, | |
| 1220 | +"cost_mac_per_elem": 128 | |
| 1221 | +}, | |
| 1222 | +{ | |
| 1223 | +"step": 2999, | |
| 1224 | +"layer": "b0.fc1", | |
| 1225 | +"transform": "diag_pow2", | |
| 1226 | +"fmt": "nv", | |
| 1227 | +"dw_rel_err": 0.16369681060314178, | |
| 1228 | +"x_rel_err": 0.09626504778862, | |
| 1229 | +"dy_rel_err": 0.1348131150007248, | |
| 1230 | +"cost_mac_per_elem": 1 | |
| 1231 | +}, | |
| 1232 | +{ | |
| 1233 | +"step": 2999, | |
| 1234 | +"layer": "b0.fc1", | |
| 1235 | +"transform": "diag_pow2", | |
| 1236 | +"fmt": "mx", | |
| 1237 | +"dw_rel_err": 0.21800395846366882, | |
| 1238 | +"x_rel_err": 0.11526273190975189, | |
| 1239 | +"dy_rel_err": 0.18059726059436798, | |
| 1240 | +"cost_mac_per_elem": 1 | |
| 1241 | +}, | |
| 1242 | +{ | |
| 1243 | +"step": 2999, | |
| 1244 | +"layer": "b0.fc1", | |
| 1245 | +"transform": "diag+rht16", | |
| 1246 | +"fmt": "nv", | |
| 1247 | +"dw_rel_err": 0.1590888351202011, | |
| 1248 | +"x_rel_err": 0.09372636675834656, | |
| 1249 | +"dy_rel_err": 0.13985076546669006, | |
| 1250 | +"cost_mac_per_elem": 17 | |
| 1251 | +}, | |
| 1252 | +{ | |
| 1253 | +"step": 2999, | |
| 1254 | +"layer": "b0.fc1", | |
| 1255 | +"transform": "diag+rht16", | |
| 1256 | +"fmt": "mx", | |
| 1257 | +"dw_rel_err": 0.18775972723960876, | |
| 1258 | +"x_rel_err": 0.11732997000217438, | |
| 1259 | +"dy_rel_err": 0.15772399306297302, | |
| 1260 | +"cost_mac_per_elem": 17 | |
| 1261 | +}, | |
| 1262 | +{ | |
| 1263 | +"step": 2999, | |
| 1264 | +"layer": "b2.qkv", | |
| 1265 | +"transform": "none", | |
| 1266 | +"fmt": "nv", | |
| 1267 | +"dw_rel_err": 0.14490635693073273, | |
| 1268 | +"x_rel_err": 0.10806804150342941, | |
| 1269 | +"dy_rel_err": 0.13061080873012543, | |
| 1270 | +"cost_mac_per_elem": 0 | |
| 1271 | +}, | |
| 1272 | +{ | |
| 1273 | +"step": 2999, | |
| 1274 | +"layer": "b2.qkv", | |
| 1275 | +"transform": "none", | |
| 1276 | +"fmt": "mx", | |
| 1277 | +"dw_rel_err": 0.19840313494205475, | |
| 1278 | +"x_rel_err": 0.1154845803976059, | |
| 1279 | +"dy_rel_err": 0.19170038402080536, | |
| 1280 | +"cost_mac_per_elem": 0 | |
| 1281 | +}, | |
| 1282 | +{ | |
| 1283 | +"step": 2999, | |
| 1284 | +"layer": "b2.qkv", | |
| 1285 | +"transform": "signs_only", | |
| 1286 | +"fmt": "nv", | |
| 1287 | +"dw_rel_err": 0.14775128662586212, | |
| 1288 | +"x_rel_err": 0.10806804150342941, | |
| 1289 | +"dy_rel_err": 0.13035984337329865, | |
| 1290 | +"cost_mac_per_elem": 0 | |
| 1291 | +}, | |
| 1292 | +{ | |
| 1293 | +"step": 2999, | |
| 1294 | +"layer": "b2.qkv", | |
| 1295 | +"transform": "signs_only", | |
| 1296 | +"fmt": "mx", | |
| 1297 | +"dw_rel_err": 0.19714128971099854, | |
| 1298 | +"x_rel_err": 0.1154845803976059, | |
| 1299 | +"dy_rel_err": 0.19093826413154602, | |
| 1300 | +"cost_mac_per_elem": 0 | |
| 1301 | +}, | |
| 1302 | +{ | |
| 1303 | +"step": 2999, | |
| 1304 | +"layer": "b2.qkv", | |
| 1305 | +"transform": "h16_fixed", | |
| 1306 | +"fmt": "nv", | |
| 1307 | +"dw_rel_err": 0.14448288083076477, | |
| 1308 | +"x_rel_err": 0.09073541313409805, | |
| 1309 | +"dy_rel_err": 0.14002864062786102, | |
| 1310 | +"cost_mac_per_elem": 16 | |
| 1311 | +}, | |
| 1312 | +{ | |
| 1313 | +"step": 2999, | |
| 1314 | +"layer": "b2.qkv", | |
| 1315 | +"transform": "h16_fixed", | |
| 1316 | +"fmt": "mx", | |
| 1317 | +"dw_rel_err": 0.21740615367889404, | |
| 1318 | +"x_rel_err": 0.15060769021511078, | |
| 1319 | +"dy_rel_err": 0.1601986587047577, | |
| 1320 | +"cost_mac_per_elem": 16 | |
| 1321 | +}, | |
| 1322 | +{ | |
| 1323 | +"step": 2999, | |
| 1324 | +"layer": "b2.qkv", | |
| 1325 | +"transform": "rht16", | |
| 1326 | +"fmt": "nv", | |
| 1327 | +"dw_rel_err": 0.15528887510299683, | |
| 1328 | +"x_rel_err": 0.08685056120157242, | |
| 1329 | +"dy_rel_err": 0.14042019844055176, | |
| 1330 | +"cost_mac_per_elem": 16 | |
| 1331 | +}, | |
| 1332 | +{ | |
| 1333 | +"step": 2999, | |
| 1334 | +"layer": "b2.qkv", | |
| 1335 | +"transform": "rht16", | |
| 1336 | +"fmt": "mx", | |
| 1337 | +"dw_rel_err": 0.18005894124507904, | |
| 1338 | +"x_rel_err": 0.11203769594430923, | |
| 1339 | +"dy_rel_err": 0.15822850167751312, | |
| 1340 | +"cost_mac_per_elem": 16 | |
| 1341 | +}, | |
| 1342 | +{ | |
| 1343 | +"step": 2999, | |
| 1344 | +"layer": "b2.qkv", | |
| 1345 | +"transform": "rht128", | |
| 1346 | +"fmt": "nv", | |
| 1347 | +"dw_rel_err": 0.15491874516010284, | |
| 1348 | +"x_rel_err": 0.09442673623561859, | |
| 1349 | +"dy_rel_err": 0.1391196846961975, | |
| 1350 | +"cost_mac_per_elem": 128 | |
| 1351 | +}, | |
| 1352 | +{ | |
| 1353 | +"step": 2999, | |
| 1354 | +"layer": "b2.qkv", | |
| 1355 | +"transform": "rht128", | |
| 1356 | +"fmt": "mx", | |
| 1357 | +"dw_rel_err": 0.1746920943260193, | |
| 1358 | +"x_rel_err": 0.11357326805591583, | |
| 1359 | +"dy_rel_err": 0.15581114590168, | |
| 1360 | +"cost_mac_per_elem": 128 | |
| 1361 | +}, | |
| 1362 | +{ | |
| 1363 | +"step": 2999, | |
| 1364 | +"layer": "b2.qkv", | |
| 1365 | +"transform": "diag_pow2", | |
| 1366 | +"fmt": "nv", | |
| 1367 | +"dw_rel_err": 0.14523935317993164, | |
| 1368 | +"x_rel_err": 0.09874279797077179, | |
| 1369 | +"dy_rel_err": 0.13351212441921234, | |
| 1370 | +"cost_mac_per_elem": 1 | |
| 1371 | +}, | |
| 1372 | +{ | |
| 1373 | +"step": 2999, | |
| 1374 | +"layer": "b2.qkv", | |
| 1375 | +"transform": "diag_pow2", | |
| 1376 | +"fmt": "mx", | |
| 1377 | +"dw_rel_err": 0.189934641122818, | |
| 1378 | +"x_rel_err": 0.11948647350072861, | |
| 1379 | +"dy_rel_err": 0.18338151276111603, | |
| 1380 | +"cost_mac_per_elem": 1 | |
| 1381 | +}, | |
| 1382 | +{ | |
| 1383 | +"step": 2999, | |
| 1384 | +"layer": "b2.qkv", | |
| 1385 | +"transform": "diag+rht16", | |
| 1386 | +"fmt": "nv", | |
| 1387 | +"dw_rel_err": 0.1350409984588623, | |
| 1388 | +"x_rel_err": 0.09325699508190155, | |
| 1389 | +"dy_rel_err": 0.13994453847408295, | |
| 1390 | +"cost_mac_per_elem": 17 | |
| 1391 | +}, | |
| 1392 | +{ | |
| 1393 | +"step": 2999, | |
| 1394 | +"layer": "b2.qkv", | |
| 1395 | +"transform": "diag+rht16", | |
| 1396 | +"fmt": "mx", | |
| 1397 | +"dw_rel_err": 0.16267021000385284, | |
| 1398 | +"x_rel_err": 0.1178780198097229, | |
| 1399 | +"dy_rel_err": 0.15853643417358398, | |
| 1400 | +"cost_mac_per_elem": 17 | |
| 1401 | +}, | |
| 1402 | +{ | |
| 1403 | +"step": 2999, | |
| 1404 | +"layer": "b3.proj", | |
| 1405 | +"transform": "none", | |
| 1406 | +"fmt": "nv", | |
| 1407 | +"dw_rel_err": 0.1661154329776764, | |
| 1408 | +"x_rel_err": 0.09772185981273651, | |
| 1409 | +"dy_rel_err": 0.1356288194656372, | |
| 1410 | +"cost_mac_per_elem": 0 | |
| 1411 | +}, | |
| 1412 | +{ | |
| 1413 | +"step": 2999, | |
| 1414 | +"layer": "b3.proj", | |
| 1415 | +"transform": "none", | |
| 1416 | +"fmt": "mx", | |
| 1417 | +"dw_rel_err": 0.20609909296035767, | |
| 1418 | +"x_rel_err": 0.11555265635251999, | |
| 1419 | +"dy_rel_err": 0.17613598704338074, | |
| 1420 | +"cost_mac_per_elem": 0 | |
| 1421 | +}, | |
| 1422 | +{ | |
| 1423 | +"step": 2999, | |
| 1424 | +"layer": "b3.proj", | |
| 1425 | +"transform": "signs_only", | |
| 1426 | +"fmt": "nv", | |
| 1427 | +"dw_rel_err": 0.16656918823719025, | |
| 1428 | +"x_rel_err": 0.09772185981273651, | |
| 1429 | +"dy_rel_err": 0.13541193306446075, | |
| 1430 | +"cost_mac_per_elem": 0 | |
| 1431 | +}, | |
| 1432 | +{ | |
| 1433 | +"step": 2999, | |
| 1434 | +"layer": "b3.proj", | |
| 1435 | +"transform": "signs_only", | |
| 1436 | +"fmt": "mx", | |
| 1437 | +"dw_rel_err": 0.20707538723945618, | |
| 1438 | +"x_rel_err": 0.11555265635251999, | |
| 1439 | +"dy_rel_err": 0.17565953731536865, | |
| 1440 | +"cost_mac_per_elem": 0 | |
| 1441 | +}, | |
| 1442 | +{ | |
| 1443 | +"step": 2999, | |
| 1444 | +"layer": "b3.proj", | |
| 1445 | +"transform": "h16_fixed", | |
| 1446 | +"fmt": "nv", | |
| 1447 | +"dw_rel_err": 0.1664019674062729, | |
| 1448 | +"x_rel_err": 0.09101807326078415, | |
| 1449 | +"dy_rel_err": 0.13917991518974304, | |
| 1450 | +"cost_mac_per_elem": 16 | |
| 1451 | +}, | |
| 1452 | +{ | |
| 1453 | +"step": 2999, | |
| 1454 | +"layer": "b3.proj", | |
| 1455 | +"transform": "h16_fixed", | |
| 1456 | +"fmt": "mx", | |
| 1457 | +"dw_rel_err": 0.2116270512342453, | |
| 1458 | +"x_rel_err": 0.13941213488578796, | |
| 1459 | +"dy_rel_err": 0.15844933688640594, | |
| 1460 | +"cost_mac_per_elem": 16 | |
| 1461 | +}, | |
| 1462 | +{ | |
| 1463 | +"step": 2999, | |
| 1464 | +"layer": "b3.proj", | |
| 1465 | +"transform": "rht16", | |
| 1466 | +"fmt": "nv", | |
| 1467 | +"dw_rel_err": 0.17074888944625854, | |
| 1468 | +"x_rel_err": 0.09459181129932404, | |
| 1469 | +"dy_rel_err": 0.13907264173030853, | |
| 1470 | +"cost_mac_per_elem": 16 | |
| 1471 | +}, | |
| 1472 | +{ | |
| 1473 | +"step": 2999, | |
| 1474 | +"layer": "b3.proj", | |
| 1475 | +"transform": "rht16", | |
| 1476 | +"fmt": "mx", | |
| 1477 | +"dw_rel_err": 0.19863489270210266, | |
| 1478 | +"x_rel_err": 0.11742784827947617, | |
| 1479 | +"dy_rel_err": 0.1580692082643509, | |
| 1480 | +"cost_mac_per_elem": 16 | |
| 1481 | +}, | |
| 1482 | +{ | |
| 1483 | +"step": 2999, | |
| 1484 | +"layer": "b3.proj", | |
| 1485 | +"transform": "rht128", | |
| 1486 | +"fmt": "nv", | |
| 1487 | +"dw_rel_err": 0.17293184995651245, | |
| 1488 | +"x_rel_err": 0.09534665197134018, | |
| 1489 | +"dy_rel_err": 0.13773488998413086, | |
| 1490 | +"cost_mac_per_elem": 128 | |
| 1491 | +}, | |
| 1492 | +{ | |
| 1493 | +"step": 2999, | |
| 1494 | +"layer": "b3.proj", | |
| 1495 | +"transform": "rht128", | |
| 1496 | +"fmt": "mx", | |
| 1497 | +"dw_rel_err": 0.19759581983089447, | |
| 1498 | +"x_rel_err": 0.11532250046730042, | |
| 1499 | +"dy_rel_err": 0.15766090154647827, | |
| 1500 | +"cost_mac_per_elem": 128 | |
| 1501 | +}, | |
| 1502 | +{ | |
| 1503 | +"step": 2999, | |
| 1504 | +"layer": "b3.proj", | |
| 1505 | +"transform": "diag_pow2", | |
| 1506 | +"fmt": "nv", | |
| 1507 | +"dw_rel_err": 0.15769639611244202, | |
| 1508 | +"x_rel_err": 0.0941571369767189, | |
| 1509 | +"dy_rel_err": 0.13578033447265625, | |
| 1510 | +"cost_mac_per_elem": 1 | |
| 1511 | +}, | |
| 1512 | +{ | |
| 1513 | +"step": 2999, | |
| 1514 | +"layer": "b3.proj", | |
| 1515 | +"transform": "diag_pow2", | |
| 1516 | +"fmt": "mx", | |
| 1517 | +"dw_rel_err": 0.19597433507442474, | |
| 1518 | +"x_rel_err": 0.1206611767411232, | |
| 1519 | +"dy_rel_err": 0.16712190210819244, | |
| 1520 | +"cost_mac_per_elem": 1 | |
| 1521 | +}, | |
| 1522 | +{ | |
| 1523 | +"step": 2999, | |
| 1524 | +"layer": "b3.proj", | |
| 1525 | +"transform": "diag+rht16", | |
| 1526 | +"fmt": "nv", | |
| 1527 | +"dw_rel_err": 0.1539326310157776, | |
| 1528 | +"x_rel_err": 0.09528309106826782, | |
| 1529 | +"dy_rel_err": 0.13794516026973724, | |
| 1530 | +"cost_mac_per_elem": 17 | |
| 1531 | +}, | |
| 1532 | +{ | |
| 1533 | +"step": 2999, | |
| 1534 | +"layer": "b3.proj", | |
| 1535 | +"transform": "diag+rht16", | |
| 1536 | +"fmt": "mx", | |
| 1537 | +"dw_rel_err": 0.17824621498584747, | |
| 1538 | +"x_rel_err": 0.11766567081212997, | |
| 1539 | +"dy_rel_err": 0.1585584431886673, | |
| 1540 | +"cost_mac_per_elem": 17 | |
| 1541 | +}, | |
| 1542 | +{ | |
| 1543 | +"step": 2999, | |
| 1544 | +"layer": "b4.fc2", | |
| 1545 | +"transform": "none", | |
| 1546 | +"fmt": "nv", | |
| 1547 | +"dw_rel_err": 0.17009615898132324, | |
| 1548 | +"x_rel_err": 0.09089470654726028, | |
| 1549 | +"dy_rel_err": 0.13445639610290527, | |
| 1550 | +"cost_mac_per_elem": 0 | |
| 1551 | +}, | |
| 1552 | +{ | |
| 1553 | +"step": 2999, | |
| 1554 | +"layer": "b4.fc2", | |
| 1555 | +"transform": "none", | |
| 1556 | +"fmt": "mx", | |
| 1557 | +"dw_rel_err": 0.23562359809875488, | |
| 1558 | +"x_rel_err": 0.14928965270519257, | |
| 1559 | +"dy_rel_err": 0.17831283807754517, | |
| 1560 | +"cost_mac_per_elem": 0 | |
| 1561 | +}, | |
| 1562 | +{ | |
| 1563 | +"step": 2999, | |
| 1564 | +"layer": "b4.fc2", | |
| 1565 | +"transform": "signs_only", | |
| 1566 | +"fmt": "nv", | |
| 1567 | +"dw_rel_err": 0.1680523157119751, | |
| 1568 | +"x_rel_err": 0.09089470654726028, | |
| 1569 | +"dy_rel_err": 0.13487358391284943, | |
| 1570 | +"cost_mac_per_elem": 0 | |
| 1571 | +}, | |
| 1572 | +{ | |
| 1573 | +"step": 2999, | |
| 1574 | +"layer": "b4.fc2", | |
| 1575 | +"transform": "signs_only", | |
| 1576 | +"fmt": "mx", | |
| 1577 | +"dw_rel_err": 0.23556438088417053, | |
| 1578 | +"x_rel_err": 0.14928965270519257, | |
| 1579 | +"dy_rel_err": 0.17861318588256836, | |
| 1580 | +"cost_mac_per_elem": 0 | |
| 1581 | +}, | |
| 1582 | +{ | |
| 1583 | +"step": 2999, | |
| 1584 | +"layer": "b4.fc2", | |
| 1585 | +"transform": "h16_fixed", | |
| 1586 | +"fmt": "nv", | |
| 1587 | +"dw_rel_err": 0.19257289171218872, | |
| 1588 | +"x_rel_err": 0.10050736367702484, | |
| 1589 | +"dy_rel_err": 0.1394626498222351, | |
| 1590 | +"cost_mac_per_elem": 16 | |
| 1591 | +}, | |
| 1592 | +{ | |
| 1593 | +"step": 2999, | |
| 1594 | +"layer": "b4.fc2", | |
| 1595 | +"transform": "h16_fixed", | |
| 1596 | +"fmt": "mx", | |
| 1597 | +"dw_rel_err": 0.2166062593460083, | |
| 1598 | +"x_rel_err": 0.11906486749649048, | |
| 1599 | +"dy_rel_err": 0.15804533660411835, | |
| 1600 | +"cost_mac_per_elem": 16 | |
| 1601 | +}, | |
| 1602 | +{ | |
| 1603 | +"step": 2999, | |
| 1604 | +"layer": "b4.fc2", | |
| 1605 | +"transform": "rht16", | |
| 1606 | +"fmt": "nv", | |
| 1607 | +"dw_rel_err": 0.19343270361423492, | |
| 1608 | +"x_rel_err": 0.10083702951669693, | |
| 1609 | +"dy_rel_err": 0.1397022008895874, | |
| 1610 | +"cost_mac_per_elem": 16 | |
| 1611 | +}, | |
| 1612 | +{ | |
| 1613 | +"step": 2999, | |
| 1614 | +"layer": "b4.fc2", | |
| 1615 | +"transform": "rht16", | |
| 1616 | +"fmt": "mx", | |
| 1617 | +"dw_rel_err": 0.21408668160438538, | |
| 1618 | +"x_rel_err": 0.11642958223819733, | |
| 1619 | +"dy_rel_err": 0.15776996314525604, | |
| 1620 | +"cost_mac_per_elem": 16 | |
| 1621 | +}, | |
| 1622 | +{ | |
| 1623 | +"step": 2999, | |
| 1624 | +"layer": "b4.fc2", | |
| 1625 | +"transform": "rht128", | |
| 1626 | +"fmt": "nv", | |
| 1627 | +"dw_rel_err": 0.1908532828092575, | |
| 1628 | +"x_rel_err": 0.09636658430099487, | |
| 1629 | +"dy_rel_err": 0.13778063654899597, | |
| 1630 | +"cost_mac_per_elem": 128 | |
| 1631 | +}, | |
| 1632 | +{ | |
| 1633 | +"step": 2999, | |
| 1634 | +"layer": "b4.fc2", | |
| 1635 | +"transform": "rht128", | |
| 1636 | +"fmt": "mx", | |
| 1637 | +"dw_rel_err": 0.2188260853290558, | |
| 1638 | +"x_rel_err": 0.11410383880138397, | |
| 1639 | +"dy_rel_err": 0.1576765477657318, | |
| 1640 | +"cost_mac_per_elem": 128 | |
| 1641 | +}, | |
| 1642 | +{ | |
| 1643 | +"step": 2999, | |
| 1644 | +"layer": "b4.fc2", | |
| 1645 | +"transform": "diag_pow2", | |
| 1646 | +"fmt": "nv", | |
| 1647 | +"dw_rel_err": 0.14365293085575104, | |
| 1648 | +"x_rel_err": 0.0884203314781189, | |
| 1649 | +"dy_rel_err": 0.13550488650798798, | |
| 1650 | +"cost_mac_per_elem": 1 | |
| 1651 | +}, | |
| 1652 | +{ | |
| 1653 | +"step": 2999, | |
| 1654 | +"layer": "b4.fc2", | |
| 1655 | +"transform": "diag_pow2", | |
| 1656 | +"fmt": "mx", | |
| 1657 | +"dw_rel_err": 0.20639684796333313, | |
| 1658 | +"x_rel_err": 0.15093031525611877, | |
| 1659 | +"dy_rel_err": 0.16766928136348724, | |
| 1660 | +"cost_mac_per_elem": 1 | |
| 1661 | +}, | |
| 1662 | +{ | |
| 1663 | +"step": 2999, | |
| 1664 | +"layer": "b4.fc2", | |
| 1665 | +"transform": "diag+rht16", | |
| 1666 | +"fmt": "nv", | |
| 1667 | +"dw_rel_err": 0.14388570189476013, | |
| 1668 | +"x_rel_err": 0.10206519067287445, | |
| 1669 | +"dy_rel_err": 0.13810187578201294, | |
| 1670 | +"cost_mac_per_elem": 17 | |
| 1671 | +}, | |
| 1672 | +{ | |
| 1673 | +"step": 2999, | |
| 1674 | +"layer": "b4.fc2", | |
| 1675 | +"transform": "diag+rht16", | |
| 1676 | +"fmt": "mx", | |
| 1677 | +"dw_rel_err": 0.16391435265541077, | |
| 1678 | +"x_rel_err": 0.1153857484459877, | |
| 1679 | +"dy_rel_err": 0.1585678905248642, | |
| 1680 | +"cost_mac_per_elem": 17 | |
| 1681 | +} | |
| 1682 | +] | |
| \ No newline at end of file |
evidence/own-fp4/outlier/summary.txt
| new file mode 100644 | ||
| @@ -0,0 +1,14 @@ | ||
| 1 | +mx diag+rht16 mean dW rel err 0.1546 max 0.1878 n 12 cost 17 MAC/elem | |
| 2 | +mx diag_pow2 mean dW rel err 0.1760 max 0.2180 n 12 cost 1 MAC/elem | |
| 3 | +mx h16_fixed mean dW rel err 0.1852 max 0.2255 n 12 cost 16 MAC/elem | |
| 4 | +mx none mean dW rel err 0.1849 max 0.2356 n 12 cost 0 MAC/elem | |
| 5 | +mx rht128 mean dW rel err 0.1701 max 0.2188 n 12 cost 128 MAC/elem | |
| 6 | +mx rht16 mean dW rel err 0.1713 max 0.2141 n 12 cost 16 MAC/elem | |
| 7 | +mx signs_only mean dW rel err 0.1849 max 0.2356 n 12 cost 0 MAC/elem | |
| 8 | +nv diag+rht16 mean dW rel err 0.1310 max 0.1596 n 12 cost 17 MAC/elem | |
| 9 | +nv diag_pow2 mean dW rel err 0.1332 max 0.1637 n 12 cost 1 MAC/elem | |
| 10 | +nv h16_fixed mean dW rel err 0.1433 max 0.1926 n 12 cost 16 MAC/elem | |
| 11 | +nv none mean dW rel err 0.1414 max 0.1703 n 12 cost 0 MAC/elem | |
| 12 | +nv rht128 mean dW rel err 0.1473 max 0.1909 n 12 cost 128 MAC/elem | |
| 13 | +nv rht16 mean dW rel err 0.1466 max 0.1934 n 12 cost 16 MAC/elem | |
| 14 | +nv signs_only mean dW rel err 0.1413 max 0.1741 n 12 cost 0 MAC/elem |
evidence/own-fp4/sources/FETCHLOG.txt
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +2026-10-20T18:25:22Z https://arxiv.org/abs/2509.25149 -> nvfp4-2509.25149.abs.html 58514B | |
| 2 | +2026-10-20T18:25:22Z https://arxiv.org/html/2509.25149 -> nvfp4-2509.25149.html 223868B | |
| 3 | +2026-10-20T18:25:22Z https://arxiv.org/abs/2505.14669 -> quartet-2505.14669.abs.html 43655B | |
| 4 | +2026-10-20T18:25:22Z https://arxiv.org/abs/2501.17116 -> msfp4-2501.17116.abs.html 43267B | |
| 5 | +2026-10-20T18:25:22Z https://arxiv.org/abs/2402.17764 -> bitnet158-2402.17764.abs.html 41057B | |
| 6 | +2026-10-20T18:25:22Z https://arxiv.org/abs/2502.20586 -> mxfp4train-2502.20586.abs.html 41863B | |
| 7 | +2026-10-20T18:25:23Z https://docs.nvidia.com/cuda/parallel-thread-execution/index.html -> ptx-isa.html 3928317B | |
| 8 | +2026-10-20T18:25:23Z https://www.nvidia.com/en-us/products/workstations/dgx-spark/ -> dgx-spark.html 649047B |
evidence/own-fp4/sources/SOURCES.sha256
| new file mode 100644 | ||
| @@ -0,0 +1,14 @@ | ||
| 1 | +# Third-party pages fetched 2026-10-20 for docs/numerics/OWN_FP4.md (see FETCHLOG.txt for URL and time). | |
| 2 | +# The copies are not kept in this repository; re-fetch the URL and compare. sha256 and bytes of the copy as fetched, | |
| 3 | +# generated from blob history of numerics/own-fp4 @ 1dff177 by: git cat-file blob <commit>:<path> | sha256sum | |
| 4 | +630e6e2211050e527d2dc1ff92817e04aeee3db167045f57e6c9a3c9d8b94c20 41057 bitnet158-2402.17764.abs.html | |
| 5 | +e11fd0ca6f40f7a81f6933cad7a97b860a2a99495bbb78f562ebdd1aa936a07e 649047 dgx-spark.html | |
| 6 | +15bc16eb7027f6a561e4be28ac844f74973025fc473bf836f36ae8b4029fc8f2 43267 msfp4-2501.17116.abs.html | |
| 7 | +d7358b751423ef0512f78a759c033c006afdb2173b775df0fdebf7c0f06e5f4e 41863 mxfp4train-2502.20586.abs.html | |
| 8 | +3721553dd6b137e33e651d89fd419bdf1cc3d5f1bfe6ec554b659e2df6d9c5b9 58514 nvfp4-2509.25149.abs.html | |
| 9 | +486ad3f6022863746cedd4a777f56fb9aa6c1fe5e35a392acd7b1c41cc4a532e 223868 nvfp4-2509.25149.html | |
| 10 | +f59bfd8189493032b829496b6ec4147bdcf29e0892bb05b6b822f69aacd94a71 79959 nvfp4.sent | |
| 11 | +c17c7f9df0defefbef96f37a53fe8b468d3058f0cc8853cf7b6a573d96c853f2 79959 nvfp4.txt | |
| 12 | +f1e14ad07468e26bf3724e41be86f3a68ab7914bcf0fc9824a6ad31a1eb2ec26 3928317 ptx-isa.html | |
| 13 | +69b800681369e3c415ea848b5da51fa204a3b131bf82aa124b47b41e88b89376 1431109 ptx-isa.txt | |
| 14 | +c4b3e3d103aa7260fd0906df54d48fe459231b94b11d878c19eb5aa963579e02 43655 quartet-2505.14669.abs.html |
evidence/physics-gb10/gr_info.txt
| new file mode 100644 | ||
| @@ -0,0 +1,19 @@ | ||
| 1 | +# gr_info, read-only RM NV2080_CTRL_CMD_GR_GET_INFO through physics nvrm (pinned 6d7cf0d4); aien-train physics/gb10 streams/physics-gb10/gr_info.c (committed with this file); host spark-b87b; 2026-10-20T18:09:06Z; driver 580.173.02 | |
| 2 | +compute_class 0xcec0 | |
| 3 | +SM_VERSION 2564 | |
| 4 | +SHADER_PIPE_COUNT 4 | |
| 5 | +SHADER_PIPE_SUB_COUNT 24 | |
| 6 | +LITTER_NUM_GPCS 4 | |
| 7 | +LITTER_NUM_TPC_PER_GPC 6 | |
| 8 | +LITTER_NUM_SM_PER_TPC 2 | |
| 9 | +MAX_WARPS_PER_SM 48 | |
| 10 | +MAX_THREADS_PER_WARP 32 | |
| 11 | +MAX_SP_PER_SM 0 | |
| 12 | +GPU_CORE_COUNT 6144 | |
| 13 | +SM_REG_BANK_COUNT 0 | |
| 14 | +SM_REG_BANK_REG_COUNT 0 | |
| 15 | +LITTER_NUM_LTCS 4 | |
| 16 | +LITTER_NUM_LTC_SLICES 4 | |
| 17 | +LITTER_NUM_SLICES_PER_LTC 4 | |
| 18 | +LITTER_NUM_FBPS 4 | |
| 19 | +exit 0 |
evidence/physics-gb10/train-probe-20261020T1834Z.txt
| new file mode 100644 | ||
| @@ -0,0 +1 @@ | ||
| 1 | +# gpu_train_probe_test chip run; omega-mv train/onchip-probe@76f7d144 (tests/gpu_train_probe_test.c, src/omega_blackwell_codegen_train.c), physics 6d7cf0d4; GB10 host spark-b87b; queued 2026-10-20T18:34:56Z under: quiet-measure flock /tmp/aien-gb10.lock |
native/omegallm/README.md
| new file mode 100644 | ||
| @@ -0,0 +1,27 @@ | ||
| 1 | +# Omega LLM has moved to omega-mv | |
| 2 | + | |
| 3 | +Since 2026-11-19 the Omega LLM `.om` code and docs live in omega-mv at `train/omega-llm/`, and that | |
| 4 | +directory is the **source of truth** (Drake and Omega Lead, 2026-11-19). | |
| 5 | + | |
| 6 | +| Here (aien-train) | Now in omega-mv | | |
| 7 | +| --- | --- | | |
| 8 | +| `native/omegallm/` | `train/omega-llm/native/` | | |
| 9 | +| `tests/omegallm/*.om` | `train/omega-llm/tests/` | | |
| 10 | +| `tools/omegallm/**/*.om` | `train/omega-llm/tools/` | | |
| 11 | +| `docs/omegallm/*.md` | `train/omega-llm/docs/` | | |
| 12 | + | |
| 13 | +The move came from aien-train main `f1bebdf3c5b0` with full history (`git log --follow` works there); | |
| 14 | +the recipe and commit maps are in omega-mv `train/import/aien-train/`. In omega-mv the units | |
| 15 | +`ollm_aarch64`, `ollm_x86linux`, `ollm_x86efi`, `ollm_a64efi` and `ollm_darwin` (`train/units.tsv`) | |
| 16 | +are built by omega-mv's own `seed/out/omc` and gated by `train/units-gate.om` (`OMEGA-TRAIN-UNITS`). | |
| 17 | +`ollm_darwin` is compile-only coverage of the Darwin file list for the default Linux AArch64 target; | |
| 18 | +the pinned compiler has no Darwin target, so a macOS Mach-O build is **NOT_RUN**. | |
| 19 | + | |
| 20 | +What stays here: the shell/Python harness in `tests/omegallm/` (`build.sh`, `oracle.py`, | |
| 21 | +`pre-review.py`, ...), the receipts in `evidence/OMEGALLM/` and `evidence-ham/ollm-speed/`, and the | |
| 22 | +C++ UI bridge `tools/omegallm-ui/`. The copies of the `.om` files and docs in this repository are kept | |
| 23 | +as they were at `f1bebdf3c5b0` so existing receipts and pins still resolve; make new Omega LLM code and | |
| 24 | +doc changes in omega-mv. | |
| 25 | + | |
| 26 | +The local `tests/omegallm/build.sh` still builds these frozen local copies, not the canonical | |
| 27 | +omega-mv sources. It will not pick up later omega-mv changes; use omega-mv's units for current code. |
native/omegallm/adam.om
| @@ -18,6 +18,8 @@ const OMUTD ulong 1 | ||
| 18 | 18 | |
| 19 | 19 | note per-sequence losses of the current batch |
| 20 | 20 | global olos f64 64 |
| 21 | +note ofreeze: when > 0, parameters i < ofreeze[0] are frozen (gradient zeroed, m/v/w untouched). | |
| 22 | +global ofreeze ulong 1 | |
| 21 | 23 | |
| 22 | 24 | note init (CONTRACT section 5): r_i = (splitmix64(S+i) >> 11) 2^-53 (N[2^-53] -> |
| 23 | 25 | note 1.1102230246251565*^-16); w = (2 r - 1) 0.034641016151377546 (N[0.02 Sqrt[3]]); wo and w2 |
| @@ -91,13 +93,18 @@ end | ||
| 91 | 93 | note clip the gradient to global norm 1 and apply one Adam update at step og[41] |
| 92 | 94 | fn oadam to void |
| 93 | 95 | p = get og 8 |
| 96 | +fz = get ofreeze 0 | |
| 94 | 97 | ss = 0.0f64 |
| 95 | 98 | for q ulong ocn p |
| 96 | 99 | i = mul q OCH |
| 97 | 100 | ie = oce q p |
| 98 | 101 | while lt i ie bound 999999 |
| 102 | +if lt i fz | |
| 103 | +ocsp i 0.0f64 | |
| 104 | +else | |
| 99 | 105 | g = ocsg i |
| 100 | 106 | ss = add ss mul g g |
| 107 | +end | |
| 101 | 108 | i = add i 1 |
| 102 | 109 | end |
| 103 | 110 | end |
| @@ -141,6 +148,9 @@ end | ||
| 141 | 148 | |
| 142 | 149 | note moments of parameter i: m = 0.9 m + (1 - 0.9) g; v = 0.99 v + (1 - 0.99) g^2 |
| 143 | 150 | fn oadam1 i ulong to void |
| 151 | +if lt i get ofreeze 0 | |
| 152 | +ret | |
| 153 | +end | |
| 144 | 154 | g = ogrg add get og 10 i |
| 145 | 155 | mo = add get og 11 i |
| 146 | 156 | m = omvg mo |
native/omegallm/cli.om
| @@ -24,6 +24,31 @@ end | ||
| 24 | 24 | ret v |
| 25 | 25 | end |
| 26 | 26 | |
| 27 | +fn ocmdlo to ulong | |
| 28 | +r = oargr 1 | |
| 29 | +if or le r 8 gt r 16 | |
| 30 | +ret 0 | |
| 31 | +end | |
| 32 | +v = ulong 0 | |
| 33 | +for k ulong 8 | |
| 34 | +v = or v shl ulong get oarg k mul k 8 | |
| 35 | +end | |
| 36 | +ret v | |
| 37 | +end | |
| 38 | + | |
| 39 | +fn ocmdhi to ulong | |
| 40 | +r = oargr 1 | |
| 41 | +if or le r 8 gt r 16 | |
| 42 | +ret 0 | |
| 43 | +end | |
| 44 | +v = ulong 0 | |
| 45 | +n = sub ulong r 8 | |
| 46 | +for k ulong n | |
| 47 | +v = or v shl ulong get oarg add 8 k mul k 8 | |
| 48 | +end | |
| 49 | +ret v | |
| 50 | +end | |
| 51 | + | |
| 27 | 52 | note run the command named by argument 1; the platform main checks that it exists. |
| 28 | 53 | fn ocmd to int |
| 29 | 54 | w = ocmdw |
| @@ -97,6 +122,86 @@ if eq w 482871572075 | ||
| 97 | 122 | cmdkvcmp |
| 98 | 123 | ret 0 |
| 99 | 124 | end |
| 125 | +if eq w 112624400429684 | |
| 126 | +cmdtrainf | |
| 127 | +ret 0 | |
| 128 | +end | |
| 129 | +if eq w 30506458620916852 | |
| 130 | +cmdttteval | |
| 131 | +ret 0 | |
| 132 | +end | |
| 133 | +if eq w 7809653406635421540 | |
| 134 | +cmddolaeval | |
| 135 | +ret 0 | |
| 136 | +end | |
| 137 | +if eq w 31645462707860596 | |
| 138 | +cmdtttsamp | |
| 139 | +ret 0 | |
| 140 | +end | |
| 141 | +if eq w 500236120179 | |
| 142 | +cmdspext | |
| 143 | +ret 0 | |
| 144 | +end | |
| 145 | +if eq w 482921771123 | |
| 146 | +cmdspapp | |
| 147 | +ret 0 | |
| 148 | +end | |
| 149 | +if eq w 123615088701555 | |
| 150 | +cmdspsamp | |
| 151 | +ret 0 | |
| 152 | +end | |
| 153 | +if eq w 119165853986931 | |
| 154 | +cmdspeval | |
| 155 | +ret 0 | |
| 156 | +end | |
| 157 | +if eq w 111499018330982 | |
| 158 | +cmdfcache | |
| 159 | +ret 0 | |
| 160 | +end | |
| 161 | +if eq w 27978647094784628 | |
| 162 | +cmdtrainfc | |
| 163 | +ret 0 | |
| 164 | +end | |
| 165 | +if eq w 30792271479792486 | |
| 166 | +cmdfcachem | |
| 167 | +ret 0 | |
| 168 | +end | |
| 169 | +if eq w 28542713673379955 | |
| 170 | +cmdspmerge | |
| 171 | +ret 0 | |
| 172 | +end | |
| 173 | +if eq w 30227092724740211 | |
| 174 | +cmdspstack | |
| 175 | +ret 0 | |
| 176 | +end | |
| 177 | +if eq w 31369549780578919 | |
| 178 | +cmdgrowpro | |
| 179 | +ret 0 | |
| 180 | +end | |
| 181 | +if eq w 495773380723 | |
| 182 | +cmdspens | |
| 183 | +ret 0 | |
| 184 | +end | |
| 185 | +if eq w 123598092333171 | |
| 186 | +cmdspclip | |
| 187 | +ret 0 | |
| 188 | +end | |
| 189 | +if eq w 0 | |
| 190 | +lo = ocmdlo | |
| 191 | +hi = ocmdhi | |
| 192 | +if and eq lo 7020664736201273459 eq hi 28784 | |
| 193 | +cmdspchainapp | |
| 194 | +ret 0 | |
| 195 | +end | |
| 196 | +if and eq lo 7308895112352985203 eq hi 7102838 | |
| 197 | +cmdspchaineval | |
| 198 | +ret 0 | |
| 199 | +end | |
| 200 | +if and eq lo 8317701428883976307 eq hi 7368033 | |
| 201 | +cmdspchainsamp | |
| 202 | +ret 0 | |
| 203 | +end | |
| 204 | +end | |
| 100 | 205 | exit 2 |
| 101 | 206 | end |
| 102 | 207 |
native/omegallm/mio.om
| new file mode 100644 | ||
| @@ -0,0 +1,351 @@ | ||
| 1 | +note SPDX-License-Identifier: AGPL-3.0-only | |
| 2 | +note omegallm lio.om (aien-train#52): the Linux platform unit, the only unit that uses host words. | |
| 3 | +note It is concatenated last for targets aarch64 and x86linux; eio.om replaces it for x86efi. Both | |
| 4 | +note define the same functions: oargc, oargr, oflush, ocwopen, ocwput, ocwend, ofsz, ogradw, ocsinit, | |
| 5 | +note ocsg, ocsp, odread, owflush, owopen, owclose, ooffrd, oprd, obmsave and main. Every other unit is | |
| 6 | +note free of host words. | |
| 7 | +global owfd int 2 | |
| 8 | +global opth uchar 2100 | |
| 9 | +global opk uchar 4200 | |
| 10 | +global ocfd int 1 | |
| 11 | +global opp uchar 8 | |
| 12 | +global ost uchar 8 | |
| 13 | +global owrf int 64 | |
| 14 | +global owpd int 64 | |
| 15 | + | |
| 16 | +note the argument count (argv[0] included) | |
| 17 | +fn oargc to ulong | |
| 18 | +ret ulong argcnt | |
| 19 | +end | |
| 20 | + | |
| 21 | +note argv[i] into oarg (at most 4096 bytes); returns the argread result (negative: no such argument) | |
| 22 | +fn oargr i ulong to long | |
| 23 | +ret argread i oarg 0 4096 | |
| 24 | +end | |
| 25 | + | |
| 26 | +fn main to int | |
| 27 | +if lt oargc 2 | |
| 28 | +exit 2 | |
| 29 | +end | |
| 30 | +ret ocmd | |
| 31 | +end | |
| 32 | + | |
| 33 | +note onsnow: monotonic nanoseconds (kvcmp's step timing in cli.om) | |
| 34 | +fn onsnow to ulong | |
| 35 | +ret ulong monons | |
| 36 | +end | |
| 37 | + | |
| 38 | +fn oflush to void | |
| 39 | +n = get oon 0 | |
| 40 | +p = ulong 0 | |
| 41 | +while lt p n bound 4097 | |
| 42 | +w = write 1 oout p sub n p | |
| 43 | +if le w 0 | |
| 44 | +exit 70 | |
| 45 | +end | |
| 46 | +p = add p ulong w | |
| 47 | +end | |
| 48 | +put oon 0 0 | |
| 49 | +end | |
| 50 | + | |
| 51 | +note v1 checkpoint stream (ckpt.om): open PATH.tmp for the path in argv[ai] (created, emptied) | |
| 52 | +fn ocwopen ai ulong to void | |
| 53 | +pl = oargp ai | |
| 54 | +if gt pl 2000 | |
| 55 | +exit 2 | |
| 56 | +end | |
| 57 | +for i ulong pl | |
| 58 | +put opth i get oarg i | |
| 59 | +end | |
| 60 | +put opth pl 46 | |
| 61 | +put opth add pl 1 116 | |
| 62 | +put opth add pl 2 109 | |
| 63 | +put opth add pl 3 112 | |
| 64 | +fd = int fopen opth 0 add pl 4 577 420 | |
| 65 | +if lt fd 0 | |
| 66 | +exit 70 | |
| 67 | +end | |
| 68 | +put ocfd 0 fd | |
| 69 | +end | |
| 70 | + | |
| 71 | +note write ock[0 .. n) at byte position pos of the open PATH.tmp | |
| 72 | +fn ocwput pos ulong n ulong to void | |
| 73 | +fd = get ocfd 0 | |
| 74 | +p = ulong 0 | |
| 75 | +while lt p n bound 999999 | |
| 76 | +w = pwrite fd ock p sub n p long add pos p | |
| 77 | +if le w 0 | |
| 78 | +exit 70 | |
| 79 | +end | |
| 80 | +p = add p ulong w | |
| 81 | +end | |
| 82 | +end | |
| 83 | + | |
| 84 | +note fsync and close PATH.tmp, then rename it onto the path in argv[ai] | |
| 85 | +fn ocwend ai ulong to void | |
| 86 | +fd = get ocfd 0 | |
| 87 | +if ne fsync fd 0 | |
| 88 | +exit 70 | |
| 89 | +end | |
| 90 | +if ne fclose fd 0 | |
| 91 | +exit 70 | |
| 92 | +end | |
| 93 | +ocrename oargp ai | |
| 94 | +end | |
| 95 | + | |
| 96 | +note rename opth[0 .. pl+4) to opth[0 .. pl) via a packed two-path list | |
| 97 | +fn ocrename pl ulong to void | |
| 98 | +put opk 0 2 | |
| 99 | +put opk 1 0 | |
| 100 | +put opk 2 uchar and add pl 4 255 | |
| 101 | +put opk 3 uchar shr add pl 4 8 | |
| 102 | +for i ulong add pl 4 | |
| 103 | +put opk add 4 i get opth i | |
| 104 | +end | |
| 105 | +q = add 8 pl | |
| 106 | +put opk q uchar and pl 255 | |
| 107 | +put opk add q 1 uchar shr pl 8 | |
| 108 | +for j ulong pl | |
| 109 | +put opk add add q 2 j get opth j | |
| 110 | +end | |
| 111 | +r = renames opk 0 add add q 2 pl 0 | |
| 112 | +if ne r 0 | |
| 113 | +exit 70 | |
| 114 | +end | |
| 115 | +end | |
| 116 | + | |
| 117 | +note size in bytes of the file named by argv[ai] (seek to its end) | |
| 118 | +fn ofsz ai ulong to ulong | |
| 119 | +n = oargp ai | |
| 120 | +fd = int fopen oarg 0 n 0 0 | |
| 121 | +if lt fd 0 | |
| 122 | +exit 70 | |
| 123 | +end | |
| 124 | +sz = fseek fd 0 2 | |
| 125 | +if lt sz 0 | |
| 126 | +exit 70 | |
| 127 | +end | |
| 128 | +if ne fclose fd 0 | |
| 129 | +exit 70 | |
| 130 | +end | |
| 131 | +ret ulong sz | |
| 132 | +end | |
| 133 | + | |
| 134 | +note cold store (CONTRACT-V3 section 2): GRD and the Adam moments, 3 P values at the CONTRACT-V3 | |
| 135 | +note maxima (3 29995392 -> 89986176 values, 719889408 bytes), in one private anonymous mapping made | |
| 136 | +note on first use (mapnew prot 3 read/write, flags 34 private|anonymous; zero-filled, and inherited | |
| 137 | +note copy-on-write by the gradient workers). A failed mapping is an I/O refusal (exit 70). | |
| 138 | +const OCSN ulong 89986176 | |
| 139 | +global ocs f64 * | |
| 140 | +global ocsf ulong 1 | |
| 141 | + | |
| 142 | +fn ocsinit to ulong | |
| 143 | +if eq get ocsf 0 0 | |
| 144 | +r = enlarge ocs OCSN | |
| 145 | +if ne r 0 | |
| 146 | +exit 70 | |
| 147 | +end | |
| 148 | +put ocsf 0 1 | |
| 149 | +end | |
| 150 | +ret OCSN | |
| 151 | +end | |
| 152 | + | |
| 153 | +fn ocsg i ulong to f64 | |
| 154 | +ret get ocs i | |
| 155 | +end | |
| 156 | + | |
| 157 | +fn ocsp i ulong v f64 to void | |
| 158 | +put ocs i v | |
| 159 | +end | |
| 160 | + | |
| 161 | +fn ogradw to f64 | |
| 162 | +k = get og 45 | |
| 163 | +if gt k 1 | |
| 164 | +exit 70 | |
| 165 | +end | |
| 166 | +ret ograd | |
| 167 | +end | |
| 168 | + | |
| 169 | +fn odread i ulong to ulong | |
| 170 | +n = oargp i | |
| 171 | +fd = int fopen oarg 0 n 0 0 | |
| 172 | +if lt fd 0 | |
| 173 | +exit 70 | |
| 174 | +end | |
| 175 | +p = ulong 0 | |
| 176 | +dn = false | |
| 177 | +for o ulong 64 | |
| 178 | +q = ulong 0 | |
| 179 | +while and not dn lt q 999999 bound 999999 | |
| 180 | +q = add q 1 | |
| 181 | +r = long 0 | |
| 182 | +if lt p ODHALF | |
| 183 | +r = read fd od0 p sub ODHALF p | |
| 184 | +else | |
| 185 | +if lt p ODCAP | |
| 186 | +r = read fd od1 sub p ODHALF sub ODCAP p | |
| 187 | +else | |
| 188 | +r = read fd ochk 0 1 | |
| 189 | +end | |
| 190 | +end | |
| 191 | +if lt r 0 | |
| 192 | +exit 70 | |
| 193 | +end | |
| 194 | +if eq r 0 | |
| 195 | +dn = true | |
| 196 | +else | |
| 197 | +p = add p ulong r | |
| 198 | +if gt p ODCAP | |
| 199 | +exit 21 | |
| 200 | +end | |
| 201 | +end | |
| 202 | +end | |
| 203 | +if dn | |
| 204 | +break | |
| 205 | +end | |
| 206 | +end | |
| 207 | +if not dn | |
| 208 | +exit 70 | |
| 209 | +end | |
| 210 | +c = fclose fd | |
| 211 | +put odn 0 p | |
| 212 | +ret p | |
| 213 | +end | |
| 214 | + | |
| 215 | +note prep output: two buffered writers (k = 0 TRAIN, k = 1 HELD). | |
| 216 | +fn owflush k ulong to void | |
| 217 | +n = get owbn k | |
| 218 | +fd = get owfd k | |
| 219 | +p = ulong 0 | |
| 220 | +while lt p n bound 65537 | |
| 221 | +w = long 0 | |
| 222 | +if eq k 0 | |
| 223 | +w = write fd owb0 p sub n p | |
| 224 | +else | |
| 225 | +w = write fd owb1 p sub n p | |
| 226 | +end | |
| 227 | +if le w 0 | |
| 228 | +exit 70 | |
| 229 | +end | |
| 230 | +p = add p ulong w | |
| 231 | +end | |
| 232 | +put owbn k 0 | |
| 233 | +end | |
| 234 | + | |
| 235 | +fn owopen k ulong i ulong to void | |
| 236 | +n = oargp i | |
| 237 | +fd = int fopen oarg 0 n 577 420 | |
| 238 | +if lt fd 0 | |
| 239 | +exit 70 | |
| 240 | +end | |
| 241 | +put owfd k fd | |
| 242 | +put owbn k 0 | |
| 243 | +end | |
| 244 | + | |
| 245 | +fn owclose k ulong to void | |
| 246 | +owflush k | |
| 247 | +fd = get owfd k | |
| 248 | +if ne fsync fd 0 | |
| 249 | +exit 70 | |
| 250 | +end | |
| 251 | +if ne fclose fd 0 | |
| 252 | +exit 70 | |
| 253 | +end | |
| 254 | +end | |
| 255 | + | |
| 256 | +note read argv[ai] (B little-endian u64 offsets) into ochk; exit 21 unless it holds exactly 8 B bytes | |
| 257 | +fn ooffrd ai ulong to void | |
| 258 | +n = oargp ai | |
| 259 | +fd = int fopen oarg 0 n 0 0 | |
| 260 | +if lt fd 0 | |
| 261 | +exit 70 | |
| 262 | +end | |
| 263 | +p = ulong 0 | |
| 264 | +dn = false | |
| 265 | +while not dn bound 70000 | |
| 266 | +r = read fd ochk p sub 65536 p | |
| 267 | +if lt r 0 | |
| 268 | +exit 70 | |
| 269 | +end | |
| 270 | +if eq r 0 | |
| 271 | +dn = true | |
| 272 | +else | |
| 273 | +p = add p ulong r | |
| 274 | +if ge p 65536 | |
| 275 | +exit 21 | |
| 276 | +end | |
| 277 | +end | |
| 278 | +end | |
| 279 | +c = fclose fd | |
| 280 | +if ne p mul 8 get og 6 | |
| 281 | +exit 21 | |
| 282 | +end | |
| 283 | +end | |
| 284 | + | |
| 285 | + | |
| 286 | +note v1 positioned read (CONTRACT-V1 section 3): read up to n bytes of the file named by argv[ai], | |
| 287 | +note from byte pos, into opw[off .. off + n). The file is opened and closed on every call. Returns | |
| 288 | +note the bytes read: n, fewer only when the file ends first, 0 at or after its end. Exit 70 on an | |
| 289 | +note I/O error, 2 on a bad argument; off + n over len opw traps 3. Each pread pass adds at least one | |
| 290 | +note byte or ends, so n + 1 <= 2097153 passes suffice: 3 outer passes of at most 999999 inner ones. | |
| 291 | +fn oprd ai ulong pos ulong off ulong n ulong to ulong | |
| 292 | +pl = oargp ai | |
| 293 | +fd = int fopen oarg 0 pl 0 0 | |
| 294 | +if lt fd 0 | |
| 295 | +exit 70 | |
| 296 | +end | |
| 297 | +p = ulong 0 | |
| 298 | +dn = false | |
| 299 | +for o ulong 3 | |
| 300 | +while and not dn lt p n bound 999999 | |
| 301 | +r = pread fd opw add off p sub n p long add pos p | |
| 302 | +if lt r 0 | |
| 303 | +exit 70 | |
| 304 | +end | |
| 305 | +if eq r 0 | |
| 306 | +dn = true | |
| 307 | +else | |
| 308 | +p = add p ulong r | |
| 309 | +end | |
| 310 | +end | |
| 311 | +end | |
| 312 | +if ne fclose fd 0 | |
| 313 | +exit 70 | |
| 314 | +end | |
| 315 | +ret p | |
| 316 | +end | |
| 317 | + | |
| 318 | +note v1 (CONTRACT-V1 section 7): write obm[0 .. n) (bpe.om) to the path in argv[ai] as ocwrite does: | |
| 319 | +note PATH.tmp, fsync, rename | |
| 320 | +fn obmsave ai ulong n ulong to void | |
| 321 | +pl = oargp ai | |
| 322 | +if gt pl 2000 | |
| 323 | +exit 2 | |
| 324 | +end | |
| 325 | +for i ulong pl | |
| 326 | +put opth i get oarg i | |
| 327 | +end | |
| 328 | +put opth pl 46 | |
| 329 | +put opth add pl 1 116 | |
| 330 | +put opth add pl 2 109 | |
| 331 | +put opth add pl 3 112 | |
| 332 | +fd = int fopen opth 0 add pl 4 577 420 | |
| 333 | +if lt fd 0 | |
| 334 | +exit 70 | |
| 335 | +end | |
| 336 | +p = ulong 0 | |
| 337 | +while lt p n bound 999999 | |
| 338 | +w = write fd obm p sub n p | |
| 339 | +if le w 0 | |
| 340 | +exit 70 | |
| 341 | +end | |
| 342 | +p = add p ulong w | |
| 343 | +end | |
| 344 | +if ne fsync fd 0 | |
| 345 | +exit 70 | |
| 346 | +end | |
| 347 | +if ne fclose fd 0 | |
| 348 | +exit 70 | |
| 349 | +end | |
| 350 | +ocrename pl | |
| 351 | +end |
native/omegallm/model.om
| @@ -986,6 +986,8 @@ note ogkm[0] = 0: the backward ReLU mask is the sign of this pass's own FP (ever | ||
| 986 | 986 | note gcmp2); 1: offb calls ogmask, which gpu/gg.om defines for gcmp2 (the chip's FP sign) and |
| 987 | 987 | note nogpu.om defines as a refusal on the CPU-only targets. ogkm[1] = the sequence in flight. |
| 988 | 988 | global ogkm ulong 2 |
| 989 | +note ofzlay: when > 0, obwd stops after layer ofzlay[0] and skips obwde (frozen base layers). | |
| 990 | +global ofzlay ulong 1 | |
| 989 | 991 | |
| 990 | 992 | note okv (ham/ollm-speed): the CPU decode's row reuse. okv[0] = the rows of obx row 0 whose layer |
| 991 | 993 | note activations the last ofwdi left valid, okvt[0..okv[0]) their tokens. ofwd clears okv[0]: it |
| @@ -1008,13 +1010,9 @@ ret ohead b | ||
| 1008 | 1010 | end |
| 1009 | 1011 | |
| 1010 | 1012 | note the first row ofwdi computes: the common prefix of obx row 0 and okvt, at most okv[0] and |
| 1011 | -note CT - 1 (the last row is always recomputed). 0 when any layer's activations live in the two | |
| 1012 | -note alternating windows (l >= LAA, og 38): oaflip would restore a layer's block over the rows the | |
| 1013 | -note layer before it just wrote into its HIN. | |
| 1013 | +note CT - 1 (the last row is always recomputed). Bank-B layers (l >= LAA) restore/save only their | |
| 1014 | +note K/V slices (oak/oau) in oab without touching oahin, so KV cache works identically for all L. | |
| 1014 | 1015 | fn okvlcp to ulong |
| 1015 | -if lt get og 38 get og 5 | |
| 1016 | -ret 0 | |
| 1017 | -end | |
| 1018 | 1016 | ct = get og 9 |
| 1019 | 1017 | n = get okv 0 |
| 1020 | 1018 | if ge n ct |
| @@ -1061,9 +1059,25 @@ kadd3w add oahin 0 mul t d wr pr d | ||
| 1061 | 1059 | end |
| 1062 | 1060 | end |
| 1063 | 1061 | |
| 1062 | +note Bank-B KV slice transfer for layer l >= LAA: copy rows [r0 .. r0 + cnt) of oak and oau | |
| 1063 | +note between oa and oab (to oab when fo, else from oab). Never touches oahin. | |
| 1064 | +fn okvkv l ulong r0 ulong cnt ulong fo bool to void | |
| 1065 | +la = get og 38 | |
| 1066 | +if or lt l la eq cnt 0 | |
| 1067 | +ret | |
| 1068 | +end | |
| 1069 | +d = get og 2 | |
| 1070 | +off = mul r0 d | |
| 1071 | +n = mul cnt d | |
| 1072 | +s = mul sub l la get og 14 | |
| 1073 | +oaflc add oak l off add add s oatd 3 off n fo | |
| 1074 | +oaflc add oau l off add add s oatd 4 off n fo | |
| 1075 | +end | |
| 1076 | + | |
| 1064 | 1077 | note olayf l for rows t0 .. t0 + nr - 1 |
| 1065 | 1078 | fn okvlay l ulong t0 ulong nr ulong to void |
| 1066 | 1079 | ostw l |
| 1080 | +okvkv l 0 t0 false | |
| 1067 | 1081 | for i ulong nr |
| 1068 | 1082 | olayf1 l add t0 i |
| 1069 | 1083 | end |
| @@ -1077,7 +1091,7 @@ end | ||
| 1077 | 1091 | for i3 ulong nr |
| 1078 | 1092 | olayf2 l add t0 i3 |
| 1079 | 1093 | end |
| 1080 | -oaflip l true | |
| 1094 | +okvkv l t0 nr true | |
| 1081 | 1095 | end |
| 1082 | 1096 | |
| 1083 | 1097 | note the final RMS of row CT - 1 into z (olast reads it), then okv = the CT context tokens |
| @@ -1322,13 +1336,16 @@ for t ulong ct | ||
| 1322 | 1336 | ohbwd b t sc |
| 1323 | 1337 | end |
| 1324 | 1338 | ll = get og 5 |
| 1325 | -for i ulong ll | |
| 1339 | +fl = get ofzlay 0 | |
| 1340 | +for i ulong sub ll fl | |
| 1326 | 1341 | olayb sub sub ll 1 i |
| 1327 | 1342 | end |
| 1343 | +if eq fl 0 | |
| 1328 | 1344 | for t2 ulong ct |
| 1329 | 1345 | obwde b t2 |
| 1330 | 1346 | end |
| 1331 | 1347 | end |
| 1348 | +end | |
| 1332 | 1349 | |
| 1333 | 1350 | note row t: dwte[x[t]] += DH[t]; dwpe[t] += DH[t] |
| 1334 | 1351 | fn obwde b ulong t ulong to void |
native/omegallm/spec.om
| new file mode 100644 | ||
| @@ -0,0 +1,2194 @@ | ||
| 1 | +note SPDX-License-Identifier: AGPL-3.0-only | |
| 2 | +note omegallm spec.om: Frozen-Core Specialist Training (trainf), Test-Time Fast-Weights | |
| 3 | +note (ttteval, tttsamp), and Layer-Contrastive Decoding (dolaeval). Pure seeded Omega. | |
| 4 | + | |
| 5 | +global odl1 f64 4096 | |
| 6 | +global odl2 f64 4096 | |
| 7 | +global ottt_st ulong 8 | |
| 8 | +global oens ulong 8 | |
| 9 | +global ocl_st ulong 16 | |
| 10 | +global ocl_k ulong 4 | |
| 11 | +global ocl_a0 ulong 4 | |
| 12 | +global ocl_sl ulong 4 | |
| 13 | +global ocl_wo ulong 4 | |
| 14 | +global ocl_wn ulong 4 | |
| 15 | +global ocl_w f64 4 | |
| 16 | +global ocl_ent f64 4 | |
| 17 | +global ocl_al f64 4 | |
| 18 | + | |
| 19 | +note ---- 1. Frozen-Core Residual Specialist Training ---- | |
| 20 | +note trainf CK TOKS UNTIL EVERY FREEZE_LAYERS [BATCH] | |
| 21 | +note Freezes embeddings + layers 0..FREEZE_LAYERS-1 bit-identically while training newer layers. | |
| 22 | +fn cmdtrainf to void | |
| 23 | +na = oargc | |
| 24 | +if and ne na 7 ne na 8 | |
| 25 | +exit 2 | |
| 26 | +end | |
| 27 | +ockload 2 | |
| 28 | +odopen 3 | |
| 29 | +until = oargu 4 | |
| 30 | +every = oargu 5 | |
| 31 | +flay = oargu 6 | |
| 32 | +if or eq every 0 gt flay get og 5 | |
| 33 | +exit 2 | |
| 34 | +end | |
| 35 | +if lt get odn 0 add get og 1 1 | |
| 36 | +exit 23 | |
| 37 | +end | |
| 38 | +put ottt_st 0 get og 6 | |
| 39 | +put ottt_st 1 get og 44 | |
| 40 | +if eq na 8 | |
| 41 | +nb = oargu 7 | |
| 42 | +if or eq nb 0 gt nb 64 | |
| 43 | +exit 2 | |
| 44 | +end | |
| 45 | +put og 6 nb | |
| 46 | +put og 44 1 | |
| 47 | +end | |
| 48 | +fz = add get og 31 mul flay get og 32 | |
| 49 | +put ofreeze 0 fz | |
| 50 | +put ofzlay 0 flay | |
| 51 | +put og 45 1 | |
| 52 | +st = get og 41 | |
| 53 | +while lt st until bound 999999 | |
| 54 | +ls = ostep | |
| 55 | +st = get og 41 | |
| 56 | +if or eq rem st every 0 eq st until | |
| 57 | +put og 6 get ottt_st 0 | |
| 58 | +put og 44 get ottt_st 1 | |
| 59 | +ocksave 2 | |
| 60 | +if eq na 8 | |
| 61 | +put og 6 oargu 7 | |
| 62 | +put og 44 1 | |
| 63 | +end | |
| 64 | +oputc 70 | |
| 65 | +oputc 32 | |
| 66 | +oputu st | |
| 67 | +oputc 32 | |
| 68 | +oputu flay | |
| 69 | +oputc 32 | |
| 70 | +oputl rmic ls | |
| 71 | +oputc 10 | |
| 72 | +oflush | |
| 73 | +end | |
| 74 | +end | |
| 75 | +put og 6 get ottt_st 0 | |
| 76 | +put og 44 get ottt_st 1 | |
| 77 | +put ofreeze 0 0 | |
| 78 | +put ofzlay 0 0 | |
| 79 | +end | |
| 80 | + | |
| 81 | +note ---- 2. Test-Time Fast-Weights (TTT-Omega) ---- | |
| 82 | +note Snapshot ow[fz..P) into cold store ocs[P + i] | |
| 83 | +fn ottt_snap fz ulong to void | |
| 84 | +c = ocsinit | |
| 85 | +p = get og 8 | |
| 86 | +i = fz | |
| 87 | +note at most 16777216 passes, run as aligned chunks of 524288 (2^19): the seeded omc takes a while bound | |
| 88 | +note of at most 999999. 33 chunks cover any 16777216 consecutive values of i, so no run that the | |
| 89 | +note bound 16777216 allowed is refused here. | |
| 90 | +while lt i p bound 33 | |
| 91 | +while lt i p bound 524288 | |
| 92 | +ocsp add p i owg i | |
| 93 | +i = add i 1 | |
| 94 | +if eq and i 524287 0 | |
| 95 | +break | |
| 96 | +end | |
| 97 | +end | |
| 98 | +end | |
| 99 | +end | |
| 100 | + | |
| 101 | +note Restore ow[fz..P) from cold store ocs[P + i] | |
| 102 | +fn ottt_rest fz ulong to void | |
| 103 | +p = get og 8 | |
| 104 | +i = fz | |
| 105 | +note at most 16777216 passes, run as aligned chunks of 524288 (2^19): the seeded omc takes a while bound | |
| 106 | +note of at most 999999. 33 chunks cover any 16777216 consecutive values of i, so no run that the | |
| 107 | +note bound 16777216 allowed is refused here. | |
| 108 | +while lt i p bound 33 | |
| 109 | +while lt i p bound 524288 | |
| 110 | +owp i ocsg add p i | |
| 111 | +i = add i 1 | |
| 112 | +if eq and i 524287 0 | |
| 113 | +break | |
| 114 | +end | |
| 115 | +end | |
| 116 | +end | |
| 117 | +end | |
| 118 | + | |
| 119 | +note Zero cold-store gradients ocs[0..P) | |
| 120 | +fn ottt_zg to void | |
| 121 | +p = get og 8 | |
| 122 | +i = ulong 0 | |
| 123 | +note at most 16777216 passes, run as aligned chunks of 524288 (2^19): the seeded omc takes a while bound | |
| 124 | +note of at most 999999. 33 chunks cover any 16777216 consecutive values of i, so no run that the | |
| 125 | +note bound 16777216 allowed is refused here. | |
| 126 | +while lt i p bound 33 | |
| 127 | +while lt i p bound 524288 | |
| 128 | +ocsp i 0.0f64 | |
| 129 | +i = add i 1 | |
| 130 | +if eq and i 524287 0 | |
| 131 | +break | |
| 132 | +end | |
| 133 | +end | |
| 134 | +end | |
| 135 | +end | |
| 136 | + | |
| 137 | +note One clipped SGD fast-weight step on ow[fz..P) using ocs[0..P) | |
| 138 | +fn ottt_sgd fz ulong lr f64 to void | |
| 139 | +p = get og 8 | |
| 140 | +ss = 0.0f64 | |
| 141 | +i = fz | |
| 142 | +note at most 16777216 passes, run as aligned chunks of 524288 (2^19): the seeded omc takes a while bound | |
| 143 | +note of at most 999999. 33 chunks cover any 16777216 consecutive values of i, so no run that the | |
| 144 | +note bound 16777216 allowed is refused here. | |
| 145 | +while lt i p bound 33 | |
| 146 | +while lt i p bound 524288 | |
| 147 | +g = ocsg i | |
| 148 | +ss = add ss mul g g | |
| 149 | +i = add i 1 | |
| 150 | +if eq and i 524287 0 | |
| 151 | +break | |
| 152 | +end | |
| 153 | +end | |
| 154 | +end | |
| 155 | +nr = fsqrt ss | |
| 156 | +sc = lr | |
| 157 | +if gt nr 1.0 | |
| 158 | +sc = div lr nr | |
| 159 | +end | |
| 160 | +i = fz | |
| 161 | +note at most 16777216 passes, run as aligned chunks of 524288 (2^19): the seeded omc takes a while bound | |
| 162 | +note of at most 999999. 33 chunks cover any 16777216 consecutive values of i, so no run that the | |
| 163 | +note bound 16777216 allowed is refused here. | |
| 164 | +while lt i p bound 33 | |
| 165 | +while lt i p bound 524288 | |
| 166 | +w = owg i | |
| 167 | +owp i sub w mul sc ocsg i | |
| 168 | +i = add i 1 | |
| 169 | +if eq and i 524287 0 | |
| 170 | +break | |
| 171 | +end | |
| 172 | +end | |
| 173 | +end | |
| 174 | +end | |
| 175 | + | |
| 176 | +note Evaluate suffix loss on sequence 0 over positions [pref..tt) after ofwd 0 | |
| 177 | +fn ottt_suf pref ulong tt ulong to f64 | |
| 178 | +ls = 0.0f64 | |
| 179 | +t = pref | |
| 180 | +while lt t tt bound 1024 | |
| 181 | +ls = add ls oheadr 0 t | |
| 182 | +t = add t 1 | |
| 183 | +end | |
| 184 | +ret div ls f64 sub tt pref | |
| 185 | +end | |
| 186 | + | |
| 187 | +note Run `steps` strictly-causal online gradient steps on prefix [0..pref) | |
| 188 | +fn ottt_adapt pref ulong steps ulong lr f64 fz ulong to void | |
| 189 | +put og 9 pref | |
| 190 | +put og 10 0 | |
| 191 | +sc = div 1.0f64 f64 pref | |
| 192 | +s = ulong 0 | |
| 193 | +while lt s steps bound 1024 | |
| 194 | +ottt_zg | |
| 195 | +l0 = ofwd 0 | |
| 196 | +obwd 0 sc | |
| 197 | +ottt_sgd fz lr | |
| 198 | +s = add s 1 | |
| 199 | +end | |
| 200 | +end | |
| 201 | + | |
| 202 | +note ttteval CK HELD W PREFIX STEPS LRMICRO LAYER_FROM | |
| 203 | +fn cmdttteval to void | |
| 204 | +if ne oargc 9 | |
| 205 | +exit 2 | |
| 206 | +end | |
| 207 | +ockload 2 | |
| 208 | +odopen 3 | |
| 209 | +ww = oargu 4 | |
| 210 | +pref = oargu 5 | |
| 211 | +steps = oargu 6 | |
| 212 | +lrm = oargu 7 | |
| 213 | +lfrom = oargu 8 | |
| 214 | +tt = get og 1 | |
| 215 | +if or eq ww 0 or eq pref 0 ge pref tt | |
| 216 | +exit 2 | |
| 217 | +end | |
| 218 | +if gt lfrom get og 5 | |
| 219 | +exit 2 | |
| 220 | +end | |
| 221 | +if gt ww div sub get odn 0 1 tt | |
| 222 | +exit 23 | |
| 223 | +end | |
| 224 | +fz = add get og 31 mul lfrom get og 32 | |
| 225 | +lr = div f64 lrm 1000000.0 | |
| 226 | +b_sum = 0.0f64 | |
| 227 | +t_sum = 0.0f64 | |
| 228 | +for w ulong ww | |
| 229 | +obrow 0 mul w tt | |
| 230 | +put og 9 tt | |
| 231 | +l0 = ofwd 0 | |
| 232 | +b_sum = add b_sum ottt_suf pref tt | |
| 233 | +ottt_snap fz | |
| 234 | +ottt_adapt pref steps lr fz | |
| 235 | +put og 9 tt | |
| 236 | +l1 = ofwd 0 | |
| 237 | +t_sum = add t_sum ottt_suf pref tt | |
| 238 | +ottt_rest fz | |
| 239 | +end | |
| 240 | +put og 9 tt | |
| 241 | +b_lo = div b_sum f64 ww | |
| 242 | +t_lo = div t_sum f64 ww | |
| 243 | +oputc 84 | |
| 244 | +oputc 84 | |
| 245 | +oputc 84 | |
| 246 | +oputc 32 | |
| 247 | +oputu ww | |
| 248 | +oputc 32 | |
| 249 | +oputu pref | |
| 250 | +oputc 32 | |
| 251 | +oputu steps | |
| 252 | +oputc 32 | |
| 253 | +oputu lrm | |
| 254 | +oputc 32 | |
| 255 | +oputu lfrom | |
| 256 | +oputc 32 | |
| 257 | +oputl rmic b_lo | |
| 258 | +oputc 32 | |
| 259 | +oputl rmic t_lo | |
| 260 | +oputc 32 | |
| 261 | +oputl rmic sub t_lo b_lo | |
| 262 | +oputc 10 | |
| 263 | +oflush | |
| 264 | +end | |
| 265 | + | |
| 266 | +fn ottt_prompt v ulong to void | |
| 267 | +put og 9 0 | |
| 268 | +ocpush 0 | |
| 269 | +if gt v 256 | |
| 270 | +np = obprompt 6 | |
| 271 | +for i ulong np | |
| 272 | +ocpush get obtk i | |
| 273 | +end | |
| 274 | +else | |
| 275 | +pl = oargr 6 | |
| 276 | +if lt pl 0 | |
| 277 | +exit 2 | |
| 278 | +end | |
| 279 | +for i ulong ulong pl | |
| 280 | +ocpush ulong get oarg i | |
| 281 | +end | |
| 282 | +end | |
| 283 | +end | |
| 284 | + | |
| 285 | +note tttsamp CK SEED N TEMPMILLI PROMPT MERGES STEPS LRMICRO LAYER_FROM | |
| 286 | +fn cmdtttsamp to void | |
| 287 | +if ne oargc 11 | |
| 288 | +exit 2 | |
| 289 | +end | |
| 290 | +ockload 2 | |
| 291 | +v = get og 0 | |
| 292 | +if gt v 256 | |
| 293 | +obload 7 v | |
| 294 | +end | |
| 295 | +ottt_prompt v | |
| 296 | +nc = get og 9 | |
| 297 | +fz = add get og 31 mul oargu 10 get og 32 | |
| 298 | +lr = div f64 oargu 9 1000000.0 | |
| 299 | +steps = oargu 8 | |
| 300 | +ottt_snap fz | |
| 301 | +if and gt steps 0 gt nc 1 | |
| 302 | +pref = sub nc 1 | |
| 303 | +for j ulong pref | |
| 304 | +put oby j get obx add j 1 | |
| 305 | +end | |
| 306 | +ottt_adapt pref steps lr fz | |
| 307 | +end | |
| 308 | +osampleloaded oargu 3 oargu 4 oargu 5 | |
| 309 | +ottt_rest fz | |
| 310 | +end | |
| 311 | + | |
| 312 | +note ---- 3. Layer-Contrastive Decoding (DoLa in pure Omega) ---- | |
| 313 | +note Compute log_softmax of oa[pr..pr+v) into odl1 (which=1) or odl2 (which=2) | |
| 314 | +note Note: osoft overwrites oa[pr..pr+v) with exp(x - m), so save raw logits first. | |
| 315 | +fn odl_lsm pr ulong v ulong which ulong to void | |
| 316 | +m = bitcast f64 ulong 18442240474082181120 | |
| 317 | +for j ulong v | |
| 318 | +x = get oa add pr j | |
| 319 | +m = fmax m x | |
| 320 | +if eq which 1 | |
| 321 | +put odl1 j x | |
| 322 | +else | |
| 323 | +put odl2 j x | |
| 324 | +end | |
| 325 | +end | |
| 326 | +sm = osoft pr v m | |
| 327 | +lsm = flog sm | |
| 328 | +for j ulong v | |
| 329 | +if eq which 1 | |
| 330 | +put odl1 j sub sub get odl1 j m lsm | |
| 331 | +else | |
| 332 | +put odl2 j sub sub get odl2 j m lsm | |
| 333 | +end | |
| 334 | +end | |
| 335 | +end | |
| 336 | + | |
| 337 | +fn odl_mix pr ulong v ulong beta f64 to void | |
| 338 | +for j ulong v | |
| 339 | +put oa add pr j sub get odl1 j mul beta get odl2 j | |
| 340 | +end | |
| 341 | +end | |
| 342 | + | |
| 343 | +fn odl_proj h ulong t ulong z ulong pr ulong which ulong to void | |
| 344 | +frms h get og 33 z add get og 16 t | |
| 345 | +klogit z pr get og 0 get og 2 | |
| 346 | +odl_lsm pr get og 0 which | |
| 347 | +end | |
| 348 | + | |
| 349 | +note Evaluate one row t with both baseline and DoLa (early layer el, contrast beta) | |
| 350 | +fn odl_row t ulong el ulong beta f64 to void | |
| 351 | +r = mul t get og 2 | |
| 352 | +z = add get og 17 r | |
| 353 | +pr = add get og 18 mul t get og 0 | |
| 354 | +odl_proj add get og 15 r t z pr 1 | |
| 355 | +odl_proj add oahin el r t z pr 2 | |
| 356 | +odl_mix pr get og 0 beta | |
| 357 | +y = get oby t | |
| 358 | +put odl1 0 sub 0.0f64 get odl1 y | |
| 359 | +put odl2 0 olossrow pr get og 0 y | |
| 360 | +end | |
| 361 | + | |
| 362 | +fn odl_print ww ulong el ulong bm ulong b_lo f64 d_lo f64 to void | |
| 363 | +oputc 68 | |
| 364 | +oputc 79 | |
| 365 | +oputc 76 | |
| 366 | +oputc 65 | |
| 367 | +oputc 32 | |
| 368 | +oputu ww | |
| 369 | +oputc 32 | |
| 370 | +oputu el | |
| 371 | +oputc 32 | |
| 372 | +oputu bm | |
| 373 | +oputc 32 | |
| 374 | +oputl rmic b_lo | |
| 375 | +oputc 32 | |
| 376 | +oputl rmic d_lo | |
| 377 | +oputc 32 | |
| 378 | +oputl rmic sub d_lo b_lo | |
| 379 | +oputc 10 | |
| 380 | +oflush | |
| 381 | +end | |
| 382 | + | |
| 383 | +note dolaeval CK HELD W EARLY_LAYER BETA_MILLI | |
| 384 | +fn cmddolaeval to void | |
| 385 | +if ne oargc 7 | |
| 386 | +exit 2 | |
| 387 | +end | |
| 388 | +ockload 2 | |
| 389 | +odopen 3 | |
| 390 | +ww = oargu 4 | |
| 391 | +el = oargu 5 | |
| 392 | +bm = oargu 6 | |
| 393 | +tt = get og 1 | |
| 394 | +if or eq ww 0 or eq el 0 ge el get og 5 | |
| 395 | +exit 2 | |
| 396 | +end | |
| 397 | +if gt ww div sub get odn 0 1 tt | |
| 398 | +exit 23 | |
| 399 | +end | |
| 400 | +beta = div f64 bm 1000.0 | |
| 401 | +b_sum = 0.0f64 | |
| 402 | +d_sum = 0.0f64 | |
| 403 | +for w ulong ww | |
| 404 | +obrow 0 mul w tt | |
| 405 | +put og 9 tt | |
| 406 | +l0 = ofwd 0 | |
| 407 | +for t ulong tt | |
| 408 | +odl_row t el beta | |
| 409 | +b_sum = add b_sum get odl1 0 | |
| 410 | +d_sum = add d_sum get odl2 0 | |
| 411 | +end | |
| 412 | +end | |
| 413 | +tot = f64 mul ww tt | |
| 414 | +odl_print ww el bm div b_sum tot div d_sum tot | |
| 415 | +end | |
| 416 | + | |
| 417 | + | |
| 418 | +note ---- 4. Swappable Specialist Layer Packs (OLLMSP01) ---- | |
| 419 | +const OSPMAG ulong 3544421225449933903 | |
| 420 | + | |
| 421 | +note FNV-1a 64 over shapes (V,T,D,H,F,base_L) + frozen base weights ow[0..fz) | |
| 422 | +fn osp_fnvu h ulong v ulong to ulong | |
| 423 | +x = h | |
| 424 | +for k ulong 8 | |
| 425 | +b = and shr v mul k 8 255 | |
| 426 | +x = mul xor x b 1099511628211 | |
| 427 | +end | |
| 428 | +ret x | |
| 429 | +end | |
| 430 | + | |
| 431 | +fn osp_basehash bl ulong fz ulong to ulong | |
| 432 | +h = ulong 14695981039346656037 | |
| 433 | +h = osp_fnvu h get og 0 | |
| 434 | +h = osp_fnvu h get og 1 | |
| 435 | +h = osp_fnvu h get og 2 | |
| 436 | +h = osp_fnvu h get og 3 | |
| 437 | +h = osp_fnvu h get og 4 | |
| 438 | +h = osp_fnvu h bl | |
| 439 | +i = ulong 0 | |
| 440 | +note at most 33554432 passes, run as aligned chunks of 524288 (2^19): the seeded omc takes a while bound | |
| 441 | +note of at most 999999. 65 chunks cover any 33554432 consecutive values of i, so no run that the | |
| 442 | +note bound 33554432 allowed is refused here. | |
| 443 | +while lt i fz bound 65 | |
| 444 | +while lt i fz bound 524288 | |
| 445 | +h = osp_fnvu h bitcast ulong owg i | |
| 446 | +i = add i 1 | |
| 447 | +if eq and i 524287 0 | |
| 448 | +break | |
| 449 | +end | |
| 450 | +end | |
| 451 | +end | |
| 452 | +ret h | |
| 453 | +end | |
| 454 | + | |
| 455 | +note Stream ow[fz..fz+nspec) to open pack file starting at offset 48; returns payload FNV-1a 64 | |
| 456 | +fn osp_wrpay fz ulong nspec ulong to ulong | |
| 457 | +h = ulong 14695981039346656037 | |
| 458 | +pos = ulong 48 | |
| 459 | +done = ulong 0 | |
| 460 | +while lt done nspec bound 1024 | |
| 461 | +cnt = sub nspec done | |
| 462 | +if gt cnt OCKC | |
| 463 | +cnt = OCKC | |
| 464 | +end | |
| 465 | +for j ulong cnt | |
| 466 | +ocput8 mul j 8 bitcast ulong owg add fz add done j | |
| 467 | +end | |
| 468 | +nb = mul cnt 8 | |
| 469 | +h = ocfnvk h nb | |
| 470 | +ocwput pos nb | |
| 471 | +pos = add pos nb | |
| 472 | +done = add done cnt | |
| 473 | +end | |
| 474 | +ret h | |
| 475 | +end | |
| 476 | + | |
| 477 | +note Stream nspec f64s from arg ai at offset 48 into ow[fz..fz+nspec); returns payload FNV-1a 64 | |
| 478 | +fn osp_rdpay ai ulong fz ulong nspec ulong to ulong | |
| 479 | +h = ulong 14695981039346656037 | |
| 480 | +pos = ulong 48 | |
| 481 | +done = ulong 0 | |
| 482 | +while lt done nspec bound 1024 | |
| 483 | +cnt = sub nspec done | |
| 484 | +if gt cnt OCKC | |
| 485 | +cnt = OCKC | |
| 486 | +end | |
| 487 | +nb = mul cnt 8 | |
| 488 | +if ne oprd ai pos 0 nb nb | |
| 489 | +exit 60 | |
| 490 | +end | |
| 491 | +h = ocfnvw h nb | |
| 492 | +for j ulong cnt | |
| 493 | +owp add fz add done j bitcast f64 opw8 mul j 8 | |
| 494 | +end | |
| 495 | +pos = add pos nb | |
| 496 | +done = add done cnt | |
| 497 | +end | |
| 498 | +ret h | |
| 499 | +end | |
| 500 | + | |
| 501 | +note spext BASE.ck SPEC.ck PACK.sp: verify frozen base bit-identical, write OLLMSP01 specialist pack | |
| 502 | +fn cmdspext to void | |
| 503 | +if ne oargc 5 | |
| 504 | +exit 2 | |
| 505 | +end | |
| 506 | +ockload 2 | |
| 507 | +bl = get og 5 | |
| 508 | +fz = get og 33 | |
| 509 | +bh = osp_basehash bl fz | |
| 510 | +put ottt_st 0 get og 0 | |
| 511 | +put ottt_st 1 get og 1 | |
| 512 | +put ottt_st 2 get og 2 | |
| 513 | +put ottt_st 3 get og 3 | |
| 514 | +put ottt_st 4 get og 4 | |
| 515 | +put ottt_st 5 bl | |
| 516 | +put ottt_st 6 fz | |
| 517 | +put ottt_st 7 bh | |
| 518 | +ockload 3 | |
| 519 | +for k ulong 5 | |
| 520 | +if ne get og k get ottt_st k | |
| 521 | +exit 62 | |
| 522 | +end | |
| 523 | +end | |
| 524 | +if le get og 5 get ottt_st 5 | |
| 525 | +exit 62 | |
| 526 | +end | |
| 527 | +if ne osp_basehash get ottt_st 5 get ottt_st 6 get ottt_st 7 | |
| 528 | +exit 62 | |
| 529 | +end | |
| 530 | +nspec = sub get og 8 get ottt_st 6 | |
| 531 | +ocwopen 4 | |
| 532 | +ph = osp_wrpay get ottt_st 6 nspec | |
| 533 | +ocput8 0 OSPMAG | |
| 534 | +ocput8 8 get ottt_st 5 | |
| 535 | +ocput8 16 get og 5 | |
| 536 | +ocput8 24 get ottt_st 7 | |
| 537 | +ocput8 32 nspec | |
| 538 | +ocput8 40 ph | |
| 539 | +ocwput 0 48 | |
| 540 | +ocwend 4 | |
| 541 | +oputc 83 | |
| 542 | +oputc 80 | |
| 543 | +oputc 69 | |
| 544 | +oputc 88 | |
| 545 | +oputc 84 | |
| 546 | +oputc 32 | |
| 547 | +oputu get ottt_st 5 | |
| 548 | +oputc 32 | |
| 549 | +oputu get og 5 | |
| 550 | +oputc 32 | |
| 551 | +oputu nspec | |
| 552 | +oputc 10 | |
| 553 | +oflush | |
| 554 | +end | |
| 555 | + | |
| 556 | +fn osp_rdhdr ai ulong bl ulong bh ulong to void | |
| 557 | +sz = ofsz ai | |
| 558 | +if lt sz 48 | |
| 559 | +exit 60 | |
| 560 | +end | |
| 561 | +if ne oprd ai 0 0 48 48 | |
| 562 | +exit 60 | |
| 563 | +end | |
| 564 | +if ne opw8 0 OSPMAG | |
| 565 | +exit 60 | |
| 566 | +end | |
| 567 | +if ne opw8 8 bl | |
| 568 | +exit 62 | |
| 569 | +end | |
| 570 | +if le opw8 16 bl | |
| 571 | +exit 62 | |
| 572 | +end | |
| 573 | +if ne opw8 24 bh | |
| 574 | +exit 62 | |
| 575 | +end | |
| 576 | +nspec = opw8 32 | |
| 577 | +if ne sz add 48 mul nspec 8 | |
| 578 | +exit 60 | |
| 579 | +end | |
| 580 | +put ottt_st 1 opw8 16 | |
| 581 | +put ottt_st 3 nspec | |
| 582 | +put ottt_st 4 opw8 40 | |
| 583 | +end | |
| 584 | + | |
| 585 | +note Shared helper: verify base & pack hashes, attach specialist layers onto base in memory | |
| 586 | +fn osp_attach bkai ulong pkai ulong to void | |
| 587 | +ockload bkai | |
| 588 | +put ottt_st 0 get og 5 | |
| 589 | +put ottt_st 2 get og 33 | |
| 590 | +osp_rdhdr pkai get ottt_st 0 osp_basehash get ottt_st 0 get ottt_st 2 | |
| 591 | +ogrowsnap get og 8 | |
| 592 | +put og 5 get ottt_st 1 | |
| 593 | +if not ogeom | |
| 594 | +exit 12 | |
| 595 | +end | |
| 596 | +if ne sub get og 8 get ottt_st 2 get ottt_st 3 | |
| 597 | +exit 62 | |
| 598 | +end | |
| 599 | +ozerom mul 2 get og 8 | |
| 600 | +ogrowcopy get ottt_st 2 | |
| 601 | +if ne osp_rdpay pkai get ottt_st 2 get ottt_st 3 get ottt_st 4 | |
| 602 | +exit 61 | |
| 603 | +end | |
| 604 | +end | |
| 605 | + | |
| 606 | +note spapp BASE.ck PACK.sp OUT.ck: verify base & pack hashes, attach specialist layers onto base | |
| 607 | +fn cmdspapp to void | |
| 608 | +if ne oargc 5 | |
| 609 | +exit 2 | |
| 610 | +end | |
| 611 | +osp_attach 2 3 | |
| 612 | +ocksave 4 | |
| 613 | +oputc 83 | |
| 614 | +oputc 80 | |
| 615 | +oputc 65 | |
| 616 | +oputc 80 | |
| 617 | +oputc 80 | |
| 618 | +oputc 32 | |
| 619 | +oputu get ottt_st 0 | |
| 620 | +oputc 32 | |
| 621 | +oputu get ottt_st 1 | |
| 622 | +oputc 32 | |
| 623 | +oputu get ottt_st 3 | |
| 624 | +oputc 10 | |
| 625 | +oflush | |
| 626 | +end | |
| 627 | + | |
| 628 | +note spsamp BASE.ck PACK.sp N TEMPMILLI PROMPT SEED [MERGES] | |
| 629 | +note Attach specialist pack in memory (no 403 MB temp checkpoint) and sample from PROMPT (argv[6]) | |
| 630 | +fn cmdspsamp to void | |
| 631 | +na = oargc | |
| 632 | +if and ne na 8 ne na 9 | |
| 633 | +exit 2 | |
| 634 | +end | |
| 635 | +osp_attach 2 3 | |
| 636 | +nn = oargu 4 | |
| 637 | +if gt nn 999999 | |
| 638 | +exit 2 | |
| 639 | +end | |
| 640 | +tm = oargu 5 | |
| 641 | +st = oargu 7 | |
| 642 | +v = get og 0 | |
| 643 | +if gt v 256 | |
| 644 | +if eq na 8 | |
| 645 | +exit 2 | |
| 646 | +end | |
| 647 | +obload 8 v | |
| 648 | +end | |
| 649 | +ochipup | |
| 650 | +osampleloaded st nn tm | |
| 651 | +end | |
| 652 | + | |
| 653 | +note speval BASE.ck PACK.sp HELD W [MERGES] | |
| 654 | +note Attach specialist pack in memory and evaluate W windows on HELD | |
| 655 | +fn cmdspeval to void | |
| 656 | +na = oargc | |
| 657 | +if and ne na 6 ne na 7 | |
| 658 | +exit 2 | |
| 659 | +end | |
| 660 | +osp_attach 2 3 | |
| 661 | +ww = oargu 5 | |
| 662 | +v = get og 0 | |
| 663 | +if gt v 256 | |
| 664 | +if eq na 6 | |
| 665 | +exit 2 | |
| 666 | +end | |
| 667 | +obload 6 v | |
| 668 | +end | |
| 669 | +odopen 4 | |
| 670 | +tt = get og 1 | |
| 671 | +m = get odn 0 | |
| 672 | +if eq ww 0 | |
| 673 | +exit 23 | |
| 674 | +end | |
| 675 | +if gt ww div sub m 1 tt | |
| 676 | +exit 23 | |
| 677 | +end | |
| 678 | +ls = 0.0f64 | |
| 679 | +nb = ulong 0 | |
| 680 | +for w ulong ww | |
| 681 | +obrow 0 mul w tt | |
| 682 | +ls = add ls ofwd 0 | |
| 683 | +if gt v 256 | |
| 684 | +nb = add nb oevnb tt | |
| 685 | +end | |
| 686 | +end | |
| 687 | +lo = div ls f64 ww | |
| 688 | +bp = div lo 0.6931471805599453 | |
| 689 | +if gt v 256 | |
| 690 | +bp = div mul bp f64 mul ww tt f64 nb | |
| 691 | +end | |
| 692 | +oputc 69 | |
| 693 | +oputc 32 | |
| 694 | +oputu get og 41 | |
| 695 | +oputc 32 | |
| 696 | +oputu ww | |
| 697 | +oputc 32 | |
| 698 | +oputl rmic lo | |
| 699 | +oputc 32 | |
| 700 | +oputl rmic bp | |
| 701 | +oputc 10 | |
| 702 | +oflush | |
| 703 | +end | |
| 704 | + | |
| 705 | +note ---- 5. Frozen-Base Hidden-State Cache (OLLMFH01: fcache, trainfc) ---- | |
| 706 | +const OFHMAG ulong 3544412373522336847 | |
| 707 | + | |
| 708 | +note Write oa[src .. src + n) as little-endian f64s starting at file offset pos; returns new pos | |
| 709 | +fn ofh_wroa pos ulong src ulong n ulong to ulong | |
| 710 | +done = ulong 0 | |
| 711 | +while lt done n bound 1024 | |
| 712 | +cnt = sub n done | |
| 713 | +if gt cnt OCKC | |
| 714 | +cnt = OCKC | |
| 715 | +end | |
| 716 | +for j ulong cnt | |
| 717 | +ocput8 mul j 8 bitcast ulong get oa add src add done j | |
| 718 | +end | |
| 719 | +nb = mul cnt 8 | |
| 720 | +ocwput pos nb | |
| 721 | +pos = add pos nb | |
| 722 | +done = add done cnt | |
| 723 | +end | |
| 724 | +ret pos | |
| 725 | +end | |
| 726 | + | |
| 727 | +note Run frozen base on window starting at token offset o, apply optional mask mkai, write to cache | |
| 728 | +fn ofh_win mkai ulong o ulong pos ulong to ulong | |
| 729 | +tt = get og 1 | |
| 730 | +bl = get og 5 | |
| 731 | +obrow 0 o | |
| 732 | +if ne mkai 0 | |
| 733 | +if ne oprd mkai add o 1 0 tt tt | |
| 734 | +exit 70 | |
| 735 | +end | |
| 736 | +for tm ulong tt | |
| 737 | +if eq get opw tm 0 | |
| 738 | +put oby tm or get oby tm 65536 | |
| 739 | +end | |
| 740 | +end | |
| 741 | +end | |
| 742 | +put okv 0 0 | |
| 743 | +put ogkm 1 0 | |
| 744 | +oemb 0 | |
| 745 | +for l ulong bl | |
| 746 | +olayf l | |
| 747 | +end | |
| 748 | +for t ulong tt | |
| 749 | +ocput8 mul t 8 get oby t | |
| 750 | +end | |
| 751 | +ocwput pos mul tt 8 | |
| 752 | +pos = add pos mul tt 8 | |
| 753 | +ret ofh_wroa pos get og 15 mul tt get og 2 | |
| 754 | +end | |
| 755 | + | |
| 756 | +note fcache / fcachem shared driver | |
| 757 | +fn ofh_run bkai ulong tkai ulong mkai ulong ww ulong outai ulong to void | |
| 758 | +ockload bkai | |
| 759 | +odopen tkai | |
| 760 | +tt = get og 1 | |
| 761 | +bl = get og 5 | |
| 762 | +if or eq ww 0 gt ww div sub get odn 0 1 tt | |
| 763 | +exit 23 | |
| 764 | +end | |
| 765 | +if gt add tt mul tt get og 2 262144 | |
| 766 | +exit 12 | |
| 767 | +end | |
| 768 | +if ne mkai 0 | |
| 769 | +if ne ofsz mkai get odn 0 | |
| 770 | +exit 21 | |
| 771 | +end | |
| 772 | +end | |
| 773 | +bh = osp_basehash bl get og 33 | |
| 774 | +ocwopen outai | |
| 775 | +ocput8 0 OFHMAG | |
| 776 | +ocput8 8 ww | |
| 777 | +ocput8 16 tt | |
| 778 | +ocput8 24 get og 2 | |
| 779 | +ocput8 32 bl | |
| 780 | +ocput8 40 bh | |
| 781 | +ocwput 0 48 | |
| 782 | +pos = ulong 48 | |
| 783 | +put og 9 tt | |
| 784 | +for w ulong ww | |
| 785 | +pos = ofh_win mkai mul w tt pos | |
| 786 | +end | |
| 787 | +ocwend outai | |
| 788 | +oputc 70 | |
| 789 | +oputc 67 | |
| 790 | +oputc 65 | |
| 791 | +oputc 67 | |
| 792 | +oputc 72 | |
| 793 | +oputc 69 | |
| 794 | +oputc 32 | |
| 795 | +oputu ww | |
| 796 | +oputc 32 | |
| 797 | +oputu tt | |
| 798 | +oputc 32 | |
| 799 | +oputu get og 2 | |
| 800 | +oputc 32 | |
| 801 | +oputu bl | |
| 802 | +oputc 10 | |
| 803 | +oflush | |
| 804 | +end | |
| 805 | + | |
| 806 | +fn cmdfcache to void | |
| 807 | +if ne oargc 6 | |
| 808 | +exit 2 | |
| 809 | +end | |
| 810 | +ofh_run 2 3 0 oargu 4 5 | |
| 811 | +end | |
| 812 | + | |
| 813 | +note fcachem BASE.ck TOKS MASK W OUT.hc (MASK: 1 byte per token; 0 masks loss at target y[t]) | |
| 814 | +fn cmdfcachem to void | |
| 815 | +if ne oargc 7 | |
| 816 | +exit 2 | |
| 817 | +end | |
| 818 | +ofh_run 2 3 4 oargu 5 6 | |
| 819 | +end | |
| 820 | + | |
| 821 | +note Read and verify OLLMFH01 header at arg ai; stores W in ottt_st[2], rec_bytes in ottt_st[3] | |
| 822 | +fn ofh_rdhdr ai ulong flay ulong bh ulong to void | |
| 823 | +sz = ofsz ai | |
| 824 | +if lt sz 48 | |
| 825 | +exit 60 | |
| 826 | +end | |
| 827 | +if ne oprd ai 0 0 48 48 | |
| 828 | +exit 60 | |
| 829 | +end | |
| 830 | +if ne opw8 0 OFHMAG | |
| 831 | +exit 60 | |
| 832 | +end | |
| 833 | +ww = opw8 8 | |
| 834 | +if eq ww 0 | |
| 835 | +exit 60 | |
| 836 | +end | |
| 837 | +tt = get og 1 | |
| 838 | +dd = get og 2 | |
| 839 | +if ne opw8 16 tt | |
| 840 | +exit 62 | |
| 841 | +end | |
| 842 | +if ne opw8 24 dd | |
| 843 | +exit 62 | |
| 844 | +end | |
| 845 | +if ne opw8 32 flay | |
| 846 | +exit 62 | |
| 847 | +end | |
| 848 | +if ne opw8 40 bh | |
| 849 | +exit 62 | |
| 850 | +end | |
| 851 | +rec = mul add tt mul tt dd 8 | |
| 852 | +if gt rec 2097152 | |
| 853 | +exit 12 | |
| 854 | +end | |
| 855 | +if ne sz add 48 mul ww rec | |
| 856 | +exit 60 | |
| 857 | +end | |
| 858 | +put ottt_st 2 ww | |
| 859 | +put ottt_st 3 rec | |
| 860 | +end | |
| 861 | + | |
| 862 | +note Load cached window w from arg ai into oby[0..T) and oa[oahin(flay)..+T*D) | |
| 863 | +fn ofh_load ai ulong w ulong flay ulong to void | |
| 864 | +tt = get og 1 | |
| 865 | +td = mul tt get og 2 | |
| 866 | +rec = get ottt_st 3 | |
| 867 | +pos = add 48 mul w rec | |
| 868 | +if ne oprd ai pos 0 rec rec | |
| 869 | +exit 60 | |
| 870 | +end | |
| 871 | +for t ulong tt | |
| 872 | +put oby t opw8 mul t 8 | |
| 873 | +end | |
| 874 | +dst = oahin flay | |
| 875 | +off = mul tt 8 | |
| 876 | +for i ulong td | |
| 877 | +put oa add dst i bitcast f64 opw8 add off mul i 8 | |
| 878 | +end | |
| 879 | +end | |
| 880 | + | |
| 881 | +note Masked head forward + backward over unmasked positions (oby[t] < 65536). | |
| 882 | +note When all T positions are unmasked, matches ohead 0 + obwd 0 sc bit-for-bit. | |
| 883 | +fn ofh_hb flay ulong b ulong bb ulong to void | |
| 884 | +ct = get og 9 | |
| 885 | +mc = ulong 0 | |
| 886 | +ls = 0.0f64 | |
| 887 | +for t ulong ct | |
| 888 | +if lt get oby t 65536 | |
| 889 | +ls = add ls oheadr 0 t | |
| 890 | +mc = add mc 1 | |
| 891 | +end | |
| 892 | +end | |
| 893 | +if eq mc 0 | |
| 894 | +put olos b 0.0f64 | |
| 895 | +ret | |
| 896 | +end | |
| 897 | +put olos b div ls f64 mc | |
| 898 | +sc = div 1.0f64 f64 mul mc bb | |
| 899 | +ozero get og 19 mul ct get og 2 | |
| 900 | +for t2 ulong ct | |
| 901 | +if lt get oby t2 65536 | |
| 902 | +ohbwd 0 t2 sc | |
| 903 | +end | |
| 904 | +end | |
| 905 | +ll = get og 5 | |
| 906 | +for i ulong sub ll flay | |
| 907 | +olayb sub sub ll 1 i | |
| 908 | +end | |
| 909 | +end | |
| 910 | + | |
| 911 | +note Forward+backward of one cached window w for batch slot b | |
| 912 | +fn ofh_one ai ulong w ulong flay ulong b ulong bb ulong to void | |
| 913 | +ofh_load ai w flay | |
| 914 | +put okv 0 0 | |
| 915 | +put ogkm 1 0 | |
| 916 | +nl = sub get og 5 flay | |
| 917 | +for j ulong nl | |
| 918 | +olayf add flay j | |
| 919 | +end | |
| 920 | +ofh_hb flay b bb | |
| 921 | +end | |
| 922 | + | |
| 923 | +note One cached frozen-core step: skips embeddings + layers 0..flay-1 completely | |
| 924 | +fn ofh_step ai ulong flay ulong to f64 | |
| 925 | +s = get og 41 | |
| 926 | +bb = get og 6 | |
| 927 | +p = get og 8 | |
| 928 | +put og 9 get og 1 | |
| 929 | +put og 10 p | |
| 930 | +ozerog p p | |
| 931 | +for b ulong bb | |
| 932 | +idx = add mul s bb b | |
| 933 | +w = rem smx xor get og 40 mul idx 11400714819323198485 get ottt_st 2 | |
| 934 | +ofh_one ai w flay b bb | |
| 935 | +end | |
| 936 | +put og 10 0 | |
| 937 | +ogfold true | |
| 938 | +ls = olsum | |
| 939 | +oadam | |
| 940 | +put og 41 add s 1 | |
| 941 | +ret ls | |
| 942 | +end | |
| 943 | + | |
| 944 | +note trainfc CK CACHE.hc UNTIL EVERY FREEZE_LAYERS [BATCH] | |
| 945 | +fn cmdtrainfc to void | |
| 946 | +na = oargc | |
| 947 | +if and ne na 7 ne na 8 | |
| 948 | +exit 2 | |
| 949 | +end | |
| 950 | +ockload 2 | |
| 951 | +until = oargu 4 | |
| 952 | +every = oargu 5 | |
| 953 | +flay = oargu 6 | |
| 954 | +if or eq every 0 ge flay get og 5 | |
| 955 | +exit 2 | |
| 956 | +end | |
| 957 | +fz = add get og 31 mul flay get og 32 | |
| 958 | +ofh_rdhdr 3 flay osp_basehash flay fz | |
| 959 | +put ottt_st 0 get og 6 | |
| 960 | +put ottt_st 1 get og 44 | |
| 961 | +if eq na 8 | |
| 962 | +nb = oargu 7 | |
| 963 | +if or eq nb 0 gt nb 64 | |
| 964 | +exit 2 | |
| 965 | +end | |
| 966 | +put og 6 nb | |
| 967 | +put og 44 1 | |
| 968 | +end | |
| 969 | +put ofreeze 0 fz | |
| 970 | +put ofzlay 0 flay | |
| 971 | +put og 45 1 | |
| 972 | +st = get og 41 | |
| 973 | +while lt st until bound 999999 | |
| 974 | +ls = ofh_step 3 flay | |
| 975 | +st = get og 41 | |
| 976 | +if or eq rem st every 0 eq st until | |
| 977 | +put og 6 get ottt_st 0 | |
| 978 | +put og 44 get ottt_st 1 | |
| 979 | +ocksave 2 | |
| 980 | +if eq na 8 | |
| 981 | +put og 6 oargu 7 | |
| 982 | +put og 44 1 | |
| 983 | +end | |
| 984 | +oputc 70 | |
| 985 | +oputc 67 | |
| 986 | +oputc 32 | |
| 987 | +oputu st | |
| 988 | +oputc 32 | |
| 989 | +oputu flay | |
| 990 | +oputc 32 | |
| 991 | +oputl rmic ls | |
| 992 | +oputc 10 | |
| 993 | +oflush | |
| 994 | +end | |
| 995 | +end | |
| 996 | +put og 6 get ottt_st 0 | |
| 997 | +put og 44 get ottt_st 1 | |
| 998 | +put ofreeze 0 0 | |
| 999 | +put ofzlay 0 0 | |
| 1000 | +end | |
| 1001 | + | |
| 1002 | +note ---- 6. Pure-Omega Specialist Fusion (spmerge, spstack) ---- | |
| 1003 | + | |
| 1004 | +note Stream ns f64s from arg ai at offset 48 into ocs[dst .. dst + ns); returns payload FNV-1a 64 | |
| 1005 | +fn osp_rd2c ai ulong dst ulong ns ulong to ulong | |
| 1006 | +h = ulong 14695981039346656037 | |
| 1007 | +pos = ulong 48 | |
| 1008 | +done = ulong 0 | |
| 1009 | +while lt done ns bound 1024 | |
| 1010 | +cnt = sub ns done | |
| 1011 | +if gt cnt OCKC | |
| 1012 | +cnt = OCKC | |
| 1013 | +end | |
| 1014 | +nb = mul cnt 8 | |
| 1015 | +if ne oprd ai pos 0 nb nb | |
| 1016 | +exit 60 | |
| 1017 | +end | |
| 1018 | +h = ocfnvw h nb | |
| 1019 | +for j ulong cnt | |
| 1020 | +ocsp add dst add done j bitcast f64 opw8 mul j 8 | |
| 1021 | +end | |
| 1022 | +pos = add pos nb | |
| 1023 | +done = add done cnt | |
| 1024 | +end | |
| 1025 | +ret h | |
| 1026 | +end | |
| 1027 | + | |
| 1028 | +note Load and verify pack payload from arg ai into ocs[dst .. dst + nspec); exits 60/61/62 on error | |
| 1029 | +fn osp_rd2ocs ai ulong dst ulong bl ulong bh ulong wantl ulong to ulong | |
| 1030 | +osp_rdhdr ai bl bh | |
| 1031 | +sl = get ottt_st 1 | |
| 1032 | +if and ne wantl 0 ne sl wantl | |
| 1033 | +exit 62 | |
| 1034 | +end | |
| 1035 | +if ne osp_rd2c ai dst get ottt_st 3 get ottt_st 4 | |
| 1036 | +exit 61 | |
| 1037 | +end | |
| 1038 | +ret sl | |
| 1039 | +end | |
| 1040 | + | |
| 1041 | +note Write OLLMSP01 pack at arg outai from ow[fz .. fz + ns) with header (bl, sl, bh, ns) | |
| 1042 | +fn osp_wrpack outai ulong bl ulong sl ulong bh ulong fz ulong ns ulong to void | |
| 1043 | +ocwopen outai | |
| 1044 | +ph = osp_wrpay fz ns | |
| 1045 | +ocput8 0 OSPMAG | |
| 1046 | +ocput8 8 bl | |
| 1047 | +ocput8 16 sl | |
| 1048 | +ocput8 24 bh | |
| 1049 | +ocput8 32 ns | |
| 1050 | +ocput8 40 ph | |
| 1051 | +ocwput 0 48 | |
| 1052 | +ocwend outai | |
| 1053 | +end | |
| 1054 | + | |
| 1055 | +note Compute exact grow initial weights W_0 for L=sl into ocs[0 .. ns) | |
| 1056 | +fn osp_init0 bl ulong sl ulong fz ulong ns ulong to void | |
| 1057 | +c = ocsinit | |
| 1058 | +ogrowsnap get og 8 | |
| 1059 | +put og 5 sl | |
| 1060 | +if not ogeom | |
| 1061 | +exit 12 | |
| 1062 | +end | |
| 1063 | +oinit | |
| 1064 | +ogrowcopy fz | |
| 1065 | +for j ulong get og 2 | |
| 1066 | +owp add get og 33 j ocsg add fz j | |
| 1067 | +end | |
| 1068 | +ogrowsilent bl | |
| 1069 | +i = ulong 0 | |
| 1070 | +note at most 16777216 passes, run as aligned chunks of 524288 (2^19): the seeded omc takes a while bound | |
| 1071 | +note of at most 999999. 33 chunks cover any 16777216 consecutive values of i, so no run that the | |
| 1072 | +note bound 16777216 allowed is refused here. | |
| 1073 | +while lt i ns bound 33 | |
| 1074 | +while lt i ns bound 524288 | |
| 1075 | +ocsp i owg add fz i | |
| 1076 | +i = add i 1 | |
| 1077 | +if eq and i 524287 0 | |
| 1078 | +break | |
| 1079 | +end | |
| 1080 | +end | |
| 1081 | +end | |
| 1082 | +end | |
| 1083 | + | |
| 1084 | +note Mode 0: weighted linear soup | |
| 1085 | +fn osp_m0 kk ulong fz ulong ns ulong to void | |
| 1086 | +sw = 0.0f64 | |
| 1087 | +for k ulong kk | |
| 1088 | +sw = add sw get odl1 k | |
| 1089 | +end | |
| 1090 | +if le sw 0.0 | |
| 1091 | +exit 2 | |
| 1092 | +end | |
| 1093 | +i = ulong 0 | |
| 1094 | +note at most 16777216 passes, run as aligned chunks of 524288 (2^19): the seeded omc takes a while bound | |
| 1095 | +note of at most 999999. 33 chunks cover any 16777216 consecutive values of i, so no run that the | |
| 1096 | +note bound 16777216 allowed is refused here. | |
| 1097 | +while lt i ns bound 33 | |
| 1098 | +while lt i ns bound 524288 | |
| 1099 | +acc = 0.0f64 | |
| 1100 | +for k2 ulong kk | |
| 1101 | +acc = add acc mul get odl1 k2 ocsg add mul add k2 1 ns i | |
| 1102 | +end | |
| 1103 | +owp add fz i div acc sw | |
| 1104 | +i = add i 1 | |
| 1105 | +if eq and i 524287 0 | |
| 1106 | +break | |
| 1107 | +end | |
| 1108 | +end | |
| 1109 | +end | |
| 1110 | +end | |
| 1111 | + | |
| 1112 | +note Mode 1: task-arithmetic sum over exact grow init W_0 | |
| 1113 | +fn osp_m1 kk ulong fz ulong ns ulong to void | |
| 1114 | +i = ulong 0 | |
| 1115 | +note at most 16777216 passes, run as aligned chunks of 524288 (2^19): the seeded omc takes a while bound | |
| 1116 | +note of at most 999999. 33 chunks cover any 16777216 consecutive values of i, so no run that the | |
| 1117 | +note bound 16777216 allowed is refused here. | |
| 1118 | +while lt i ns bound 33 | |
| 1119 | +while lt i ns bound 524288 | |
| 1120 | +w0 = ocsg i | |
| 1121 | +acc = w0 | |
| 1122 | +for k ulong kk | |
| 1123 | +d = sub ocsg add mul add k 1 ns i w0 | |
| 1124 | +acc = add acc mul get odl1 k d | |
| 1125 | +end | |
| 1126 | +owp add fz i acc | |
| 1127 | +i = add i 1 | |
| 1128 | +if eq and i 524287 0 | |
| 1129 | +break | |
| 1130 | +end | |
| 1131 | +end | |
| 1132 | +end | |
| 1133 | +end | |
| 1134 | + | |
| 1135 | +note Compute TIES RMS threshold 0.5*rms(W_k - W_0) into odl2[k] | |
| 1136 | +fn osp_ties_tau kk ulong ns ulong to void | |
| 1137 | +for k ulong kk | |
| 1138 | +ss = 0.0f64 | |
| 1139 | +off = mul add k 1 ns | |
| 1140 | +i = ulong 0 | |
| 1141 | +note at most 16777216 passes, run as aligned chunks of 524288 (2^19): the seeded omc takes a while bound | |
| 1142 | +note of at most 999999. 33 chunks cover any 16777216 consecutive values of i, so no run that the | |
| 1143 | +note bound 16777216 allowed is refused here. | |
| 1144 | +while lt i ns bound 33 | |
| 1145 | +while lt i ns bound 524288 | |
| 1146 | +d = sub ocsg add off i ocsg i | |
| 1147 | +ss = add ss mul d d | |
| 1148 | +i = add i 1 | |
| 1149 | +if eq and i 524287 0 | |
| 1150 | +break | |
| 1151 | +end | |
| 1152 | +end | |
| 1153 | +end | |
| 1154 | +put odl2 k mul 0.5 fsqrt div ss f64 ns | |
| 1155 | +end | |
| 1156 | +end | |
| 1157 | + | |
| 1158 | +note Elect TIES sign at i: 0=none, 1=pos, 2=neg | |
| 1159 | +fn osp_m2_sg kk ulong ns ulong i ulong to ulong | |
| 1160 | +w0 = ocsg i | |
| 1161 | +ps = 0.0f64 | |
| 1162 | +ng = 0.0f64 | |
| 1163 | +for k ulong kk | |
| 1164 | +d = sub ocsg add mul add k 1 ns i w0 | |
| 1165 | +if ge fabs d get odl2 k | |
| 1166 | +if gt d 0.0 | |
| 1167 | +ps = add ps mul get odl1 k d | |
| 1168 | +else | |
| 1169 | +ng = add ng mul get odl1 k sub 0.0f64 d | |
| 1170 | +end | |
| 1171 | +end | |
| 1172 | +end | |
| 1173 | +if and eq ps 0.0 eq ng 0.0 | |
| 1174 | +ret 0 | |
| 1175 | +end | |
| 1176 | +if ge ps ng | |
| 1177 | +ret 1 | |
| 1178 | +end | |
| 1179 | +ret 2 | |
| 1180 | +end | |
| 1181 | + | |
| 1182 | +note Mode 2: TIES trimmed sign-consensus merge at parameter index i | |
| 1183 | +fn osp_m2_i kk ulong ns ulong i ulong to f64 | |
| 1184 | +sg = osp_m2_sg kk ns i | |
| 1185 | +w0 = ocsg i | |
| 1186 | +if eq sg 0 | |
| 1187 | +ret w0 | |
| 1188 | +end | |
| 1189 | +num = 0.0f64 | |
| 1190 | +den = 0.0f64 | |
| 1191 | +for k ulong kk | |
| 1192 | +d = sub ocsg add mul add k 1 ns i w0 | |
| 1193 | +if ge fabs d get odl2 k | |
| 1194 | +ag = false | |
| 1195 | +if and eq sg 1 gt d 0.0 | |
| 1196 | +ag = true | |
| 1197 | +end | |
| 1198 | +if and eq sg 2 lt d 0.0 | |
| 1199 | +ag = true | |
| 1200 | +end | |
| 1201 | +if ag | |
| 1202 | +wk = get odl1 k | |
| 1203 | +num = add num mul wk d | |
| 1204 | +den = add den wk | |
| 1205 | +end | |
| 1206 | +end | |
| 1207 | +end | |
| 1208 | +if eq den 0.0 | |
| 1209 | +ret w0 | |
| 1210 | +end | |
| 1211 | +ret add w0 div num den | |
| 1212 | +end | |
| 1213 | + | |
| 1214 | +fn osp_m2 kk ulong fz ulong ns ulong to void | |
| 1215 | +osp_ties_tau kk ns | |
| 1216 | +i = ulong 0 | |
| 1217 | +note at most 16777216 passes, run as aligned chunks of 524288 (2^19): the seeded omc takes a while bound | |
| 1218 | +note of at most 999999. 33 chunks cover any 16777216 consecutive values of i, so no run that the | |
| 1219 | +note bound 16777216 allowed is refused here. | |
| 1220 | +while lt i ns bound 33 | |
| 1221 | +while lt i ns bound 524288 | |
| 1222 | +owp add fz i osp_m2_i kk ns i | |
| 1223 | +i = add i 1 | |
| 1224 | +if eq and i 524287 0 | |
| 1225 | +break | |
| 1226 | +end | |
| 1227 | +end | |
| 1228 | +end | |
| 1229 | +end | |
| 1230 | + | |
| 1231 | +fn osp_mgrun mode ulong kk ulong fz ulong ns ulong to void | |
| 1232 | +if eq mode 0 | |
| 1233 | +osp_m0 kk fz ns | |
| 1234 | +ret | |
| 1235 | +end | |
| 1236 | +if eq mode 1 | |
| 1237 | +osp_m1 kk fz ns | |
| 1238 | +ret | |
| 1239 | +end | |
| 1240 | +osp_m2 kk fz ns | |
| 1241 | +end | |
| 1242 | + | |
| 1243 | +note spmerge BASE.ck MODE OUT.sp W1 P1.sp W2 P2.sp [W3 P3.sp [W4 P4.sp]] | |
| 1244 | +fn cmdspmerge to void | |
| 1245 | +na = oargc | |
| 1246 | +if or lt na 9 or gt na 13 ne rem sub na 5 2 0 | |
| 1247 | +exit 2 | |
| 1248 | +end | |
| 1249 | +kk = div sub na 5 2 | |
| 1250 | +if gt oargu 3 2 | |
| 1251 | +exit 2 | |
| 1252 | +end | |
| 1253 | +ockload 2 | |
| 1254 | +bl = get og 5 | |
| 1255 | +fz = get og 33 | |
| 1256 | +bh = osp_basehash bl fz | |
| 1257 | +osp_rdhdr 6 bl bh | |
| 1258 | +sl = get ottt_st 1 | |
| 1259 | +ns = get ottt_st 3 | |
| 1260 | +osp_init0 bl sl fz ns | |
| 1261 | +for k ulong kk | |
| 1262 | +put odl1 k div f64 oargu add 5 mul k 2 1000.0 | |
| 1263 | +z = osp_rd2ocs add 6 mul k 2 mul add k 1 ns bl bh sl | |
| 1264 | +end | |
| 1265 | +osp_mgrun oargu 3 kk fz ns | |
| 1266 | +osp_wrpack 4 bl sl bh fz ns | |
| 1267 | +oputc 83 | |
| 1268 | +oputc 80 | |
| 1269 | +oputc 77 | |
| 1270 | +oputc 82 | |
| 1271 | +oputc 71 | |
| 1272 | +oputc 32 | |
| 1273 | +oputu oargu 3 | |
| 1274 | +oputc 32 | |
| 1275 | +oputu kk | |
| 1276 | +oputc 32 | |
| 1277 | +oputu sl | |
| 1278 | +oputc 32 | |
| 1279 | +oputu ns | |
| 1280 | +oputc 10 | |
| 1281 | +oflush | |
| 1282 | +end | |
| 1283 | + | |
| 1284 | +note Copy n f64s from ocs[src..) into ow[dst..) | |
| 1285 | +fn osp_c2w dst ulong src ulong n ulong to void | |
| 1286 | +i = ulong 0 | |
| 1287 | +note at most 16777216 passes, run as aligned chunks of 524288 (2^19): the seeded omc takes a while bound | |
| 1288 | +note of at most 999999. 33 chunks cover any 16777216 consecutive values of i, so no run that the | |
| 1289 | +note bound 16777216 allowed is refused here. | |
| 1290 | +while lt i n bound 33 | |
| 1291 | +while lt i n bound 524288 | |
| 1292 | +owp add dst i ocsg add src i | |
| 1293 | +i = add i 1 | |
| 1294 | +if eq and i 524287 0 | |
| 1295 | +break | |
| 1296 | +end | |
| 1297 | +end | |
| 1298 | +end | |
| 1299 | +end | |
| 1300 | + | |
| 1301 | +note Scale Wo and W2 of layers [l0 .. l0+cnt) in ow by sc | |
| 1302 | +fn osp_sclays l0 ulong cnt ulong sc f64 to void | |
| 1303 | +d = get og 2 | |
| 1304 | +for k ulong cnt | |
| 1305 | +l = add l0 k | |
| 1306 | +oiscale opwo l mul d d sc | |
| 1307 | +oiscale opw2 l mul d get og 4 sc | |
| 1308 | +end | |
| 1309 | +end | |
| 1310 | + | |
| 1311 | +fn osp_stkgf dst ulong o1 ulong o2 ulong to void | |
| 1312 | +for g ulong get og 2 | |
| 1313 | +v = mul 0.5 add ocsg add o1 g ocsg add o2 g | |
| 1314 | +owp add dst g v | |
| 1315 | +end | |
| 1316 | +end | |
| 1317 | + | |
| 1318 | +note Finish vertical stack copy + scaling + gf average + pack write; ottt_st[5..7] = bl, fz, bh | |
| 1319 | +fn osp_stkfin d1 ulong n1 ulong d2 ulong to void | |
| 1320 | +bl = get ottt_st 5 | |
| 1321 | +fz = get ottt_st 6 | |
| 1322 | +b1 = mul d1 get og 32 | |
| 1323 | +b2 = mul d2 get og 32 | |
| 1324 | +osp_c2w fz 0 b1 | |
| 1325 | +osp_c2w add fz b1 n1 b2 | |
| 1326 | +osp_sclays bl d1 div f64 oargu 5 1000.0 | |
| 1327 | +osp_sclays add bl d1 d2 div f64 oargu 6 1000.0 | |
| 1328 | +osp_stkgf add fz add b1 b2 b1 add n1 b2 | |
| 1329 | +ns = add add b1 b2 get og 2 | |
| 1330 | +osp_wrpack 7 bl get og 5 get ottt_st 7 fz ns | |
| 1331 | +oputc 83 | |
| 1332 | +oputc 80 | |
| 1333 | +oputc 83 | |
| 1334 | +oputc 84 | |
| 1335 | +oputc 75 | |
| 1336 | +oputc 32 | |
| 1337 | +oputu bl | |
| 1338 | +oputc 32 | |
| 1339 | +oputu get og 5 | |
| 1340 | +oputc 32 | |
| 1341 | +oputu ns | |
| 1342 | +oputc 10 | |
| 1343 | +oflush | |
| 1344 | +end | |
| 1345 | + | |
| 1346 | +note spstack BASE.ck P1.sp P2.sp S1_MILLI S2_MILLI OUT.sp | |
| 1347 | +note Vertically stack P1 layers then P2 layers on top of frozen BASE.ck | |
| 1348 | +fn cmdspstack to void | |
| 1349 | +if ne oargc 8 | |
| 1350 | +exit 2 | |
| 1351 | +end | |
| 1352 | +c = ocsinit | |
| 1353 | +ockload 2 | |
| 1354 | +bl = get og 5 | |
| 1355 | +fz = get og 33 | |
| 1356 | +bh = osp_basehash bl fz | |
| 1357 | +put ottt_st 5 bl | |
| 1358 | +put ottt_st 6 fz | |
| 1359 | +put ottt_st 7 bh | |
| 1360 | +d1 = sub osp_rd2ocs 3 0 bl bh 0 bl | |
| 1361 | +n1 = get ottt_st 3 | |
| 1362 | +d2 = sub osp_rd2ocs 4 n1 bl bh 0 bl | |
| 1363 | +put og 5 add bl add d1 d2 | |
| 1364 | +if not ogeom | |
| 1365 | +exit 12 | |
| 1366 | +end | |
| 1367 | +osp_stkfin d1 n1 d2 | |
| 1368 | +end | |
| 1369 | + | |
| 1370 | +note ---- 7. LLaMA-Pro Block-Expansion Growth (growpro) ---- | |
| 1371 | +note Clones the last base layer's trained (g1, Wq, Wk, Wv, g2, W1) into each added layer | |
| 1372 | +note and zeroes only (Wo, W2) so step-0 output is bit-identical to base while starting at | |
| 1373 | +note the base layer's exact weight scale (44x sharper Q*K logits than random oinit). | |
| 1374 | +fn osp_clone oldl ulong ll ulong to void | |
| 1375 | +lstr = get og 32 | |
| 1376 | +src = add get og 31 mul sub oldl 1 lstr | |
| 1377 | +for k ulong sub ll oldl | |
| 1378 | +dst = add get og 31 mul add oldl k lstr | |
| 1379 | +osp_c2w dst src lstr | |
| 1380 | +end | |
| 1381 | +end | |
| 1382 | + | |
| 1383 | +fn cmdgrowpro to void | |
| 1384 | +if ne oargc 7 | |
| 1385 | +exit 2 | |
| 1386 | +end | |
| 1387 | +ockload 2 | |
| 1388 | +ll = oargu 4 | |
| 1389 | +tt = oargu 5 | |
| 1390 | +lr = oargu 6 | |
| 1391 | +if or le ll get og 5 or eq tt 0 gt tt 999999 | |
| 1392 | +exit 12 | |
| 1393 | +end | |
| 1394 | +if eq lr 0 | |
| 1395 | +exit 12 | |
| 1396 | +end | |
| 1397 | +oldl = get og 5 | |
| 1398 | +oldg = get og 33 | |
| 1399 | +ogrowsnap get og 8 | |
| 1400 | +put og 5 ll | |
| 1401 | +if not ogeom | |
| 1402 | +exit 12 | |
| 1403 | +end | |
| 1404 | +put og 41 0 | |
| 1405 | +put og 42 tt | |
| 1406 | +put og 43 bitcast ulong div f64 lr 1000000.0 | |
| 1407 | +ozerom mul 2 get og 8 | |
| 1408 | +ogrowcopy oldg | |
| 1409 | +for j ulong get og 2 | |
| 1410 | +owp add get og 33 j ocsg add oldg j | |
| 1411 | +end | |
| 1412 | +osp_clone oldl ll | |
| 1413 | +ogrowsilent oldl | |
| 1414 | +ocksave 3 | |
| 1415 | +oputc 71 | |
| 1416 | +oputc 80 | |
| 1417 | +oputc 32 | |
| 1418 | +oputu oldl | |
| 1419 | +oputc 32 | |
| 1420 | +oputu ll | |
| 1421 | +oputc 32 | |
| 1422 | +oputu get og 8 | |
| 1423 | +oputc 10 | |
| 1424 | +oflush | |
| 1425 | +end | |
| 1426 | + | |
| 1427 | +note ---- 8. Shared-Base Product-of-Experts Parallel Ensemble (spens) ---- | |
| 1428 | +note spens BASE.ck P1.sp P2.sp W1_MILLI N PROMPT TEMPMILLI SEED [MERGES] | |
| 1429 | +note Runs frozen base layers 0..bl-1 ONCE per token, then runs P1 and P2 specialist layers | |
| 1430 | +note in parallel over the shared H_base and fuses log_softmax(z1) & log_softmax(z2). | |
| 1431 | +note Works across DIFFERENT init basins (grow + growpro) with zero weight-averaging interference! | |
| 1432 | + | |
| 1433 | +fn osp_hsnap dst ulong src ulong n ulong to void | |
| 1434 | +i = ulong 0 | |
| 1435 | +while lt i n bound 262144 | |
| 1436 | +ocsp add dst i get oa add src i | |
| 1437 | +i = add i 1 | |
| 1438 | +end | |
| 1439 | +end | |
| 1440 | + | |
| 1441 | +fn osp_hrest dst ulong src ulong n ulong to void | |
| 1442 | +i = ulong 0 | |
| 1443 | +while lt i n bound 262144 | |
| 1444 | +put oa add dst i ocsg add src i | |
| 1445 | +i = add i 1 | |
| 1446 | +end | |
| 1447 | +end | |
| 1448 | + | |
| 1449 | +note Run final norm + klogit + log_softmax on row nc-1 into odl1 (which=1) or odl2 (which=2) | |
| 1450 | +fn osp_ens_head which ulong nc ulong to void | |
| 1451 | +d = get og 2 | |
| 1452 | +nc1 = sub nc 1 | |
| 1453 | +r = mul nc1 d | |
| 1454 | +z = add get og 17 r | |
| 1455 | +hf = add get og 15 r | |
| 1456 | +s0 = add get og 16 nc1 | |
| 1457 | +frms hf get og 33 z s0 | |
| 1458 | +klogit z get og 27 get og 0 d | |
| 1459 | +odl_lsm get og 27 get og 0 which | |
| 1460 | +end | |
| 1461 | + | |
| 1462 | +note Run one specialist branch (P1 if which=1 else P2) from cached H_base -> log_softmax in odl1/odl2 | |
| 1463 | +fn osp_ens_br which ulong nc ulong to void | |
| 1464 | +bl = get oens 0 | |
| 1465 | +sl = get oens 2 | |
| 1466 | +if eq which 1 | |
| 1467 | +osp_c2w get oens 1 get oens 3 get oens 4 | |
| 1468 | +else | |
| 1469 | +sl = get oens 5 | |
| 1470 | +osp_c2w get oens 1 get oens 6 get oens 7 | |
| 1471 | +end | |
| 1472 | +ho = oahin bl | |
| 1473 | +hs = add get oens 6 get oens 7 | |
| 1474 | +osp_hrest ho hs mul nc get og 2 | |
| 1475 | +put og 9 nc | |
| 1476 | +put okv 0 0 | |
| 1477 | +put ogkm 1 0 | |
| 1478 | +for k ulong sub sl bl | |
| 1479 | +olayf add bl k | |
| 1480 | +end | |
| 1481 | +osp_ens_head which nc | |
| 1482 | +end | |
| 1483 | + | |
| 1484 | +fn osp_ens_fuse w1 f64 to void | |
| 1485 | +pr = get og 27 | |
| 1486 | +w2 = sub 1.0f64 w1 | |
| 1487 | +for j ulong get og 0 | |
| 1488 | +a = mul w1 get odl1 j | |
| 1489 | +b = mul w2 get odl2 j | |
| 1490 | +put oa add pr j add a b | |
| 1491 | +end | |
| 1492 | +end | |
| 1493 | + | |
| 1494 | +note One PoE decode step: shared base 0..bl-1 once, then P1 + P2 branches, fused into TMP (og[27]) | |
| 1495 | +fn osp_ens_step w1 f64 st ulong tm ulong to ulong | |
| 1496 | +nc = get og 9 | |
| 1497 | +bl = get oens 0 | |
| 1498 | +put okv 0 0 | |
| 1499 | +put ogkm 1 0 | |
| 1500 | +oemb 0 | |
| 1501 | +for l ulong bl | |
| 1502 | +olayf l | |
| 1503 | +end | |
| 1504 | +hs = add get oens 6 get oens 7 | |
| 1505 | +ho = oahin bl | |
| 1506 | +osp_hsnap hs ho mul nc get og 2 | |
| 1507 | +osp_ens_br 1 nc | |
| 1508 | +osp_ens_br 2 nc | |
| 1509 | +osp_ens_fuse w1 | |
| 1510 | +if eq tm 0 | |
| 1511 | +ret oargmax | |
| 1512 | +end | |
| 1513 | +ret odraw st div f64 tm 1000.0 | |
| 1514 | +end | |
| 1515 | + | |
| 1516 | +fn osp_ens_loop nn ulong w1 f64 st ulong tm ulong to void | |
| 1517 | +v = get og 0 | |
| 1518 | +for g ulong nn | |
| 1519 | +c = osp_ens_step w1 st tm | |
| 1520 | +if ne tm 0 | |
| 1521 | +st = add st 11400714819323198485 | |
| 1522 | +end | |
| 1523 | +if eq c 0 | |
| 1524 | +break | |
| 1525 | +end | |
| 1526 | +if gt v 256 | |
| 1527 | +obtput c | |
| 1528 | +else | |
| 1529 | +oputc c | |
| 1530 | +end | |
| 1531 | +oflush | |
| 1532 | +ocpush c | |
| 1533 | +end | |
| 1534 | +oflush | |
| 1535 | +end | |
| 1536 | + | |
| 1537 | +fn osp_ens_init to void | |
| 1538 | +c = ocsinit | |
| 1539 | +ockload 2 | |
| 1540 | +bl = get og 5 | |
| 1541 | +fz = get og 33 | |
| 1542 | +p0 = get og 8 | |
| 1543 | +bh = osp_basehash bl fz | |
| 1544 | +ogrowsnap p0 | |
| 1545 | +l1 = osp_rd2ocs 3 p0 bl bh 0 | |
| 1546 | +n1 = get ottt_st 3 | |
| 1547 | +l2 = osp_rd2ocs 4 add p0 n1 bl bh l1 | |
| 1548 | +put oens 0 bl | |
| 1549 | +put oens 1 fz | |
| 1550 | +put oens 2 l1 | |
| 1551 | +put oens 3 p0 | |
| 1552 | +put oens 4 n1 | |
| 1553 | +put oens 5 l2 | |
| 1554 | +put oens 6 add p0 n1 | |
| 1555 | +put oens 7 get ottt_st 3 | |
| 1556 | +put og 5 l1 | |
| 1557 | +if not ogeom | |
| 1558 | +exit 12 | |
| 1559 | +end | |
| 1560 | +ogrowcopy fz | |
| 1561 | +end | |
| 1562 | + | |
| 1563 | +note spens BASE.ck P1.sp P2.sp W1_MILLI PROMPT N TEMPMILLI SEED [MERGES] | |
| 1564 | +fn cmdspens to void | |
| 1565 | +na = oargc | |
| 1566 | +if and ne na 10 ne na 11 | |
| 1567 | +exit 2 | |
| 1568 | +end | |
| 1569 | +osp_ens_init | |
| 1570 | +v = get og 0 | |
| 1571 | +if gt v 256 | |
| 1572 | +if eq na 10 | |
| 1573 | +exit 2 | |
| 1574 | +end | |
| 1575 | +obload 10 v | |
| 1576 | +end | |
| 1577 | +ottt_prompt v | |
| 1578 | +osp_ens_loop oargu 7 div f64 oargu 5 1000.0 oargu 9 oargu 8 | |
| 1579 | +end | |
| 1580 | + | |
| 1581 | +note ---- 9. Multi-Link Merkle Specialist Chains (spchainapp, spchaineval, spchainsamp) ---- | |
| 1582 | + | |
| 1583 | +note Chunked copy: ocs[dst..dst+n) = ow[src..src+n) | |
| 1584 | +fn osp_w2c dst ulong src ulong n ulong to void | |
| 1585 | +for q ulong ocn n | |
| 1586 | +i = mul q OCH | |
| 1587 | +ie = oce q n | |
| 1588 | +while lt i ie bound 999999 | |
| 1589 | +ocsp add dst i owg add src i | |
| 1590 | +i = add i 1 | |
| 1591 | +end | |
| 1592 | +end | |
| 1593 | +end | |
| 1594 | + | |
| 1595 | +note Chunked copy: ow[dst..dst+n) = ocs[src..src+n) | |
| 1596 | +fn osp_c2wb dst ulong src ulong n ulong to void | |
| 1597 | +for q ulong ocn n | |
| 1598 | +i = mul q OCH | |
| 1599 | +ie = oce q n | |
| 1600 | +while lt i ie bound 999999 | |
| 1601 | +owp add dst i ocsg add src i | |
| 1602 | +i = add i 1 | |
| 1603 | +end | |
| 1604 | +end | |
| 1605 | +end | |
| 1606 | + | |
| 1607 | +note Verify payload FNV-1a 64 of pack at argv[ai] without writing ow (exits 60/61 on error) | |
| 1608 | +fn osp_chkpay ai ulong ns ulong wantph ulong to void | |
| 1609 | +h = ulong 14695981039346656037 | |
| 1610 | +pos = ulong 48 | |
| 1611 | +done = ulong 0 | |
| 1612 | +while lt done ns bound 1024 | |
| 1613 | +cnt = sub ns done | |
| 1614 | +if gt cnt OCKC | |
| 1615 | +cnt = OCKC | |
| 1616 | +end | |
| 1617 | +nb = mul cnt 8 | |
| 1618 | +if ne oprd ai pos 0 nb nb | |
| 1619 | +exit 60 | |
| 1620 | +end | |
| 1621 | +h = ocfnvw h nb | |
| 1622 | +pos = add pos nb | |
| 1623 | +done = add done cnt | |
| 1624 | +end | |
| 1625 | +if ne h wantph | |
| 1626 | +exit 61 | |
| 1627 | +end | |
| 1628 | +end | |
| 1629 | + | |
| 1630 | +note Verify and attach one OLLMSP01 pack at argv[ai] onto the running model in ow | |
| 1631 | +fn osp_chain_link ai ulong to void | |
| 1632 | +cur_l = get og 5 | |
| 1633 | +cur_fz = get og 33 | |
| 1634 | +osp_rdhdr ai cur_l osp_basehash cur_l cur_fz | |
| 1635 | +ogrowsnap get og 8 | |
| 1636 | +put og 5 get ottt_st 1 | |
| 1637 | +if not ogeom | |
| 1638 | +exit 12 | |
| 1639 | +end | |
| 1640 | +if ne sub get og 8 cur_fz get ottt_st 3 | |
| 1641 | +exit 62 | |
| 1642 | +end | |
| 1643 | +ozerom mul 2 get og 8 | |
| 1644 | +ogrowcopy cur_fz | |
| 1645 | +if ne osp_rdpay ai cur_fz get ottt_st 3 get ottt_st 4 | |
| 1646 | +exit 61 | |
| 1647 | +end | |
| 1648 | +end | |
| 1649 | + | |
| 1650 | +note Load BASE.ck at argv[bkai] and sequentially attach K (1..8) Merkle-chained packs at argv[p0ai..] | |
| 1651 | +fn ospchainload bkai ulong k ulong p0ai ulong to void | |
| 1652 | +if or eq k 0 gt k 8 | |
| 1653 | +exit 2 | |
| 1654 | +end | |
| 1655 | +ockload bkai | |
| 1656 | +put ottt_st 0 get og 5 | |
| 1657 | +for j ulong k | |
| 1658 | +osp_chain_link add p0ai j | |
| 1659 | +end | |
| 1660 | +end | |
| 1661 | + | |
| 1662 | +note Load prompt from argv[pai] into obx with leading token 0 | |
| 1663 | +fn osp_prompt pai ulong v ulong to void | |
| 1664 | +put og 9 0 | |
| 1665 | +ocpush 0 | |
| 1666 | +if gt v 256 | |
| 1667 | +r = oargr pai | |
| 1668 | +if or lt r 0 gt r 4000 | |
| 1669 | +exit 2 | |
| 1670 | +end | |
| 1671 | +np = obprompt pai | |
| 1672 | +for i ulong np | |
| 1673 | +ocpush get obtk i | |
| 1674 | +end | |
| 1675 | +else | |
| 1676 | +r = oargr pai | |
| 1677 | +if or lt r 0 gt r 4096 | |
| 1678 | +exit 2 | |
| 1679 | +end | |
| 1680 | +for i ulong ulong r | |
| 1681 | +ocpush ulong get oarg i | |
| 1682 | +end | |
| 1683 | +end | |
| 1684 | +end | |
| 1685 | + | |
| 1686 | +note Sample nn tokens from the currently loaded model + context | |
| 1687 | +fn osp_samploop seed ulong nn ulong tm ulong to void | |
| 1688 | +if gt nn 999999 | |
| 1689 | +exit 2 | |
| 1690 | +end | |
| 1691 | +st = seed | |
| 1692 | +v = get og 0 | |
| 1693 | +for g ulong nn | |
| 1694 | +c = osstep st tm | |
| 1695 | +if ne tm 0 | |
| 1696 | +st = add st 11400714819323198485 | |
| 1697 | +end | |
| 1698 | +if eq c 0 | |
| 1699 | +break | |
| 1700 | +end | |
| 1701 | +if gt v 256 | |
| 1702 | +obtput c | |
| 1703 | +else | |
| 1704 | +oputc c | |
| 1705 | +end | |
| 1706 | +oflush | |
| 1707 | +ocpush c | |
| 1708 | +end | |
| 1709 | +oflush | |
| 1710 | +end | |
| 1711 | + | |
| 1712 | +note spchainapp BASE.ck OUT.ck K P1.sp ... PK.sp | |
| 1713 | +fn cmdspchainapp to void | |
| 1714 | +na = oargc | |
| 1715 | +if lt na 6 | |
| 1716 | +exit 2 | |
| 1717 | +end | |
| 1718 | +k = oargu 4 | |
| 1719 | +if or eq k 0 or gt k 8 ne na add 5 k | |
| 1720 | +exit 2 | |
| 1721 | +end | |
| 1722 | +ospchainload 2 k 5 | |
| 1723 | +ocksave 3 | |
| 1724 | +oputc 83 | |
| 1725 | +oputc 80 | |
| 1726 | +oputc 67 | |
| 1727 | +oputc 72 | |
| 1728 | +oputc 65 | |
| 1729 | +oputc 80 | |
| 1730 | +oputc 80 | |
| 1731 | +oputc 32 | |
| 1732 | +oputu get ottt_st 0 | |
| 1733 | +oputc 32 | |
| 1734 | +oputu get og 5 | |
| 1735 | +oputc 32 | |
| 1736 | +oputu k | |
| 1737 | +oputc 32 | |
| 1738 | +oputu get og 8 | |
| 1739 | +oputc 10 | |
| 1740 | +oflush | |
| 1741 | +end | |
| 1742 | + | |
| 1743 | +note spchaineval BASE.ck HELD W MERGES K P1.sp ... PK.sp | |
| 1744 | +fn cmdspchaineval to void | |
| 1745 | +na = oargc | |
| 1746 | +if lt na 8 | |
| 1747 | +exit 2 | |
| 1748 | +end | |
| 1749 | +k = oargu 6 | |
| 1750 | +if or eq k 0 or gt k 8 ne na add 7 k | |
| 1751 | +exit 2 | |
| 1752 | +end | |
| 1753 | +ospchainload 2 k 7 | |
| 1754 | +ww = oargu 4 | |
| 1755 | +v = get og 0 | |
| 1756 | +if gt v 256 | |
| 1757 | +obload 5 v | |
| 1758 | +end | |
| 1759 | +odopen 3 | |
| 1760 | +tt = get og 1 | |
| 1761 | +m = get odn 0 | |
| 1762 | +if eq ww 0 | |
| 1763 | +exit 23 | |
| 1764 | +end | |
| 1765 | +if gt ww div sub m 1 tt | |
| 1766 | +exit 23 | |
| 1767 | +end | |
| 1768 | +ls = 0.0f64 | |
| 1769 | +nb = ulong 0 | |
| 1770 | +for w ulong ww | |
| 1771 | +obrow 0 mul w tt | |
| 1772 | +ls = add ls ofwd 0 | |
| 1773 | +if gt v 256 | |
| 1774 | +nb = add nb oevnb tt | |
| 1775 | +end | |
| 1776 | +end | |
| 1777 | +lo = div ls f64 ww | |
| 1778 | +bp = div lo 0.6931471805599453 | |
| 1779 | +if gt v 256 | |
| 1780 | +bp = div mul bp f64 mul ww tt f64 nb | |
| 1781 | +end | |
| 1782 | +oputc 69 | |
| 1783 | +oputc 32 | |
| 1784 | +oputu get og 41 | |
| 1785 | +oputc 32 | |
| 1786 | +oputu ww | |
| 1787 | +oputc 32 | |
| 1788 | +oputl rmic lo | |
| 1789 | +oputc 32 | |
| 1790 | +oputl rmic bp | |
| 1791 | +oputc 10 | |
| 1792 | +oflush | |
| 1793 | +end | |
| 1794 | + | |
| 1795 | +note spchainsamp BASE.ck N TEMPMILLI PROMPT SEED MERGES K P1.sp ... PK.sp | |
| 1796 | +fn cmdspchainsamp to void | |
| 1797 | +na = oargc | |
| 1798 | +if lt na 10 | |
| 1799 | +exit 2 | |
| 1800 | +end | |
| 1801 | +k = oargu 8 | |
| 1802 | +if or eq k 0 or gt k 8 ne na add 9 k | |
| 1803 | +exit 2 | |
| 1804 | +end | |
| 1805 | +ospchainload 2 k 9 | |
| 1806 | +nn = oargu 3 | |
| 1807 | +if gt nn 999999 | |
| 1808 | +exit 2 | |
| 1809 | +end | |
| 1810 | +tm = oargu 4 | |
| 1811 | +st = oargu 6 | |
| 1812 | +v = get og 0 | |
| 1813 | +if gt v 256 | |
| 1814 | +obload 7 v | |
| 1815 | +end | |
| 1816 | +ochipup | |
| 1817 | +osp_prompt 5 v | |
| 1818 | +osp_samploop st nn tm | |
| 1819 | +end | |
| 1820 | + | |
| 1821 | +note ---- 10. DNA-Style Multi-Helix Chain Clipping (spclip, S = 2..4 strands) ---- | |
| 1822 | +note spclip BASE.ck MODE PROMPT N TEMPMILLI SEED MERGES S W1 K1 A1..AK1 W2 K2 B1..BK2 [W3 K3 C1..CK3 [W4 K4 D1..DK4]] | |
| 1823 | +note MODE=0: normalized prior PoE (w_s / sum(w)); MODE=1: entropy-gated multi-helix (u_s = w_s / (H_s + 0.001)). | |
| 1824 | + | |
| 1825 | +note Hidden-state output offset in oa after running layers 0..l-1 (l >= 1) | |
| 1826 | +fn osp_hout l ulong to ulong | |
| 1827 | +if lt l get og 5 | |
| 1828 | +ret oahin l | |
| 1829 | +end | |
| 1830 | +ret get og 15 | |
| 1831 | +end | |
| 1832 | + | |
| 1833 | +note Parse spclip CLI arguments into ocl_st, ocl_w, ocl_k, ocl_a0 | |
| 1834 | +fn osp_clip_parse to void | |
| 1835 | +na = oargc | |
| 1836 | +if lt na 16 | |
| 1837 | +exit 2 | |
| 1838 | +end | |
| 1839 | +md = oargu 3 | |
| 1840 | +ss = oargu 9 | |
| 1841 | +if or gt md 1 or lt ss 2 gt ss 4 | |
| 1842 | +exit 2 | |
| 1843 | +end | |
| 1844 | +put ocl_st 0 md | |
| 1845 | +put ocl_st 1 ss | |
| 1846 | +idx = ulong 10 | |
| 1847 | +sw = 0.0f64 | |
| 1848 | +for s ulong ss | |
| 1849 | +if gt add idx 2 na | |
| 1850 | +exit 2 | |
| 1851 | +end | |
| 1852 | +ws = div f64 oargu idx 1000.0 | |
| 1853 | +ks = oargu add idx 1 | |
| 1854 | +if or eq ks 0 gt ks 8 | |
| 1855 | +exit 2 | |
| 1856 | +end | |
| 1857 | +if gt add add idx 2 ks na | |
| 1858 | +exit 2 | |
| 1859 | +end | |
| 1860 | +put ocl_w s ws | |
| 1861 | +sw = add sw ws | |
| 1862 | +put ocl_k s ks | |
| 1863 | +put ocl_a0 s add idx 2 | |
| 1864 | +idx = add add idx 2 ks | |
| 1865 | +end | |
| 1866 | +if or ne idx na le sw 0.0 | |
| 1867 | +exit 2 | |
| 1868 | +end | |
| 1869 | +end | |
| 1870 | + | |
| 1871 | +note True iff all ss strands share an identical valid pack at link index j on top of current ow | |
| 1872 | +fn osp_clip_same j ulong ss ulong to bool | |
| 1873 | +bh = osp_basehash get og 5 get og 33 | |
| 1874 | +osp_rdhdr add get ocl_a0 0 j get og 5 bh | |
| 1875 | +sl0 = get ottt_st 1 | |
| 1876 | +ns0 = get ottt_st 3 | |
| 1877 | +ph0 = get ottt_st 4 | |
| 1878 | +s = ulong 1 | |
| 1879 | +while lt s ss bound 4 | |
| 1880 | +osp_rdhdr add get ocl_a0 s j get og 5 bh | |
| 1881 | +if ne get ottt_st 1 sl0 | |
| 1882 | +ret false | |
| 1883 | +end | |
| 1884 | +if ne get ottt_st 3 ns0 | |
| 1885 | +ret false | |
| 1886 | +end | |
| 1887 | +if ne get ottt_st 4 ph0 | |
| 1888 | +ret false | |
| 1889 | +end | |
| 1890 | +s = add s 1 | |
| 1891 | +end | |
| 1892 | +s = ulong 1 | |
| 1893 | +while lt s ss bound 4 | |
| 1894 | +osp_chkpay add get ocl_a0 s j ns0 ph0 | |
| 1895 | +s = add s 1 | |
| 1896 | +end | |
| 1897 | +ret true | |
| 1898 | +end | |
| 1899 | + | |
| 1900 | +note Load longest common prefix of packs across all S strands into ow; save trunk_gf in odl2 | |
| 1901 | +fn osp_clip_trunk to void | |
| 1902 | +ss = get ocl_st 1 | |
| 1903 | +mink = get ocl_k 0 | |
| 1904 | +for s ulong ss | |
| 1905 | +if lt get ocl_k s mink | |
| 1906 | +mink = get ocl_k s | |
| 1907 | +end | |
| 1908 | +end | |
| 1909 | +comm = ulong 0 | |
| 1910 | +for j ulong mink | |
| 1911 | +if not osp_clip_same j ss | |
| 1912 | +break | |
| 1913 | +end | |
| 1914 | +osp_chain_link add get ocl_a0 0 j | |
| 1915 | +comm = add comm 1 | |
| 1916 | +end | |
| 1917 | +put ocl_st 3 get og 5 | |
| 1918 | +put ocl_st 4 get og 33 | |
| 1919 | +put ocl_st 6 comm | |
| 1920 | +for g ulong get og 2 | |
| 1921 | +put odl2 g owg add get og 33 g | |
| 1922 | +end | |
| 1923 | +end | |
| 1924 | + | |
| 1925 | +note Peek final spec_L of each strand's last pack to find max_L across all S strands | |
| 1926 | +fn osp_clip_maxl to ulong | |
| 1927 | +ss = get ocl_st 1 | |
| 1928 | +comm = get ocl_st 6 | |
| 1929 | +ml = get ocl_st 3 | |
| 1930 | +for s ulong ss | |
| 1931 | +ks = get ocl_k s | |
| 1932 | +if gt ks comm | |
| 1933 | +ai = add get ocl_a0 s sub ks 1 | |
| 1934 | +if lt ofsz ai 48 | |
| 1935 | +exit 60 | |
| 1936 | +end | |
| 1937 | +if ne oprd ai 0 0 48 48 | |
| 1938 | +exit 60 | |
| 1939 | +end | |
| 1940 | +if ne opw8 0 OSPMAG | |
| 1941 | +exit 60 | |
| 1942 | +end | |
| 1943 | +sl = opw8 16 | |
| 1944 | +if gt sl ml | |
| 1945 | +ml = sl | |
| 1946 | +end | |
| 1947 | +end | |
| 1948 | +end | |
| 1949 | +if gt ml 16 | |
| 1950 | +exit 12 | |
| 1951 | +end | |
| 1952 | +ret ml | |
| 1953 | +end | |
| 1954 | + | |
| 1955 | +note Load one non-shared link ai onto (cur_l, cur_fz); returns new spec_L | |
| 1956 | +fn osp_clip_1link ai ulong cur_l ulong cur_fz ulong to ulong | |
| 1957 | +osp_rdhdr ai cur_l osp_basehash cur_l cur_fz | |
| 1958 | +sl = get ottt_st 1 | |
| 1959 | +ns = get ottt_st 3 | |
| 1960 | +if gt sl get og 5 | |
| 1961 | +exit 62 | |
| 1962 | +end | |
| 1963 | +wn = mul sub sl cur_l get og 32 | |
| 1964 | +if ne ns add wn get og 2 | |
| 1965 | +exit 62 | |
| 1966 | +end | |
| 1967 | +if ne osp_rdpay ai cur_fz ns get ottt_st 4 | |
| 1968 | +exit 61 | |
| 1969 | +end | |
| 1970 | +ret sl | |
| 1971 | +end | |
| 1972 | + | |
| 1973 | +note Load remaining links comm..ks-1 of strand s into ow[fzt..); returns final depth cur_l | |
| 1974 | +fn osp_clip_slinks s ulong to ulong | |
| 1975 | +cur_l = get ocl_st 3 | |
| 1976 | +cur_fz = get ocl_st 4 | |
| 1977 | +j = get ocl_st 6 | |
| 1978 | +ks = get ocl_k s | |
| 1979 | +while lt j ks bound 16 | |
| 1980 | +sl = osp_clip_1link add get ocl_a0 s j cur_l cur_fz | |
| 1981 | +cur_l = sl | |
| 1982 | +cur_fz = add get og 31 mul sl get og 32 | |
| 1983 | +j = add j 1 | |
| 1984 | +end | |
| 1985 | +ret cur_l | |
| 1986 | +end | |
| 1987 | + | |
| 1988 | +note Verify & store strand s's remaining layer weights + gf into ocs | |
| 1989 | +fn osp_clip_strand s ulong to void | |
| 1990 | +comm = get ocl_st 6 | |
| 1991 | +ks = get ocl_k s | |
| 1992 | +tl = get ocl_st 3 | |
| 1993 | +fzt = get ocl_st 4 | |
| 1994 | +oc = get ocl_st 8 | |
| 1995 | +d = get og 2 | |
| 1996 | +cap = ocsinit | |
| 1997 | +if eq ks comm | |
| 1998 | +if gt add oc d cap | |
| 1999 | +exit 12 | |
| 2000 | +end | |
| 2001 | +for g ulong d | |
| 2002 | +ocsp add oc g get odl2 g | |
| 2003 | +end | |
| 2004 | +put ocl_sl s tl | |
| 2005 | +put ocl_wo s oc | |
| 2006 | +put ocl_wn s 0 | |
| 2007 | +put ocl_st 8 add oc d | |
| 2008 | +ret | |
| 2009 | +end | |
| 2010 | +cl = osp_clip_slinks s | |
| 2011 | +wn = mul sub cl tl get og 32 | |
| 2012 | +ntot = add wn d | |
| 2013 | +if gt add oc ntot cap | |
| 2014 | +exit 12 | |
| 2015 | +end | |
| 2016 | +osp_w2c oc fzt ntot | |
| 2017 | +put ocl_sl s cl | |
| 2018 | +put ocl_wo s oc | |
| 2019 | +put ocl_wn s wn | |
| 2020 | +put ocl_st 8 add oc ntot | |
| 2021 | +end | |
| 2022 | + | |
| 2023 | +note Initialize spclip: load BASE.ck, common trunk, grow to max_L, store all S strand suffixes in ocs | |
| 2024 | +fn osp_clip_init to void | |
| 2025 | +c = ocsinit | |
| 2026 | +ockload 2 | |
| 2027 | +put ocl_st 2 get og 5 | |
| 2028 | +osp_clip_trunk | |
| 2029 | +ml = osp_clip_maxl | |
| 2030 | +put ocl_st 5 ml | |
| 2031 | +if gt ml get ocl_st 3 | |
| 2032 | +ogrowsnap get og 8 | |
| 2033 | +put og 5 ml | |
| 2034 | +if not ogeom | |
| 2035 | +exit 12 | |
| 2036 | +end | |
| 2037 | +ogrowcopy get ocl_st 4 | |
| 2038 | +end | |
| 2039 | +td = mul get og 1 get og 2 | |
| 2040 | +put ocl_st 7 0 | |
| 2041 | +put ocl_st 9 td | |
| 2042 | +put ocl_st 8 add td mul get ocl_st 1 get og 0 | |
| 2043 | +for s ulong get ocl_st 1 | |
| 2044 | +osp_clip_strand s | |
| 2045 | +end | |
| 2046 | +end | |
| 2047 | + | |
| 2048 | +note Compute log_softmax of TMP[0..V) into ocs[logp_off + s*V .. +V) and Shannon entropy into ocl_ent[s] | |
| 2049 | +fn osp_clip_lsm s ulong to void | |
| 2050 | +pr = get og 27 | |
| 2051 | +v = get og 0 | |
| 2052 | +m = bitcast f64 ulong 18442240474082181120 | |
| 2053 | +for j ulong v | |
| 2054 | +x = get oa add pr j | |
| 2055 | +m = fmax m x | |
| 2056 | +put odl1 j x | |
| 2057 | +end | |
| 2058 | +sm = osoft pr v m | |
| 2059 | +lsm = flog sm | |
| 2060 | +dst = add get ocl_st 9 mul s v | |
| 2061 | +ent = 0.0f64 | |
| 2062 | +for j2 ulong v | |
| 2063 | +lp = sub sub get odl1 j2 m lsm | |
| 2064 | +ocsp add dst j2 lp | |
| 2065 | +pj = get oa add pr j2 | |
| 2066 | +if gt pj 0.0 | |
| 2067 | +ent = sub ent mul pj lp | |
| 2068 | +end | |
| 2069 | +end | |
| 2070 | +if lt ent 0.0 | |
| 2071 | +ent = 0.0f64 | |
| 2072 | +end | |
| 2073 | +put ocl_ent s ent | |
| 2074 | +end | |
| 2075 | + | |
| 2076 | +note Final norm + klogit on row nc-1 of osp_hout(ocl_sl[s]), then log_softmax + entropy | |
| 2077 | +fn osp_clip_head s ulong nc ulong to void | |
| 2078 | +d = get og 2 | |
| 2079 | +nc1 = sub nc 1 | |
| 2080 | +r = mul nc1 d | |
| 2081 | +z = add get og 17 r | |
| 2082 | +hf = add osp_hout get ocl_sl s r | |
| 2083 | +s0 = add get og 16 nc1 | |
| 2084 | +frms hf get og 33 z s0 | |
| 2085 | +klogit z get og 27 get og 0 d | |
| 2086 | +osp_clip_lsm s | |
| 2087 | +end | |
| 2088 | + | |
| 2089 | +note Run strand s from cached H_trunk through layers trunk_L..L_s-1 and head | |
| 2090 | +fn osp_clip_br s ulong nc ulong to void | |
| 2091 | +tl = get ocl_st 3 | |
| 2092 | +sl = get ocl_sl s | |
| 2093 | +wo = get ocl_wo s | |
| 2094 | +wn = get ocl_wn s | |
| 2095 | +if gt wn 0 | |
| 2096 | +osp_c2wb get ocl_st 4 wo wn | |
| 2097 | +end | |
| 2098 | +osp_c2wb get og 33 add wo wn get og 2 | |
| 2099 | +osp_hrest osp_hout tl get ocl_st 7 mul nc get og 2 | |
| 2100 | +put og 9 nc | |
| 2101 | +put okv 0 0 | |
| 2102 | +put ogkm 1 0 | |
| 2103 | +for k ulong sub sl tl | |
| 2104 | +olayf add tl k | |
| 2105 | +end | |
| 2106 | +osp_clip_head s nc | |
| 2107 | +end | |
| 2108 | + | |
| 2109 | +note Fuse S strands' log-probs in ocs into TMP[0..V) using MODE=0 (prior) or MODE=1 (entropy-gated) | |
| 2110 | +fn osp_clip_fuse to void | |
| 2111 | +md = get ocl_st 0 | |
| 2112 | +ss = get ocl_st 1 | |
| 2113 | +su = 0.0f64 | |
| 2114 | +for s ulong ss | |
| 2115 | +u = get ocl_w s | |
| 2116 | +if eq md 1 | |
| 2117 | +u = div u add get ocl_ent s 0.001 | |
| 2118 | +end | |
| 2119 | +put ocl_al s u | |
| 2120 | +su = add su u | |
| 2121 | +end | |
| 2122 | +for s2 ulong ss | |
| 2123 | +put ocl_al s2 div get ocl_al s2 su | |
| 2124 | +end | |
| 2125 | +pr = get og 27 | |
| 2126 | +v = get og 0 | |
| 2127 | +lo = get ocl_st 9 | |
| 2128 | +for j ulong v | |
| 2129 | +acc = 0.0f64 | |
| 2130 | +for s3 ulong ss | |
| 2131 | +acc = add acc mul get ocl_al s3 ocsg add lo add mul s3 v j | |
| 2132 | +end | |
| 2133 | +put oa add pr j acc | |
| 2134 | +end | |
| 2135 | +end | |
| 2136 | + | |
| 2137 | +note One DNA-clipped decode step: shared trunk ONCE, then S strands over H_trunk, fused into TMP | |
| 2138 | +fn osp_clip_step st ulong tm ulong to ulong | |
| 2139 | +nc = get og 9 | |
| 2140 | +tl = get ocl_st 3 | |
| 2141 | +put okv 0 0 | |
| 2142 | +put ogkm 1 0 | |
| 2143 | +oemb 0 | |
| 2144 | +for l ulong tl | |
| 2145 | +olayf l | |
| 2146 | +end | |
| 2147 | +osp_hsnap get ocl_st 7 osp_hout tl mul nc get og 2 | |
| 2148 | +for s ulong get ocl_st 1 | |
| 2149 | +osp_clip_br s nc | |
| 2150 | +end | |
| 2151 | +osp_clip_fuse | |
| 2152 | +if eq tm 0 | |
| 2153 | +ret oargmax | |
| 2154 | +end | |
| 2155 | +ret odraw st div f64 tm 1000.0 | |
| 2156 | +end | |
| 2157 | + | |
| 2158 | +fn osp_clip_loop nn ulong st ulong tm ulong to void | |
| 2159 | +v = get og 0 | |
| 2160 | +for g ulong nn | |
| 2161 | +c = osp_clip_step st tm | |
| 2162 | +if ne tm 0 | |
| 2163 | +st = add st 11400714819323198485 | |
| 2164 | +end | |
| 2165 | +if eq c 0 | |
| 2166 | +break | |
| 2167 | +end | |
| 2168 | +if gt v 256 | |
| 2169 | +obtput c | |
| 2170 | +else | |
| 2171 | +oputc c | |
| 2172 | +end | |
| 2173 | +oflush | |
| 2174 | +ocpush c | |
| 2175 | +end | |
| 2176 | +oflush | |
| 2177 | +end | |
| 2178 | + | |
| 2179 | +fn cmdspclip to void | |
| 2180 | +osp_clip_parse | |
| 2181 | +nn = oargu 5 | |
| 2182 | +if gt nn 999999 | |
| 2183 | +exit 2 | |
| 2184 | +end | |
| 2185 | +tm = oargu 6 | |
| 2186 | +st = oargu 7 | |
| 2187 | +osp_clip_init | |
| 2188 | +v = get og 0 | |
| 2189 | +if gt v 256 | |
| 2190 | +obload 8 v | |
| 2191 | +end | |
| 2192 | +osp_prompt 4 v | |
| 2193 | +osp_clip_loop nn st tm | |
| 2194 | +end |
streams/data/.gitignore
| new file mode 100644 | ||
| @@ -0,0 +1 @@ | ||
| 1 | +aienbpe/target/ |
streams/data/aienbpe/.gitignore
| new file mode 100644 | ||
| @@ -0,0 +1 @@ | ||
| 1 | +target/ |
streams/data/aienbpe/Cargo.lock
| new file mode 100644 | ||
| @@ -0,0 +1,7 @@ | ||
| 1 | +# This file is automatically @generated by Cargo. | |
| 2 | +# It is not intended for manual editing. | |
| 3 | +version = 4 | |
| 4 | + | |
| 5 | +[[package]] | |
| 6 | +name = "aienbpe" | |
| 7 | +version = "0.1.0" |
streams/data/aienbpe/Cargo.toml
| new file mode 100644 | ||
| @@ -0,0 +1,11 @@ | ||
| 1 | +[package] | |
| 2 | +name = "aienbpe" | |
| 3 | +version = "0.1.0" | |
| 4 | +edition = "2021" | |
| 5 | +description = "aien-train data stream: byte-level BPE trainer, encoder and decoder. Standard library only." | |
| 6 | + | |
| 7 | +[dependencies] | |
| 8 | + | |
| 9 | +[profile.release] | |
| 10 | +opt-level = 3 | |
| 11 | +debug = false |
streams/data/aienbpe/src/main.rs
| new file mode 100644 | ||
| @@ -0,0 +1,523 @@ | ||
| 1 | +//! aienbpe: byte-level BPE for the aien-train corpus. Standard library only. | |
| 2 | +//! | |
| 3 | +//! Document stream (stdin of train/encode, stdout of decode): repeated [u32 LE byte length][bytes]. | |
| 4 | +//! Tokenizer file `AIENBPE 1`: see docs/data/CORPUS.md. Token file `AIENTOK1`: same document. | |
| 5 | +use std::cmp::Reverse; | |
| 6 | +use std::collections::{BinaryHeap, HashMap}; | |
| 7 | +use std::hash::{BuildHasherDefault, Hasher}; | |
| 8 | +use std::io::{BufRead, BufReader, BufWriter, Read, Seek, SeekFrom, Write}; | |
| 9 | + | |
| 10 | +const MAX_CHUNK: usize = 128; | |
| 11 | +const PRETOK_ID: &str = "aien-pretok-1"; | |
| 12 | + | |
| 13 | +// ---------- small fast hasher (FxHash-style) ---------- | |
| 14 | +#[derive(Default)] | |
| 15 | +struct Fx(u64); | |
| 16 | +impl Hasher for Fx { | |
| 17 | + fn write(&mut self, bytes: &[u8]) { | |
| 18 | + for c in bytes.chunks(8) { | |
| 19 | + let mut v = 0u64; | |
| 20 | + for (i, b) in c.iter().enumerate() { | |
| 21 | + v |= (*b as u64) << (8 * i); | |
| 22 | + } | |
| 23 | + self.0 = (self.0.rotate_left(5) ^ v).wrapping_mul(0x51_7c_c1_b7_27_22_0a_95); | |
| 24 | + } | |
| 25 | + self.0 = (self.0.rotate_left(5) ^ bytes.len() as u64).wrapping_mul(0x51_7c_c1_b7_27_22_0a_95); | |
| 26 | + } | |
| 27 | + fn write_u64(&mut self, v: u64) { | |
| 28 | + self.0 = (self.0.rotate_left(5) ^ v).wrapping_mul(0x51_7c_c1_b7_27_22_0a_95); | |
| 29 | + } | |
| 30 | + fn write_u32(&mut self, v: u32) { | |
| 31 | + self.write_u64(v as u64) | |
| 32 | + } | |
| 33 | + fn finish(&self) -> u64 { | |
| 34 | + self.0 | |
| 35 | + } | |
| 36 | +} | |
| 37 | +type FxMap<K, V> = HashMap<K, V, BuildHasherDefault<Fx>>; | |
| 38 | + | |
| 39 | +// ---------- pre-tokenizer aien-pretok-1 (byte classes; documented in CORPUS.md) ---------- | |
| 40 | +#[inline] | |
| 41 | +fn class(b: u8) -> u8 { | |
| 42 | + match b { | |
| 43 | + b'A'..=b'Z' | b'a'..=b'z' | 0x80..=0xFF => 0, // letter (any non-ASCII byte counts as letter) | |
| 44 | + b'0'..=b'9' => 1, | |
| 45 | + 0x09..=0x0D | 0x20 => 2, // space class | |
| 46 | + _ => 3, // punctuation and controls | |
| 47 | + } | |
| 48 | +} | |
| 49 | + | |
| 50 | +fn emit_capped(s: &[u8], f: &mut impl FnMut(&[u8])) { | |
| 51 | + for p in s.chunks(MAX_CHUNK) { | |
| 52 | + f(p); | |
| 53 | + } | |
| 54 | +} | |
| 55 | + | |
| 56 | +/// Run of `c` starting at `i`; digit runs are at most 3 long. | |
| 57 | +fn run_end(d: &[u8], i: usize, c: u8) -> usize { | |
| 58 | + let mut k = i; | |
| 59 | + while k < d.len() && class(d[k]) == c { | |
| 60 | + k += 1; | |
| 61 | + if c == 1 && k - i == 3 { | |
| 62 | + break; | |
| 63 | + } | |
| 64 | + } | |
| 65 | + k | |
| 66 | +} | |
| 67 | + | |
| 68 | +fn pretok(d: &[u8], f: &mut impl FnMut(&[u8])) { | |
| 69 | + let n = d.len(); | |
| 70 | + let mut i = 0; | |
| 71 | + while i < n { | |
| 72 | + let c = class(d[i]); | |
| 73 | + if c != 2 { | |
| 74 | + let k = run_end(d, i, c); | |
| 75 | + emit_capped(&d[i..k], f); | |
| 76 | + i = k; | |
| 77 | + continue; | |
| 78 | + } | |
| 79 | + let mut j = i; | |
| 80 | + while j < n && class(d[j]) == 2 { | |
| 81 | + j += 1; | |
| 82 | + } | |
| 83 | + if j < n && d[j - 1] == b' ' { | |
| 84 | + if j - 1 > i { | |
| 85 | + emit_capped(&d[i..j - 1], f); | |
| 86 | + i = j - 1; | |
| 87 | + } else { | |
| 88 | + let k = run_end(d, j, class(d[j])); | |
| 89 | + emit_capped(&d[i..k], f); | |
| 90 | + i = k; | |
| 91 | + } | |
| 92 | + } else { | |
| 93 | + emit_capped(&d[i..j], f); | |
| 94 | + i = j; | |
| 95 | + } | |
| 96 | + } | |
| 97 | +} | |
| 98 | + | |
| 99 | +// ---------- tokenizer model ---------- | |
| 100 | +struct Model { | |
| 101 | + merges: Vec<(u32, u32)>, | |
| 102 | + vocab: u32, // includes 256 bytes, merges, and the one special token | |
| 103 | + rank: FxMap<u64, u32>, // pair -> new token id | |
| 104 | +} | |
| 105 | +fn pk(a: u32, b: u32) -> u64 { | |
| 106 | + ((a as u64) << 32) | b as u64 | |
| 107 | +} | |
| 108 | +impl Model { | |
| 109 | + fn new(merges: Vec<(u32, u32)>) -> Model { | |
| 110 | + let mut rank = FxMap::default(); | |
| 111 | + for (i, &(a, b)) in merges.iter().enumerate() { | |
| 112 | + rank.insert(pk(a, b), 256 + i as u32); | |
| 113 | + } | |
| 114 | + let vocab = 256 + merges.len() as u32 + 1; | |
| 115 | + Model { merges, vocab, rank } | |
| 116 | + } | |
| 117 | + fn eos(&self) -> u32 { | |
| 118 | + self.vocab - 1 | |
| 119 | + } | |
| 120 | + fn load(path: &str) -> Model { | |
| 121 | + let f = BufReader::new(std::fs::File::open(path).expect("open tokenizer")); | |
| 122 | + let mut lines = f.lines().map(|l| l.unwrap()); | |
| 123 | + assert_eq!(lines.next().unwrap(), "AIENBPE 1"); | |
| 124 | + let merges_n; | |
| 125 | + let mut vocab = 0u32; | |
| 126 | + loop { | |
| 127 | + let l = lines.next().expect("header"); | |
| 128 | + if let Some(v) = l.strip_prefix("pretok ") { | |
| 129 | + assert_eq!(v, PRETOK_ID); | |
| 130 | + } else if let Some(v) = l.strip_prefix("vocab_size ") { | |
| 131 | + vocab = v.parse().unwrap(); | |
| 132 | + } else if l.starts_with("eos_id ") { | |
| 133 | + } else if let Some(v) = l.strip_prefix("merges ") { | |
| 134 | + merges_n = v.parse().unwrap(); | |
| 135 | + break; | |
| 136 | + } | |
| 137 | + } | |
| 138 | + let mut merges = Vec::with_capacity(merges_n); | |
| 139 | + for _ in 0..merges_n { | |
| 140 | + let l = lines.next().expect("merge line"); | |
| 141 | + let mut it = l.split(' '); | |
| 142 | + merges.push((it.next().unwrap().parse().unwrap(), it.next().unwrap().parse().unwrap())); | |
| 143 | + } | |
| 144 | + let m = Model::new(merges); | |
| 145 | + assert_eq!(m.vocab, vocab, "vocab_size does not match merge count"); | |
| 146 | + m | |
| 147 | + } | |
| 148 | + fn save(&self, path: &str) { | |
| 149 | + let mut w = BufWriter::new(std::fs::File::create(path).unwrap()); | |
| 150 | + writeln!(w, "AIENBPE 1").unwrap(); | |
| 151 | + writeln!(w, "pretok {}", PRETOK_ID).unwrap(); | |
| 152 | + writeln!(w, "vocab_size {}", self.vocab).unwrap(); | |
| 153 | + writeln!(w, "eos_id {}", self.eos()).unwrap(); | |
| 154 | + writeln!(w, "merges {}", self.merges.len()).unwrap(); | |
| 155 | + for &(a, b) in &self.merges { | |
| 156 | + writeln!(w, "{} {}", a, b).unwrap(); | |
| 157 | + } | |
| 158 | + } | |
| 159 | + fn encode_chunk(&self, chunk: &[u8], ids: &mut Vec<u32>) { | |
| 160 | + ids.clear(); | |
| 161 | + ids.extend(chunk.iter().map(|&b| b as u32)); | |
| 162 | + loop { | |
| 163 | + let mut best = u32::MAX; | |
| 164 | + let mut bp = (0, 0); | |
| 165 | + for w in ids.windows(2) { | |
| 166 | + if let Some(&r) = self.rank.get(&pk(w[0], w[1])) { | |
| 167 | + if r < best { | |
| 168 | + best = r; | |
| 169 | + bp = (w[0], w[1]); | |
| 170 | + } | |
| 171 | + } | |
| 172 | + } | |
| 173 | + if best == u32::MAX { | |
| 174 | + return; | |
| 175 | + } | |
| 176 | + let mut o = 0; | |
| 177 | + let mut i = 0; | |
| 178 | + while i < ids.len() { | |
| 179 | + if i + 1 < ids.len() && ids[i] == bp.0 && ids[i + 1] == bp.1 { | |
| 180 | + ids[o] = best; | |
| 181 | + i += 2; | |
| 182 | + } else { | |
| 183 | + ids[o] = ids[i]; | |
| 184 | + i += 1; | |
| 185 | + } | |
| 186 | + o += 1; | |
| 187 | + } | |
| 188 | + ids.truncate(o); | |
| 189 | + } | |
| 190 | + } | |
| 191 | + fn token_bytes(&self) -> Vec<Vec<u8>> { | |
| 192 | + let mut t: Vec<Vec<u8>> = (0..256u32).map(|b| vec![b as u8]).collect(); | |
| 193 | + for &(a, b) in &self.merges { | |
| 194 | + let mut v = t[a as usize].clone(); | |
| 195 | + v.extend_from_slice(&t[b as usize]); | |
| 196 | + t.push(v); | |
| 197 | + } | |
| 198 | + t | |
| 199 | + } | |
| 200 | +} | |
| 201 | + | |
| 202 | +// ---------- streams ---------- | |
| 203 | +fn read_doc(r: &mut impl Read, buf: &mut Vec<u8>) -> bool { | |
| 204 | + let mut l = [0u8; 4]; | |
| 205 | + match r.read_exact(&mut l) { | |
| 206 | + Ok(()) => {} | |
| 207 | + Err(e) if e.kind() == std::io::ErrorKind::UnexpectedEof => return false, | |
| 208 | + Err(e) => panic!("read: {e}"), | |
| 209 | + } | |
| 210 | + buf.resize(u32::from_le_bytes(l) as usize, 0); | |
| 211 | + r.read_exact(buf).expect("short document"); | |
| 212 | + true | |
| 213 | +} | |
| 214 | + | |
| 215 | +// ---------- train ---------- | |
| 216 | +fn train(vocab: u32, min_count: u64) { | |
| 217 | + let mut counts: FxMap<Box<[u8]>, u64> = FxMap::default(); | |
| 218 | + let mut stdin = BufReader::with_capacity(1 << 20, std::io::stdin().lock()); | |
| 219 | + let (mut docs, mut bytes) = (0u64, 0u64); | |
| 220 | + let mut doc = Vec::new(); | |
| 221 | + while read_doc(&mut stdin, &mut doc) { | |
| 222 | + docs += 1; | |
| 223 | + bytes += doc.len() as u64; | |
| 224 | + pretok(&doc, &mut |c| { | |
| 225 | + if let Some(v) = counts.get_mut(c) { | |
| 226 | + *v += 1; | |
| 227 | + } else { | |
| 228 | + counts.insert(c.into(), 1); | |
| 229 | + } | |
| 230 | + }); | |
| 231 | + if docs % 200_000 == 0 { | |
| 232 | + eprintln!("counted docs={docs} bytes={bytes} unique_chunks={}", counts.len()); | |
| 233 | + } | |
| 234 | + } | |
| 235 | + let unique = counts.len(); | |
| 236 | + let mut words: Vec<(Vec<u32>, u64)> = Vec::new(); | |
| 237 | + let mut kept_occ = 0u64; | |
| 238 | + let mut all_occ = 0u64; | |
| 239 | + for (k, v) in counts.drain() { | |
| 240 | + all_occ += v; | |
| 241 | + if v >= min_count { | |
| 242 | + kept_occ += v; | |
| 243 | + words.push((k.iter().map(|&b| b as u32).collect(), v)); | |
| 244 | + } | |
| 245 | + } | |
| 246 | + drop(counts); | |
| 247 | + // deterministic order independent of hash iteration | |
| 248 | + words.sort_by(|a, b| b.1.cmp(&a.1).then_with(|| a.0.cmp(&b.0))); | |
| 249 | + eprintln!( | |
| 250 | + "docs={docs} bytes={bytes} unique_chunks={unique} kept_chunks={} kept_occurrences={kept_occ}/{all_occ}", | |
| 251 | + words.len() | |
| 252 | + ); | |
| 253 | + | |
| 254 | + let mut pc: FxMap<u64, i64> = FxMap::default(); | |
| 255 | + let mut pw: FxMap<u64, Vec<u32>> = FxMap::default(); | |
| 256 | + for (wi, (ids, c)) in words.iter().enumerate() { | |
| 257 | + for w in ids.windows(2) { | |
| 258 | + let k = pk(w[0], w[1]); | |
| 259 | + *pc.entry(k).or_insert(0) += *c as i64; | |
| 260 | + let l = pw.entry(k).or_default(); | |
| 261 | + if l.last() != Some(&(wi as u32)) { | |
| 262 | + l.push(wi as u32); | |
| 263 | + } | |
| 264 | + } | |
| 265 | + } | |
| 266 | + let mut heap: BinaryHeap<(i64, Reverse<u64>)> = pc.iter().map(|(&k, &c)| (c, Reverse(k))).collect(); | |
| 267 | + let nmerge = (vocab - 257) as usize; | |
| 268 | + let mut merges: Vec<(u32, u32)> = Vec::with_capacity(nmerge); | |
| 269 | + let mut delta: FxMap<u64, i64> = FxMap::default(); | |
| 270 | + while merges.len() < nmerge { | |
| 271 | + let best = loop { | |
| 272 | + let Some((c, Reverse(k))) = heap.pop() else { break None }; | |
| 273 | + let cur = pc.get(&k).copied().unwrap_or(0); | |
| 274 | + if cur <= 0 { | |
| 275 | + continue; | |
| 276 | + } | |
| 277 | + if cur != c { | |
| 278 | + heap.push((cur, Reverse(k))); | |
| 279 | + continue; | |
| 280 | + } | |
| 281 | + break Some((k, cur)); | |
| 282 | + }; | |
| 283 | + let Some((k, cnt)) = best else { | |
| 284 | + eprintln!("no pairs left after {} merges", merges.len()); | |
| 285 | + break; | |
| 286 | + }; | |
| 287 | + let (a, b) = ((k >> 32) as u32, (k & 0xFFFF_FFFF) as u32); | |
| 288 | + let new_id = 256 + merges.len() as u32; | |
| 289 | + merges.push((a, b)); | |
| 290 | + let mut list = pw.remove(&k).unwrap_or_default(); | |
| 291 | + list.sort_unstable(); | |
| 292 | + list.dedup(); | |
| 293 | + delta.clear(); | |
| 294 | + for &wi in &list { | |
| 295 | + let (ids, c) = &mut words[wi as usize]; | |
| 296 | + if !ids.windows(2).any(|w| w[0] == a && w[1] == b) { | |
| 297 | + continue; | |
| 298 | + } | |
| 299 | + for w in ids.windows(2) { | |
| 300 | + *delta.entry(pk(w[0], w[1])).or_insert(0) -= *c as i64; | |
| 301 | + } | |
| 302 | + let mut o = 0; | |
| 303 | + let mut i = 0; | |
| 304 | + while i < ids.len() { | |
| 305 | + if i + 1 < ids.len() && ids[i] == a && ids[i + 1] == b { | |
| 306 | + ids[o] = new_id; | |
| 307 | + i += 2; | |
| 308 | + } else { | |
| 309 | + ids[o] = ids[i]; | |
| 310 | + i += 1; | |
| 311 | + } | |
| 312 | + o += 1; | |
| 313 | + } | |
| 314 | + ids.truncate(o); | |
| 315 | + for w in ids.windows(2) { | |
| 316 | + let kk = pk(w[0], w[1]); | |
| 317 | + *delta.entry(kk).or_insert(0) += *c as i64; | |
| 318 | + if w[0] == new_id || w[1] == new_id { | |
| 319 | + let l = pw.entry(kk).or_default(); | |
| 320 | + if l.last() != Some(&wi) { | |
| 321 | + l.push(wi); | |
| 322 | + } | |
| 323 | + } | |
| 324 | + } | |
| 325 | + } | |
| 326 | + for (&kk, &d) in delta.iter() { | |
| 327 | + if d == 0 { | |
| 328 | + continue; | |
| 329 | + } | |
| 330 | + let e = pc.entry(kk).or_insert(0); | |
| 331 | + *e += d; | |
| 332 | + if d > 0 && *e > 0 { | |
| 333 | + heap.push((*e, Reverse(kk))); | |
| 334 | + } | |
| 335 | + } | |
| 336 | + pc.remove(&k); | |
| 337 | + if merges.len() % 2000 == 0 || merges.len() == nmerge { | |
| 338 | + eprintln!("merges={} last_pair_count={cnt}", merges.len()); | |
| 339 | + } | |
| 340 | + } | |
| 341 | + let model = Model::new(merges); | |
| 342 | + // self-check: the encoder must reproduce the trainer's final segmentation | |
| 343 | + let mut tmp = Vec::new(); | |
| 344 | + let mut bad = 0; | |
| 345 | + let bytes_of = model.token_bytes(); | |
| 346 | + for (ids, _) in words.iter().take(300_000) { | |
| 347 | + let mut raw = Vec::new(); | |
| 348 | + for &t in ids { | |
| 349 | + raw.extend_from_slice(&bytes_of[t as usize]); | |
| 350 | + } | |
| 351 | + model.encode_chunk(&raw, &mut tmp); | |
| 352 | + if &tmp != ids { | |
| 353 | + bad += 1; | |
| 354 | + } | |
| 355 | + } | |
| 356 | + eprintln!("selfcheck encoder==trainer on top 300000 chunks: mismatches={bad}"); | |
| 357 | + assert_eq!(bad, 0); | |
| 358 | + model.save(&std::env::args().nth(4).expect("out path")); | |
| 359 | +} | |
| 360 | + | |
| 361 | +// ---------- encode ---------- | |
| 362 | +const HDR: usize = 64; | |
| 363 | +fn header(vocab: u32, dtype: u32, eos: u32, tokens: u64, docs: u64, tok_hash16: [u8; 16]) -> [u8; HDR] { | |
| 364 | + let mut h = [0u8; HDR]; | |
| 365 | + h[0..8].copy_from_slice(b"AIENTOK1"); | |
| 366 | + h[8..12].copy_from_slice(&1u32.to_le_bytes()); | |
| 367 | + h[12..16].copy_from_slice(&vocab.to_le_bytes()); | |
| 368 | + h[16..20].copy_from_slice(&dtype.to_le_bytes()); | |
| 369 | + h[20..24].copy_from_slice(&eos.to_le_bytes()); | |
| 370 | + h[24..32].copy_from_slice(&tokens.to_le_bytes()); | |
| 371 | + h[32..40].copy_from_slice(&docs.to_le_bytes()); | |
| 372 | + h[40..56].copy_from_slice(&tok_hash16); | |
| 373 | + h | |
| 374 | +} | |
| 375 | + | |
| 376 | +fn encode(args: &[String]) { | |
| 377 | + // encode <tok.bpe> <out.tok|-> <threads> <tokfile-sha256-hex16> | |
| 378 | + let model = Model::load(&args[0]); | |
| 379 | + let out_path = &args[1]; | |
| 380 | + let threads: usize = args[2].parse().unwrap(); | |
| 381 | + let mut hash16 = [0u8; 16]; | |
| 382 | + for i in 0..16 { | |
| 383 | + hash16[i] = u8::from_str_radix(&args[3][2 * i..2 * i + 2], 16).unwrap(); | |
| 384 | + } | |
| 385 | + assert!(model.vocab <= 65536, "vocab does not fit uint16"); | |
| 386 | + let mut out = if out_path == "-" { None } else { Some(BufWriter::with_capacity(1 << 22, std::fs::File::create(out_path).unwrap())) }; | |
| 387 | + if let Some(o) = out.as_mut() { | |
| 388 | + o.write_all(&[0u8; HDR]).unwrap(); | |
| 389 | + } | |
| 390 | + let mut stdin = BufReader::with_capacity(1 << 22, std::io::stdin().lock()); | |
| 391 | + let mut caches: Vec<FxMap<Vec<u8>, Box<[u16]>>> = (0..threads).map(|_| FxMap::default()).collect(); | |
| 392 | + let (mut ndocs, mut nbytes, mut ntok) = (0u64, 0u64, 0u64); | |
| 393 | + let mut eof = false; | |
| 394 | + while !eof { | |
| 395 | + let mut batch: Vec<Vec<u8>> = Vec::new(); | |
| 396 | + let mut bb = 0usize; | |
| 397 | + while bb < (48 << 20) { | |
| 398 | + let mut d = Vec::new(); | |
| 399 | + if !read_doc(&mut stdin, &mut d) { | |
| 400 | + eof = true; | |
| 401 | + break; | |
| 402 | + } | |
| 403 | + bb += d.len(); | |
| 404 | + batch.push(d); | |
| 405 | + } | |
| 406 | + if batch.is_empty() { | |
| 407 | + break; | |
| 408 | + } | |
| 409 | + nbytes += bb as u64; | |
| 410 | + ndocs += batch.len() as u64; | |
| 411 | + // split into contiguous groups of roughly equal bytes | |
| 412 | + let per = bb / threads + 1; | |
| 413 | + let mut groups: Vec<&[Vec<u8>]> = Vec::new(); | |
| 414 | + let (mut s, mut acc) = (0usize, 0usize); | |
| 415 | + for (i, d) in batch.iter().enumerate() { | |
| 416 | + acc += d.len(); | |
| 417 | + if acc >= per { | |
| 418 | + groups.push(&batch[s..=i]); | |
| 419 | + s = i + 1; | |
| 420 | + acc = 0; | |
| 421 | + } | |
| 422 | + } | |
| 423 | + if s < batch.len() { | |
| 424 | + groups.push(&batch[s..]); | |
| 425 | + } | |
| 426 | + let eos = model.eos() as u16; | |
| 427 | + let results: Vec<Vec<u16>> = std::thread::scope(|sc| { | |
| 428 | + let hs: Vec<_> = groups | |
| 429 | + .iter() | |
| 430 | + .zip(caches.iter_mut()) | |
| 431 | + .map(|(g, cache)| { | |
| 432 | + let model = &model; | |
| 433 | + sc.spawn(move || { | |
| 434 | + let mut toks: Vec<u16> = Vec::new(); | |
| 435 | + let mut tmp = Vec::new(); | |
| 436 | + for d in g.iter() { | |
| 437 | + pretok(d, &mut |c| { | |
| 438 | + if let Some(t) = cache.get(c) { | |
| 439 | + toks.extend_from_slice(t); | |
| 440 | + } else { | |
| 441 | + model.encode_chunk(c, &mut tmp); | |
| 442 | + let t: Box<[u16]> = tmp.iter().map(|&x| x as u16).collect(); | |
| 443 | + toks.extend_from_slice(&t); | |
| 444 | + if cache.len() >= 1_000_000 { | |
| 445 | + cache.clear(); | |
| 446 | + } | |
| 447 | + cache.insert(c.to_vec(), t); | |
| 448 | + } | |
| 449 | + }); | |
| 450 | + toks.push(eos); | |
| 451 | + } | |
| 452 | + toks | |
| 453 | + }) | |
| 454 | + }) | |
| 455 | + .collect(); | |
| 456 | + hs.into_iter().map(|h| h.join().unwrap()).collect() | |
| 457 | + }); | |
| 458 | + for r in results { | |
| 459 | + ntok += r.len() as u64; | |
| 460 | + if let Some(o) = out.as_mut() { | |
| 461 | + let mut b = Vec::with_capacity(r.len() * 2); | |
| 462 | + for t in r { | |
| 463 | + b.extend_from_slice(&t.to_le_bytes()); | |
| 464 | + } | |
| 465 | + o.write_all(&b).unwrap(); | |
| 466 | + } | |
| 467 | + } | |
| 468 | + } | |
| 469 | + if let Some(mut o) = out { | |
| 470 | + o.flush().unwrap(); | |
| 471 | + let mut f = o.into_inner().unwrap(); | |
| 472 | + f.seek(SeekFrom::Start(0)).unwrap(); | |
| 473 | + f.write_all(&header(model.vocab, 2, model.eos(), ntok, ndocs, hash16)).unwrap(); | |
| 474 | + } | |
| 475 | + println!("{{\"docs\":{ndocs},\"bytes\":{nbytes},\"tokens\":{ntok},\"bytes_per_token\":{:.5}}}", nbytes as f64 / ntok as f64); | |
| 476 | +} | |
| 477 | + | |
| 478 | +fn decode(args: &[String]) { | |
| 479 | + // decode <tok.bpe> <in.tok> -> document stream on stdout | |
| 480 | + let model = Model::load(&args[0]); | |
| 481 | + let tb = model.token_bytes(); | |
| 482 | + let mut f = BufReader::with_capacity(1 << 22, std::fs::File::open(&args[1]).unwrap()); | |
| 483 | + let mut h = [0u8; HDR]; | |
| 484 | + f.read_exact(&mut h).unwrap(); | |
| 485 | + assert_eq!(&h[0..8], b"AIENTOK1"); | |
| 486 | + assert_eq!(u32::from_le_bytes(h[12..16].try_into().unwrap()), model.vocab); | |
| 487 | + let eos = model.eos(); | |
| 488 | + let mut out = BufWriter::with_capacity(1 << 22, std::io::stdout().lock()); | |
| 489 | + let mut cur: Vec<u8> = Vec::new(); | |
| 490 | + let mut b = [0u8; 2]; | |
| 491 | + while f.read_exact(&mut b).is_ok() { | |
| 492 | + let t = u16::from_le_bytes(b) as u32; | |
| 493 | + if t == eos { | |
| 494 | + out.write_all(&(cur.len() as u32).to_le_bytes()).unwrap(); | |
| 495 | + out.write_all(&cur).unwrap(); | |
| 496 | + cur.clear(); | |
| 497 | + } else { | |
| 498 | + cur.extend_from_slice(&tb[t as usize]); | |
| 499 | + } | |
| 500 | + } | |
| 501 | + assert!(cur.is_empty(), "token file does not end with EOS"); | |
| 502 | +} | |
| 503 | + | |
| 504 | +fn truncate(args: &[String]) { | |
| 505 | + // truncate <in.bpe> <vocab> <out.bpe> | |
| 506 | + let m = Model::load(&args[0]); | |
| 507 | + let v: u32 = args[1].parse().unwrap(); | |
| 508 | + let n = (v - 257) as usize; | |
| 509 | + assert!(n <= m.merges.len()); | |
| 510 | + Model::new(m.merges[..n].to_vec()).save(&args[2]); | |
| 511 | +} | |
| 512 | + | |
| 513 | +fn main() { | |
| 514 | + let a: Vec<String> = std::env::args().collect(); | |
| 515 | + match a.get(1).map(|s| s.as_str()) { | |
| 516 | + // train <vocab> <min_count> <out.bpe> | |
| 517 | + Some("train") => train(a[2].parse().unwrap(), a[3].parse().unwrap()), | |
| 518 | + Some("encode") => encode(&a[2..]), | |
| 519 | + Some("decode") => decode(&a[2..]), | |
| 520 | + Some("truncate") => truncate(&a[2..]), | |
| 521 | + _ => eprintln!("usage: aienbpe train <vocab> <min_count> <out.bpe> | encode <tok.bpe> <out.tok|-> <threads> <hash16hex> | decode <tok.bpe> <in.tok> | truncate <in.bpe> <vocab> <out.bpe>"), | |
| 522 | + } | |
| 523 | +} |
streams/data/extract.py
| new file mode 100644 | ||
| @@ -0,0 +1,21 @@ | ||
| 1 | +#!/usr/bin/env python3 | |
| 2 | +"""Data preparation only (not the product path): stream the `text` column of FineWeb-Edu parquet | |
| 3 | +shards to stdout as length-prefixed documents: u32 little-endian byte length, then UTF-8 bytes. | |
| 4 | +Usage: extract.py <shard.parquet> [--skip-docs N] [--max-docs N] [--max-bytes N] | |
| 5 | +Prints nothing else on stdout. Run with the pyarrow venv.""" | |
| 6 | +import sys, struct, argparse | |
| 7 | +import pyarrow.parquet as pq | |
| 8 | +ap = argparse.ArgumentParser() | |
| 9 | +ap.add_argument("shard"); ap.add_argument("--skip-docs", type=int, default=0) | |
| 10 | +ap.add_argument("--max-docs", type=int, default=1 << 62); ap.add_argument("--max-bytes", type=int, default=1 << 62) | |
| 11 | +a = ap.parse_args() | |
| 12 | +out = sys.stdout.buffer | |
| 13 | +seen = emitted = nbytes = 0 | |
| 14 | +for batch in pq.ParquetFile(a.shard).iter_batches(batch_size=2048, columns=["text"]): | |
| 15 | + for t in batch.column(0).to_pylist(): | |
| 16 | + seen += 1 | |
| 17 | + if seen <= a.skip_docs: continue | |
| 18 | + if emitted >= a.max_docs or nbytes >= a.max_bytes: sys.exit(0) | |
| 19 | + b = t.encode("utf-8") | |
| 20 | + out.write(struct.pack("<I", len(b))); out.write(b) | |
| 21 | + emitted += 1; nbytes += len(b) |
streams/data/fetch.sh
| new file mode 100644 | ||
| @@ -0,0 +1,21 @@ | ||
| 1 | +#!/bin/bash | |
| 2 | +# Fetch FineWeb-Edu sample-10BT parquet shards at a pinned Hub revision, verify each against the | |
| 3 | +# sha256 the Hub publishes (LFS oid), resume-safe. Usage: fetch.sh <dest-dir> <tree.json> | |
| 4 | +set -u | |
| 5 | +REV=87f09149ef4734204d70ed1d046ddc9ca3f2b8f9 | |
| 6 | +DEST=$1; TREE=$2 | |
| 7 | +python3 -I - "$TREE" <<'P' > "$DEST/.list" | |
| 8 | +import json,sys | |
| 9 | +for f in json.load(open(sys.argv[1])): | |
| 10 | + print(f['path'].split('/')[-1], f['size'], f['lfs']['oid']) | |
| 11 | +P | |
| 12 | +while read -r name size oid; do | |
| 13 | + f="$DEST/$name" | |
| 14 | + have=$(stat -c %s "$f" 2>/dev/null || echo 0) | |
| 15 | + if [ "$have" != "$size" ]; then | |
| 16 | + nice -n 19 ionice -c 3 curl -sSL --retry 8 --retry-delay 5 -C - -o "$f" \ | |
| 17 | + "https://huggingface.co/datasets/HuggingFaceFW/fineweb-edu/resolve/$REV/sample/10BT/$name" || { echo "FAIL $name"; continue; } | |
| 18 | + fi | |
| 19 | + got=$(nice -n 19 ionice -c 3 sha256sum "$f" | cut -d' ' -f1) | |
| 20 | + if [ "$got" = "$oid" ]; then echo "OK $name $got"; else echo "MISMATCH $name got=$got want=$oid"; fi | |
| 21 | +done < "$DEST/.list" |
streams/efficiency/sources.tsv
| new file mode 100644 | ||
| @@ -0,0 +1,68 @@ | ||
| 1 | +1 https://www.nvidia.com/en-us/products/workstations/dgx-spark/ NVIDIA DGX Spark product page 2026-10-20 Memory Interface 256-bit Memory Bandwidth 273 GB/s ... Experience up to 1 petaFLOP of AI performance at FP4 precision with the NVIDIA Grace Blackwell architecture. | |
| 2 | +2 https://docs.nvidia.com/dgx/dgx-spark/hardware.html DGX Spark User Guide: Hardware 2026-10-20 CUDA Cores: 6,144 Copy Engines: 2 ... Memory Bandwidth: 273 GB/s Memory Channels: 16 channels (256 bit) LPDDR5X 8533 ... up to 1 PFLOP (petaFLOP) at FP4 precision with sparsity | |
| 3 | +3 https://www.hc2025.hotchips.org/assets/program/conference/day2/21_nvidia_skende_final.pdf NVIDIA GB10 SoC, Hot Chips 2025 slides 2025-08 Large graphics L2 (GL2) • 24MB, provides GPU compute units with large local bandwidth | |
| 4 | +4 https://docs.nvidia.com/cuda/cuda-programming-guide/05-appendices/compute-capabilities.html CUDA Programming Guide, Appendix: Compute Capabilities 2026-10-20 Number of 32-bit registers per SM 64 K ... 12.x 128 0, 8, 16, 32, 64, 100 | |
| 5 | +5 https://geizhals.de/lenovo-thinkstation-pgx-dgx-spark-30kl0073gf-a3959977.html Geizhals listing, Lenovo ThinkStation PGX (DGX Spark) 2026-10-20 48SM/6144SP/384TMU/48ROP ... 192 Tensor-Cores (5th Gen) | |
| 6 | +6 https://www.storagereview.com/review/nvidia-dgx-spark-review-the-ai-appliance-bringing-datacenter-capabilities-to-desktops NVIDIA DGX Spark review, StorageReview 2026-10-20 At BF16 precision, we observe a MAMF of 99.8 TFLOPs, while FP8 (E4M3) demonstrates a MAMF of 207.7 TFLOPs. | |
| 7 | +7 https://arxiv.org/abs/2001.08361 Scaling Laws for Neural Language Models (Kaplan et al.) 2020-01-23 Larger models are significantly more sample-efficient, such that optimally compute-efficient training involves training very large models on a relatively modest amount of data and stopping significantly before convergence. | |
| 8 | +8 https://arxiv.org/abs/2203.15556 Training Compute-Optimal Large Language Models (Hoffmann et al., Chinchilla) 2022-03-29 for compute-optimal training, the model size and the number of training tokens should be scaled equally: for every doubling of model size the number of training tokens should also be doubled. | |
| 9 | +9 https://ai.meta.com/blog/meta-llama-3/ Introducing Meta Llama 3 2026-10-20 the Chinchilla-optimal amount of training compute for an 8B parameter model corresponds to ~200B tokens, ... we found that model performance continues to improve even after the model is trained on two orders of magnitude more data. | |
| 10 | +10 https://arxiv.org/abs/2302.13971 LLaMA: Open and Efficient Foundation Language Models 2023-02-27 LLaMA-13B outperforms GPT-3 (175B) on most benchmarks | |
| 11 | +11 https://arxiv.org/abs/2305.16264 Scaling Data-Constrained Language Models (Muennighoff et al.) 2023-05-25 training with up to 4 epochs of repeated data yields negligible changes to loss compared to having unique data. However, with more repetition, the value of adding compute eventually decays to zero. | |
| 12 | +12 https://arxiv.org/abs/2407.21783 The Llama 3 Herd of Models 2024-07-31 While our scaling laws suggest our flagship model is an approximately compute-optimal size for our training budget, we also train our smaller models for much longer than is compute-optimal. ... we achieve an overall BF16 Model FLOPs Utilization (MFU; Chowdhery et al. (2023)) of 38-43% for the configurations shown in Table 4. | |
| 13 | +13 https://raw.githubusercontent.com/KellerJordan/modded-nanogpt/master/README.md modded-nanogpt README (record tables) 2026-10-20 This repository hosts the *NanoGPT speedrun*, in which we (collaboratively|competitively) search for the fastest algorithm to use 8 NVIDIA H100 GPUs to train a language model that attains 3.28 cross-entropy loss on the FineWeb validation set. | |
| 14 | +14 https://github.com/karpathy/llm.c/discussions/481 llm.c discussion 481: reproducing GPT-2 (124M) 2026-10-20 reproducing this model on one 8X A100 80GB SXM node takes ~90 minutes ... -d 524288 requests that the total batch size per single update be ~0.5M tokens ... On 8X A100 80GB SXM the 350M stepped at 820ms/iter. Trained for 60K steps (instead of ~20K), for a total of ~30B tokens (instead of ~10B tokens). Total training time 14 hours. | |
| 15 | +15 https://kellerjordan.github.io/posts/muon/ Muon: An optimizer for hidden layers in neural networks (Keller Jordan) 2026-10-20 Muon has a FLOP overhead below 1% | |
| 16 | +16 https://arxiv.org/abs/2212.14034 Cramming: Training a Language Model on a Single GPU in One Day 2022-12-28 How far can we get with a single GPU in just one day? | |
| 17 | +17 https://arxiv.org/abs/2305.07759 TinyStories: How Small Can Language Models Be and Still Speak Coherent English? 2023-05-12 We show that TinyStories can be used to train and evaluate LMs that are much smaller than the state-of-the-art models (below 10 million total parameters), or have much simpler architectures (with only one transformer block), yet still produce fluent and consistent stories | |
| 18 | +18 https://arxiv.org/abs/2306.11644 Textbooks Are All You Need (phi-1) 2023-06-20 phi-1 is a Transformer-based model with 1.3B parameters, trained for 4 days on 8 A100s | |
| 19 | +19 https://github.com/alexjc/nanogpt-speedrun alexjc/nanogpt-speedrun (fork of modded-nanogpt) 2026-10-20 4.7 minutes on 8xH100 instead of 45 | |
| 20 | +20 https://www.microsoft.com/en-us/research/blog/phi-2-the-surprising-power-of-small-language-models/ Phi-2: The surprising power of small language models (Microsoft Research) 2023-12-12 The training for Phi-2 took 14 days on 96 A100 GPUs | |
| 21 | +21 https://arxiv.org/abs/2504.08165 Findings of the BabyLM Challenge: Sample-Efficient Pretraining on Developmentally Plausible Corpora 2025-04-10 The winning submissions using the LTG-BERT architecture (Samuel et al., 2023) outperformed models trained on trillions of words. | |
| 22 | +22 https://arxiv.org/abs/2406.17557 The FineWeb Datasets: Decanting the Web for the Finest Text Data at Scale 2024-06-25 On MMLU, FineWeb-Edu can match the final performance of Matrix with almost 10x fewer tokens | |
| 23 | +23 https://arxiv.org/abs/2406.11794 DataComp-LM: In search of the next generation of training sets for language models 2024-06-17 Our baseline model is also comparable to Mistral-7B-v0.3 and Llama 3 8B on MMLU (63% & 66%), and performs similarly on an average of 53 natural language understanding tasks while being trained with 6.6× less compute than Llama 3 8B. | |
| 24 | +24 https://arxiv.org/abs/2501.00656 2 OLMo 2 Furious 2024-12-31 Our OLMo 2 base models sit at the Pareto frontier of performance to training compute, often matching or outperforming open-weight only models like Llama 3.1, Qwen 2.5, and Gemma 2 while using fewer FLOPs | |
| 25 | +25 https://arxiv.org/abs/2402.00159 Dolma: an Open Corpus of Three Trillion Tokens for Language Model Pretraining Research 2024-01-31 we curate and release Dolma, a three-trillion-token English corpus, built from a diverse mixture of web content, scientific papers, code, public-domain books, social media, and encyclopedic materials. | |
| 26 | +26 https://arxiv.org/abs/2412.19437 DeepSeek-V3 Technical Report 2024-12-27 compared with the BF16 baseline, the relative loss error of our FP8-training model remains consistently below 0.25%, a level well within the acceptable range of training randomness. ... DeepSeek-V3, a strong Mixture-of-Experts (MoE) language model with 671B total parameters with 37B activated for each token. | |
| 27 | +27 https://arxiv.org/abs/2509.25149 Pretraining Large Language Models with NVFP4 2025-09-29 We validate our approach by training a 12-billion-parameter model on 10 trillion tokens -- the longest publicly documented training run in 4-bit precision to date. | |
| 28 | +28 https://arxiv.org/abs/2209.05433 FP8 Formats for Deep Learning 2022-09-12 we propose an 8-bit floating point (FP8) binary interchange format consisting of two encodings - E4M3 (4-bit exponent and 3-bit mantissa) and E5M2 (5-bit exponent and 2-bit mantissa). | |
| 29 | +29 https://arxiv.org/abs/2310.18313 FP8-LM: Training FP8 Large Language Models 2023-10-27 during the training of GPT-175B model on H100 GPU platform, our FP8 mixed-precision training framework not only achieved a remarkable 39% reduction in real memory usage but also ran 75% faster than the widely adopted BF16 framework (i.e., Megatron-LM) | |
| 30 | +30 https://arxiv.org/abs/2402.17764 The Era of 1-bit LLMs: All Large Language Models are in 1.58 Bits (BitNet b1.58) 2024-02-27 every single parameter (or weight) of the LLM is ternary {-1, 0, 1}. It matches the full-precision (i.e., FP16 or BF16) Transformer LLM with the same model size and training tokens in terms of both perplexity and end-task performance | |
| 31 | +31 https://forums.developer.nvidia.com/t/fp4-on-dgx-spark-why-it-doesnt-scale-like-youd-expect/360142 FP4 on DGX Spark: why it doesn't scale like you'd expect (NVIDIA Developer Forums) 2026-10-20 Die Tensor Cores sind leistungsfaehig (356 TFLOPS NVFP4, 188 TFLOPS FP8) aber architekturbedingt verschieden von SM100 | |
| 32 | +32 https://arxiv.org/abs/2205.14135 FlashAttention: Fast and Memory-Efficient Exact Attention with IO-Awareness 2022-05-27 FlashAttention, an IO-aware exact attention algorithm that uses tiling to reduce the number of memory reads/writes between GPU high bandwidth memory (HBM) and GPU on-chip SRAM. ... 15% end-to-end wall-clock speedup on BERT-large (seq. length 512) compared to the MLPerf 1.1 training speed record | |
| 33 | +33 https://arxiv.org/abs/2307.08691 FlashAttention-2: Faster Attention with Better Parallelism and Work Partitioning 2023-07-17 FlashAttention-2 reaches training speed of up to 225 TFLOPs/s per A100 GPU (72% model FLOPs utilization). | |
| 34 | +34 https://arxiv.org/abs/2407.08608 FlashAttention-3: Fast and Accurate Attention with Asynchrony and Low-precision 2024-07-11 achieves speedup on H100 GPUs by 1.5-2.0× with FP16 reaching up to 740 TFLOPs/s (75% utilization), and with FP8 reaching close to 1.2 PFLOPs/s. | |
| 35 | +35 https://hazyresearch.stanford.edu/blog/2025-05-27-no-bubbles Look Ma, No Bubbles! Designing a Low-Latency Megakernel for Llama-1B (Hazy Research) 2025-05-27 on an H100, we use 78% of memory bandwidth and outperform existing systems by over 1.5x. | |
| 36 | +36 https://arxiv.org/abs/2512.22219 MPK: A Compiler and Runtime for Mega-Kernelizing Tensor Programs (Mirage Persistent Kernel) 2025-12-22 achieving up to 1.7× lower end-to-end inference latency and pushing LLM inference performance close to the limits of the underlying hardware | |
| 37 | +37 https://arxiv.org/abs/1910.02054 ZeRO: Memory Optimizations Toward Training Trillion Parameter Models 2019-10-04 Mixed-precision Adam has K = 12. In total, this results in 2Ψ + 2Ψ + KΨ = 16Ψ bytes | |
| 38 | +38 https://arxiv.org/abs/1604.06174 Training Deep Nets with Sublinear Memory Cost 2016-04-21 we can reduce the memory cost of a 1,000-layer deep residual network from 48G to 7G with only 30 percent additional running time cost on ImageNet problems | |
| 39 | +39 https://arxiv.org/abs/2205.05198 Reducing Activation Recomputation in Large Transformer Models 2022-05-10 Activations memory per layer = sbh(34 + 5as/h) | |
| 40 | +40 https://arxiv.org/abs/2410.10989 Liger Kernel: Efficient Triton Kernels for LLM Training 2024-10-14 our kernels achieve on average a 20% increase in training throughput and a 60% reduction in GPU memory usage for popular LLMs compared to HuggingFace implementations | |
| 41 | +41 https://arxiv.org/abs/2503.11698 A Comparison of the Cerebras Wafer-Scale Integration Technology with Nvidia GPU-based Systems for Artificial Intelligence 2025-03-11 integrates 4 trillion transistors, 900,000 AI-optimized cores, and 44 GB of on-chip SRAM. It achieves a peak computing performance of 125 petaflops and a memory bandwidth of 21 petabytes per second. | |
| 42 | +42 https://arxiv.org/abs/2301.13637 Tricking AI chips into Simulating the Human Brain: A Detailed Performance Analysis (GroqChip section) 2023-01-31 The memory modules add up to a total of 220 MiB of on-chip SRAM. | |
| 43 | +43 https://arxiv.org/abs/2304.03208 Cerebras-GPT: Open Compute-Optimal Language Models Trained on the Cerebras Wafer-Scale Cluster 2023-04-06 Cerebras-GPT, a family of open compute-optimal language models scaled from 111M to 13B parameters. | |
| 44 | +44 https://arxiv.org/abs/2005.14165 Language Models are Few-Shot Learners (GPT-3), model table 2020-05-28 GPT-3 Small 125M 12 768 12 64 0.5M 6.0 × 10−4 ... GPT-3 XL 1.3B 24 2048 24 128 1M 2.0 × 10−4 | |
| 45 | +45 https://arxiv.org/abs/2101.03961 Switch Transformers: Scaling to Trillion Parameter Models with Simple and Efficient Sparsity 2021-01-11 We design models based off T5-Base and T5-Large to obtain up to 7x increases in pre-training speed with the same computational resources. | |
| 46 | +46 https://arxiv.org/abs/2401.06066 DeepSeekMoE: Towards Ultimate Expert Specialization in Mixture-of-Experts Language Models 2024-01-11 we scale up DeepSeekMoE to 16B parameters and show that it achieves comparable performance with LLaMA2 7B, with only about 40% of computations. | |
| 47 | +47 https://arxiv.org/abs/2002.10957 MiniLM: Deep Self-Attention Distillation for Task-Agnostic Compression of Pre-Trained Transformers 2020-02-25 it retains more than 99% accuracy on SQuAD 2.0 and several GLUE benchmark tasks using 50% of the Transformer parameters and computations of the teacher model. | |
| 48 | +48 https://arxiv.org/abs/2408.00118 Gemma 2: Improving Open Language Models at a Practical Size 2024-07-31 We also train the 2B and 9B models with knowledge distillation (Hinton et al., 2015) instead of next token prediction. The resulting models deliver the best performance for their size, and even offer competitive alternatives to models that are 2-3 times bigger. | |
| 49 | +49 https://arxiv.org/abs/2501.12948 DeepSeek-R1: Incentivizing Reasoning Capability in LLMs via Reinforcement Learning 2025-01-22 DeepSeek-R1-Distill-Qwen-7B achieves 55.5% on AIME 2024, surpassing QwQ-32B-Preview. | |
| 50 | +50 https://arxiv.org/abs/2405.15319 Stacking Your Transformers: A Closer Look at Model Growth for Efficient LLM Pre-Training 2024-05-24 compared to a conventionally trained 7B model using 300B tokens, our G_stack model converges to the same loss with 194B tokens, resulting in a 54.6% speedup. | |
| 51 | +51 https://arxiv.org/abs/2212.05055 Sparse Upcycling: Training Mixture-of-Experts from Dense Checkpoints 2022-12-09 significantly outperform their dense counterparts on SuperGLUE and ImageNet, using only ~50% of the initial dense pretraining sunk cost. | |
| 52 | +52 https://arxiv.org/abs/2401.02415 LLaMA Pro: Progressive LLaMA with Block Expansion 2024-01-04 We tune the expanded blocks using only new corpus, efficiently and effectively improving the model's knowledge without catastrophic forgetting. | |
| 53 | +53 https://arxiv.org/abs/2501.19393 s1: Simple test-time scaling 2025-01-31 our model s1-32B exceeds o1-preview on competition math questions by up to 27% (MATH and AIME24). Further, scaling s1-32B with budget forcing allows extrapolating beyond its performance without test-time intervention: from 50% to 57% on AIME24. | |
| 54 | +54 https://arxiv.org/abs/2408.03314 Scaling LLM Test-Time Compute Optimally can be More Effective than Scaling Model Parameters 2024-08-06 in a FLOPs-matched evaluation, we find that on problems where a smaller base model attains somewhat non-trivial success rates, test-time compute can be used to outperform a 14x larger model. | |
| 55 | +55 https://arxiv.org/abs/1802.09568 Shampoo: Preconditioned Stochastic Tensor Optimization 2018-02-26 Our experiments with state-of-the-art deep learning models show that Shampoo is capable of converging considerably faster than commonly used optimizers. | |
| 56 | +56 https://arxiv.org/abs/2409.11321 SOAP: Improving and Stabilizing Shampoo using Adam 2024-09-17 In the large batch regime, SOAP reduces the number of iterations by over 40% and wall clock time by over 35% compared to AdamW, with approximately 20% improvements in both metrics compared to Shampoo. | |
| 57 | +57 https://arxiv.org/abs/2305.14342 Sophia: A Scalable Stochastic Second-order Optimizer for Language Model Pre-training 2023-05-23 On language modeling with GPT models of sizes ranging from 125M to 1.5B, Sophia achieves a 2x speed-up compared to Adam in the number of steps, total compute, and wall-clock time | |
| 58 | +58 https://arxiv.org/abs/2302.06675 Symbolic Discovery of Optimization Algorithms (Lion) 2023-02-13 It is more memory-efficient than Adam as it only keeps track of the momentum. | |
| 59 | +59 https://arxiv.org/abs/2404.06395 MiniCPM: Unveiling the Potential of Small Language Models with Scalable Training Strategies 2024-04-09 we introduce a Warmup-Stable-Decay (WSD) learning rate scheduler (LRS), conducive to continuous training and domain adaptation. | |
| 60 | +60 https://arxiv.org/abs/2502.16982 Muon is Scalable for LLM Training 2025-02-24 Scaling law experiments indicate that Muon achieves ~2× computational efficiency compared to AdamW with compute optimal training. | |
| 61 | +61 https://arxiv.org/abs/2505.02222 Practical Efficiency of Muon for Pretraining 2025-05-04 We demonstrate that Muon, the simplest instantiation of a second-order optimizer, explicitly expands the Pareto frontier over AdamW on the compute-time tradeoff. | |
| 62 | +62 https://arxiv.org/abs/2509.02046 Fantastic Pretraining Optimizers and Where to Find Them 2025-09-02 the speedup of matrix-based optimizers is inversely proportional to model scale, decreasing from 1.4x over AdamW for 0.1B parameter models to merely 1.1x for 1.2B parameter models. | |
| 63 | +63 https://github.com/karpathy/nanochat karpathy/nanochat (repository README) 2026-10-20 you can train your own GPT-2 capability LLM (which cost ~$43,000 to train in 2019) for only $48 (~2 hours of 8XH100 GPU node) ... but you'll have to wait 8 times longer. | |
| 64 | +64 https://github.com/karpathy/nanochat/discussions/28 Anyone managed to run training on an NVIDIA Spark yet? (nanochat Discussion #28) 2025-10-14 Mine just finished pre-training after 14,137.8 minutes = 235.63 hours = 9.8 days (pretty much as expected). | |
| 65 | +65 https://forums.developer.nvidia.com/t/pretrain-nanochat-on-2-x-dgx-sparks/350564 Pretrain nanochat on 2 x DGX Sparks (NVIDIA Developer Forums) 2025-11-07 Training takes about 4.5 days (half the Training time on 1 DGX Spark). | |
| 66 | +66 https://arxiv.org/abs/2606.22189 L20-Edu-135M: An Auditable Single-GPU Study of Data-Efficient Small Language Modeling 2026-06-20 At that rate, the 10B-token run takes about 72 GPU-hours. | |
| 67 | +67 https://arxiv.org/abs/2401.02385 TinyLlama: An Open-Source Small Language Model 2024-01-04 We present TinyLlama, a compact 1.1B language model pretrained on around 1 trillion tokens for approximately 3 epochs. ... We pretrain TinyLlama with 16 A100-40G GPUs in our project. | |
| 68 | +68 https://github.com/karpathy/nanoGPT karpathy/nanoGPT (README) 2026-10-20 On one A100 GPU this training run takes about 3 minutes and the best validation loss is 1.4697. |
streams/math-training/common.py
| new file mode 100644 | ||
| @@ -0,0 +1,99 @@ | ||
| 1 | +# Shared pieces for the L283 math-training experiments: data, frozen model, feature extraction, receipts. | |
| 2 | +# PyTorch here is an oracle (feature extraction and baselines), never the product path. | |
| 3 | +import hashlib, json, os, platform, subprocess, sys, time | |
| 4 | +import numpy as np | |
| 5 | +import torch | |
| 6 | + | |
| 7 | +ROOT = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) | |
| 8 | +SCRATCH = os.path.join(ROOT, ".scratch") | |
| 9 | +EVID = os.path.join(ROOT, "evidence", "math-training") | |
| 10 | +MODEL_DIR = os.path.expanduser("~/models/SmolLM2-1.7B-Instruct-31b70e2e869a") | |
| 11 | +MODEL_SHA = "f55217be716b6a997b97b9d8d7eb6fad02e00858f5010ec24f64603c3a98a0e8" # PROVENANCE.md, model.safetensors | |
| 12 | +SEQ = 256 | |
| 13 | +DEV = "cuda" | |
| 14 | + | |
| 15 | + | |
| 16 | +def code_sha(): | |
| 17 | + return subprocess.run(["git", "-C", ROOT, "rev-parse", "HEAD"], capture_output=True, text=True).stdout.strip() | |
| 18 | + | |
| 19 | + | |
| 20 | +def code_dirty(): | |
| 21 | + out = subprocess.run(["git", "-C", ROOT, "status", "--porcelain", "streams"], capture_output=True, text=True).stdout | |
| 22 | + return bool(out.strip()) | |
| 23 | + | |
| 24 | + | |
| 25 | +def receipt(name, payload): | |
| 26 | + """Write evidence/math-training/<name>.json with chip, model sha, code sha and command.""" | |
| 27 | + os.makedirs(EVID, exist_ok=True) | |
| 28 | + gpu = torch.cuda.get_device_name(0) if torch.cuda.is_available() else "none" | |
| 29 | + body = { | |
| 30 | + "chip": "GB10 (DGX Spark)", "torch_device": gpu, "host": platform.node(), | |
| 31 | + "model": MODEL_DIR, "model_sha256": MODEL_SHA, | |
| 32 | + "code_sha": code_sha(), "code_dirty": code_dirty(), | |
| 33 | + "command": " ".join([os.path.relpath(sys.executable, os.path.expanduser("~")) if sys.executable.startswith(os.path.expanduser("~")) else sys.executable] + sys.argv), | |
| 34 | + "utc": time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime()), | |
| 35 | + "torch": torch.__version__, "numpy": np.__version__, | |
| 36 | + **payload, | |
| 37 | + } | |
| 38 | + path = os.path.join(EVID, name + ".json") | |
| 39 | + with open(path, "w") as f: | |
| 40 | + json.dump(body, f, indent=1, default=float) | |
| 41 | + print("receipt", path) | |
| 42 | + return path | |
| 43 | + | |
| 44 | + | |
| 45 | +def load_split(split): | |
| 46 | + with open(os.path.join(SCRATCH, f"gsm8k-{split}.jsonl")) as f: | |
| 47 | + return [json.loads(l) for l in f] | |
| 48 | + | |
| 49 | + | |
| 50 | +def text_of(ex): | |
| 51 | + return "Question: " + ex["question"] + "\nAnswer: " + ex["answer"] | |
| 52 | + | |
| 53 | + | |
| 54 | +def load_model(dtype=torch.bfloat16): | |
| 55 | + from transformers import AutoModelForCausalLM, AutoTokenizer | |
| 56 | + tok = AutoTokenizer.from_pretrained(MODEL_DIR) | |
| 57 | + model = AutoModelForCausalLM.from_pretrained(MODEL_DIR, dtype=dtype).to(DEV) | |
| 58 | + model.eval() | |
| 59 | + return tok, model | |
| 60 | + | |
| 61 | + | |
| 62 | +def encode(tok, exs, seq=SEQ): | |
| 63 | + """Token id lists, one per example, truncated to seq.""" | |
| 64 | + return [tok(text_of(e), add_special_tokens=False)["input_ids"][:seq] for e in exs] | |
| 65 | + | |
| 66 | + | |
| 67 | +def batches(ids, bs): | |
| 68 | + for i in range(0, len(ids), bs): | |
| 69 | + chunk = ids[i:i + bs] | |
| 70 | + L = max(len(c) for c in chunk) | |
| 71 | + x = torch.full((len(chunk), L), 2, dtype=torch.long) | |
| 72 | + m = torch.zeros((len(chunk), L), dtype=torch.bool) | |
| 73 | + for j, c in enumerate(chunk): | |
| 74 | + x[j, :len(c)] = torch.tensor(c) | |
| 75 | + m[j, :len(c)] = True | |
| 76 | + yield x, m | |
| 77 | + | |
| 78 | + | |
| 79 | +@torch.no_grad() | |
| 80 | +def extract_final(model, ids, cap_tokens, bs=16): | |
| 81 | + """Final-norm hidden state h_t (fp32) and next token y_t for positions t with a next token, up to cap_tokens.""" | |
| 82 | + feats, ys, n = [], [], 0 | |
| 83 | + for x, m in batches(ids, bs): | |
| 84 | + x, m = x.to(DEV), m.to(DEV) | |
| 85 | + out = model.model(input_ids=x, attention_mask=m.long()) | |
| 86 | + h = out.last_hidden_state # after the final RMSNorm | |
| 87 | + valid = m[:, 1:] & m[:, :-1] | |
| 88 | + feats.append(h[:, :-1][valid].float().cpu()) | |
| 89 | + ys.append(x[:, 1:][valid].cpu()) | |
| 90 | + n += int(valid.sum()) | |
| 91 | + if n >= cap_tokens: | |
| 92 | + break | |
| 93 | + X = torch.cat(feats)[:cap_tokens] | |
| 94 | + Y = torch.cat(ys)[:cap_tokens] | |
| 95 | + return X, Y | |
| 96 | + | |
| 97 | + | |
| 98 | +def sha_of_tensor(t): | |
| 99 | + return hashlib.sha256(t.contiguous().numpy().tobytes()).hexdigest() |
streams/math-training/e1.py
| new file mode 100644 | ||
| @@ -0,0 +1,412 @@ | ||
| 1 | +# E1: direct head solve vs gradient training on frozen SmolLM2-1.7B features. | |
| 2 | +# python e1.py sweep -> picks every hyperparameter on the val split, scores test once, writes e1-sweep.json | |
| 3 | +# python e1.py time -> re-runs the chosen configs 3x (run under quiet-measure), writes e1-time.json | |
| 4 | +# Task A: next token over the K most frequent fit next-tokens + OTHER (K+1 classes). | |
| 5 | +# Task B: binary, "the next token is a digit". | |
| 6 | +# Cost unit: one "pass" = every row of X read once (a fused X W and X^T R over a chunk counts as one pass). | |
| 7 | +import json, os, sys, time, math | |
| 8 | +import torch | |
| 9 | +from common import * | |
| 10 | + | |
| 11 | +torch.backends.cuda.matmul.allow_tf32 = False | |
| 12 | +torch.backends.cudnn.allow_tf32 = False | |
| 13 | +K = 1024 | |
| 14 | +CH = 16384 | |
| 15 | +MODE = sys.argv[1] if len(sys.argv) > 1 else "sweep" | |
| 16 | + | |
| 17 | + | |
| 18 | +def sync(): | |
| 19 | + torch.cuda.synchronize() | |
| 20 | + | |
| 21 | + | |
| 22 | +def load(name): | |
| 23 | + d = torch.load(os.path.join(SCRATCH, f"e1-{name}.pt")) | |
| 24 | + X = torch.cat([d["X"], torch.ones(d["X"].shape[0], 1)], 1) # append 1 so every head has a bias row | |
| 25 | + return X.to(DEV), d["Y"].to(DEV) | |
| 26 | + | |
| 27 | + | |
| 28 | +Xf, Yf = load("fit") | |
| 29 | +Xv, Yv = load("val") | |
| 30 | +Xt, Yt = load("test") | |
| 31 | +N, D = Xf.shape | |
| 32 | +E = torch.load(os.path.join(SCRATCH, "e1-embed.pt")).to(DEV) # [V, d], the frozen tied LM head | |
| 33 | + | |
| 34 | +# ---- class map for task A | |
| 35 | +counts = torch.bincount(Yf, minlength=E.shape[0]) | |
| 36 | +top = torch.argsort(counts, descending=True)[:K] | |
| 37 | +cmap = torch.full((E.shape[0],), K, dtype=torch.long, device=DEV) | |
| 38 | +cmap[top] = torch.arange(K, device=DEV) | |
| 39 | +cf, cv, ct = cmap[Yf], cmap[Yv], cmap[Yt] | |
| 40 | +C = K + 1 | |
| 41 | +coverage = {s: float((c < K).float().mean()) for s, c in (("fit", cf), ("val", cv), ("test", ct))} | |
| 42 | + | |
| 43 | +# ---- labels for task B (digit tokens, from the tokenizer) | |
| 44 | +from transformers import AutoTokenizer | |
| 45 | +tok = AutoTokenizer.from_pretrained(MODEL_DIR) | |
| 46 | +digit = torch.zeros(E.shape[0], dtype=torch.bool) | |
| 47 | +for v in range(E.shape[0]): | |
| 48 | + s = tok.decode([v]).strip() | |
| 49 | + digit[v] = len(s) > 0 and s.isdigit() | |
| 50 | +digit = digit.to(DEV) | |
| 51 | +bf, bv, bt = digit[Yf].float(), digit[Yv].float(), digit[Yt].float() | |
| 52 | + | |
| 53 | + | |
| 54 | +# ---- metrics | |
| 55 | +def eval_logits_A(logit_fn, X, c): | |
| 56 | + """top-1 and NLL in class space; logit_fn(chunk) -> [n, C] log-probabilities or scores.""" | |
| 57 | + hit, nll, n = 0, 0.0, X.shape[0] | |
| 58 | + for i in range(0, n, CH): | |
| 59 | + lp = logit_fn(X[i:i + CH]) | |
| 60 | + hit += int((lp.argmax(1) == c[i:i + CH]).sum()) | |
| 61 | + nll += float(-torch.log_softmax(lp, 1).gather(1, c[i:i + CH, None]).sum()) | |
| 62 | + return {"top1": hit / n, "nll": nll / n} | |
| 63 | + | |
| 64 | + | |
| 65 | +def ceiling_A(X): | |
| 66 | + """Frozen LM head, restricted to the same K+1 classes: p(OTHER) = sum of the rest of the vocabulary.""" | |
| 67 | + def f(x): | |
| 68 | + lp = torch.log_softmax(x[:, :-1] @ E.T, 1) | |
| 69 | + other = lp.clone() | |
| 70 | + other[:, top] = -float("inf") | |
| 71 | + return torch.cat([lp[:, top], torch.logsumexp(other, 1, keepdim=True)], 1) | |
| 72 | + return f | |
| 73 | + | |
| 74 | + | |
| 75 | +def auc(score, y): | |
| 76 | + o = torch.argsort(score) | |
| 77 | + r = torch.empty_like(score) | |
| 78 | + r[o] = torch.arange(1, len(score) + 1, device=score.device, dtype=score.dtype) | |
| 79 | + npos = y.sum() | |
| 80 | + nneg = len(y) - npos | |
| 81 | + return float((r[y > 0].sum() - npos * (npos + 1) / 2) / (npos * nneg)) | |
| 82 | + | |
| 83 | + | |
| 84 | +def eval_B(logit, y): | |
| 85 | + p = torch.sigmoid(logit) | |
| 86 | + pred = (p > 0.5).float() | |
| 87 | + tpr = float((pred * y).sum() / y.sum()) | |
| 88 | + tnr = float(((1 - pred) * (1 - y)).sum() / (1 - y).sum()) | |
| 89 | + nll = float(torch.nn.functional.binary_cross_entropy_with_logits(logit, y)) | |
| 90 | + return {"auc": auc(logit, y), "bal_acc": (tpr + tnr) / 2, "nll": nll} | |
| 91 | + | |
| 92 | + | |
| 93 | +def ceiling_B(X): | |
| 94 | + out = [] | |
| 95 | + for i in range(0, X.shape[0], CH): | |
| 96 | + lp = torch.log_softmax(X[i:i + CH, :-1] @ E.T, 1) | |
| 97 | + a = torch.logsumexp(lp[:, digit], 1) | |
| 98 | + b = torch.logsumexp(lp[:, ~digit], 1) | |
| 99 | + out.append(a - b) # logit of p(digit) | |
| 100 | + return torch.cat(out) | |
| 101 | + | |
| 102 | + | |
| 103 | +# ---- the direct solve: one pass builds G = X^T X and H = X^T Y, then a Cholesky solve | |
| 104 | +def gram_pass(X, labels, ncls): | |
| 105 | + """G (fp64) and H (fp64). Each chunk matmul is fp32, accumulated in fp64. H for one-hot targets is a scatter-add.""" | |
| 106 | + G = torch.zeros(D, D, dtype=torch.float64, device=DEV) | |
| 107 | + H = torch.zeros(D, ncls, dtype=torch.float64, device=DEV) | |
| 108 | + for i in range(0, X.shape[0], CH): | |
| 109 | + x = X[i:i + CH] | |
| 110 | + G += (x.T @ x).double() | |
| 111 | + if labels.dtype == torch.long: | |
| 112 | + H.index_add_(1, labels[i:i + CH], x.T.double()) | |
| 113 | + else: | |
| 114 | + H[:, 0] += (x.T @ labels[i:i + CH]).double() | |
| 115 | + return G, H | |
| 116 | + | |
| 117 | + | |
| 118 | +def ridge_solve(G, H, lam, n): | |
| 119 | + A = G / n + lam * torch.eye(D, dtype=torch.float64, device=DEV) | |
| 120 | + L = torch.linalg.cholesky(A) | |
| 121 | + return torch.cholesky_solve(H / n, L).float() | |
| 122 | + | |
| 123 | + | |
| 124 | +def fit_scale(scores_fn, X, c): | |
| 125 | + """One scalar beta so softmax(beta * scores) is a probability model; fit on val by golden-section on NLL.""" | |
| 126 | + def nll(b): | |
| 127 | + return eval_logits_A(lambda x: b * scores_fn(x), X, c)["nll"] | |
| 128 | + lo, hi = 1.0, 200.0 | |
| 129 | + g = (math.sqrt(5) - 1) / 2 | |
| 130 | + for _ in range(30): | |
| 131 | + a, b = hi - g * (hi - lo), lo + g * (hi - lo) | |
| 132 | + if nll(a) < nll(b): | |
| 133 | + hi = b | |
| 134 | + else: | |
| 135 | + lo = a | |
| 136 | + return (lo + hi) / 2 | |
| 137 | + | |
| 138 | + | |
| 139 | +# ---- gradient baselines on the cached features | |
| 140 | +def ce_grad_pass(W, X, c, lam): | |
| 141 | + """Mean CE + lam/2 |W|^2: loss and gradient in one pass over X.""" | |
| 142 | + g = torch.zeros_like(W) | |
| 143 | + loss = 0.0 | |
| 144 | + for i in range(0, X.shape[0], CH): | |
| 145 | + x = X[i:i + CH] | |
| 146 | + p = torch.softmax(x @ W, 1) | |
| 147 | + loss += float(-torch.log(p.gather(1, c[i:i + CH, None]).clamp_min(1e-30)).sum()) | |
| 148 | + p[torch.arange(x.shape[0], device=DEV), c[i:i + CH]] -= 1 | |
| 149 | + g += x.T @ p | |
| 150 | + n = X.shape[0] | |
| 151 | + return loss / n + lam / 2 * float((W * W).sum()), g / n + lam * W | |
| 152 | + | |
| 153 | + | |
| 154 | +def adamw_run(X, c, Xv, cv, loss_kind, lr, wd, target, max_epochs=30, bs=4096, seed=0): | |
| 155 | + torch.manual_seed(seed) | |
| 156 | + W = torch.zeros(D, C, device=DEV, requires_grad=True) | |
| 157 | + opt = torch.optim.AdamW([W], lr=lr, weight_decay=wd) | |
| 158 | + hist, reach = [], {} | |
| 159 | + t0 = time.time() | |
| 160 | + for ep in range(1, max_epochs + 1): | |
| 161 | + perm = torch.randperm(X.shape[0], device=DEV) | |
| 162 | + for i in range(0, X.shape[0], bs): | |
| 163 | + idx = perm[i:i + bs] | |
| 164 | + s = X[idx] @ W | |
| 165 | + if loss_kind == "ce": | |
| 166 | + loss = torch.nn.functional.cross_entropy(s, c[idx]) | |
| 167 | + else: | |
| 168 | + loss = ((s - torch.nn.functional.one_hot(c[idx], C).float()) ** 2).sum(1).mean() | |
| 169 | + opt.zero_grad(set_to_none=True) | |
| 170 | + loss.backward() | |
| 171 | + opt.step() | |
| 172 | + with torch.no_grad(): | |
| 173 | + m = eval_logits_A(lambda x: x @ W, Xv, cv) | |
| 174 | + sync() | |
| 175 | + hist.append({"epoch": ep, "val_top1": m["top1"], "val_nll": m["nll"], "t": time.time() - t0}) | |
| 176 | + for k, tv in target.items(): | |
| 177 | + if k not in reach and m["top1"] >= tv: | |
| 178 | + reach[k] = {"epoch": ep, "passes": ep, "t": time.time() - t0} | |
| 179 | + if len(reach) == len(target): | |
| 180 | + break | |
| 181 | + return W.detach(), hist, reach | |
| 182 | + | |
| 183 | + | |
| 184 | +def lbfgs_run(X, c, Xv, cv, lam, target, max_evals=300): | |
| 185 | + W = torch.zeros(D, C, device=DEV, requires_grad=True) | |
| 186 | + opt = torch.optim.LBFGS([W], lr=1, max_iter=10, history_size=20, line_search_fn="strong_wolfe") | |
| 187 | + evals = [0] | |
| 188 | + | |
| 189 | + def closure(): | |
| 190 | + evals[0] += 1 | |
| 191 | + with torch.no_grad(): | |
| 192 | + l, g = ce_grad_pass(W, X, c, lam) | |
| 193 | + W.grad = g | |
| 194 | + return torch.tensor(l) | |
| 195 | + | |
| 196 | + hist, reach = [], {} | |
| 197 | + t0 = time.time() | |
| 198 | + while evals[0] < max_evals: | |
| 199 | + opt.step(closure) | |
| 200 | + with torch.no_grad(): | |
| 201 | + m = eval_logits_A(lambda x: x @ W, Xv, cv) | |
| 202 | + sync() | |
| 203 | + hist.append({"passes": evals[0], "val_top1": m["top1"], "val_nll": m["nll"], "t": time.time() - t0}) | |
| 204 | + for k, tv in target.items(): | |
| 205 | + if k not in reach and m["top1"] >= tv: | |
| 206 | + reach[k] = {"passes": evals[0], "t": time.time() - t0} | |
| 207 | + if len(reach) == len(target): | |
| 208 | + break | |
| 209 | + return W.detach(), hist, reach | |
| 210 | + | |
| 211 | + | |
| 212 | +def bohning_run(X, c, Xv, cv, lam, target, G, W0=None, max_passes=200): | |
| 213 | + """Fixed-Hessian MM (Bohning 1992): Hessian of mean CE <= 1/2 (I - 11^T/C) kron G/n. | |
| 214 | + Factor (G/(2n) + lam I) once; each step is one gradient pass plus two triangular solves. | |
| 215 | + The column-mean part of the step solves lam * dW_m = grad_m (softmax ignores it).""" | |
| 216 | + n = X.shape[0] | |
| 217 | + L = torch.linalg.cholesky(G / (2 * n) + lam * torch.eye(D, dtype=torch.float64, device=DEV)) | |
| 218 | + W = torch.zeros(D, C, device=DEV) if W0 is None else W0.clone() | |
| 219 | + hist, reach = [], {} | |
| 220 | + t0 = time.time() | |
| 221 | + for k in range(1, max_passes + 1): | |
| 222 | + _, g = ce_grad_pass(W, X, c, lam) | |
| 223 | + gm = g.mean(1, keepdim=True) | |
| 224 | + W -= torch.cholesky_solve((g - gm).double(), L).float() + gm / lam | |
| 225 | + m = eval_logits_A(lambda x: x @ W, Xv, cv) | |
| 226 | + sync() | |
| 227 | + hist.append({"passes": k, "val_top1": m["top1"], "val_nll": m["nll"], "t": time.time() - t0}) | |
| 228 | + for kk, tv in target.items(): | |
| 229 | + if kk not in reach and m["top1"] >= tv: | |
| 230 | + reach[kk] = {"passes": k, "t": time.time() - t0} | |
| 231 | + if len(reach) == len(target): | |
| 232 | + break | |
| 233 | + return W, hist, reach | |
| 234 | + | |
| 235 | + | |
| 236 | +# ---- task B: exact Newton (IRLS) for logistic regression, one weighted Gram pass per step | |
| 237 | +def irls_run(X, y, lam, steps=12, W0=None): | |
| 238 | + n = X.shape[0] | |
| 239 | + w = torch.zeros(D, device=DEV) if W0 is None else W0.clone() | |
| 240 | + hist = [] | |
| 241 | + for k in range(1, steps + 1): | |
| 242 | + Hs = torch.zeros(D, D, dtype=torch.float64, device=DEV) | |
| 243 | + g = torch.zeros(D, dtype=torch.float64, device=DEV) | |
| 244 | + for i in range(0, n, CH): | |
| 245 | + x = X[i:i + CH] | |
| 246 | + p = torch.sigmoid(x @ w) | |
| 247 | + g += (x.T @ (p - y[i:i + CH])).double() | |
| 248 | + Hs += ((x * (p * (1 - p))[:, None]).T @ x).double() | |
| 249 | + g = g / n + lam * w.double() | |
| 250 | + Hs = Hs / n + lam * torch.eye(D, dtype=torch.float64, device=DEV) | |
| 251 | + step = torch.linalg.solve(Hs, g) | |
| 252 | + w = w - step.float() | |
| 253 | + hist.append({"step": k, "grad_norm": float(g.norm()), "step_norm": float(step.norm())}) | |
| 254 | + if float(step.norm()) < 1e-6 * max(1.0, float(w.norm())): | |
| 255 | + break | |
| 256 | + return w, hist | |
| 257 | + | |
| 258 | + | |
| 259 | +def adamw_B(X, y, lr, wd, epochs, bs=4096, seed=0): | |
| 260 | + torch.manual_seed(seed) | |
| 261 | + w = torch.zeros(D, device=DEV, requires_grad=True) | |
| 262 | + opt = torch.optim.AdamW([w], lr=lr, weight_decay=wd) | |
| 263 | + for ep in range(epochs): | |
| 264 | + perm = torch.randperm(X.shape[0], device=DEV) | |
| 265 | + for i in range(0, X.shape[0], bs): | |
| 266 | + idx = perm[i:i + bs] | |
| 267 | + loss = torch.nn.functional.binary_cross_entropy_with_logits(X[idx] @ w, y[idx]) | |
| 268 | + opt.zero_grad(set_to_none=True) | |
| 269 | + loss.backward() | |
| 270 | + opt.step() | |
| 271 | + return w.detach() | |
| 272 | + | |
| 273 | + | |
| 274 | +def timed(f): | |
| 275 | + sync() | |
| 276 | + t0 = time.time() | |
| 277 | + r = f() | |
| 278 | + sync() | |
| 279 | + return r, time.time() - t0 | |
| 280 | + | |
| 281 | + | |
| 282 | +LAMS = [1e-6, 1e-5, 1e-4, 1e-3, 1e-2] | |
| 283 | +X_BYTES = N * D * 4 | |
| 284 | + | |
| 285 | +if MODE == "sweep": | |
| 286 | + out = {"N_fit": N, "N_val": Xv.shape[0], "N_test": Xt.shape[0], "D_with_bias": D, "K": K, | |
| 287 | + "class_coverage_in_topK": coverage, "digit_rate": {"fit": float(bf.mean()), "val": float(bv.mean()), "test": float(bt.mean())}} | |
| 288 | + # ceilings | |
| 289 | + out["ceiling_A"] = {"val": eval_logits_A(ceiling_A(Xv), Xv, cv), "test": eval_logits_A(ceiling_A(Xt), Xt, ct)} | |
| 290 | + out["ceiling_B"] = {"val": eval_B(ceiling_B(Xv), bv), "test": eval_B(ceiling_B(Xt), bt)} | |
| 291 | + cv_top = out["ceiling_A"]["val"]["top1"] | |
| 292 | + target = {"ceil-1.0": cv_top - 0.010, "ceil-0.5": cv_top - 0.005} | |
| 293 | + out["target_val_top1"] = target | |
| 294 | + print("ceilings", out["ceiling_A"], out["ceiling_B"]) | |
| 295 | + | |
| 296 | + # ridge, task A | |
| 297 | + (G, H), tg = timed(lambda: gram_pass(Xf, cf, C)) | |
| 298 | + rs = {} | |
| 299 | + for lam in LAMS: | |
| 300 | + W = ridge_solve(G, H, lam, N) | |
| 301 | + rs[lam] = eval_logits_A(lambda x: x @ W, Xv, cv) | |
| 302 | + lam_r = max(rs, key=lambda l: rs[l]["top1"]) | |
| 303 | + Wr = ridge_solve(G, H, lam_r, N) | |
| 304 | + beta = fit_scale(lambda x: x @ Wr, Xv, cv) | |
| 305 | + out["ridge_A"] = {"val_by_lambda": {str(k): v for k, v in rs.items()}, "lambda": lam_r, "beta": beta, | |
| 306 | + "gram_pass_seconds_unlocked": tg, | |
| 307 | + "val": eval_logits_A(lambda x: beta * (x @ Wr), Xv, cv), | |
| 308 | + "test": eval_logits_A(lambda x: beta * (x @ Wr), Xt, ct)} | |
| 309 | + # exactness: gradient of the ridge objective at the solution, and chunk-order invariance of G | |
| 310 | + Wd = torch.cholesky_solve(H / N, torch.linalg.cholesky(G / N + lam_r * torch.eye(D, dtype=torch.float64, device=DEV))) | |
| 311 | + grad = (G / N) @ Wd - H / N + lam_r * Wd | |
| 312 | + G2, _ = gram_pass(Xf.flip(0), cf.flip(0), C) | |
| 313 | + out["ridge_A"]["checks"] = {"rel_grad_norm_at_solution_fp64": float(grad.norm() / (H / N).norm()), | |
| 314 | + "G_reverse_chunk_order_rel_diff": float((G - G2).norm() / G.norm()), | |
| 315 | + "cond_G_plus_lam": float(torch.linalg.cond(G / N + lam_r * torch.eye(D, dtype=torch.float64, device=DEV)))} | |
| 316 | + print("ridge", out["ridge_A"]["lambda"], out["ridge_A"]["val"], out["ridge_A"]["test"], out["ridge_A"]["checks"]) | |
| 317 | + | |
| 318 | + # AdamW CE and MSE, sweep on val | |
| 319 | + for kind in ("ce", "mse"): | |
| 320 | + runs = [] | |
| 321 | + for lr in (1e-3, 3e-3, 1e-2): | |
| 322 | + for wd in (0.0, 0.01): | |
| 323 | + W, hist, reach = adamw_run(Xf, cf, Xv, cv, kind, lr, wd, target) | |
| 324 | + runs.append({"lr": lr, "wd": wd, "best_val_top1": max(h["val_top1"] for h in hist), "reach": reach, "hist": hist}) | |
| 325 | + print(kind, lr, wd, runs[-1]["best_val_top1"], reach) | |
| 326 | + best = max(runs, key=lambda r: (len(r["reach"]), -min([v["passes"] for v in r["reach"].values()] or [99]), r["best_val_top1"])) | |
| 327 | + W, hist, reach = adamw_run(Xf, cf, Xv, cv, kind, best["lr"], best["wd"], target) | |
| 328 | + out[f"adamw_{kind}_A"] = {"runs": runs, "chosen": {"lr": best["lr"], "wd": best["wd"]}, | |
| 329 | + "val": eval_logits_A(lambda x: x @ W, Xv, cv), "test": eval_logits_A(lambda x: x @ W, Xt, ct), "reach": reach} | |
| 330 | + | |
| 331 | + # L-BFGS full batch CE | |
| 332 | + lb = {} | |
| 333 | + for lam in (1e-5, 1e-4): | |
| 334 | + W, hist, reach = lbfgs_run(Xf, cf, Xv, cv, lam, target) | |
| 335 | + lb[lam] = {"hist": hist, "reach": reach, "W": W} | |
| 336 | + print("lbfgs", lam, hist[-1], reach) | |
| 337 | + lam_l = max(lb, key=lambda l: (len(lb[l]["reach"]), max(h["val_top1"] for h in lb[l]["hist"]))) | |
| 338 | + W = lb[lam_l]["W"] | |
| 339 | + out["lbfgs_ce_A"] = {"lambda": lam_l, "runs": {str(k): {"hist": v["hist"], "reach": v["reach"]} for k, v in lb.items()}, | |
| 340 | + "val": eval_logits_A(lambda x: x @ W, Xv, cv), "test": eval_logits_A(lambda x: x @ W, Xt, ct), "reach": lb[lam_l]["reach"]} | |
| 341 | + | |
| 342 | + # Bohning MM: cold start, and warm start from the scaled ridge head | |
| 343 | + for name, W0 in (("bohning_cold_A", None), ("bohning_warm_A", beta * Wr)): | |
| 344 | + bm = {} | |
| 345 | + for lam in (1e-5, 1e-4): | |
| 346 | + W, hist, reach = bohning_run(Xf, cf, Xv, cv, lam, target, G, W0=W0, max_passes=100) | |
| 347 | + bm[lam] = {"hist": hist, "reach": reach, "W": W} | |
| 348 | + print(name, lam, hist[-1], reach) | |
| 349 | + lam_b = max(bm, key=lambda l: (len(bm[l]["reach"]), max(h["val_top1"] for h in bm[l]["hist"]))) | |
| 350 | + W = bm[lam_b]["W"] | |
| 351 | + out[name] = {"lambda": lam_b, "runs": {str(k): {"hist": v["hist"], "reach": v["reach"]} for k, v in bm.items()}, | |
| 352 | + "val": eval_logits_A(lambda x: x @ W, Xv, cv), "test": eval_logits_A(lambda x: x @ W, Xt, ct), "reach": bm[lam_b]["reach"]} | |
| 353 | + | |
| 354 | + # task B | |
| 355 | + Gb, Hb = gram_pass(Xf, bf, 1) | |
| 356 | + rb = {} | |
| 357 | + for lam in LAMS: | |
| 358 | + w = ridge_solve(Gb, Hb, lam, N)[:, 0] | |
| 359 | + rb[lam] = eval_B(Xv @ w - 0.5, bv) # ridge on 0/1 labels: threshold 0.5 -> logit sign | |
| 360 | + lam_b = max(rb, key=lambda l: rb[l]["auc"]) | |
| 361 | + w = ridge_solve(Gb, Hb, lam_b, N)[:, 0] | |
| 362 | + out["ridge_B"] = {"lambda": lam_b, "val": rb[lam_b], "test": eval_B(Xt @ w - 0.5, bt), | |
| 363 | + "note": "AUC and balanced accuracy only; ridge outputs are not log-odds, NLL is not meaningful"} | |
| 364 | + ib = {} | |
| 365 | + for lam in (1e-5, 1e-4, 1e-3): | |
| 366 | + w, hist = irls_run(Xf, bf, lam) | |
| 367 | + ib[lam] = {"w": w, "hist": hist, "val": eval_B(Xv @ w, bv)} | |
| 368 | + lam_i = min(ib, key=lambda l: ib[l]["val"]["nll"]) | |
| 369 | + w = ib[lam_i]["w"] | |
| 370 | + out["irls_newton_B"] = {"lambda": lam_i, "steps": len(ib[lam_i]["hist"]), "hist": ib[lam_i]["hist"], | |
| 371 | + "val": ib[lam_i]["val"], "test": eval_B(Xt @ w, bt)} | |
| 372 | + ab = {} | |
| 373 | + for lr in (1e-3, 3e-3, 1e-2): | |
| 374 | + w = adamw_B(Xf, bf, lr, 0.0, 10) | |
| 375 | + ab[lr] = {"w": w, "val": eval_B(Xv @ w, bv)} | |
| 376 | + lr_b = min(ab, key=lambda l: ab[l]["val"]["nll"]) | |
| 377 | + out["adamw_bce_B"] = {"lr": lr_b, "epochs": 10, "val": ab[lr_b]["val"], "test": eval_B(Xt @ ab[lr_b]["w"], bt)} | |
| 378 | + print("B", out["ridge_B"]["test"], out["irls_newton_B"]["test"], out["adamw_bce_B"]["test"]) | |
| 379 | + out["peak_gpu_bytes"] = torch.cuda.max_memory_allocated() | |
| 380 | + out["X_fit_bytes_fp32"] = X_BYTES | |
| 381 | + receipt("e1-sweep", out) | |
| 382 | + | |
| 383 | +elif MODE == "time": | |
| 384 | + sw = json.load(open(os.path.join(EVID, "e1-sweep.json"))) | |
| 385 | + # The sweep's ceiling targets (frozen LM head minus 0.5 / 1.0 points on val) were reached by no method, so timing | |
| 386 | + # uses two reachable ones: the ridge head's own val quality, and the best AdamW-CE val quality minus 0.5 points. | |
| 387 | + target = {"ridge_quality": sw["ridge_A"]["val"]["top1"], | |
| 388 | + "best_ce_minus_0.5": max(r["best_val_top1"] for r in sw["adamw_ce_A"]["runs"]) - 0.005} | |
| 389 | + reps = [] | |
| 390 | + for r in range(3): | |
| 391 | + row = {} | |
| 392 | + torch.cuda.reset_peak_memory_stats() | |
| 393 | + (G, H), row["ridge_gram_pass"] = timed(lambda: gram_pass(Xf, cf, C)) | |
| 394 | + Wr, row["ridge_solve"] = timed(lambda: ridge_solve(G, H, sw["ridge_A"]["lambda"], N)) | |
| 395 | + row["ridge_total"] = row["ridge_gram_pass"] + row["ridge_solve"] | |
| 396 | + row["ridge_peak_gpu_bytes"] = torch.cuda.max_memory_allocated() | |
| 397 | + for kind in ("ce", "mse"): | |
| 398 | + ch = sw[f"adamw_{kind}_A"]["chosen"] | |
| 399 | + torch.cuda.reset_peak_memory_stats() | |
| 400 | + (_, _, reach), t = timed(lambda: adamw_run(Xf, cf, Xv, cv, kind, ch["lr"], ch["wd"], target)) | |
| 401 | + row[f"adamw_{kind}"] = {"reach": reach, "total": t, "peak_gpu_bytes": torch.cuda.max_memory_allocated()} | |
| 402 | + torch.cuda.reset_peak_memory_stats() | |
| 403 | + (_, _, reach), t = timed(lambda: lbfgs_run(Xf, cf, Xv, cv, sw["lbfgs_ce_A"]["lambda"], target)) | |
| 404 | + row["lbfgs_ce"] = {"reach": reach, "total": t, "peak_gpu_bytes": torch.cuda.max_memory_allocated()} | |
| 405 | + torch.cuda.reset_peak_memory_stats() | |
| 406 | + beta = sw["ridge_A"]["beta"] | |
| 407 | + (_, _, reach), t = timed(lambda: bohning_run(Xf, cf, Xv, cv, sw["bohning_warm_A"]["lambda"], target, G, W0=beta * Wr, max_passes=100)) | |
| 408 | + row["bohning_warm"] = {"reach": reach, "total": t, "peak_gpu_bytes": torch.cuda.max_memory_allocated()} | |
| 409 | + reps.append(row) | |
| 410 | + print(r, json.dumps(row)[:400]) | |
| 411 | + receipt("e1-time", {"target_val_top1": target, "repeats": reps, "note": "times include per-epoch/per-step val evaluation for the iterative methods; ridge has none", | |
| 412 | + "X_fit_bytes_fp32": X_BYTES}) |
streams/math-training/e2.py
| new file mode 100644 | ||
| @@ -0,0 +1,294 @@ | ||
| 1 | +# E2: structured adapter bases vs LoRA on frozen SmolLM2-1.7B, matched trainable-parameter counts. | |
| 2 | +# python e2.py check -> numeric checks of the three adapter operators (FourierFT custom backward vs autograd, PHM vs dense Kronecker) | |
| 3 | +# python e2.py train METHOD LR SEED [STEPS] -> one fine-tune, writes evidence/math-training/e2-train-METHOD-LR-SEED.json | |
| 4 | +# python e2.py time -> step time / peak memory per method, 3 repeats (run under quiet-measure) | |
| 5 | +# Adapters on q,k,v,o,gate,up,down of all 24 layers. Every adapter is written the same way (plain torch ops, no PEFT). | |
| 6 | +# Loss: next-token cross-entropy on the answer tokens of GSM8K. Fit: train[0:6500]; val: train[7000:7300]; test: test[0:300]. | |
| 7 | +import json, math, os, sys, time | |
| 8 | +import torch | |
| 9 | +import torch.nn as nn | |
| 10 | +import torch.nn.functional as F | |
| 11 | +from common import * | |
| 12 | + | |
| 13 | +TARGETS = ("q_proj", "k_proj", "v_proj", "o_proj", "gate_proj", "up_proj", "down_proj") | |
| 14 | +R = 8 # LoRA rank; the other methods are matched to its parameter count | |
| 15 | +PHM_N = 4 # Kronecker block count n for PHM | |
| 16 | + | |
| 17 | + | |
| 18 | +class LoRA(nn.Module): | |
| 19 | + def __init__(self, base, r=R, alpha=16): | |
| 20 | + super().__init__() | |
| 21 | + self.base = base | |
| 22 | + o, i = base.weight.shape | |
| 23 | + self.A = nn.Parameter(torch.randn(r, i) / math.sqrt(i)) | |
| 24 | + self.B = nn.Parameter(torch.zeros(o, r)) | |
| 25 | + self.s = alpha / r | |
| 26 | + | |
| 27 | + def delta(self, x): | |
| 28 | + return (x @ self.A.to(x.dtype).T) @ self.B.to(x.dtype).T * self.s | |
| 29 | + | |
| 30 | + def forward(self, x): | |
| 31 | + return self.base(x) + self.delta(x) | |
| 32 | + | |
| 33 | + | |
| 34 | +class PHM(nn.Module): | |
| 35 | + """Delta W = sum_m A_m kron (S_m T_m^T): A_m is n x n (shared per layer), S_m is (o/n) x r, T_m is (i/n) x r. | |
| 36 | + Applied without building Delta W: split x into n blocks, project each with T_m, mix blocks with A_m, expand with S_m. | |
| 37 | + Trainable per matrix: n * r * (o + i) / n = r (o + i), the same as LoRA rank r; plus n^3 shared per layer. | |
| 38 | + Rank of Delta W is at most n * (n * r) = n^2 r (128 for n=4, r=8), against r = 8 for LoRA.""" | |
| 39 | + def __init__(self, base, Ashared, r=R, n=PHM_N, alpha=16): | |
| 40 | + super().__init__() | |
| 41 | + self.base = base | |
| 42 | + o, i = base.weight.shape | |
| 43 | + self.n, self.o, self.i = n, o, i | |
| 44 | + self.A = Ashared | |
| 45 | + self.T = nn.Parameter(torch.randn(n, i // n, r) / math.sqrt(i // n)) | |
| 46 | + self.S = nn.Parameter(torch.zeros(n, o // n, r)) | |
| 47 | + self.s = alpha / r | |
| 48 | + | |
| 49 | + def delta(self, x): | |
| 50 | + xb = x.reshape(*x.shape[:-1], self.n, self.i // self.n) # [..., n_j, i/n] | |
| 51 | + U = torch.einsum("...jk,mkr->...mjr", xb, self.T.to(x.dtype)) # [..., m, n_j, r] | |
| 52 | + V = torch.einsum("mij,...mjr->...mir", self.A.to(x.dtype), U) # [..., m, n_i, r] | |
| 53 | + y = torch.einsum("...mir,mor->...io", V, self.S.to(x.dtype)) # [..., n_i, o/n] | |
| 54 | + return y.reshape(*x.shape[:-1], self.o) * self.s | |
| 55 | + | |
| 56 | + def dense_delta(self): | |
| 57 | + return sum(torch.kron(self.A[m], self.S[m] @ self.T[m].T) for m in range(self.n)) * self.s | |
| 58 | + | |
| 59 | + def forward(self, x): | |
| 60 | + return self.base(x) + self.delta(x) | |
| 61 | + | |
| 62 | + | |
| 63 | +class _FourierMatmul(torch.autograd.Function): | |
| 64 | + """y = x Delta W^T with Delta W = alpha * Re(sum_k c_k exp(+2 pi i (u_k p / o + v_k q / i))), c real. | |
| 65 | + Forward builds Delta W by one inverse 2-D FFT of the scattered coefficients; backward rebuilds it instead of storing it, | |
| 66 | + and gets dL/dc_k = alpha * Re(FFT2(dL/dDeltaW))[u_k, v_k] (the adjoint of the scatter + inverse FFT).""" | |
| 67 | + @staticmethod | |
| 68 | + def forward(ctx, x, c, idx, o, i, alpha): | |
| 69 | + dW = _fourier_dense(c, idx, o, i, alpha).to(x.dtype) | |
| 70 | + ctx.save_for_backward(x, c, idx) | |
| 71 | + ctx.o, ctx.i, ctx.alpha = o, i, alpha | |
| 72 | + return x @ dW.T | |
| 73 | + | |
| 74 | + @staticmethod | |
| 75 | + def backward(ctx, g): | |
| 76 | + x, c, idx = ctx.saved_tensors | |
| 77 | + dW = _fourier_dense(c, idx, ctx.o, ctx.i, ctx.alpha).to(g.dtype) | |
| 78 | + gx = g @ dW | |
| 79 | + gW = g.reshape(-1, ctx.o).T.float() @ x.reshape(-1, ctx.i).float() # [o, i] | |
| 80 | + gc = ctx.alpha * torch.fft.fft2(gW, norm="backward").real.reshape(-1)[idx] | |
| 81 | + return gx, gc, None, None, None, None | |
| 82 | + | |
| 83 | + | |
| 84 | +def _fourier_dense(c, idx, o, i, alpha): | |
| 85 | + spec = torch.zeros(o * i, dtype=torch.complex64, device=c.device) | |
| 86 | + spec[idx] = c.to(torch.complex64) | |
| 87 | + return alpha * torch.fft.ifft2(spec.reshape(o, i), norm="forward").real | |
| 88 | + | |
| 89 | + | |
| 90 | +class FourierFT(nn.Module): | |
| 91 | + def __init__(self, base, ncoef, seed): | |
| 92 | + super().__init__() | |
| 93 | + self.base = base | |
| 94 | + o, i = base.weight.shape | |
| 95 | + self.o, self.i = o, i | |
| 96 | + g = torch.Generator().manual_seed(seed) | |
| 97 | + self.register_buffer("idx", torch.randperm(o * i, generator=g)[:ncoef]) | |
| 98 | + self.c = nn.Parameter(torch.zeros(ncoef)) | |
| 99 | + self.alpha = 1.0 / math.sqrt(ncoef) | |
| 100 | + | |
| 101 | + def delta(self, x): | |
| 102 | + return _FourierMatmul.apply(x, self.c, self.idx.to(x.device), self.o, self.i, self.alpha) | |
| 103 | + | |
| 104 | + def forward(self, x): | |
| 105 | + return self.base(x) + self.delta(x) | |
| 106 | + | |
| 107 | + | |
| 108 | +def attach(model, method, seed): | |
| 109 | + torch.manual_seed(seed) | |
| 110 | + for p in model.parameters(): | |
| 111 | + p.requires_grad_(False) | |
| 112 | + n_train = 0 | |
| 113 | + for li, layer in enumerate(model.model.layers): | |
| 114 | + Ash = nn.Parameter(torch.randn(PHM_N, PHM_N, PHM_N, device=DEV) / PHM_N) if method == "phm" else None | |
| 115 | + if Ash is not None: | |
| 116 | + layer.register_parameter("phm_A", Ash) | |
| 117 | + for parent in (layer.self_attn, layer.mlp): | |
| 118 | + for name in TARGETS: | |
| 119 | + if not hasattr(parent, name): | |
| 120 | + continue | |
| 121 | + base = getattr(parent, name) | |
| 122 | + o, i = base.weight.shape | |
| 123 | + if method.startswith("lora"): | |
| 124 | + r = int(method[4:] or R) | |
| 125 | + m = LoRA(base, r=r) | |
| 126 | + elif method == "phm": | |
| 127 | + m = PHM(base, Ash) | |
| 128 | + elif method == "fourier": | |
| 129 | + m = FourierFT(base, R * (o + i), seed * 1000 + li * 10 + TARGETS.index(name)) | |
| 130 | + else: | |
| 131 | + raise ValueError(method) | |
| 132 | + setattr(parent, name, m.to(DEV)) | |
| 133 | + params = [p for p in model.parameters() if p.requires_grad] | |
| 134 | + return params, sum(p.numel() for p in params) | |
| 135 | + | |
| 136 | + | |
| 137 | +def answer_batches(tok, exs, bs, seq=SEQ): | |
| 138 | + """(ids, mask over loss positions): loss only on tokens after 'Answer:'.""" | |
| 139 | + rows = [] | |
| 140 | + for e in exs: | |
| 141 | + q = tok("Question: " + e["question"] + "\nAnswer:", add_special_tokens=False)["input_ids"] | |
| 142 | + a = tok(" " + e["answer"], add_special_tokens=False)["input_ids"] | |
| 143 | + ids = (q + a)[:seq] | |
| 144 | + rows.append((ids, len(q))) | |
| 145 | + for k in range(0, len(rows), bs): | |
| 146 | + chunk = rows[k:k + bs] | |
| 147 | + L = max(len(r[0]) for r in chunk) | |
| 148 | + x = torch.full((len(chunk), L), 2, dtype=torch.long) | |
| 149 | + lm = torch.zeros((len(chunk), L), dtype=torch.bool) | |
| 150 | + am = torch.zeros((len(chunk), L), dtype=torch.long) | |
| 151 | + for j, (ids, qlen) in enumerate(chunk): | |
| 152 | + x[j, :len(ids)] = torch.tensor(ids) | |
| 153 | + am[j, :len(ids)] = 1 | |
| 154 | + lm[j, qlen:len(ids)] = True | |
| 155 | + yield x.to(DEV), am.to(DEV), lm.to(DEV) | |
| 156 | + | |
| 157 | + | |
| 158 | +def lm_loss(model, x, am, lm): | |
| 159 | + logits = model(input_ids=x, attention_mask=am).logits[:, :-1].float() | |
| 160 | + tgt = x[:, 1:] | |
| 161 | + m = lm[:, 1:] | |
| 162 | + return F.cross_entropy(logits[m], tgt[m], reduction="sum"), int(m.sum()) | |
| 163 | + | |
| 164 | + | |
| 165 | +@torch.no_grad() | |
| 166 | +def eval_nll(model, tok, exs): | |
| 167 | + tot, n = 0.0, 0 | |
| 168 | + for x, am, lm in answer_batches(tok, exs, 8): | |
| 169 | + l, k = lm_loss(model, x, am, lm) | |
| 170 | + tot += float(l) | |
| 171 | + n += k | |
| 172 | + return tot / n | |
| 173 | + | |
| 174 | + | |
| 175 | +def splits(): | |
| 176 | + tr, te = load_split("train"), load_split("test") | |
| 177 | + return tr[:6500], tr[7000:7300], te[:300] | |
| 178 | + | |
| 179 | + | |
| 180 | +if __name__ == "__main__": | |
| 181 | + mode = sys.argv[1] | |
| 182 | + if mode == "check": | |
| 183 | + torch.manual_seed(0) | |
| 184 | + out = {} | |
| 185 | + # FourierFT: custom backward vs plain autograd through torch.fft, small matrix, fp64-accurate in fp32 | |
| 186 | + o, i, nc = 48, 32, 100 | |
| 187 | + base = nn.Linear(i, o, bias=False).to(DEV) | |
| 188 | + f = FourierFT(base, nc, 1).to(DEV) | |
| 189 | + with torch.no_grad(): | |
| 190 | + f.c.normal_() | |
| 191 | + x = torch.randn(5, i, device=DEV, requires_grad=True) | |
| 192 | + y = f.delta(x) | |
| 193 | + g = torch.randn_like(y) | |
| 194 | + gx, gc = torch.autograd.grad(y, (x, f.c), g) | |
| 195 | + c2 = f.c.detach().clone().requires_grad_(True) | |
| 196 | + x2 = x.detach().clone().requires_grad_(True) | |
| 197 | + y2 = x2 @ _fourier_dense(c2, f.idx, o, i, f.alpha).T | |
| 198 | + gx2, gc2 = torch.autograd.grad(y2, (x2, c2), g) | |
| 199 | + out["fourier_forward_rel_err"] = float((y - y2).norm() / y2.norm()) | |
| 200 | + out["fourier_grad_x_rel_err"] = float((gx - gx2).norm() / gx2.norm()) | |
| 201 | + out["fourier_grad_c_rel_err"] = float((gc - gc2).norm() / gc2.norm()) | |
| 202 | + # PHM: structured apply vs the dense Kronecker sum | |
| 203 | + base = nn.Linear(64, 96, bias=False).to(DEV) | |
| 204 | + A = nn.Parameter(torch.randn(PHM_N, PHM_N, PHM_N, device=DEV)) | |
| 205 | + p = PHM(base, A, r=3).to(DEV) | |
| 206 | + with torch.no_grad(): | |
| 207 | + p.S.normal_() | |
| 208 | + x = torch.randn(7, 64, device=DEV) | |
| 209 | + out["phm_structured_vs_dense_rel_err"] = float((p.delta(x) - x @ p.dense_delta().T).norm() / (x @ p.dense_delta().T).norm()) | |
| 210 | + out["phm_dense_rank"] = int(torch.linalg.matrix_rank(p.dense_delta())) | |
| 211 | + out["phm_rank_bound_n_squared_times_r"] = PHM_N * PHM_N * 3 # n terms, each rank(A_m) * rank(S_m T_m^T) = n * r | |
| 212 | + print(out) | |
| 213 | + receipt("e2-check", out) | |
| 214 | + | |
| 215 | + elif mode == "train": | |
| 216 | + method, lr, seed = sys.argv[2], float(sys.argv[3]), int(sys.argv[4]) | |
| 217 | + steps = int(sys.argv[5]) if len(sys.argv) > 5 else 300 | |
| 218 | + bs, accum = 4, 2 | |
| 219 | + tok, model = load_model() | |
| 220 | + fit, val, test = splits() | |
| 221 | + base_val = eval_nll(model, tok, val) | |
| 222 | + base_test = eval_nll(model, tok, test) | |
| 223 | + params, ntrain = attach(model, method, seed) | |
| 224 | + opt = torch.optim.AdamW(params, lr=lr, weight_decay=0.0) | |
| 225 | + sched = torch.optim.lr_scheduler.LambdaLR(opt, lambda s: min(1.0, (s + 1) / 20)) | |
| 226 | + g = torch.Generator().manual_seed(seed) | |
| 227 | + order = torch.randperm(len(fit), generator=g).tolist() | |
| 228 | + curve, k = [], 0 | |
| 229 | + torch.cuda.reset_peak_memory_stats() | |
| 230 | + t0 = time.time() | |
| 231 | + model.train() | |
| 232 | + for step in range(1, steps + 1): | |
| 233 | + opt.zero_grad(set_to_none=True) | |
| 234 | + tl, tn = 0.0, 0 | |
| 235 | + for _ in range(accum): | |
| 236 | + exs = [fit[order[(k + j) % len(fit)]] for j in range(bs)] | |
| 237 | + k += bs | |
| 238 | + x, am, lm = next(answer_batches(tok, exs, bs)) | |
| 239 | + l, n = lm_loss(model, x, am, lm) | |
| 240 | + (l / n / accum).backward() | |
| 241 | + tl += float(l) | |
| 242 | + tn += n | |
| 243 | + opt.step() | |
| 244 | + sched.step() | |
| 245 | + if step % 50 == 0 or step == steps: | |
| 246 | + model.eval() | |
| 247 | + v = eval_nll(model, tok, val) | |
| 248 | + model.train() | |
| 249 | + curve.append({"step": step, "train_nll": tl / tn, "val_nll": v, "t": time.time() - t0}) | |
| 250 | + print(method, lr, seed, curve[-1], flush=True) | |
| 251 | + model.eval() | |
| 252 | + res = {"method": method, "lr": lr, "seed": seed, "steps": steps, "batch": bs * accum, "trainable_params": ntrain, | |
| 253 | + "val_nll_frozen": base_val, "curve": curve, "val_nll": curve[-1]["val_nll"], | |
| 254 | + "test_nll": eval_nll(model, tok, test), "test_nll_frozen": base_test, | |
| 255 | + "peak_gpu_bytes": torch.cuda.max_memory_allocated(), "seconds_unlocked": time.time() - t0} | |
| 256 | + print(res["val_nll"], res["test_nll"], ntrain) | |
| 257 | + receipt(f"e2-train-{method}-{lr:g}-{seed}", res) | |
| 258 | + | |
| 259 | + elif mode == "time": | |
| 260 | + reps = {} | |
| 261 | + fit, _, _ = splits() | |
| 262 | + for method in ("none", "lora", "phm", "fourier"): | |
| 263 | + reps[method] = [] | |
| 264 | + for r in range(3): | |
| 265 | + tok, model = load_model() | |
| 266 | + if method == "none": | |
| 267 | + for p in model.parameters(): | |
| 268 | + p.requires_grad_(False) | |
| 269 | + model.model.embed_tokens.weight.requires_grad_(False) | |
| 270 | + params, ntrain = [], 0 | |
| 271 | + else: | |
| 272 | + params, ntrain = attach(model, method, 0) | |
| 273 | + opt = torch.optim.AdamW(params, lr=1e-4) if params else None | |
| 274 | + exs = fit[:4] | |
| 275 | + x, am, lm = next(answer_batches(tok, exs, 4)) | |
| 276 | + times = [] | |
| 277 | + torch.cuda.reset_peak_memory_stats() | |
| 278 | + for s in range(12): | |
| 279 | + torch.cuda.synchronize() | |
| 280 | + t0 = time.time() | |
| 281 | + l, n = lm_loss(model, x, am, lm) | |
| 282 | + if params: | |
| 283 | + (l / n).backward() | |
| 284 | + opt.step() | |
| 285 | + opt.zero_grad(set_to_none=True) | |
| 286 | + torch.cuda.synchronize() | |
| 287 | + times.append(time.time() - t0) | |
| 288 | + reps[method].append({"step_s_median_after_warmup": sorted(times[2:])[len(times[2:]) // 2], | |
| 289 | + "peak_gpu_bytes": torch.cuda.max_memory_allocated(), "trainable": ntrain, | |
| 290 | + "tokens_per_step": int(am.sum())}) | |
| 291 | + print(method, r, reps[method][-1], flush=True) | |
| 292 | + del model, opt | |
| 293 | + torch.cuda.empty_cache() | |
| 294 | + receipt("e2-time", {"note": "batch 4 x up to 256 tokens, one optimizer step per timed step; 'none' = forward only, frozen", "repeats": reps}) |
streams/math-training/e3.py
| new file mode 100644 | ||
| @@ -0,0 +1,262 @@ | ||
| 1 | +# E3: do real weight matrices live in a small closed algebra (structure constants)? | |
| 2 | +# python e3.py toy -> exact checks of the paste's toy claims (rational arithmetic), writes e3-toy.json | |
| 3 | +# python e3.py algebra -> per-head OV/QK spans, closure of virtual-head products, growth, controls, writes e3-algebra.json | |
| 4 | +# python e3.py nonlin -> linear fit of each gated MLP on real activations, and the NLL cost of swapping it in, writes e3-nonlin.json | |
| 5 | +# Rank-64 head matrices are kept factored, M = L R^T (L, R are d x 64), so inner products and products never build d x d: | |
| 6 | +# <L1 R1^T, L2 R2^T> = sum((L1^T L2) * (R1^T R2)), (L1 R1^T)(L2 R2^T) = (L1 (R1^T L2)) R2^T. | |
| 7 | +import json, os, sys, random | |
| 8 | +from fractions import Fraction as Fr | |
| 9 | +import torch | |
| 10 | +from common import * | |
| 11 | + | |
| 12 | +MODE = sys.argv[1] | |
| 13 | +HD, NH = 64, 32 | |
| 14 | + | |
| 15 | + | |
| 16 | +def weights(layer): | |
| 17 | + from safetensors import safe_open | |
| 18 | + out = {} | |
| 19 | + with safe_open(os.path.join(MODEL_DIR, "model.safetensors"), "pt") as f: | |
| 20 | + for n in ("q_proj", "k_proj", "v_proj", "o_proj"): | |
| 21 | + out[n] = f.get_tensor(f"model.layers.{layer}.self_attn.{n}.weight").float() | |
| 22 | + for n in ("gate_proj", "up_proj", "down_proj"): | |
| 23 | + out[n] = f.get_tensor(f"model.layers.{layer}.mlp.{n}.weight").float() | |
| 24 | + return out | |
| 25 | + | |
| 26 | + | |
| 27 | +def heads_OV(w): | |
| 28 | + """OV_h = W_O[:, h] W_V[h, :] (x -> contribution of head h, ignoring the attention mixing).""" | |
| 29 | + return [(w["o_proj"][:, h * HD:(h + 1) * HD], w["v_proj"][h * HD:(h + 1) * HD].T) for h in range(NH)] | |
| 30 | + | |
| 31 | + | |
| 32 | +def heads_QK(w): | |
| 33 | + """QK_h = W_Q[h]^T W_K[h] (bilinear score at relative position 0; RoPE rotates it at other offsets).""" | |
| 34 | + return [(w["q_proj"][h * HD:(h + 1) * HD].T, w["k_proj"][h * HD:(h + 1) * HD].T) for h in range(NH)] | |
| 35 | + | |
| 36 | + | |
| 37 | +def gram(items, others=None): | |
| 38 | + others = items if others is None else others | |
| 39 | + G = torch.empty(len(items), len(others), dtype=torch.float64, device=items[0][0].device) | |
| 40 | + for a, (La, Ra) in enumerate(items): | |
| 41 | + LL = torch.stack([La.T @ Lb for Lb, _ in others]) # [n, r, r] | |
| 42 | + RR = torch.stack([Ra.T @ Rb for _, Rb in others]) | |
| 43 | + G[a] = (LL * RR).sum((1, 2)).double() | |
| 44 | + return G | |
| 45 | + | |
| 46 | + | |
| 47 | +def normalize(items): | |
| 48 | + out = [] | |
| 49 | + for L, R in items: | |
| 50 | + n = float(((L.T @ L) * (R.T @ R)).sum()) ** 0.5 | |
| 51 | + out.append((L / n ** 0.5, R / n ** 0.5)) | |
| 52 | + return out | |
| 53 | + | |
| 54 | + | |
| 55 | +def energy_dims(G, levels=(0.95, 0.99, 0.999)): | |
| 56 | + ev = torch.linalg.eigvalsh(G).flip(0).clamp_min(0) | |
| 57 | + c = torch.cumsum(ev, 0) / ev.sum() | |
| 58 | + return {str(l): int((c < l).sum()) + 1 for l in levels}, ev | |
| 59 | + | |
| 60 | + | |
| 61 | +def matched_random(items, seed): | |
| 62 | + """Control: same singular values per matrix, random orthonormal singular vectors.""" | |
| 63 | + g = torch.Generator(device="cpu").manual_seed(seed) | |
| 64 | + out = [] | |
| 65 | + for L, R in items: | |
| 66 | + # exact SVD of L R^T from the factors: L = Ql Rl, R = Qr Rr, core = Rl Rr^T | |
| 67 | + Ql, Rl = torch.linalg.qr(L) | |
| 68 | + Qr, Rr = torch.linalg.qr(R) | |
| 69 | + s = torch.linalg.svdvals(Rl @ Rr.T) | |
| 70 | + d, r = L.shape | |
| 71 | + A = torch.linalg.qr(torch.randn(d, r, generator=g).to(L.device))[0] | |
| 72 | + B = torch.linalg.qr(torch.randn(d, r, generator=g).to(L.device))[0] | |
| 73 | + out.append((A * s, B)) | |
| 74 | + return out | |
| 75 | + | |
| 76 | + | |
| 77 | +def closure_residual(B_items, P_items): | |
| 78 | + """Relative residual of each P after orthogonal projection onto span(B): sqrt(1 - b^T G^-1 b / |P|^2).""" | |
| 79 | + G = gram(B_items) | |
| 80 | + b = gram(P_items, B_items) # [nP, nB] | |
| 81 | + nP = torch.stack([((L.T @ L) * (R.T @ R)).sum() for L, R in P_items]).double() | |
| 82 | + w = torch.linalg.solve(G + 1e-12 * torch.eye(len(B_items), dtype=G.dtype, device=G.device) * G.diagonal().mean(), b.T) | |
| 83 | + proj = (b.T * w).sum(0) | |
| 84 | + return torch.sqrt((1 - proj / nP).clamp_min(0)) | |
| 85 | + | |
| 86 | + | |
| 87 | +def products(A_items, B_items, pairs): | |
| 88 | + return [(A_items[i][0] @ (A_items[i][1].T @ B_items[j][0]), B_items[j][1]) for i, j in pairs] | |
| 89 | + | |
| 90 | + | |
| 91 | +if MODE == "toy": | |
| 92 | + out = {} | |
| 93 | + I = [[Fr(1), Fr(0)], [Fr(0), Fr(1)]] | |
| 94 | + Q = [[Fr(1), Fr(1)], [Fr(1), Fr(0)]] | |
| 95 | + mm = lambda A, B: [[sum(A[i][k] * B[k][j] for k in range(2)) for j in range(2)] for i in range(2)] | |
| 96 | + add = lambda A, B, a=1, b=1: [[a * A[i][j] + b * B[i][j] for j in range(2)] for i in range(2)] | |
| 97 | + out["Q2_equals_Q_plus_I_exact"] = mm(Q, Q) == add(Q, I) | |
| 98 | + # eigenvalues are roots of t^2 - t - 1 (trace 1, det -1); check numerically too | |
| 99 | + import numpy as np | |
| 100 | + ev = sorted(np.linalg.eigvalsh(np.array([[1.0, 1.0], [1.0, 0.0]])).tolist()) | |
| 101 | + out["eigenvalues"] = ev | |
| 102 | + out["eigen_match_golden"] = abs(ev[1] - (1 + 5 ** 0.5) / 2) < 1e-14 and abs(ev[0] - (1 - 5 ** 0.5) / 2) < 1e-14 | |
| 103 | + # (aI + bQ)(cI + dQ) = (ac + bd) I + (ad + bc + bd) Q, exact on 200 random rationals | |
| 104 | + rnd = random.Random(0) | |
| 105 | + ok = True | |
| 106 | + for _ in range(200): | |
| 107 | + a, b, c, d = (Fr(rnd.randint(-50, 50), rnd.randint(1, 20)) for _ in range(4)) | |
| 108 | + lhs = mm(add(I, Q, a, b), add(I, Q, c, d)) | |
| 109 | + ok &= lhs == add(I, Q, a * c + b * d, a * d + b * c + b * d) | |
| 110 | + out["product_rule_exact_200_random_rationals"] = ok | |
| 111 | + # ReLU does not commute with Q: one witness | |
| 112 | + relu = lambda v: [max(x, 0) for x in v] | |
| 113 | + mv = lambda A, v: [sum(A[i][k] * v[k] for k in range(2)) for i in range(2)] | |
| 114 | + v = [Fr(1), Fr(-2)] | |
| 115 | + out["relu_witness"] = {"v": [str(x) for x in v], "Q_relu_v": [str(x) for x in mv(Q, relu(v))], "relu_Q_v": [str(x) for x in relu(mv(Q, v))]} | |
| 116 | + out["relu_breaks_commutation"] = mv(Q, relu(v)) != relu(mv(Q, v)) | |
| 117 | + # chunked sufficient statistics are exactly additive (integer toy, exact rationals), and the ridge gradient is 0 | |
| 118 | + rows = [[Fr(rnd.randint(-5, 5)) for _ in range(3)] for _ in range(12)] | |
| 119 | + ys = [Fr(rnd.randint(-5, 5)) for _ in range(12)] | |
| 120 | + def stats(R, Y): | |
| 121 | + G = [[sum(r[i] * r[j] for r in R) for j in range(3)] for i in range(3)] | |
| 122 | + H = [sum(r[i] * y for r, y in zip(R, Y)) for i in range(3)] | |
| 123 | + return G, H | |
| 124 | + G1, H1 = stats(rows[:5], ys[:5]); G2, H2 = stats(rows[5:], ys[5:]); G, H = stats(rows, ys) | |
| 125 | + out["chunked_G_H_exact"] = all(G1[i][j] + G2[i][j] == G[i][j] for i in range(3) for j in range(3)) and all(H1[i] + H2[i] == H[i] for i in range(3)) | |
| 126 | + lam = Fr(1, 2) | |
| 127 | + A = [[G[i][j] + (lam if i == j else 0) for j in range(3)] + [H[i]] for i in range(3)] | |
| 128 | + for c in range(3): # exact Gauss-Jordan | |
| 129 | + p = next(r for r in range(c, 3) if A[r][c] != 0); A[c], A[p] = A[p], A[c] | |
| 130 | + A[c] = [x / A[c][c] for x in A[c]] | |
| 131 | + for r in range(3): | |
| 132 | + if r != c: | |
| 133 | + A[r] = [x - A[r][c] * y for x, y in zip(A[r], A[c])] | |
| 134 | + W = [A[i][3] for i in range(3)] | |
| 135 | + grad = [sum(G[i][j] * W[j] for j in range(3)) + lam * W[i] - H[i] for i in range(3)] | |
| 136 | + out["ridge_solution_exact"] = [str(x) for x in W] | |
| 137 | + out["ridge_gradient_exact_zero"] = all(g == 0 for g in grad) | |
| 138 | + print(out) | |
| 139 | + receipt("e3-toy", out) | |
| 140 | + | |
| 141 | +elif MODE == "algebra": | |
| 142 | + dev = DEV if torch.cuda.is_available() else "cpu" | |
| 143 | + torch.backends.cuda.matmul.allow_tf32 = False | |
| 144 | + out = {"per_layer": [], "notes": "items normalized to unit Frobenius norm before every Gram; energy = eigenvalue mass of the Gram"} | |
| 145 | + rng = random.Random(0) | |
| 146 | + # positive control: matrices drawn from the exact 2-dim algebra span{I, Q} kron I_1024 close perfectly | |
| 147 | + d = 2048 | |
| 148 | + Qd = torch.kron(torch.tensor([[1.0, 1.0], [1.0, 0.0]]), torch.eye(d // 2)).to(dev) | |
| 149 | + Id = torch.eye(d, device=dev) | |
| 150 | + pc = [(a * Id + b * Qd, Id) for a, b in ((1.0, 0.3), (0.2, 1.0), (-0.5, 0.7))] | |
| 151 | + pp = products(pc, pc, [(i, j) for i in range(3) for j in range(3)]) | |
| 152 | + out["positive_control_IQ_closure_residual_max"] = float(closure_residual(normalize(pc), normalize(pp)).max()) | |
| 153 | + prev = None | |
| 154 | + for layer in range(24): | |
| 155 | + w = {k: v.to(dev) for k, v in weights(layer).items()} | |
| 156 | + ov, qk = normalize(heads_OV(w)), normalize(heads_QK(w)) | |
| 157 | + row = {"layer": layer} | |
| 158 | + for name, items in (("OV", ov), ("QK", qk)): | |
| 159 | + dims, _ = energy_dims(gram(items)) | |
| 160 | + dims_r, _ = energy_dims(gram(normalize(matched_random(items, layer * 7 + len(name))))) | |
| 161 | + row[f"{name}_heads_energy_dims"] = dims | |
| 162 | + row[f"{name}_heads_energy_dims_random_control"] = dims_r | |
| 163 | + if prev is not None: | |
| 164 | + # virtual heads: OV of this layer applied after OV of the previous layer (products the model actually forms) | |
| 165 | + pairs = [(i, j) for i in range(NH) for j in range(NH)] | |
| 166 | + sub = rng.sample(pairs, 256) | |
| 167 | + P = normalize(products(ov, prev, sub)) | |
| 168 | + basis = ov + prev | |
| 169 | + res = closure_residual(basis, P) | |
| 170 | + ovr, prevr = normalize(matched_random(ov, layer)), normalize(matched_random(prev, layer + 100)) | |
| 171 | + res_r = closure_residual(ovr + prevr, normalize(products(ovr, prevr, sub))) | |
| 172 | + row["virtual_head_closure_residual"] = {"median": float(res.median()), "min": float(res.min()), "max": float(res.max())} | |
| 173 | + row["virtual_head_closure_residual_random_control"] = {"median": float(res_r.median()), "min": float(res_r.min()), "max": float(res_r.max())} | |
| 174 | + if layer in (1, 6, 12, 18, 23): | |
| 175 | + # growth: dims of span(B) and span(B + B.B) at 99% energy, B = 64 OV heads of two layers, 256 sampled products | |
| 176 | + g1, _ = energy_dims(gram(basis)) | |
| 177 | + g2, _ = energy_dims(gram(basis + P)) | |
| 178 | + g2r, _ = energy_dims(gram(ovr + prevr + normalize(products(ovr, prevr, sub)))) | |
| 179 | + row["growth"] = {"n_basis": len(basis), "n_basis_plus_products": len(basis) + len(P), | |
| 180 | + "dims_basis": g1, "dims_with_products": g2, "dims_with_products_random_control": g2r} | |
| 181 | + prev = ov | |
| 182 | + out["per_layer"].append(row) | |
| 183 | + print(json.dumps(row)[:600], flush=True) | |
| 184 | + # across depth: the 24 dense matrices of each kind | |
| 185 | + depth = {} | |
| 186 | + from safetensors import safe_open | |
| 187 | + with safe_open(os.path.join(MODEL_DIR, "model.safetensors"), "pt") as f: | |
| 188 | + for n, sec in (("q_proj", "self_attn"), ("k_proj", "self_attn"), ("v_proj", "self_attn"), ("o_proj", "self_attn"), | |
| 189 | + ("gate_proj", "mlp"), ("up_proj", "mlp"), ("down_proj", "mlp")): | |
| 190 | + M = torch.stack([f.get_tensor(f"model.layers.{l}.{sec}.{n}.weight").float().reshape(-1) for l in range(24)]).to(dev) | |
| 191 | + M = M / M.norm(dim=1, keepdim=True) | |
| 192 | + G = (M @ M.T).double() | |
| 193 | + depth[n] = {"energy_dims_of_24": energy_dims(G)[0], "mean_abs_cosine_offdiag": float((G - torch.eye(24, device=dev, dtype=G.dtype)).abs().sum() / (24 * 23))} | |
| 194 | + del M | |
| 195 | + out["across_depth"] = depth | |
| 196 | + out["apply_cost_per_token_flops"] = { | |
| 197 | + "dense_d_by_d": 2 * 2048 * 2048, "one_OV_head_factored": 2 * 2 * 2048 * 64, | |
| 198 | + "virtual_head_factored": 2 * (2048 * 64 + 64 * 64 + 64 * 2048), | |
| 199 | + "coefficients_over_r_dense_basis_elements": "r * 2 * d^2 (worse than dense for r > 1 unless each B_k is structured)"} | |
| 200 | + print(json.dumps(depth)) | |
| 201 | + receipt("e3-algebra", out) | |
| 202 | + | |
| 203 | +elif MODE == "nonlin": | |
| 204 | + # Collect MLP input u = post_attention_layernorm(h) and output y = mlp(u) on real text; fit y ~ [u, 1] W per layer. | |
| 205 | + tok, model = load_model() | |
| 206 | + tr, te = load_split("train"), load_split("test") | |
| 207 | + fit_ids, ev_ids = encode(tok, tr[:80]), encode(tok, te[:40]) | |
| 208 | + caps = {} | |
| 209 | + | |
| 210 | + def hook(li): | |
| 211 | + def f(mod, inp, outp): | |
| 212 | + caps.setdefault(li, []).append((inp[0].detach().float().reshape(-1, inp[0].shape[-1]).cpu(), outp.detach().float().reshape(-1, outp.shape[-1]).cpu())) | |
| 213 | + return f | |
| 214 | + | |
| 215 | + hs = [l.mlp.register_forward_hook(hook(i)) for i, l in enumerate(model.model.layers)] | |
| 216 | + with torch.no_grad(): | |
| 217 | + for x, m in batches(fit_ids, 1): # batch 1: no padding positions in the captured activations | |
| 218 | + model.model(input_ids=x.to(DEV), attention_mask=m.long().to(DEV)) | |
| 219 | + fitcap = caps | |
| 220 | + caps = {} | |
| 221 | + with torch.no_grad(): | |
| 222 | + for x, m in batches(ev_ids, 1): | |
| 223 | + model.model(input_ids=x.to(DEV), attention_mask=m.long().to(DEV)) | |
| 224 | + evcap = caps | |
| 225 | + for h in hs: | |
| 226 | + h.remove() | |
| 227 | + Wfit, rows = {}, [] | |
| 228 | + for li in range(24): | |
| 229 | + U = torch.cat([a for a, _ in fitcap[li]]); Y = torch.cat([b for _, b in fitcap[li]]) | |
| 230 | + Ue = torch.cat([a for a, _ in evcap[li]]); Ye = torch.cat([b for _, b in evcap[li]]) | |
| 231 | + Ua = torch.cat([U, torch.ones(len(U), 1)], 1).double() | |
| 232 | + G = Ua.T @ Ua | |
| 233 | + W = torch.linalg.solve(G + 1e-6 * G.diagonal().mean() * torch.eye(G.shape[0], dtype=G.dtype), Ua.T @ Y.double()).float() | |
| 234 | + pe = torch.cat([Ue, torch.ones(len(Ue), 1)], 1) @ W | |
| 235 | + rows.append({"layer": li, "tokens_fit": len(U), "tokens_eval": len(Ue), | |
| 236 | + "linear_fit_rel_residual_heldout": float((Ye - pe).norm() / Ye.norm()), | |
| 237 | + "linear_fit_rel_residual_fit": float((Y - torch.cat([U, torch.ones(len(U), 1)], 1) @ W).norm() / Y.norm())}) | |
| 238 | + Wfit[li] = W | |
| 239 | + print(rows[-1], flush=True) | |
| 240 | + del fitcap, evcap | |
| 241 | + | |
| 242 | + # NLL on held-out when one MLP at a time is replaced by its linear fit | |
| 243 | + @torch.no_grad() | |
| 244 | + def nll(): | |
| 245 | + tot, n = 0.0, 0 | |
| 246 | + for x, m in batches(ev_ids, 8): | |
| 247 | + x, m = x.to(DEV), m.to(DEV) | |
| 248 | + lg = model(input_ids=x, attention_mask=m.long()).logits[:, :-1].float() | |
| 249 | + v = m[:, 1:] & m[:, :-1] | |
| 250 | + tot += float(torch.nn.functional.cross_entropy(lg[v], x[:, 1:][v], reduction="sum")); n += int(v.sum()) | |
| 251 | + return tot / n | |
| 252 | + base = nll() | |
| 253 | + for li in range(24): | |
| 254 | + W = Wfit[li].to(DEV) | |
| 255 | + orig = model.model.layers[li].mlp.forward | |
| 256 | + model.model.layers[li].mlp.forward = lambda u, W=W: (torch.cat([u.float(), torch.ones(*u.shape[:-1], 1, device=DEV)], -1) @ W).to(u.dtype) | |
| 257 | + rows[li]["heldout_nll_with_this_mlp_linearized"] = nll() | |
| 258 | + rows[li]["nll_increase"] = rows[li]["heldout_nll_with_this_mlp_linearized"] - base | |
| 259 | + model.model.layers[li].mlp.forward = orig | |
| 260 | + print(li, rows[li]["nll_increase"], flush=True) | |
| 261 | + receipt("e3-nonlin", {"heldout_nll_full_model": base, "per_layer": rows, | |
| 262 | + "fit": "GSM8K train[0:80] all positions; eval GSM8K test[0:40]; least squares with bias, ridge 1e-6 * mean diag"}) |
streams/math-training/e4.py
| new file mode 100644 | ||
| @@ -0,0 +1,158 @@ | ||
| 1 | +# E4: how many dimensions does the between-layer state (the residual stream) really use, and what does keeping it small cost? | |
| 2 | +# python e4.py -> writes evidence/math-training/e4-subspace.json | |
| 3 | +# Fit PCA at every layer boundary on GSM8K train[0:80] (positions >= 1), evaluate on GSM8K test[0:40]. | |
| 4 | +# Truncation: h -> mu + U_k U_k^T (h - mu) at the output of a layer, for positions >= 1 (position 0, the attention-sink token, is kept). | |
| 5 | +import json, os, math | |
| 6 | +import torch | |
| 7 | +from common import * | |
| 8 | + | |
| 9 | +torch.backends.cuda.matmul.allow_tf32 = False | |
| 10 | +tok, model = load_model() | |
| 11 | +layers = model.model.layers | |
| 12 | +NL, d = len(layers), 2048 | |
| 13 | +tr, te = load_split("train"), load_split("test") | |
| 14 | +fit_ids, ev_ids = encode(tok, tr[:80]), encode(tok, te[:40]) | |
| 15 | + | |
| 16 | +# ---- capture layer outputs (residual stream after layer l) on fit text | |
| 17 | +caps = [[] for _ in range(NL)] | |
| 18 | +def cap(li): | |
| 19 | + def f(mod, inp, out): | |
| 20 | + h = out[0] if isinstance(out, tuple) else out | |
| 21 | + caps[li].append(h[0, 1:].float()) # batch 1, drop position 0 | |
| 22 | + return f | |
| 23 | +hs = [l.register_forward_hook(cap(i)) for i, l in enumerate(layers)] | |
| 24 | +with torch.no_grad(): | |
| 25 | + for x, m in batches(fit_ids, 1): | |
| 26 | + model.model(input_ids=x.to(DEV)) | |
| 27 | +for h in hs: | |
| 28 | + h.remove() | |
| 29 | + | |
| 30 | +pca, out = [], {"per_layer": []} | |
| 31 | +for li in range(NL): | |
| 32 | + H = torch.cat(caps[li]).double() | |
| 33 | + mu = H.mean(0) | |
| 34 | + C = (H - mu).T @ (H - mu) / len(H) | |
| 35 | + ev, U = torch.linalg.eigh(C) | |
| 36 | + ev, U = ev.flip(0).clamp_min(0), U.flip(1) | |
| 37 | + c = torch.cumsum(ev, 0) / ev.sum() | |
| 38 | + dims = {str(l): int((c < l).sum()) + 1 for l in (0.95, 0.99, 0.999)} | |
| 39 | + # outlier ("massive") dims: per-coordinate RMS more than 20x the median coordinate RMS | |
| 40 | + rms = H.pow(2).mean(0).sqrt() | |
| 41 | + outl = torch.nonzero(rms > 20 * rms.median()).flatten() | |
| 42 | + keep = torch.ones(d, dtype=torch.bool, device=H.device); keep[outl] = False | |
| 43 | + Hk = H[:, keep] | |
| 44 | + Ck = (Hk - Hk.mean(0)).T @ (Hk - Hk.mean(0)) / len(Hk) | |
| 45 | + evk = torch.linalg.eigvalsh(Ck).flip(0).clamp_min(0) | |
| 46 | + ck = torch.cumsum(evk, 0) / evk.sum() | |
| 47 | + dims_k = {str(l): int((ck < l).sum()) + 1 for l in (0.95, 0.99, 0.999)} | |
| 48 | + pca.append((mu.float(), U.float())) | |
| 49 | + out["per_layer"].append({"layer": li, "tokens": len(H), "energy_dims": dims, "outlier_dims": outl.tolist(), | |
| 50 | + "energy_dims_without_outlier_dims": dims_k, | |
| 51 | + "share_of_uncentered_energy_in_outlier_dims": float(H[:, outl].pow(2).sum() / H.pow(2).sum())}) | |
| 52 | + caps[li] = None | |
| 53 | +print(json.dumps(out["per_layer"][::6])[:1500], flush=True) | |
| 54 | + | |
| 55 | +# ---- subspace stability: mean cos^2 of principal angles between top-k subspaces of consecutive boundaries | |
| 56 | +for k in (64, 256, 1024): | |
| 57 | + out[f"consecutive_overlap_k{k}"] = [float((pca[l][1][:, :k].T @ pca[l + 1][1][:, :k]).pow(2).sum() / k) for l in range(NL - 1)] | |
| 58 | + out[f"first_last_overlap_k{k}"] = float((pca[0][1][:, :k].T @ pca[-1][1][:, :k]).pow(2).sum() / k) | |
| 59 | + | |
| 60 | +# ---- truncation experiments | |
| 61 | +state = {"k": None, "only": None, "rand": None} | |
| 62 | +def trunc(li): | |
| 63 | + def f(mod, inp, outp): | |
| 64 | + if state["k"] is None or (state["only"] is not None and state["only"] != li): | |
| 65 | + return None | |
| 66 | + h = outp[0] if isinstance(outp, tuple) else outp | |
| 67 | + mu, U = pca[li] | |
| 68 | + Uk = state["rand"][li] if state["rand"] is not None else U[:, :state["k"]] | |
| 69 | + hf = h.float() | |
| 70 | + p = mu + ((hf - mu) @ Uk) @ Uk.T | |
| 71 | + p[:, 0] = hf[:, 0] | |
| 72 | + p = p.to(h.dtype) | |
| 73 | + return (p,) + tuple(outp[1:]) if isinstance(outp, tuple) else p | |
| 74 | + return f | |
| 75 | +hs = [l.register_forward_hook(trunc(i)) for i, l in enumerate(layers)] | |
| 76 | + | |
| 77 | +ref_logits = [] | |
| 78 | +@torch.no_grad() | |
| 79 | +def run(collect=False): | |
| 80 | + tot, n, agree, i = 0.0, 0, 0, 0 | |
| 81 | + for x, m in batches(ev_ids, 1): | |
| 82 | + x = x.to(DEV) | |
| 83 | + lg = model(input_ids=x).logits[0, :-1].float() | |
| 84 | + tot += float(torch.nn.functional.cross_entropy(lg, x[0, 1:], reduction="sum")); n += lg.shape[0] | |
| 85 | + a = lg.argmax(1) | |
| 86 | + if collect: | |
| 87 | + ref_logits.append(a) | |
| 88 | + else: | |
| 89 | + agree += int((a == ref_logits[i]).sum()) | |
| 90 | + i += 1 | |
| 91 | + return tot / n, (agree / n if not collect else 1.0) | |
| 92 | + | |
| 93 | +base_nll, _ = run(collect=True) | |
| 94 | +out["heldout_nll_full"] = base_nll | |
| 95 | +res = [] | |
| 96 | +for k in (64, 128, 256, 512, 1024, 1536, 2048): | |
| 97 | + state.update(k=k, only=None, rand=None) | |
| 98 | + nll, ag = run() | |
| 99 | + res.append({"k": k, "nll": nll, "nll_increase": nll - base_nll, "top1_agreement_with_full": ag}) | |
| 100 | + print(res[-1], flush=True) | |
| 101 | +out["all_boundaries_pca"] = res | |
| 102 | +g = torch.Generator(device="cpu").manual_seed(0) | |
| 103 | +rr = [] | |
| 104 | +for k in (512, 1024, 1536): | |
| 105 | + state.update(k=k, only=None, rand=[torch.linalg.qr(torch.randn(d, k, generator=g))[0].to(DEV) for _ in range(NL)]) | |
| 106 | + nll, ag = run() | |
| 107 | + rr.append({"k": k, "nll_increase": nll - base_nll, "top1_agreement_with_full": ag}) | |
| 108 | + print("rand", rr[-1], flush=True) | |
| 109 | +out["all_boundaries_random_subspace_control"] = rr | |
| 110 | +one = [] | |
| 111 | +for li in range(NL): | |
| 112 | + state.update(k=256, only=li, rand=None) | |
| 113 | + nll, ag = run() | |
| 114 | + one.append({"layer": li, "k": 256, "nll_increase": nll - base_nll, "top1_agreement_with_full": ag}) | |
| 115 | +out["one_boundary_at_k256"] = one | |
| 116 | +print("one", [round(o["nll_increase"], 3) for o in one], flush=True) | |
| 117 | +state.update(k=None, only=None, rand=None) | |
| 118 | +for h in hs: | |
| 119 | + h.remove() | |
| 120 | + | |
| 121 | +# ---- the fold: with h = mu + U z (U orthonormal, d x k), q = W diag(g) (h / rms(h)) needs only z: | |
| 122 | +# rms(h)^2 = (|mu|^2 + 2 mu^T U z + |z|^2) / d, W diag(g) h = (W diag(g) mu) + (W diag(g) U) z | |
| 123 | +li, k = 12, 512 | |
| 124 | +mu, U = pca[li - 1] | |
| 125 | +Uk = U[:, :k] | |
| 126 | +lay = layers[li] | |
| 127 | +g_attn = lay.input_layernorm.weight.float() | |
| 128 | +Wq = lay.self_attn.q_proj.weight.float() | |
| 129 | +with torch.no_grad(): | |
| 130 | + x, _ = next(batches(ev_ids[:1], 1)) | |
| 131 | + hcap = [] | |
| 132 | + hk = layers[li - 1].register_forward_hook(lambda m_, i_, o_: hcap.append((o_[0] if isinstance(o_, tuple) else o_)[0, 1:].float())) | |
| 133 | + model.model(input_ids=x.to(DEV)); hk.remove() | |
| 134 | + h = mu + ((hcap[0] - mu) @ Uk) @ Uk.T # a state that lies exactly in the subspace | |
| 135 | + z = (h - mu) @ Uk | |
| 136 | + eps = model.config.rms_norm_eps | |
| 137 | + direct = (h / torch.sqrt(h.pow(2).mean(1, keepdim=True) + eps) * g_attn) @ Wq.T | |
| 138 | + r2 = (mu @ mu + 2 * z @ (Uk.T @ mu) + z.pow(2).sum(1)) / d | |
| 139 | + folded = ((Wq * g_attn) @ mu + z @ ((Wq * g_attn) @ Uk).T) / torch.sqrt(r2 + eps)[:, None] | |
| 140 | +out["fold_check"] = {"layer": li, "k": k, "rel_err_folded_vs_direct_fp32": float((folded - direct).norm() / direct.norm())} | |
| 141 | +print(out["fold_check"]) | |
| 142 | + | |
| 143 | +# ---- bytes: decode weight reads per token at k vs d (bf16), at the measured 245.1 GB/s (L279 / L151) | |
| 144 | +cfg = model.config | |
| 145 | +F = cfg.intermediate_size | |
| 146 | +per_layer = 4 * d * d + 3 * d * F | |
| 147 | +lm_head = cfg.vocab_size * d | |
| 148 | +full = (NL * per_layer + lm_head) * 2 | |
| 149 | +kv_per_ctx_token = NL * 2 * d * 2 | |
| 150 | +bw = 245.1e9 | |
| 151 | +tab = [] | |
| 152 | +for k in (256, 512, 1024, 1536, 2048): | |
| 153 | + w = full * k / d + NL * k * k * 2 # every matrix shrinks by k/d; plus one k x k change of basis per boundary | |
| 154 | + tab.append({"k": k, "weight_bytes_per_token": w, "ms_at_245GBps_weights_only": w / bw * 1e3, | |
| 155 | + "kv_bytes_per_token_at_ctx_1024_unchanged": kv_per_ctx_token * 1024}) | |
| 156 | +out["decode_bytes"] = {"full_weight_bytes_per_token": full, "table": tab, | |
| 157 | + "note": "weights only, bf16, one decode token; KV-cache reads do not shrink with k"} | |
| 158 | +receipt("e4-subspace", out) |
streams/math-training/extract_e1.py
| new file mode 100644 | ||
| @@ -0,0 +1,34 @@ | ||
| 1 | +# E1 step 1: freeze SmolLM2-1.7B, extract final-norm features X and next tokens Y once, save to .scratch. | |
| 2 | +# Splits: fit = GSM8K train examples [0, 6000); val = train [6000, 7473) (for lambda / early stop); test = GSM8K test. | |
| 3 | +import os, time, torch | |
| 4 | +from common import * | |
| 5 | + | |
| 6 | +CAP = {"fit": 262144, "val": 32768, "test": 65536} | |
| 7 | + | |
| 8 | +tok, model = load_model() | |
| 9 | +train, test = load_split("train"), load_split("test") | |
| 10 | +parts = {"fit": train[:6000], "val": train[6000:], "test": test} | |
| 11 | +E = model.model.embed_tokens.weight.detach() # tied LM head, [V, d] | |
| 12 | + | |
| 13 | +# Check that last_hidden_state is the post-norm state the LM head reads: logits must match. | |
| 14 | +ids = encode(tok, parts["test"][:2]) | |
| 15 | +x, m = next(batches(ids, 2)) | |
| 16 | +with torch.no_grad(): | |
| 17 | + ref = model(input_ids=x.to(DEV), attention_mask=m.long().to(DEV)).logits.float() | |
| 18 | + h = model.model(input_ids=x.to(DEV), attention_mask=m.long().to(DEV)).last_hidden_state | |
| 19 | + mine = (h @ E.T).float() | |
| 20 | +md = (ref - mine)[m.to(DEV)].abs().max().item() | |
| 21 | +print("logit check max abs diff", md) | |
| 22 | +assert md < 1e-2, md | |
| 23 | + | |
| 24 | +info = {"logit_check_max_abs_diff": md} | |
| 25 | +for name, exs in parts.items(): | |
| 26 | + t0 = time.time() | |
| 27 | + X, Y = extract_final(model, encode(tok, exs), CAP[name]) | |
| 28 | + torch.save({"X": X, "Y": Y}, os.path.join(SCRATCH, f"e1-{name}.pt")) | |
| 29 | + info[name] = {"examples_available": len(exs), "tokens": int(X.shape[0]), "d": int(X.shape[1]), | |
| 30 | + "sha256_X": sha_of_tensor(X), "seconds": time.time() - t0} | |
| 31 | + print(name, info[name]) | |
| 32 | +torch.save(E.float().cpu(), os.path.join(SCRATCH, "e1-embed.pt")) | |
| 33 | +info["peak_gpu_bytes"] = torch.cuda.max_memory_allocated() | |
| 34 | +receipt("e1-extract", info) |
streams/math-training/gsm8k_to_jsonl.py
| new file mode 100644 | ||
| @@ -0,0 +1,9 @@ | ||
| 1 | +# One-time conversion of the locally cached GSM8K arrow files to JSONL (pyarrow lives only in another venv). | |
| 2 | +import json, sys, pyarrow as pa | |
| 3 | +src, dst = sys.argv[1], sys.argv[2] | |
| 4 | +with pa.memory_map(src) as f: | |
| 5 | + t = pa.ipc.open_stream(f).read_all() | |
| 6 | +with open(dst, "w") as o: | |
| 7 | + for q, a in zip(t.column("question").to_pylist(), t.column("answer").to_pylist()): | |
| 8 | + o.write(json.dumps({"question": q, "answer": a}) + "\n") | |
| 9 | +print(dst, t.num_rows) |
streams/math-training/queue.sh
| new file mode 100644 | ||
| @@ -0,0 +1,16 @@ | ||
| 1 | +#!/bin/sh | |
| 2 | +# Sequential GPU queue for L283 after the E1 timing run: E3 nonlin, E4, E2 sweep + controls, E2 timing (quiet lock). | |
| 3 | +cd "$(dirname "$0")" | |
| 4 | +S=../../.scratch; EV=../../evidence/math-training; PY=$HOME/.venv/bin/python | |
| 5 | +R() { nice -n 10 ./run_retry.sh "$S/$1.log" $PY -u "$@" ; } | |
| 6 | +until [ -f $EV/e1-time.json ]; do sleep 30; done | |
| 7 | +nice -n 10 ./run_retry.sh $S/e3-nonlin.log $PY -u e3.py nonlin | |
| 8 | +nice -n 10 ./run_retry.sh $S/e4.log $PY -u e4.py | |
| 9 | +for lr in 1e-4 3e-4 1e-3; do nice -n 10 ./run_retry.sh $S/e2-lora-$lr.log $PY -u e2.py train lora $lr 0; done | |
| 10 | +for lr in 1e-4 3e-4 1e-3; do nice -n 10 ./run_retry.sh $S/e2-phm-$lr.log $PY -u e2.py train phm $lr 0; done | |
| 11 | +for lr in 1e-5 1e-4 1e-3; do nice -n 10 ./run_retry.sh $S/e2-fourier-$lr.log $PY -u e2.py train fourier $lr 0; done | |
| 12 | +best() { $PY -c "import json,glob,sys; r=[json.load(open(f)) for f in glob.glob('$EV/e2-train-$1-*-0.json')]; print(min(r,key=lambda x:x['val_nll'])['lr'])"; } | |
| 13 | +for m in lora phm fourier; do lr=$(best $m); nice -n 10 ./run_retry.sh $S/e2-$m-$lr-s1.log $PY -u e2.py train $m $lr 1; done | |
| 14 | +lr=$(best lora); nice -n 10 ./run_retry.sh $S/e2-lora64.log $PY -u e2.py train lora64 $lr 0 | |
| 15 | +nice -n 5 ./run_retry.sh $S/e2-time.log quiet-measure flock /tmp/aien-gb10.lock $PY -u e2.py time | |
| 16 | +echo QUEUE-DONE $(date -u +%H:%M:%SZ) > $S/queue.done |
streams/math-training/queue2.sh
| new file mode 100644 | ||
| @@ -0,0 +1,11 @@ | ||
| 1 | +#!/bin/sh | |
| 2 | +# L283 remaining GPU queue (fourier 1e-5 seed 0 already done, receipt in evidence): every GPU run holds /tmp/aien-gb10.lock (one run at a time), so the live 30B server is not starved. | |
| 3 | +cd "$(dirname "$0")" | |
| 4 | +S=../../.scratch; EV=../../evidence/math-training; PY=$HOME/.venv/bin/python | |
| 5 | +L() { log=$1; shift; nice -n 10 ./run_retry.sh "$log" flock /tmp/aien-gb10.lock "$@"; } | |
| 6 | +for lr in 1e-4 1e-3; do L $S/e2-fourier-$lr.log $PY -u e2.py train fourier $lr 0; done | |
| 7 | +best() { $PY -I -c "import json,glob; r=[json.load(open(f)) for f in glob.glob('$EV/e2-train-$1-*-0.json')]; print(min(r,key=lambda x:x['val_nll'])['lr'])"; } | |
| 8 | +for m in lora phm fourier; do lr=$(best $m); L $S/e2-$m-$lr-s1.log $PY -u e2.py train $m $lr 1; done | |
| 9 | +lr=$(best lora); L $S/e2-lora64.log $PY -u e2.py train lora64 $lr 0 | |
| 10 | +nice -n 5 ./run_retry.sh $S/e2-time.log quiet-measure flock /tmp/aien-gb10.lock $PY -u e2.py time | |
| 11 | +echo QUEUE-DONE $(date -u +%H:%M:%SZ) > $S/queue.done |
streams/math-training/run_retry.sh
| new file mode 100644 | ||
| @@ -0,0 +1,11 @@ | ||
| 1 | +#!/bin/sh | |
| 2 | +# Rerun a GPU script when CUDA context creation fails on fragmented memory (cuDevicePrimaryCtxRetain OOM). | |
| 3 | +# Usage: run_retry.sh LOG cmd... Retries up to 30 times, 60 s apart, only for that specific startup failure. | |
| 4 | +log=$1; shift | |
| 5 | +i=0 | |
| 6 | +while [ $i -lt 30 ]; do | |
| 7 | + "$@" > "$log" 2>&1 && exit 0 | |
| 8 | + grep -q "cuDevicePrimaryCtxRetain" "$log" || exit 1 | |
| 9 | + i=$((i+1)); echo "ctx-retry $i $(date -u +%H:%M:%SZ)" >> "$log.retries"; sleep 60 | |
| 10 | +done | |
| 11 | +exit 1 |
streams/own-fp4/.gitignore
| new file mode 100644 | ||
| @@ -0,0 +1,3 @@ | ||
| 1 | +*.cubin | |
| 2 | +*.err | |
| 3 | +__pycache__/ |
streams/own-fp4/asm/c_rn_e2m1x2.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rn.satfinite.e2m1x2.f32 q, f0, f1; cvt.u32.u8 r0, q; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
streams/own-fp4/asm/c_rn_e4m3x2.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rn.satfinite.e4m3x2.f32 h, f0, f1; cvt.u32.u16 r0, h; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
streams/own-fp4/asm/c_rp_ue8m0x2.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rp.satfinite.ue8m0x2.f32 h, f0, f1; cvt.u32.u16 r0, h; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
streams/own-fp4/asm/c_rs_e2m1x4.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rs.satfinite.e2m1x4.f32 h, {f0,f1,f2,f3}, r1; cvt.u32.u16 r0, h; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
streams/own-fp4/asm/c_rs_e4m3x4.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rs.satfinite.e4m3x4.f32 r0, {f0,f1,f2,f3}, r1; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
streams/own-fp4/asm/c_rz_ue8m0x2.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rz.satfinite.ue8m0x2.f32 h, f0, f1; cvt.u32.u16 r0, h; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
streams/own-fp4/asm/f8f6f4_e2m1.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k32.row.col.kind::f8f6f4.f32.e2m1.e2m1.f32 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/f8f6f4_e2m1.sass
| new file mode 100644 | ||
| @@ -0,0 +1,282 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x24, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x00000012 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x02, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0000 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x00000090 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ LDG.E.64 R8, desc[UR4][R2.64+0x10] ; /* 0x0000100402087981 */ | |
| 216 | + /* 0x001ea8000c1e1b00 */ | |
| 217 | + /*0040*/ LDG.E.128 R4, desc[UR4][R2.64] ; /* 0x0000000402047981 */ | |
| 218 | + /* 0x000ea8000c1e1d00 */ | |
| 219 | + /*0050*/ LDG.E.128 R12, desc[UR4][R2.64+0x20] ; /* 0x00002004020c7981 */ | |
| 220 | + /* 0x000ea4000c1e1d00 */ | |
| 221 | + /*0060*/ QMMA.16832.F32.E2M1.E2M1 R4, R4, R8, R12 ; /* 0x000000080404727a */ | |
| 222 | + /* 0x004fde000028ec0c */ | |
| 223 | + /*0070*/ NOP ; /* 0x0000000000007918 */ | |
| 224 | + /* 0x000fda0000000000 */ | |
| 225 | + /*0080*/ STG.E.128 desc[UR4][R2.64], R4 ; /* 0x0000000402007986 */ | |
| 226 | + /* 0x000fe2000c101d04 */ | |
| 227 | + /*0090*/ EXIT ; /* 0x000000000000794d */ | |
| 228 | + /* 0x000fea0003800000 */ | |
| 229 | +.L_x_0: | |
| 230 | + /*00a0*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 231 | + /* 0x000fc0000383ffff */ | |
| 232 | + /*00b0*/ NOP; /* 0x0000000000007918 */ | |
| 233 | + /* 0x000fc00000000000 */ | |
| 234 | + /*00c0*/ NOP; /* 0x0000000000007918 */ | |
| 235 | + /* 0x000fc00000000000 */ | |
| 236 | + /*00d0*/ NOP; /* 0x0000000000007918 */ | |
| 237 | + /* 0x000fc00000000000 */ | |
| 238 | + /*00e0*/ NOP; /* 0x0000000000007918 */ | |
| 239 | + /* 0x000fc00000000000 */ | |
| 240 | + /*00f0*/ NOP; /* 0x0000000000007918 */ | |
| 241 | + /* 0x000fc00000000000 */ | |
| 242 | + /*0100*/ NOP; /* 0x0000000000007918 */ | |
| 243 | + /* 0x000fc00000000000 */ | |
| 244 | + /*0110*/ NOP; /* 0x0000000000007918 */ | |
| 245 | + /* 0x000fc00000000000 */ | |
| 246 | + /*0120*/ NOP; /* 0x0000000000007918 */ | |
| 247 | + /* 0x000fc00000000000 */ | |
| 248 | + /*0130*/ NOP; /* 0x0000000000007918 */ | |
| 249 | + /* 0x000fc00000000000 */ | |
| 250 | + /*0140*/ NOP; /* 0x0000000000007918 */ | |
| 251 | + /* 0x000fc00000000000 */ | |
| 252 | + /*0150*/ NOP; /* 0x0000000000007918 */ | |
| 253 | + /* 0x000fc00000000000 */ | |
| 254 | + /*0160*/ NOP; /* 0x0000000000007918 */ | |
| 255 | + /* 0x000fc00000000000 */ | |
| 256 | + /*0170*/ NOP; /* 0x0000000000007918 */ | |
| 257 | + /* 0x000fc00000000000 */ | |
| 258 | +.L_x_1: | |
| 259 | + | |
| 260 | + | |
| 261 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 262 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 263 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 264 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 265 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 266 | +__nv_reservedSMEM_offset_0_alias: | |
| 267 | + .zero 0 | |
| 268 | + .zero 64 | |
| 269 | + | |
| 270 | + | |
| 271 | +//--------------------- .nv.constant0.k -------------------------- | |
| 272 | + .section .nv.constant0.k,"a",@progbits | |
| 273 | + .sectionflags @"" | |
| 274 | + .align 4 | |
| 275 | +.nv.constant0.k: | |
| 276 | + .zero 904 | |
| 277 | + | |
| 278 | + | |
| 279 | +//--------------------- SYMBOLS -------------------------- | |
| 280 | + | |
| 281 | + .type .nv.reservedSmem.offset0,@object | |
| 282 | + .size .nv.reservedSmem.offset0,0x4 |
streams/own-fp4/asm/f8f6f4_e2m1xe4m3.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k32.row.col.kind::f8f6f4.f32.e2m1.e4m3.f32 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/f8f6f4_e2m1xe4m3.sass
| new file mode 100644 | ||
| @@ -0,0 +1,282 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x24, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x00000012 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x02, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0000 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x00000090 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ LDG.E.64 R8, desc[UR4][R2.64+0x10] ; /* 0x0000100402087981 */ | |
| 216 | + /* 0x001ea8000c1e1b00 */ | |
| 217 | + /*0040*/ LDG.E.128 R4, desc[UR4][R2.64] ; /* 0x0000000402047981 */ | |
| 218 | + /* 0x000ea8000c1e1d00 */ | |
| 219 | + /*0050*/ LDG.E.128 R12, desc[UR4][R2.64+0x20] ; /* 0x00002004020c7981 */ | |
| 220 | + /* 0x000ea4000c1e1d00 */ | |
| 221 | + /*0060*/ QMMA.16832.F32.E2M1.E4M3 R4, R4, R8, R12 ; /* 0x000000080404727a */ | |
| 222 | + /* 0x004fde0000086c0c */ | |
| 223 | + /*0070*/ NOP ; /* 0x0000000000007918 */ | |
| 224 | + /* 0x000fda0000000000 */ | |
| 225 | + /*0080*/ STG.E.128 desc[UR4][R2.64], R4 ; /* 0x0000000402007986 */ | |
| 226 | + /* 0x000fe2000c101d04 */ | |
| 227 | + /*0090*/ EXIT ; /* 0x000000000000794d */ | |
| 228 | + /* 0x000fea0003800000 */ | |
| 229 | +.L_x_0: | |
| 230 | + /*00a0*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 231 | + /* 0x000fc0000383ffff */ | |
| 232 | + /*00b0*/ NOP; /* 0x0000000000007918 */ | |
| 233 | + /* 0x000fc00000000000 */ | |
| 234 | + /*00c0*/ NOP; /* 0x0000000000007918 */ | |
| 235 | + /* 0x000fc00000000000 */ | |
| 236 | + /*00d0*/ NOP; /* 0x0000000000007918 */ | |
| 237 | + /* 0x000fc00000000000 */ | |
| 238 | + /*00e0*/ NOP; /* 0x0000000000007918 */ | |
| 239 | + /* 0x000fc00000000000 */ | |
| 240 | + /*00f0*/ NOP; /* 0x0000000000007918 */ | |
| 241 | + /* 0x000fc00000000000 */ | |
| 242 | + /*0100*/ NOP; /* 0x0000000000007918 */ | |
| 243 | + /* 0x000fc00000000000 */ | |
| 244 | + /*0110*/ NOP; /* 0x0000000000007918 */ | |
| 245 | + /* 0x000fc00000000000 */ | |
| 246 | + /*0120*/ NOP; /* 0x0000000000007918 */ | |
| 247 | + /* 0x000fc00000000000 */ | |
| 248 | + /*0130*/ NOP; /* 0x0000000000007918 */ | |
| 249 | + /* 0x000fc00000000000 */ | |
| 250 | + /*0140*/ NOP; /* 0x0000000000007918 */ | |
| 251 | + /* 0x000fc00000000000 */ | |
| 252 | + /*0150*/ NOP; /* 0x0000000000007918 */ | |
| 253 | + /* 0x000fc00000000000 */ | |
| 254 | + /*0160*/ NOP; /* 0x0000000000007918 */ | |
| 255 | + /* 0x000fc00000000000 */ | |
| 256 | + /*0170*/ NOP; /* 0x0000000000007918 */ | |
| 257 | + /* 0x000fc00000000000 */ | |
| 258 | +.L_x_1: | |
| 259 | + | |
| 260 | + | |
| 261 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 262 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 263 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 264 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 265 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 266 | +__nv_reservedSMEM_offset_0_alias: | |
| 267 | + .zero 0 | |
| 268 | + .zero 64 | |
| 269 | + | |
| 270 | + | |
| 271 | +//--------------------- .nv.constant0.k -------------------------- | |
| 272 | + .section .nv.constant0.k,"a",@progbits | |
| 273 | + .sectionflags @"" | |
| 274 | + .align 4 | |
| 275 | +.nv.constant0.k: | |
| 276 | + .zero 904 | |
| 277 | + | |
| 278 | + | |
| 279 | +//--------------------- SYMBOLS -------------------------- | |
| 280 | + | |
| 281 | + .type .nv.reservedSmem.offset0,@object | |
| 282 | + .size .nv.reservedSmem.offset0,0x4 |
streams/own-fp4/asm/f8f6f4_e4m3.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k32.row.col.kind::f8f6f4.f32.e4m3.e4m3.f32 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/f8f6f4_e4m3.sass
| new file mode 100644 | ||
| @@ -0,0 +1,282 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x24, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x00000012 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x02, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0000 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x00000090 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ LDG.E.64 R8, desc[UR4][R2.64+0x10] ; /* 0x0000100402087981 */ | |
| 216 | + /* 0x001ea8000c1e1b00 */ | |
| 217 | + /*0040*/ LDG.E.128 R4, desc[UR4][R2.64] ; /* 0x0000000402047981 */ | |
| 218 | + /* 0x000ea8000c1e1d00 */ | |
| 219 | + /*0050*/ LDG.E.128 R12, desc[UR4][R2.64+0x20] ; /* 0x00002004020c7981 */ | |
| 220 | + /* 0x000ea4000c1e1d00 */ | |
| 221 | + /*0060*/ QMMA.16832.F32.E4M3.E4M3 R4, R4, R8, R12 ; /* 0x000000080404727a */ | |
| 222 | + /* 0x004fde0000002c0c */ | |
| 223 | + /*0070*/ NOP ; /* 0x0000000000007918 */ | |
| 224 | + /* 0x000fda0000000000 */ | |
| 225 | + /*0080*/ STG.E.128 desc[UR4][R2.64], R4 ; /* 0x0000000402007986 */ | |
| 226 | + /* 0x000fe2000c101d04 */ | |
| 227 | + /*0090*/ EXIT ; /* 0x000000000000794d */ | |
| 228 | + /* 0x000fea0003800000 */ | |
| 229 | +.L_x_0: | |
| 230 | + /*00a0*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 231 | + /* 0x000fc0000383ffff */ | |
| 232 | + /*00b0*/ NOP; /* 0x0000000000007918 */ | |
| 233 | + /* 0x000fc00000000000 */ | |
| 234 | + /*00c0*/ NOP; /* 0x0000000000007918 */ | |
| 235 | + /* 0x000fc00000000000 */ | |
| 236 | + /*00d0*/ NOP; /* 0x0000000000007918 */ | |
| 237 | + /* 0x000fc00000000000 */ | |
| 238 | + /*00e0*/ NOP; /* 0x0000000000007918 */ | |
| 239 | + /* 0x000fc00000000000 */ | |
| 240 | + /*00f0*/ NOP; /* 0x0000000000007918 */ | |
| 241 | + /* 0x000fc00000000000 */ | |
| 242 | + /*0100*/ NOP; /* 0x0000000000007918 */ | |
| 243 | + /* 0x000fc00000000000 */ | |
| 244 | + /*0110*/ NOP; /* 0x0000000000007918 */ | |
| 245 | + /* 0x000fc00000000000 */ | |
| 246 | + /*0120*/ NOP; /* 0x0000000000007918 */ | |
| 247 | + /* 0x000fc00000000000 */ | |
| 248 | + /*0130*/ NOP; /* 0x0000000000007918 */ | |
| 249 | + /* 0x000fc00000000000 */ | |
| 250 | + /*0140*/ NOP; /* 0x0000000000007918 */ | |
| 251 | + /* 0x000fc00000000000 */ | |
| 252 | + /*0150*/ NOP; /* 0x0000000000007918 */ | |
| 253 | + /* 0x000fc00000000000 */ | |
| 254 | + /*0160*/ NOP; /* 0x0000000000007918 */ | |
| 255 | + /* 0x000fc00000000000 */ | |
| 256 | + /*0170*/ NOP; /* 0x0000000000007918 */ | |
| 257 | + /* 0x000fc00000000000 */ | |
| 258 | +.L_x_1: | |
| 259 | + | |
| 260 | + | |
| 261 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 262 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 263 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 264 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 265 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 266 | +__nv_reservedSMEM_offset_0_alias: | |
| 267 | + .zero 0 | |
| 268 | + .zero 64 | |
| 269 | + | |
| 270 | + | |
| 271 | +//--------------------- .nv.constant0.k -------------------------- | |
| 272 | + .section .nv.constant0.k,"a",@progbits | |
| 273 | + .sectionflags @"" | |
| 274 | + .align 4 | |
| 275 | +.nv.constant0.k: | |
| 276 | + .zero 904 | |
| 277 | + | |
| 278 | + | |
| 279 | +//--------------------- SYMBOLS -------------------------- | |
| 280 | + | |
| 281 | + .type .nv.reservedSmem.offset0,@object | |
| 282 | + .size .nv.reservedSmem.offset0,0x4 |
streams/own-fp4/asm/f8f6f4_f16acc.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k32.row.col.kind::f8f6f4.f16.e2m1.e2m1.f16 {a0,a1},{a0,a1,a2,a3},{b0,b1},{a2,a3}; mov.b32 d0,0f00000000; mov.b32 d1,0f00000000; mov.b32 d2,0f00000000; mov.b32 d3,0f00000000; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/f8f6f4_f16acc.sass
| new file mode 100644 | ||
| @@ -0,0 +1,266 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x10, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x00000006 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x01, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0000 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x00000040 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ STG.E.128 desc[UR4][R2.64], RZ ; /* 0x000000ff02007986 */ | |
| 216 | + /* 0x001fe2000c101d04 */ | |
| 217 | + /*0040*/ EXIT ; /* 0x000000000000794d */ | |
| 218 | + /* 0x000fea0003800000 */ | |
| 219 | +.L_x_0: | |
| 220 | + /*0050*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 221 | + /* 0x000fc0000383ffff */ | |
| 222 | + /*0060*/ NOP; /* 0x0000000000007918 */ | |
| 223 | + /* 0x000fc00000000000 */ | |
| 224 | + /*0070*/ NOP; /* 0x0000000000007918 */ | |
| 225 | + /* 0x000fc00000000000 */ | |
| 226 | + /*0080*/ NOP; /* 0x0000000000007918 */ | |
| 227 | + /* 0x000fc00000000000 */ | |
| 228 | + /*0090*/ NOP; /* 0x0000000000007918 */ | |
| 229 | + /* 0x000fc00000000000 */ | |
| 230 | + /*00a0*/ NOP; /* 0x0000000000007918 */ | |
| 231 | + /* 0x000fc00000000000 */ | |
| 232 | + /*00b0*/ NOP; /* 0x0000000000007918 */ | |
| 233 | + /* 0x000fc00000000000 */ | |
| 234 | + /*00c0*/ NOP; /* 0x0000000000007918 */ | |
| 235 | + /* 0x000fc00000000000 */ | |
| 236 | + /*00d0*/ NOP; /* 0x0000000000007918 */ | |
| 237 | + /* 0x000fc00000000000 */ | |
| 238 | + /*00e0*/ NOP; /* 0x0000000000007918 */ | |
| 239 | + /* 0x000fc00000000000 */ | |
| 240 | + /*00f0*/ NOP; /* 0x0000000000007918 */ | |
| 241 | + /* 0x000fc00000000000 */ | |
| 242 | +.L_x_1: | |
| 243 | + | |
| 244 | + | |
| 245 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 246 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 247 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 248 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 249 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 250 | +__nv_reservedSMEM_offset_0_alias: | |
| 251 | + .zero 0 | |
| 252 | + .zero 64 | |
| 253 | + | |
| 254 | + | |
| 255 | +//--------------------- .nv.constant0.k -------------------------- | |
| 256 | + .section .nv.constant0.k,"a",@progbits | |
| 257 | + .sectionflags @"" | |
| 258 | + .align 4 | |
| 259 | +.nv.constant0.k: | |
| 260 | + .zero 904 | |
| 261 | + | |
| 262 | + | |
| 263 | +//--------------------- SYMBOLS -------------------------- | |
| 264 | + | |
| 265 | + .type .nv.reservedSmem.offset0,@object | |
| 266 | + .size .nv.reservedSmem.offset0,0x4 |
streams/own-fp4/asm/mxf4_1x.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4.block_scale.scale_vec::1X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/mxf4_2x.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/mxf4_2x.sass
| new file mode 100644 | ||
| @@ -0,0 +1,282 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x28, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x00000012 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x02, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0000 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x000000a0 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ LDG.E.64 R8, desc[UR4][R2.64+0x10] ; /* 0x0000100402087981 */ | |
| 216 | + /* 0x001ea8000c1e1b00 */ | |
| 217 | + /*0040*/ LDG.E.64 R10, desc[UR4][R2.64+0x30] ; /* 0x00003004020a7981 */ | |
| 218 | + /* 0x000ea8000c1e1b00 */ | |
| 219 | + /*0050*/ LDG.E.128 R4, desc[UR4][R2.64] ; /* 0x0000000402047981 */ | |
| 220 | + /* 0x000ea8000c1e1d00 */ | |
| 221 | + /*0060*/ LDG.E.128 R12, desc[UR4][R2.64+0x20] ; /* 0x00002004020c7981 */ | |
| 222 | + /* 0x000ea4000c1e1d00 */ | |
| 223 | + /*0070*/ OMMA.SF.16864.F32.E2M1.E2M1.E8 R4, R4, R8, R12, R10, R11, URZ ; /* 0x70b00a080404747f */ | |
| 224 | + /* 0x004fde0000083e0c */ | |
| 225 | + /*0080*/ NOP ; /* 0x0000000000007918 */ | |
| 226 | + /* 0x000fda0000000000 */ | |
| 227 | + /*0090*/ STG.E.128 desc[UR4][R2.64], R4 ; /* 0x0000000402007986 */ | |
| 228 | + /* 0x000fe2000c101d04 */ | |
| 229 | + /*00a0*/ EXIT ; /* 0x000000000000794d */ | |
| 230 | + /* 0x000fea0003800000 */ | |
| 231 | +.L_x_0: | |
| 232 | + /*00b0*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 233 | + /* 0x000fc0000383ffff */ | |
| 234 | + /*00c0*/ NOP; /* 0x0000000000007918 */ | |
| 235 | + /* 0x000fc00000000000 */ | |
| 236 | + /*00d0*/ NOP; /* 0x0000000000007918 */ | |
| 237 | + /* 0x000fc00000000000 */ | |
| 238 | + /*00e0*/ NOP; /* 0x0000000000007918 */ | |
| 239 | + /* 0x000fc00000000000 */ | |
| 240 | + /*00f0*/ NOP; /* 0x0000000000007918 */ | |
| 241 | + /* 0x000fc00000000000 */ | |
| 242 | + /*0100*/ NOP; /* 0x0000000000007918 */ | |
| 243 | + /* 0x000fc00000000000 */ | |
| 244 | + /*0110*/ NOP; /* 0x0000000000007918 */ | |
| 245 | + /* 0x000fc00000000000 */ | |
| 246 | + /*0120*/ NOP; /* 0x0000000000007918 */ | |
| 247 | + /* 0x000fc00000000000 */ | |
| 248 | + /*0130*/ NOP; /* 0x0000000000007918 */ | |
| 249 | + /* 0x000fc00000000000 */ | |
| 250 | + /*0140*/ NOP; /* 0x0000000000007918 */ | |
| 251 | + /* 0x000fc00000000000 */ | |
| 252 | + /*0150*/ NOP; /* 0x0000000000007918 */ | |
| 253 | + /* 0x000fc00000000000 */ | |
| 254 | + /*0160*/ NOP; /* 0x0000000000007918 */ | |
| 255 | + /* 0x000fc00000000000 */ | |
| 256 | + /*0170*/ NOP; /* 0x0000000000007918 */ | |
| 257 | + /* 0x000fc00000000000 */ | |
| 258 | +.L_x_1: | |
| 259 | + | |
| 260 | + | |
| 261 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 262 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 263 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 264 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 265 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 266 | +__nv_reservedSMEM_offset_0_alias: | |
| 267 | + .zero 0 | |
| 268 | + .zero 64 | |
| 269 | + | |
| 270 | + | |
| 271 | +//--------------------- .nv.constant0.k -------------------------- | |
| 272 | + .section .nv.constant0.k,"a",@progbits | |
| 273 | + .sectionflags @"" | |
| 274 | + .align 4 | |
| 275 | +.nv.constant0.k: | |
| 276 | + .zero 904 | |
| 277 | + | |
| 278 | + | |
| 279 | +//--------------------- SYMBOLS -------------------------- | |
| 280 | + | |
| 281 | + .type .nv.reservedSmem.offset0,@object | |
| 282 | + .size .nv.reservedSmem.offset0,0x4 |
streams/own-fp4/asm/mxf8f6f4_e2m1.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k32.row.col.kind::mxf8f6f4.block_scale.scale_vec::1X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/mxf8f6f4_e2m1.sass
| new file mode 100644 | ||
| @@ -0,0 +1,282 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x28, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x00000012 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x02, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0000 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x000000a0 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ LDG.E.64 R8, desc[UR4][R2.64+0x10] ; /* 0x0000100402087981 */ | |
| 216 | + /* 0x001ea8000c1e1b00 */ | |
| 217 | + /*0040*/ LDG.E.64 R10, desc[UR4][R2.64+0x30] ; /* 0x00003004020a7981 */ | |
| 218 | + /* 0x000ea8000c1e1b00 */ | |
| 219 | + /*0050*/ LDG.E.128 R4, desc[UR4][R2.64] ; /* 0x0000000402047981 */ | |
| 220 | + /* 0x000ea8000c1e1d00 */ | |
| 221 | + /*0060*/ LDG.E.128 R12, desc[UR4][R2.64+0x20] ; /* 0x00002004020c7981 */ | |
| 222 | + /* 0x000ea4000c1e1d00 */ | |
| 223 | + /*0070*/ QMMA.SF.16832.F32.E2M1.E2M1.E8 R4, R4, R8, R12, R10, R11, URZ ; /* 0x70b00a080404747a */ | |
| 224 | + /* 0x004fde000028fe0c */ | |
| 225 | + /*0080*/ NOP ; /* 0x0000000000007918 */ | |
| 226 | + /* 0x000fda0000000000 */ | |
| 227 | + /*0090*/ STG.E.128 desc[UR4][R2.64], R4 ; /* 0x0000000402007986 */ | |
| 228 | + /* 0x000fe2000c101d04 */ | |
| 229 | + /*00a0*/ EXIT ; /* 0x000000000000794d */ | |
| 230 | + /* 0x000fea0003800000 */ | |
| 231 | +.L_x_0: | |
| 232 | + /*00b0*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 233 | + /* 0x000fc0000383ffff */ | |
| 234 | + /*00c0*/ NOP; /* 0x0000000000007918 */ | |
| 235 | + /* 0x000fc00000000000 */ | |
| 236 | + /*00d0*/ NOP; /* 0x0000000000007918 */ | |
| 237 | + /* 0x000fc00000000000 */ | |
| 238 | + /*00e0*/ NOP; /* 0x0000000000007918 */ | |
| 239 | + /* 0x000fc00000000000 */ | |
| 240 | + /*00f0*/ NOP; /* 0x0000000000007918 */ | |
| 241 | + /* 0x000fc00000000000 */ | |
| 242 | + /*0100*/ NOP; /* 0x0000000000007918 */ | |
| 243 | + /* 0x000fc00000000000 */ | |
| 244 | + /*0110*/ NOP; /* 0x0000000000007918 */ | |
| 245 | + /* 0x000fc00000000000 */ | |
| 246 | + /*0120*/ NOP; /* 0x0000000000007918 */ | |
| 247 | + /* 0x000fc00000000000 */ | |
| 248 | + /*0130*/ NOP; /* 0x0000000000007918 */ | |
| 249 | + /* 0x000fc00000000000 */ | |
| 250 | + /*0140*/ NOP; /* 0x0000000000007918 */ | |
| 251 | + /* 0x000fc00000000000 */ | |
| 252 | + /*0150*/ NOP; /* 0x0000000000007918 */ | |
| 253 | + /* 0x000fc00000000000 */ | |
| 254 | + /*0160*/ NOP; /* 0x0000000000007918 */ | |
| 255 | + /* 0x000fc00000000000 */ | |
| 256 | + /*0170*/ NOP; /* 0x0000000000007918 */ | |
| 257 | + /* 0x000fc00000000000 */ | |
| 258 | +.L_x_1: | |
| 259 | + | |
| 260 | + | |
| 261 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 262 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 263 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 264 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 265 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 266 | +__nv_reservedSMEM_offset_0_alias: | |
| 267 | + .zero 0 | |
| 268 | + .zero 64 | |
| 269 | + | |
| 270 | + | |
| 271 | +//--------------------- .nv.constant0.k -------------------------- | |
| 272 | + .section .nv.constant0.k,"a",@progbits | |
| 273 | + .sectionflags @"" | |
| 274 | + .align 4 | |
| 275 | +.nv.constant0.k: | |
| 276 | + .zero 904 | |
| 277 | + | |
| 278 | + | |
| 279 | +//--------------------- SYMBOLS -------------------------- | |
| 280 | + | |
| 281 | + .type .nv.reservedSmem.offset0,@object | |
| 282 | + .size .nv.reservedSmem.offset0,0x4 |
streams/own-fp4/asm/nvf4_2x_ue4m3.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4nvf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue4m3 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/nvf4_2x_ue8m0.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4nvf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/nvf4_2x_ue8m0.sass
| new file mode 100644 | ||
| @@ -0,0 +1,282 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x28, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x00000012 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x02, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0000 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x000000a0 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ LDG.E.64 R8, desc[UR4][R2.64+0x10] ; /* 0x0000100402087981 */ | |
| 216 | + /* 0x001ea8000c1e1b00 */ | |
| 217 | + /*0040*/ LDG.E.64 R10, desc[UR4][R2.64+0x30] ; /* 0x00003004020a7981 */ | |
| 218 | + /* 0x000ea8000c1e1b00 */ | |
| 219 | + /*0050*/ LDG.E.128 R4, desc[UR4][R2.64] ; /* 0x0000000402047981 */ | |
| 220 | + /* 0x000ea8000c1e1d00 */ | |
| 221 | + /*0060*/ LDG.E.128 R12, desc[UR4][R2.64+0x20] ; /* 0x00002004020c7981 */ | |
| 222 | + /* 0x000ea4000c1e1d00 */ | |
| 223 | + /*0070*/ OMMA.SF.16864.F32.E2M1.E2M1.E8 R4, R4, R8, R12, R10, R11, URZ ; /* 0x70b00a080404747f */ | |
| 224 | + /* 0x004fde0000083e0c */ | |
| 225 | + /*0080*/ NOP ; /* 0x0000000000007918 */ | |
| 226 | + /* 0x000fda0000000000 */ | |
| 227 | + /*0090*/ STG.E.128 desc[UR4][R2.64], R4 ; /* 0x0000000402007986 */ | |
| 228 | + /* 0x000fe2000c101d04 */ | |
| 229 | + /*00a0*/ EXIT ; /* 0x000000000000794d */ | |
| 230 | + /* 0x000fea0003800000 */ | |
| 231 | +.L_x_0: | |
| 232 | + /*00b0*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 233 | + /* 0x000fc0000383ffff */ | |
| 234 | + /*00c0*/ NOP; /* 0x0000000000007918 */ | |
| 235 | + /* 0x000fc00000000000 */ | |
| 236 | + /*00d0*/ NOP; /* 0x0000000000007918 */ | |
| 237 | + /* 0x000fc00000000000 */ | |
| 238 | + /*00e0*/ NOP; /* 0x0000000000007918 */ | |
| 239 | + /* 0x000fc00000000000 */ | |
| 240 | + /*00f0*/ NOP; /* 0x0000000000007918 */ | |
| 241 | + /* 0x000fc00000000000 */ | |
| 242 | + /*0100*/ NOP; /* 0x0000000000007918 */ | |
| 243 | + /* 0x000fc00000000000 */ | |
| 244 | + /*0110*/ NOP; /* 0x0000000000007918 */ | |
| 245 | + /* 0x000fc00000000000 */ | |
| 246 | + /*0120*/ NOP; /* 0x0000000000007918 */ | |
| 247 | + /* 0x000fc00000000000 */ | |
| 248 | + /*0130*/ NOP; /* 0x0000000000007918 */ | |
| 249 | + /* 0x000fc00000000000 */ | |
| 250 | + /*0140*/ NOP; /* 0x0000000000007918 */ | |
| 251 | + /* 0x000fc00000000000 */ | |
| 252 | + /*0150*/ NOP; /* 0x0000000000007918 */ | |
| 253 | + /* 0x000fc00000000000 */ | |
| 254 | + /*0160*/ NOP; /* 0x0000000000007918 */ | |
| 255 | + /* 0x000fc00000000000 */ | |
| 256 | + /*0170*/ NOP; /* 0x0000000000007918 */ | |
| 257 | + /* 0x000fc00000000000 */ | |
| 258 | +.L_x_1: | |
| 259 | + | |
| 260 | + | |
| 261 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 262 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 263 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 264 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 265 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 266 | +__nv_reservedSMEM_offset_0_alias: | |
| 267 | + .zero 0 | |
| 268 | + .zero 64 | |
| 269 | + | |
| 270 | + | |
| 271 | +//--------------------- .nv.constant0.k -------------------------- | |
| 272 | + .section .nv.constant0.k,"a",@progbits | |
| 273 | + .sectionflags @"" | |
| 274 | + .align 4 | |
| 275 | +.nv.constant0.k: | |
| 276 | + .zero 904 | |
| 277 | + | |
| 278 | + | |
| 279 | +//--------------------- SYMBOLS -------------------------- | |
| 280 | + | |
| 281 | + .type .nv.reservedSmem.offset0,@object | |
| 282 | + .size .nv.reservedSmem.offset0,0x4 |
streams/own-fp4/asm/nvf4_4x_ue4m3.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4nvf4.block_scale.scale_vec::4X.f32.e2m1.e2m1.f32.ue4m3 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/nvf4_4x_ue4m3.sass
| new file mode 100644 | ||
| @@ -0,0 +1,282 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x28, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x00000012 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x02, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0000 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x000000a0 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ LDG.E.64 R8, desc[UR4][R2.64+0x10] ; /* 0x0000100402087981 */ | |
| 216 | + /* 0x001ea8000c1e1b00 */ | |
| 217 | + /*0040*/ LDG.E.64 R10, desc[UR4][R2.64+0x30] ; /* 0x00003004020a7981 */ | |
| 218 | + /* 0x000ea8000c1e1b00 */ | |
| 219 | + /*0050*/ LDG.E.128 R4, desc[UR4][R2.64] ; /* 0x0000000402047981 */ | |
| 220 | + /* 0x000ea8000c1e1d00 */ | |
| 221 | + /*0060*/ LDG.E.128 R12, desc[UR4][R2.64+0x20] ; /* 0x00002004020c7981 */ | |
| 222 | + /* 0x000ea4000c1e1d00 */ | |
| 223 | + /*0070*/ OMMA.SF.16864.F32.E2M1.E2M1.UE4M3.4X R4, R4, R8, R12, R10, R11, URZ ; /* 0x70b00a080404747f */ | |
| 224 | + /* 0x004fde0000043e0c */ | |
| 225 | + /*0080*/ NOP ; /* 0x0000000000007918 */ | |
| 226 | + /* 0x000fda0000000000 */ | |
| 227 | + /*0090*/ STG.E.128 desc[UR4][R2.64], R4 ; /* 0x0000000402007986 */ | |
| 228 | + /* 0x000fe2000c101d04 */ | |
| 229 | + /*00a0*/ EXIT ; /* 0x000000000000794d */ | |
| 230 | + /* 0x000fea0003800000 */ | |
| 231 | +.L_x_0: | |
| 232 | + /*00b0*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 233 | + /* 0x000fc0000383ffff */ | |
| 234 | + /*00c0*/ NOP; /* 0x0000000000007918 */ | |
| 235 | + /* 0x000fc00000000000 */ | |
| 236 | + /*00d0*/ NOP; /* 0x0000000000007918 */ | |
| 237 | + /* 0x000fc00000000000 */ | |
| 238 | + /*00e0*/ NOP; /* 0x0000000000007918 */ | |
| 239 | + /* 0x000fc00000000000 */ | |
| 240 | + /*00f0*/ NOP; /* 0x0000000000007918 */ | |
| 241 | + /* 0x000fc00000000000 */ | |
| 242 | + /*0100*/ NOP; /* 0x0000000000007918 */ | |
| 243 | + /* 0x000fc00000000000 */ | |
| 244 | + /*0110*/ NOP; /* 0x0000000000007918 */ | |
| 245 | + /* 0x000fc00000000000 */ | |
| 246 | + /*0120*/ NOP; /* 0x0000000000007918 */ | |
| 247 | + /* 0x000fc00000000000 */ | |
| 248 | + /*0130*/ NOP; /* 0x0000000000007918 */ | |
| 249 | + /* 0x000fc00000000000 */ | |
| 250 | + /*0140*/ NOP; /* 0x0000000000007918 */ | |
| 251 | + /* 0x000fc00000000000 */ | |
| 252 | + /*0150*/ NOP; /* 0x0000000000007918 */ | |
| 253 | + /* 0x000fc00000000000 */ | |
| 254 | + /*0160*/ NOP; /* 0x0000000000007918 */ | |
| 255 | + /* 0x000fc00000000000 */ | |
| 256 | + /*0170*/ NOP; /* 0x0000000000007918 */ | |
| 257 | + /* 0x000fc00000000000 */ | |
| 258 | +.L_x_1: | |
| 259 | + | |
| 260 | + | |
| 261 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 262 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 263 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 264 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 265 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 266 | +__nv_reservedSMEM_offset_0_alias: | |
| 267 | + .zero 0 | |
| 268 | + .zero 64 | |
| 269 | + | |
| 270 | + | |
| 271 | +//--------------------- .nv.constant0.k -------------------------- | |
| 272 | + .section .nv.constant0.k,"a",@progbits | |
| 273 | + .sectionflags @"" | |
| 274 | + .align 4 | |
| 275 | +.nv.constant0.k: | |
| 276 | + .zero 904 | |
| 277 | + | |
| 278 | + | |
| 279 | +//--------------------- SYMBOLS -------------------------- | |
| 280 | + | |
| 281 | + .type .nv.reservedSmem.offset0,@object | |
| 282 | + .size .nv.reservedSmem.offset0,0x4 |
streams/own-fp4/asm/nvf4_4x_ue8m0.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4nvf4.block_scale.scale_vec::4X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/rs_sm_100a.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_100a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rs.satfinite.e2m1x4.f32 h, {f0,f1,f2,f3}, r1; cvt.u32.u16 r0, h; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
streams/own-fp4/asm/rs_sm_103a.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_103a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rs.satfinite.e2m1x4.f32 h, {f0,f1,f2,f3}, r1; cvt.u32.u16 r0, h; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
streams/own-fp4/asm/rs_sm_120a.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_120a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rs.satfinite.e2m1x4.f32 h, {f0,f1,f2,f3}, r1; cvt.u32.u16 r0, h; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
streams/own-fp4/asm/rs_sm_121a.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,8 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .f32 f<4>; .reg .b8 q; .reg .b16 h; .reg .b32 r<2>; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; ld.global.v4.f32 {f0,f1,f2,f3},[rp]; ld.global.b32 r1,[rp+16]; | |
| 7 | + cvt.rs.satfinite.e2m1x4.f32 h, {f0,f1,f2,f3}, r1; cvt.u32.u16 r0, h; | |
| 8 | + st.global.b32 [rp],r0; ret;} |
streams/own-fp4/asm/s4.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.s32.s4.s4.s32 {a0,a1,a2,a3},{a0,a1,a2,a3},{b0,b1},{a0,a1,a2,a3}; mov.b32 d0,a0; mov.b32 d1,a1; mov.b32 d2,a2; mov.b32 d3,a3; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/s4.sass
| new file mode 100644 | ||
| @@ -0,0 +1,700 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0xa0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x14, 0x00, 0x00, 0x00, 0x0c, 0x81, 0x80 | |
| 16 | + /*005c*/ .byte 0x80, 0x28, 0x00, 0x04, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 17 | + /*006c*/ .byte 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff | |
| 18 | + /*007c*/ .byte 0x03, 0x00, 0x04, 0x7c, 0x80, 0x82, 0x80, 0x28, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x08, 0xff | |
| 19 | + /*008c*/ .byte 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x08, 0x80, 0x80, 0x80, 0x28, 0x16, 0x80, 0x82 | |
| 20 | + /*009c*/ .byte 0x80, 0x28, 0x10, 0x03 | |
| 21 | + /*00a0*/ .dword k | |
| 22 | + /*00a8*/ .byte 0x92, 0x80, 0x80, 0x80, 0x28, 0x00, 0x22, 0x00, 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00 | |
| 23 | + /*00b8*/ .byte 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 24 | + /*00c4*/ .dword (k + $__internal_0_$__cuda_sm_9x_mma_sub_byte_internal_m16n8k64_s4_s4@srel) | |
| 25 | + /*00cc*/ .byte 0xe0, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xd8, 0x02, 0x00, 0x00, 0x09, 0x80, 0x80 | |
| 26 | + /*00dc*/ .byte 0x80, 0x28, 0x82, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 27 | + | |
| 28 | + | |
| 29 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 30 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 31 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 32 | + .tkinfo | |
| 33 | + /*0018*/ .word 0x00000002 | |
| 34 | + /*0030*/ .string "" | |
| 35 | + /*0030*/ .string "ptxas" | |
| 36 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 37 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 38 | + /*0030*/ .string "-arch sm_121a " | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 43 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 44 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 45 | + /*0018*/ .short 0x0002 | |
| 46 | + /*001a*/ .short 0x0079 | |
| 47 | + /*001c*/ .short 0x0082 | |
| 48 | + .zero 2 | |
| 49 | + | |
| 50 | + | |
| 51 | +//--------------------- .nv.info -------------------------- | |
| 52 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 53 | + .align 4 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 57 | + .align 4 | |
| 58 | + /*0000*/ .byte 0x04, 0x2f | |
| 59 | + /*0002*/ .short (.L_1 - .L_0) | |
| 60 | + .align 4 | |
| 61 | +.L_0: | |
| 62 | + /*0004*/ .word index@(k) | |
| 63 | + /*0008*/ .word 0x0000001c | |
| 64 | + | |
| 65 | + | |
| 66 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 67 | + .align 4 | |
| 68 | +.L_1: | |
| 69 | + /*000c*/ .byte 0x04, 0x11 | |
| 70 | + /*000e*/ .short (.L_3 - .L_2) | |
| 71 | + .align 4 | |
| 72 | +.L_2: | |
| 73 | + /*0010*/ .word index@($__internal_0_$__cuda_sm_9x_mma_sub_byte_internal_m16n8k64_s4_s4) | |
| 74 | + /*0014*/ .word 0x00000000 | |
| 75 | + | |
| 76 | + | |
| 77 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 78 | + .align 4 | |
| 79 | +.L_3: | |
| 80 | + /*0018*/ .byte 0x04, 0x11 | |
| 81 | + /*001a*/ .short (.L_5 - .L_4) | |
| 82 | + .align 4 | |
| 83 | +.L_4: | |
| 84 | + /*001c*/ .word index@(k) | |
| 85 | + /*0020*/ .word 0x00000000 | |
| 86 | + | |
| 87 | + | |
| 88 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 89 | + .align 4 | |
| 90 | +.L_5: | |
| 91 | + /*0024*/ .byte 0x04, 0x12 | |
| 92 | + /*0026*/ .short (.L_7 - .L_6) | |
| 93 | + .align 4 | |
| 94 | +.L_6: | |
| 95 | + /*0028*/ .word index@(k) | |
| 96 | + /*002c*/ .word 0x00000000 | |
| 97 | +.L_7: | |
| 98 | + | |
| 99 | + | |
| 100 | +//--------------------- .nv.compat -------------------------- | |
| 101 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 102 | + .align 4 | |
| 103 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x01, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 104 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 105 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 106 | + | |
| 107 | + | |
| 108 | +//--------------------- .nv.info.k -------------------------- | |
| 109 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 110 | + .sectionflags @"" | |
| 111 | + .align 4 | |
| 112 | + | |
| 113 | + | |
| 114 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 115 | + .align 4 | |
| 116 | + /*0000*/ .byte 0x04, 0x37 | |
| 117 | + /*0002*/ .short (.L_9 - .L_8) | |
| 118 | +.L_8: | |
| 119 | + /*0004*/ .word 0x00000082 | |
| 120 | + | |
| 121 | + | |
| 122 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 123 | + .align 4 | |
| 124 | +.L_9: | |
| 125 | + /*0008*/ .byte 0x04, 0x17 | |
| 126 | + /*000a*/ .short (.L_11 - .L_10) | |
| 127 | +.L_10: | |
| 128 | + /*000c*/ .word 0x00000000 | |
| 129 | + /*0010*/ .short 0x0000 | |
| 130 | + /*0012*/ .short 0x0000 | |
| 131 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 132 | + | |
| 133 | + | |
| 134 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 135 | + .align 4 | |
| 136 | +.L_11: | |
| 137 | + /*0018*/ .byte 0x03, 0x50 | |
| 138 | + /*001a*/ .short 0x0000 | |
| 139 | + | |
| 140 | + | |
| 141 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 142 | + .align 4 | |
| 143 | + /*001c*/ .byte 0x03, 0x1b | |
| 144 | + /*001e*/ .short 0x00ff | |
| 145 | + | |
| 146 | + | |
| 147 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 148 | + .align 4 | |
| 149 | + /*0020*/ .byte 0x03, 0x5f | |
| 150 | + /*0022*/ .short 0x0101 | |
| 151 | + | |
| 152 | + | |
| 153 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 154 | + .align 4 | |
| 155 | + /*0024*/ .byte 0x02, 0x4a | |
| 156 | + .zero 1 | |
| 157 | + .zero 1 | |
| 158 | + | |
| 159 | + | |
| 160 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 161 | + .align 4 | |
| 162 | + /*0028*/ .byte 0x04, 0x1c | |
| 163 | + /*002a*/ .short (.L_13 - .L_12) | |
| 164 | + | |
| 165 | + | |
| 166 | + // ....[0].... | |
| 167 | +.L_12: | |
| 168 | + /*002c*/ .word 0x00000090 | |
| 169 | + | |
| 170 | + | |
| 171 | + //----- nvinfo : EIATTR_CRS_STACK_SIZE | |
| 172 | + .align 4 | |
| 173 | +.L_13: | |
| 174 | + /*0030*/ .byte 0x04, 0x1e | |
| 175 | + /*0032*/ .short (.L_15 - .L_14) | |
| 176 | +.L_14: | |
| 177 | + /*0034*/ .word 0x00000000 | |
| 178 | + | |
| 179 | + | |
| 180 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 181 | + .align 4 | |
| 182 | +.L_15: | |
| 183 | + /*0038*/ .byte 0x03, 0x19 | |
| 184 | + /*003a*/ .short 0x0008 | |
| 185 | + | |
| 186 | + | |
| 187 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 188 | + .align 4 | |
| 189 | + /*003c*/ .byte 0x04, 0x0a | |
| 190 | + /*003e*/ .short (.L_17 - .L_16) | |
| 191 | + .align 4 | |
| 192 | +.L_16: | |
| 193 | + /*0040*/ .word index@(.nv.constant0.k) | |
| 194 | + /*0044*/ .short 0x0380 | |
| 195 | + /*0046*/ .short 0x0008 | |
| 196 | + | |
| 197 | + | |
| 198 | + //----- nvinfo : EIATTR_SW_WAR | |
| 199 | + .align 4 | |
| 200 | +.L_17: | |
| 201 | + /*0048*/ .byte 0x04, 0x36 | |
| 202 | + /*004a*/ .short (.L_19 - .L_18) | |
| 203 | +.L_18: | |
| 204 | + /*004c*/ .word 0x00000000 | |
| 205 | +.L_19: | |
| 206 | + | |
| 207 | + | |
| 208 | +//--------------------- .nv.callgraph -------------------------- | |
| 209 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 210 | + .align 4 | |
| 211 | + .sectionentsize 8 | |
| 212 | + .align 4 | |
| 213 | + /*0000*/ .word 0x00000000 | |
| 214 | + .align 4 | |
| 215 | + /*0004*/ .word 0xffffffff | |
| 216 | + .align 4 | |
| 217 | + /*0008*/ .word 0x00000000 | |
| 218 | + .align 4 | |
| 219 | + /*000c*/ .word 0xfffffffe | |
| 220 | + .align 4 | |
| 221 | + /*0010*/ .word 0x00000000 | |
| 222 | + .align 4 | |
| 223 | + /*0014*/ .word 0xfffffffd | |
| 224 | + .align 4 | |
| 225 | + /*0018*/ .word 0x00000000 | |
| 226 | + .align 4 | |
| 227 | + /*001c*/ .word 0xfffffffc | |
| 228 | + | |
| 229 | + | |
| 230 | +//--------------------- .text.k -------------------------- | |
| 231 | + .section .text.k,"ax",@progbits | |
| 232 | + .align 128 | |
| 233 | + .global k | |
| 234 | + .type k,@function | |
| 235 | + .size k,(.L_x_1 - k) | |
| 236 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 237 | +k: | |
| 238 | +.text.k: | |
| 239 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 240 | + /* 0x000fe20000000800 */ | |
| 241 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 242 | + /* 0x000e2e0008000a00 */ | |
| 243 | + /*0020*/ LDC.64 R8, c[0x0][0x380] ; /* 0x0000e000ff087b82 */ | |
| 244 | + /* 0x000e240000000a00 */ | |
| 245 | + /*0030*/ LDG.E.64 R2, desc[UR4][R8.64+0x10] ; /* 0x0000100408027981 */ | |
| 246 | + /* 0x001168000c1e1b00 */ | |
| 247 | + /*0040*/ LDG.E.128 R4, desc[UR4][R8.64] ; /* 0x0000000408047981 */ | |
| 248 | + /* 0x000162000c1e1d00 */ | |
| 249 | + /*0050*/ MOV R0, 0x70 ; /* 0x0000007000007802 */ | |
| 250 | + /* 0x000fce0000000f00 */ | |
| 251 | + /*0060*/ CALL.REL.NOINC `($__internal_0_$__cuda_sm_9x_mma_sub_byte_internal_m16n8k64_s4_s4) ; /* 0x00000000000c7944 */ | |
| 252 | + /* 0x021fea0003c00000 */ | |
| 253 | + /*0070*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 254 | + /* 0x000e240000000a00 */ | |
| 255 | + /*0080*/ STG.E.128 desc[UR4][R2.64], R8 ; /* 0x0000000802007986 */ | |
| 256 | + /* 0x001fe2000c101d04 */ | |
| 257 | + /*0090*/ EXIT ; /* 0x000000000000794d */ | |
| 258 | + /* 0x000fea0003800000 */ | |
| 259 | + .weak $__internal_0_$__cuda_sm_9x_mma_sub_byte_internal_m16n8k64_s4_s4 | |
| 260 | + .type $__internal_0_$__cuda_sm_9x_mma_sub_byte_internal_m16n8k64_s4_s4,@function | |
| 261 | + .size $__internal_0_$__cuda_sm_9x_mma_sub_byte_internal_m16n8k64_s4_s4,(.L_x_1 - $__internal_0_$__cuda_sm_9x_mma_sub_byte_internal_m16n8k64_s4_s4) | |
| 262 | +$__internal_0_$__cuda_sm_9x_mma_sub_byte_internal_m16n8k64_s4_s4: | |
| 263 | + /*00a0*/ LOP3.LUT R13, R2.reuse, 0xf00, RZ, 0xc0, !PT ; /* 0x00000f00020d7812 */ | |
| 264 | + /* 0x040fe200078ec0ff */ | |
| 265 | + /*00b0*/ IMAD.SHL.U32 R12, R2, 0x10000000, RZ ; /* 0x10000000020c7824 */ | |
| 266 | + /* 0x000fe200078e00ff */ | |
| 267 | + /*00c0*/ LOP3.LUT R15, R3.reuse, 0xf00, RZ, 0xc0, !PT ; /* 0x00000f00030f7812 */ | |
| 268 | + /* 0x040fe200078ec0ff */ | |
| 269 | + /*00d0*/ IMAD.SHL.U32 R14, R3, 0x10000000, RZ ; /* 0x10000000030e7824 */ | |
| 270 | + /* 0x000fe200078e00ff */ | |
| 271 | + /*00e0*/ LOP3.LUT R11, R5.reuse, 0xf00, RZ, 0xc0, !PT ; /* 0x00000f00050b7812 */ | |
| 272 | + /* 0x040fe200078ec0ff */ | |
| 273 | + /*00f0*/ IMAD.SHL.U32 R10, R5, 0x10000000, RZ ; /* 0x10000000050a7824 */ | |
| 274 | + /* 0x000fe200078e00ff */ | |
| 275 | + /*0100*/ LOP3.LUT R9, R4.reuse, 0xf00, RZ, 0xc0, !PT ; /* 0x00000f0004097812 */ | |
| 276 | + /* 0x040fe200078ec0ff */ | |
| 277 | + /*0110*/ IMAD.SHL.U32 R8, R4, 0x10000000, RZ ; /* 0x1000000004087824 */ | |
| 278 | + /* 0x000fe200078e00ff */ | |
| 279 | + /*0120*/ SHF.R.S32.HI R12, RZ, 0x1c, R12 ; /* 0x0000001cff0c7819 */ | |
| 280 | + /* 0x000fe2000001140c */ | |
| 281 | + /*0130*/ IMAD.SHL.U32 R13, R13, 0x100000, RZ ; /* 0x001000000d0d7824 */ | |
| 282 | + /* 0x000fe200078e00ff */ | |
| 283 | + /*0140*/ SHF.R.S32.HI R14, RZ, 0x1c, R14 ; /* 0x0000001cff0e7819 */ | |
| 284 | + /* 0x000fe2000001140e */ | |
| 285 | + /*0150*/ IMAD.SHL.U32 R15, R15, 0x100000, RZ ; /* 0x001000000f0f7824 */ | |
| 286 | + /* 0x000fe200078e00ff */ | |
| 287 | + /*0160*/ SHF.R.S32.HI R10, RZ, 0x1c, R10 ; /* 0x0000001cff0a7819 */ | |
| 288 | + /* 0x000fe2000001140a */ | |
| 289 | + /*0170*/ IMAD.SHL.U32 R11, R11, 0x100000, RZ ; /* 0x001000000b0b7824 */ | |
| 290 | + /* 0x000fe200078e00ff */ | |
| 291 | + /*0180*/ SHF.R.S32.HI R8, RZ, 0x1c, R8 ; /* 0x0000001cff087819 */ | |
| 292 | + /* 0x000fe20000011408 */ | |
| 293 | + /*0190*/ IMAD.SHL.U32 R9, R9, 0x100000, RZ ; /* 0x0010000009097824 */ | |
| 294 | + /* 0x000fe200078e00ff */ | |
| 295 | + /*01a0*/ LOP3.LUT R12, R12, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff0c0c7812 */ | |
| 296 | + /* 0x000fc400078ec0ff */ | |
| 297 | + /*01b0*/ SHF.R.S32.HI R13, RZ, 0x14, R13 ; /* 0x00000014ff0d7819 */ | |
| 298 | + /* 0x000fe4000001140d */ | |
| 299 | + /*01c0*/ LOP3.LUT R14, R14, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff0e0e7812 */ | |
| 300 | + /* 0x000fe400078ec0ff */ | |
| 301 | + /*01d0*/ SHF.R.S32.HI R15, RZ, 0x14, R15 ; /* 0x00000014ff0f7819 */ | |
| 302 | + /* 0x000fe4000001140f */ | |
| 303 | + /*01e0*/ LOP3.LUT R10, R10, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff0a0a7812 */ | |
| 304 | + /* 0x000fe400078ec0ff */ | |
| 305 | + /*01f0*/ SHF.R.S32.HI R11, RZ, 0x14, R11 ; /* 0x00000014ff0b7819 */ | |
| 306 | + /* 0x000fe4000001140b */ | |
| 307 | + /*0200*/ LOP3.LUT R8, R8, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff08087812 */ | |
| 308 | + /* 0x000fc400078ec0ff */ | |
| 309 | + /*0210*/ SHF.R.S32.HI R9, RZ, 0x14, R9 ; /* 0x00000014ff097819 */ | |
| 310 | + /* 0x000fe40000011409 */ | |
| 311 | + /*0220*/ LOP3.LUT R16, R2, 0xf0, RZ, 0xc0, !PT ; /* 0x000000f002107812 */ | |
| 312 | + /* 0x000fe400078ec0ff */ | |
| 313 | + /*0230*/ LOP3.LUT R12, R12, 0xff00, R13, 0xf8, !PT ; /* 0x0000ff000c0c7812 */ | |
| 314 | + /* 0x000fe400078ef80d */ | |
| 315 | + /*0240*/ LOP3.LUT R13, R14, 0xff00, R15, 0xf8, !PT ; /* 0x0000ff000e0d7812 */ | |
| 316 | + /* 0x000fe200078ef80f */ | |
| 317 | + /*0250*/ IMAD.SHL.U32 R17, R16, 0x1000000, RZ ; /* 0x0100000010117824 */ | |
| 318 | + /* 0x000fe200078e00ff */ | |
| 319 | + /*0260*/ LOP3.LUT R11, R10, 0xff00, R11, 0xf8, !PT ; /* 0x0000ff000a0b7812 */ | |
| 320 | + /* 0x000fe200078ef80b */ | |
| 321 | + /*0270*/ IMAD.SHL.U32 R14, R7.reuse, 0x10000000, RZ ; /* 0x10000000070e7824 */ | |
| 322 | + /* 0x040fe200078e00ff */ | |
| 323 | + /*0280*/ LOP3.LUT R15, R7, 0xf00, RZ, 0xc0, !PT ; /* 0x00000f00070f7812 */ | |
| 324 | + /* 0x000fc400078ec0ff */ | |
| 325 | + /*0290*/ LOP3.LUT R9, R8, 0xff00, R9, 0xf8, !PT ; /* 0x0000ff0008097812 */ | |
| 326 | + /* 0x000fe200078ef809 */ | |
| 327 | + /*02a0*/ IMAD.SHL.U32 R8, R6, 0x10000000, RZ ; /* 0x1000000006087824 */ | |
| 328 | + /* 0x000fe200078e00ff */ | |
| 329 | + /*02b0*/ LOP3.LUT R18, R2, 0xf000, RZ, 0xc0, !PT ; /* 0x0000f00002127812 */ | |
| 330 | + /* 0x000fe200078ec0ff */ | |
| 331 | + /*02c0*/ IMAD.SHL.U32 R16, R15, 0x100000, RZ ; /* 0x001000000f107824 */ | |
| 332 | + /* 0x000fe200078e00ff */ | |
| 333 | + /*02d0*/ LOP3.LUT R10, R6, 0xf00, RZ, 0xc0, !PT ; /* 0x00000f00060a7812 */ | |
| 334 | + /* 0x000fe400078ec0ff */ | |
| 335 | + /*02e0*/ LOP3.LUT R20, R2, 0xf0000, RZ, 0xc0, !PT ; /* 0x000f000002147812 */ | |
| 336 | + /* 0x000fe200078ec0ff */ | |
| 337 | + /*02f0*/ IMAD.U32 R19, R18, 0x10000, RZ ; /* 0x0001000012137824 */ | |
| 338 | + /* 0x000fe200078e00ff */ | |
| 339 | + /*0300*/ SHF.R.S32.HI R8, RZ, 0x1c, R8 ; /* 0x0000001cff087819 */ | |
| 340 | + /* 0x000fe20000011408 */ | |
| 341 | + /*0310*/ IMAD.SHL.U32 R10, R10, 0x100000, RZ ; /* 0x001000000a0a7824 */ | |
| 342 | + /* 0x000fe200078e00ff */ | |
| 343 | + /*0320*/ SHF.R.S32.HI R18, RZ, 0x1c, R17 ; /* 0x0000001cff127819 */ | |
| 344 | + /* 0x000fe20000011411 */ | |
| 345 | + /*0330*/ IMAD.SHL.U32 R20, R20, 0x1000, RZ ; /* 0x0000100014147824 */ | |
| 346 | + /* 0x000fe200078e00ff */ | |
| 347 | + /*0340*/ SHF.R.S32.HI R14, RZ, 0x1c, R14 ; /* 0x0000001cff0e7819 */ | |
| 348 | + /* 0x000fc4000001140e */ | |
| 349 | + /*0350*/ SHF.R.S32.HI R17, RZ, 0x14, R16 ; /* 0x00000014ff117819 */ | |
| 350 | + /* 0x000fe40000011410 */ | |
| 351 | + /*0360*/ SHF.R.S32.HI R19, RZ, 0x14, R19 ; /* 0x00000014ff137819 */ | |
| 352 | + /* 0x000fe40000011413 */ | |
| 353 | + /*0370*/ LOP3.LUT R8, R8, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff08087812 */ | |
| 354 | + /* 0x000fe400078ec0ff */ | |
| 355 | + /*0380*/ SHF.R.S32.HI R15, RZ, 0x14, R10 ; /* 0x00000014ff0f7819 */ | |
| 356 | + /* 0x000fe4000001140a */ | |
| 357 | + /*0390*/ LOP3.LUT R16, R18, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff12107812 */ | |
| 358 | + /* 0x000fe400078ec0ff */ | |
| 359 | + /*03a0*/ LOP3.LUT R14, R14, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff0e0e7812 */ | |
| 360 | + /* 0x000fc400078ec0ff */ | |
| 361 | + /*03b0*/ SHF.R.S32.HI R21, RZ, 0xc, R20 ; /* 0x0000000cff157819 */ | |
| 362 | + /* 0x000fe40000011414 */ | |
| 363 | + /*03c0*/ LOP3.LUT R10, R8, 0xff00, R15, 0xf8, !PT ; /* 0x0000ff00080a7812 */ | |
| 364 | + /* 0x000fe400078ef80f */ | |
| 365 | + /*03d0*/ LOP3.LUT R16, R16, 0xff00, R19, 0xf8, !PT ; /* 0x0000ff0010107812 */ | |
| 366 | + /* 0x000fe400078ef813 */ | |
| 367 | + /*03e0*/ LOP3.LUT R8, R14, 0xff00, R17, 0xf8, !PT ; /* 0x0000ff000e087812 */ | |
| 368 | + /* 0x000fe400078ef811 */ | |
| 369 | + /*03f0*/ LOP3.LUT R19, R3, 0xf0, RZ, 0xc0, !PT ; /* 0x000000f003137812 */ | |
| 370 | + /* 0x000fe400078ec0ff */ | |
| 371 | + /*0400*/ LOP3.LUT R14, R4, 0xf0, RZ, 0xc0, !PT ; /* 0x000000f0040e7812 */ | |
| 372 | + /* 0x000fc400078ec0ff */ | |
| 373 | + /*0410*/ LOP3.LUT R17, R5, 0xf0, RZ, 0xc0, !PT ; /* 0x000000f005117812 */ | |
| 374 | + /* 0x000fe200078ec0ff */ | |
| 375 | + /*0420*/ IMAD.SHL.U32 R19, R19, 0x1000000, RZ ; /* 0x0100000013137824 */ | |
| 376 | + /* 0x000fe200078e00ff */ | |
| 377 | + /*0430*/ LOP3.LUT R12, R12, 0xff0000, R21, 0xf8, !PT ; /* 0x00ff00000c0c7812 */ | |
| 378 | + /* 0x000fe200078ef815 */ | |
| 379 | + /*0440*/ IMAD.SHL.U32 R14, R14, 0x1000000, RZ ; /* 0x010000000e0e7824 */ | |
| 380 | + /* 0x000fe200078e00ff */ | |
| 381 | + /*0450*/ LOP3.LUT R21, R3, 0xf0000, RZ, 0xc0, !PT ; /* 0x000f000003157812 */ | |
| 382 | + /* 0x000fe200078ec0ff */ | |
| 383 | + /*0460*/ IMAD.SHL.U32 R17, R17, 0x1000000, RZ ; /* 0x0100000011117824 */ | |
| 384 | + /* 0x000fe200078e00ff */ | |
| 385 | + /*0470*/ LOP3.LUT R20, R3, 0xf000, RZ, 0xc0, !PT ; /* 0x0000f00003147812 */ | |
| 386 | + /* 0x000fe400078ec0ff */ | |
| 387 | + /*0480*/ LOP3.LUT R18, R5, 0xf000, RZ, 0xc0, !PT ; /* 0x0000f00005127812 */ | |
| 388 | + /* 0x000fe200078ec0ff */ | |
| 389 | + /*0490*/ IMAD.SHL.U32 R21, R21, 0x1000, RZ ; /* 0x0000100015157824 */ | |
| 390 | + /* 0x000fe200078e00ff */ | |
| 391 | + /*04a0*/ LOP3.LUT R15, R4, 0xf000, RZ, 0xc0, !PT ; /* 0x0000f000040f7812 */ | |
| 392 | + /* 0x000fe200078ec0ff */ | |
| 393 | + /*04b0*/ IMAD.U32 R20, R20, 0x10000, RZ ; /* 0x0001000014147824 */ | |
| 394 | + /* 0x000fe200078e00ff */ | |
| 395 | + /*04c0*/ SHF.R.S32.HI R19, RZ, 0x1c, R19 ; /* 0x0000001cff137819 */ | |
| 396 | + /* 0x000fe20000011413 */ | |
| 397 | + /*04d0*/ IMAD.U32 R18, R18, 0x10000, RZ ; /* 0x0001000012127824 */ | |
| 398 | + /* 0x000fe200078e00ff */ | |
| 399 | + /*04e0*/ SHF.R.S32.HI R14, RZ, 0x1c, R14 ; /* 0x0000001cff0e7819 */ | |
| 400 | + /* 0x000fe2000001140e */ | |
| 401 | + /*04f0*/ IMAD.U32 R15, R15, 0x10000, RZ ; /* 0x000100000f0f7824 */ | |
| 402 | + /* 0x000fe200078e00ff */ | |
| 403 | + /*0500*/ SHF.R.S32.HI R17, RZ, 0x1c, R17 ; /* 0x0000001cff117819 */ | |
| 404 | + /* 0x000fc40000011411 */ | |
| 405 | + /*0510*/ SHF.R.S32.HI R22, RZ, 0xc, R21 ; /* 0x0000000cff167819 */ | |
| 406 | + /* 0x000fe40000011415 */ | |
| 407 | + /*0520*/ SHF.R.S32.HI R20, RZ, 0x14, R20 ; /* 0x00000014ff147819 */ | |
| 408 | + /* 0x000fe40000011414 */ | |
| 409 | + /*0530*/ LOP3.LUT R19, R19, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff13137812 */ | |
| 410 | + /* 0x000fe400078ec0ff */ | |
| 411 | + /*0540*/ SHF.R.S32.HI R21, RZ, 0x14, R18 ; /* 0x00000014ff157819 */ | |
| 412 | + /* 0x000fe40000011412 */ | |
| 413 | + /*0550*/ SHF.R.S32.HI R15, RZ, 0x14, R15 ; /* 0x00000014ff0f7819 */ | |
| 414 | + /* 0x000fe4000001140f */ | |
| 415 | + /*0560*/ LOP3.LUT R14, R14, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff0e0e7812 */ | |
| 416 | + /* 0x000fc400078ec0ff */ | |
| 417 | + /*0570*/ LOP3.LUT R18, R17, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff11127812 */ | |
| 418 | + /* 0x000fe400078ec0ff */ | |
| 419 | + /*0580*/ LOP3.LUT R17, R19, 0xff00, R20, 0xf8, !PT ; /* 0x0000ff0013117812 */ | |
| 420 | + /* 0x000fe400078ef814 */ | |
| 421 | + /*0590*/ LOP3.LUT R19, R14, 0xff00, R15, 0xf8, !PT ; /* 0x0000ff000e137812 */ | |
| 422 | + /* 0x000fe400078ef80f */ | |
| 423 | + /*05a0*/ LOP3.LUT R18, R18, 0xff00, R21, 0xf8, !PT ; /* 0x0000ff0012127812 */ | |
| 424 | + /* 0x000fe400078ef815 */ | |
| 425 | + /*05b0*/ LOP3.LUT R14, R6, 0xf0, RZ, 0xc0, !PT ; /* 0x000000f0060e7812 */ | |
| 426 | + /* 0x000fe400078ec0ff */ | |
| 427 | + /*05c0*/ LOP3.LUT R21, R7, 0xf0, RZ, 0xc0, !PT ; /* 0x000000f007157812 */ | |
| 428 | + /* 0x000fc400078ec0ff */ | |
| 429 | + /*05d0*/ LOP3.LUT R13, R13, 0xff0000, R22, 0xf8, !PT ; /* 0x00ff00000d0d7812 */ | |
| 430 | + /* 0x000fe200078ef816 */ | |
| 431 | + /*05e0*/ IMAD.SHL.U32 R15, R14, 0x1000000, RZ ; /* 0x010000000e0f7824 */ | |
| 432 | + /* 0x000fe200078e00ff */ | |
| 433 | + /*05f0*/ LOP3.LUT R20, R6, 0xf000, RZ, 0xc0, !PT ; /* 0x0000f00006147812 */ | |
| 434 | + /* 0x000fe200078ec0ff */ | |
| 435 | + /*0600*/ IMAD.SHL.U32 R21, R21, 0x1000000, RZ ; /* 0x0100000015157824 */ | |
| 436 | + /* 0x000fe200078e00ff */ | |
| 437 | + /*0610*/ LOP3.LUT R22, R7, 0xf000, RZ, 0xc0, !PT ; /* 0x0000f00007167812 */ | |
| 438 | + /* 0x000fe400078ec0ff */ | |
| 439 | + /*0620*/ SHF.R.S32.HI R15, RZ, 0x1c, R15 ; /* 0x0000001cff0f7819 */ | |
| 440 | + /* 0x000fe2000001140f */ | |
| 441 | + /*0630*/ IMAD.U32 R20, R20, 0x10000, RZ ; /* 0x0001000014147824 */ | |
| 442 | + /* 0x000fe200078e00ff */ | |
| 443 | + /*0640*/ LOP3.LUT R14, R4, 0xf0000, RZ, 0xc0, !PT ; /* 0x000f0000040e7812 */ | |
| 444 | + /* 0x000fe200078ec0ff */ | |
| 445 | + /*0650*/ IMAD.U32 R23, R22, 0x10000, RZ ; /* 0x0001000016177824 */ | |
| 446 | + /* 0x000fe200078e00ff */ | |
| 447 | + /*0660*/ SHF.R.S32.HI R22, RZ, 0x1c, R21 ; /* 0x0000001cff167819 */ | |
| 448 | + /* 0x000fc40000011415 */ | |
| 449 | + /*0670*/ LOP3.LUT R21, R5, 0xf0000, RZ, 0xc0, !PT ; /* 0x000f000005157812 */ | |
| 450 | + /* 0x000fe400078ec0ff */ | |
| 451 | + /*0680*/ SHF.R.S32.HI R20, RZ, 0x14, R20 ; /* 0x00000014ff147819 */ | |
| 452 | + /* 0x000fe40000011414 */ | |
| 453 | + /*0690*/ LOP3.LUT R15, R15, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff0f0f7812 */ | |
| 454 | + /* 0x000fe200078ec0ff */ | |
| 455 | + /*06a0*/ IMAD.SHL.U32 R21, R21, 0x1000, RZ ; /* 0x0000100015157824 */ | |
| 456 | + /* 0x000fe200078e00ff */ | |
| 457 | + /*06b0*/ SHF.R.S32.HI R23, RZ, 0x14, R23 ; /* 0x00000014ff177819 */ | |
| 458 | + /* 0x000fe40000011417 */ | |
| 459 | + /*06c0*/ LOP3.LUT R22, R22, 0xff, RZ, 0xc0, !PT ; /* 0x000000ff16167812 */ | |
| 460 | + /* 0x000fe400078ec0ff */ | |
| 461 | + /*06d0*/ LOP3.LUT R15, R15, 0xff00, R20, 0xf8, !PT ; /* 0x0000ff000f0f7812 */ | |
| 462 | + /* 0x000fe200078ef814 */ | |
| 463 | + /*06e0*/ IMAD.SHL.U32 R20, R14, 0x1000, RZ ; /* 0x000010000e147824 */ | |
| 464 | + /* 0x000fe200078e00ff */ | |
| 465 | + /*06f0*/ LOP3.LUT R14, R22, 0xff00, R23, 0xf8, !PT ; /* 0x0000ff00160e7812 */ | |
| 466 | + /* 0x000fc400078ef817 */ | |
| 467 | + /*0700*/ SHF.R.S32.HI R22, RZ, 0xc, R21 ; /* 0x0000000cff167819 */ | |
| 468 | + /* 0x000fe40000011415 */ | |
| 469 | + /*0710*/ LOP3.LUT R21, R7, 0xf0000, RZ, 0xc0, !PT ; /* 0x000f000007157812 */ | |
| 470 | + /* 0x000fe400078ec0ff */ | |
| 471 | + /*0720*/ SHF.R.S32.HI R20, RZ, 0xc, R20 ; /* 0x0000000cff147819 */ | |
| 472 | + /* 0x000fe40000011414 */ | |
| 473 | + /*0730*/ LOP3.LUT R23, R6, 0xf0000, RZ, 0xc0, !PT ; /* 0x000f000006177812 */ | |
| 474 | + /* 0x000fe200078ec0ff */ | |
| 475 | + /*0740*/ IMAD.SHL.U32 R21, R21, 0x1000, RZ ; /* 0x0000100015157824 */ | |
| 476 | + /* 0x000fe200078e00ff */ | |
| 477 | + /*0750*/ LOP3.LUT R9, R9, 0xff0000, R20, 0xf8, !PT ; /* 0x00ff000009097812 */ | |
| 478 | + /* 0x000fe400078ef814 */ | |
| 479 | + /*0760*/ LOP3.LUT R20, R2, 0xf00000, RZ, 0xc0, !PT ; /* 0x00f0000002147812 */ | |
| 480 | + /* 0x000fe200078ec0ff */ | |
| 481 | + /*0770*/ IMAD.SHL.U32 R23, R23, 0x1000, RZ ; /* 0x0000100017177824 */ | |
| 482 | + /* 0x000fe200078e00ff */ | |
| 483 | + /*0780*/ SHF.R.S32.HI R21, RZ, 0xc, R21 ; /* 0x0000000cff157819 */ | |
| 484 | + /* 0x000fc40000011415 */ | |
| 485 | + /*0790*/ LOP3.LUT R11, R11, 0xff0000, R22, 0xf8, !PT ; /* 0x00ff00000b0b7812 */ | |
| 486 | + /* 0x000fe200078ef816 */ | |
| 487 | + /*07a0*/ IMAD.SHL.U32 R22, R20, 0x100, RZ ; /* 0x0000010014167824 */ | |
| 488 | + /* 0x000fe200078e00ff */ | |
| 489 | + /*07b0*/ LOP3.LUT R20, R8, 0xff0000, R21, 0xf8, !PT ; /* 0x00ff000008147812 */ | |
| 490 | + /* 0x000fe400078ef815 */ | |
| 491 | + /*07c0*/ SHF.R.S32.HI R23, RZ, 0xc, R23 ; /* 0x0000000cff177819 */ | |
| 492 | + /* 0x000fe40000011417 */ | |
| 493 | + /*07d0*/ LOP3.LUT R24, R3, 0xf00000, RZ, 0xc0, !PT ; /* 0x00f0000003187812 */ | |
| 494 | + /* 0x000fe400078ec0ff */ | |
| 495 | + /*07e0*/ LOP3.LUT R8, R4, 0xf00000, RZ, 0xc0, !PT ; /* 0x00f0000004087812 */ | |
| 496 | + /* 0x000fe400078ec0ff */ | |
| 497 | + /*07f0*/ LOP3.LUT R21, R5, 0xf00000, RZ, 0xc0, !PT ; /* 0x00f0000005157812 */ | |
| 498 | + /* 0x000fe200078ec0ff */ | |
| 499 | + /*0800*/ IMAD.SHL.U32 R24, R24, 0x100, RZ ; /* 0x0000010018187824 */ | |
| 500 | + /* 0x000fe200078e00ff */ | |
| 501 | + /*0810*/ LOP3.LUT R10, R10, 0xff0000, R23, 0xf8, !PT ; /* 0x00ff00000a0a7812 */ | |
| 502 | + /* 0x000fe200078ef817 */ | |
| 503 | + /*0820*/ IMAD.SHL.U32 R8, R8, 0x100, RZ ; /* 0x0000010008087824 */ | |
| 504 | + /* 0x000fe200078e00ff */ | |
| 505 | + /*0830*/ SHF.R.S32.HI R23, RZ, 0xc, R22 ; /* 0x0000000cff177819 */ | |
| 506 | + /* 0x000fe20000011416 */ | |
| 507 | + /*0840*/ IMAD.SHL.U32 R21, R21, 0x100, RZ ; /* 0x0000010015157824 */ | |
| 508 | + /* 0x000fe200078e00ff */ | |
| 509 | + /*0850*/ LOP3.LUT R22, R2, 0xf000000, RZ, 0xc0, !PT ; /* 0x0f00000002167812 */ | |
| 510 | + /* 0x000fc400078ec0ff */ | |
| 511 | + /*0860*/ LOP3.LUT R16, R16, 0xff0000, R23, 0xf8, !PT ; /* 0x00ff000010107812 */ | |
| 512 | + /* 0x000fe400078ef817 */ | |
| 513 | + /*0870*/ SHF.R.S32.HI R24, RZ, 0xc, R24 ; /* 0x0000000cff187819 */ | |
| 514 | + /* 0x000fe20000011418 */ | |
| 515 | + /*0880*/ IMAD.SHL.U32 R22, R22, 0x10, RZ ; /* 0x0000001016167824 */ | |
| 516 | + /* 0x000fe200078e00ff */ | |
| 517 | + /*0890*/ SHF.R.S32.HI R8, RZ, 0xc, R8 ; /* 0x0000000cff087819 */ | |
| 518 | + /* 0x000fe40000011408 */ | |
| 519 | + /*08a0*/ LOP3.LUT R23, R3, 0xf000000, RZ, 0xc0, !PT ; /* 0x0f00000003177812 */ | |
| 520 | + /* 0x000fe400078ec0ff */ | |
| 521 | + /*08b0*/ SHF.R.S32.HI R21, RZ, 0xc, R21 ; /* 0x0000000cff157819 */ | |
| 522 | + /* 0x000fe40000011415 */ | |
| 523 | + /*08c0*/ LOP3.LUT R17, R17, 0xff0000, R24, 0xf8, !PT ; /* 0x00ff000011117812 */ | |
| 524 | + /* 0x000fe200078ef818 */ | |
| 525 | + /*08d0*/ IMAD.SHL.U32 R24, R23, 0x10, RZ ; /* 0x0000001017187824 */ | |
| 526 | + /* 0x000fe200078e00ff */ | |
| 527 | + /*08e0*/ LOP3.LUT R19, R19, 0xff0000, R8, 0xf8, !PT ; /* 0x00ff000013137812 */ | |
| 528 | + /* 0x000fc400078ef808 */ | |
| 529 | + /*08f0*/ LOP3.LUT R18, R18, 0xff0000, R21, 0xf8, !PT ; /* 0x00ff000012127812 */ | |
| 530 | + /* 0x000fe400078ef815 */ | |
| 531 | + /*0900*/ LOP3.LUT R8, R4, 0xf000000, RZ, 0xc0, !PT ; /* 0x0f00000004087812 */ | |
| 532 | + /* 0x000fe400078ec0ff */ | |
| 533 | + /*0910*/ LOP3.LUT R21, R5, 0xf000000, RZ, 0xc0, !PT ; /* 0x0f00000005157812 */ | |
| 534 | + /* 0x000fe400078ec0ff */ | |
| 535 | + /*0920*/ SHF.R.S32.HI R23, RZ, 0x4, R22 ; /* 0x00000004ff177819 */ | |
| 536 | + /* 0x000fe20000011416 */ | |
| 537 | + /*0930*/ IMAD.SHL.U32 R8, R8, 0x10, RZ ; /* 0x0000001008087824 */ | |
| 538 | + /* 0x000fe200078e00ff */ | |
| 539 | + /*0940*/ SHF.R.S32.HI R24, RZ, 0x4, R24 ; /* 0x00000004ff187819 */ | |
| 540 | + /* 0x000fe20000011418 */ | |
| 541 | + /*0950*/ IMAD.SHL.U32 R21, R21, 0x10, RZ ; /* 0x0000001015157824 */ | |
| 542 | + /* 0x000fe200078e00ff */ | |
| 543 | + /*0960*/ LOP3.LUT R12, R12, 0xff000000, R23, 0xf8, !PT ; /* 0xff0000000c0c7812 */ | |
| 544 | + /* 0x000fc400078ef817 */ | |
| 545 | + /*0970*/ LOP3.LUT R13, R13, 0xff000000, R24, 0xf8, !PT ; /* 0xff0000000d0d7812 */ | |
| 546 | + /* 0x000fe400078ef818 */ | |
| 547 | + /*0980*/ LOP3.LUT R23, R6, 0xf000000, RZ, 0xc0, !PT ; /* 0x0f00000006177812 */ | |
| 548 | + /* 0x000fe400078ec0ff */ | |
| 549 | + /*0990*/ SHF.R.S32.HI R8, RZ, 0x4, R8 ; /* 0x00000004ff087819 */ | |
| 550 | + /* 0x000fe40000011408 */ | |
| 551 | + /*09a0*/ LOP3.LUT R24, R7, 0xf000000, RZ, 0xc0, !PT ; /* 0x0f00000007187812 */ | |
| 552 | + /* 0x000fe200078ec0ff */ | |
| 553 | + /*09b0*/ IMAD.SHL.U32 R23, R23, 0x10, RZ ; /* 0x0000001017177824 */ | |
| 554 | + /* 0x000fe200078e00ff */ | |
| 555 | + /*09c0*/ SHF.R.S32.HI R22, RZ, 0x4, R21 ; /* 0x00000004ff167819 */ | |
| 556 | + /* 0x000fe40000011415 */ | |
| 557 | + /*09d0*/ LOP3.LUT R8, R9, 0xff000000, R8, 0xf8, !PT ; /* 0xff00000009087812 */ | |
| 558 | + /* 0x000fe200078ef808 */ | |
| 559 | + /*09e0*/ IMAD.SHL.U32 R24, R24, 0x10, RZ ; /* 0x0000001018187824 */ | |
| 560 | + /* 0x000fe200078e00ff */ | |
| 561 | + /*09f0*/ LOP3.LUT R9, R11, 0xff000000, R22, 0xf8, !PT ; /* 0xff0000000b097812 */ | |
| 562 | + /* 0x000fc400078ef816 */ | |
| 563 | + /*0a00*/ LOP3.LUT R11, R6, 0xf00000, RZ, 0xc0, !PT ; /* 0x00f00000060b7812 */ | |
| 564 | + /* 0x000fe400078ec0ff */ | |
| 565 | + /*0a10*/ LOP3.LUT R22, R7, 0xf00000, RZ, 0xc0, !PT ; /* 0x00f0000007167812 */ | |
| 566 | + /* 0x000fe400078ec0ff */ | |
| 567 | + /*0a20*/ SHF.R.S32.HI R23, RZ, 0x4, R23 ; /* 0x00000004ff177819 */ | |
| 568 | + /* 0x000fe20000011417 */ | |
| 569 | + /*0a30*/ IMAD.SHL.U32 R21, R11, 0x100, RZ ; /* 0x000001000b157824 */ | |
| 570 | + /* 0x000fe200078e00ff */ | |
| 571 | + /*0a40*/ SHF.R.S32.HI R25, RZ, 0x4, R24 ; /* 0x00000004ff197819 */ | |
| 572 | + /* 0x000fe20000011418 */ | |
| 573 | + /*0a50*/ IMAD.SHL.U32 R22, R22, 0x100, RZ ; /* 0x0000010016167824 */ | |
| 574 | + /* 0x000fe200078e00ff */ | |
| 575 | + /*0a60*/ LOP3.LUT R10, R10, 0xff000000, R23, 0xf8, !PT ; /* 0xff0000000a0a7812 */ | |
| 576 | + /* 0x000fe400078ef817 */ | |
| 577 | + /*0a70*/ LOP3.LUT R2, R2, 0xf0000000, RZ, 0xc0, !PT ; /* 0xf000000002027812 */ | |
| 578 | + /* 0x000fc400078ec0ff */ | |
| 579 | + /*0a80*/ LOP3.LUT R11, R20, 0xff000000, R25, 0xf8, !PT ; /* 0xff000000140b7812 */ | |
| 580 | + /* 0x000fe400078ef819 */ | |
| 581 | + /*0a90*/ LOP3.LUT R23, R3, 0xf0000000, RZ, 0xc0, !PT ; /* 0xf000000003177812 */ | |
| 582 | + /* 0x000fe400078ec0ff */ | |
| 583 | + /*0aa0*/ SHF.R.S32.HI R20, RZ, 0xc, R21 ; /* 0x0000000cff147819 */ | |
| 584 | + /* 0x000fe40000011415 */ | |
| 585 | + /*0ab0*/ SHF.R.S32.HI R21, RZ, 0x4, R2 ; /* 0x00000004ff157819 */ | |
| 586 | + /* 0x000fe20000011402 */ | |
| 587 | + /*0ac0*/ IMMA.16832.S8.S8 R8, R8.ROW, R12.COL, RZ ; /* 0x0000000c08087237 */ | |
| 588 | + /* 0x000fe20000405cff */ | |
| 589 | + /*0ad0*/ SHF.R.S32.HI R3, RZ, 0xc, R22 ; /* 0x0000000cff037819 */ | |
| 590 | + /* 0x000fe40000011416 */ | |
| 591 | + /*0ae0*/ SHF.R.S32.HI R2, RZ, 0x4, R23 ; /* 0x00000004ff027819 */ | |
| 592 | + /* 0x000fc40000011417 */ | |
| 593 | + /*0af0*/ LOP3.LUT R15, R15, 0xff0000, R20, 0xf8, !PT ; /* 0x00ff00000f0f7812 */ | |
| 594 | + /* 0x000fe400078ef814 */ | |
| 595 | + /*0b00*/ LOP3.LUT R20, R14, 0xff0000, R3, 0xf8, !PT ; /* 0x00ff00000e147812 */ | |
| 596 | + /* 0x000fe400078ef803 */ | |
| 597 | + /*0b10*/ LOP3.LUT R17, R17, 0xff000000, R2, 0xf8, !PT ; /* 0xff00000011117812 */ | |
| 598 | + /* 0x000fe400078ef802 */ | |
| 599 | + /*0b20*/ LOP3.LUT R12, R6, 0xf0000000, RZ, 0xc0, !PT ; /* 0xf0000000060c7812 */ | |
| 600 | + /* 0x000fe400078ec0ff */ | |
| 601 | + /*0b30*/ LOP3.LUT R2, R4, 0xf0000000, RZ, 0xc0, !PT ; /* 0xf000000004027812 */ | |
| 602 | + /* 0x000fe400078ec0ff */ | |
| 603 | + /*0b40*/ LOP3.LUT R3, R5, 0xf0000000, RZ, 0xc0, !PT ; /* 0xf000000005037812 */ | |
| 604 | + /* 0x000fc400078ec0ff */ | |
| 605 | + /*0b50*/ LOP3.LUT R13, R7, 0xf0000000, RZ, 0xc0, !PT ; /* 0xf0000000070d7812 */ | |
| 606 | + /* 0x000fe400078ec0ff */ | |
| 607 | + /*0b60*/ LOP3.LUT R16, R16, 0xff000000, R21, 0xf8, !PT ; /* 0xff00000010107812 */ | |
| 608 | + /* 0x000fe400078ef815 */ | |
| 609 | + /*0b70*/ SHF.R.S32.HI R14, RZ, 0x4, R12 ; /* 0x00000004ff0e7819 */ | |
| 610 | + /* 0x000fe4000001140c */ | |
| 611 | + /*0b80*/ SHF.R.S32.HI R2, RZ, 0x4, R2 ; /* 0x00000004ff027819 */ | |
| 612 | + /* 0x000fe40000011402 */ | |
| 613 | + /*0b90*/ SHF.R.S32.HI R3, RZ, 0x4, R3 ; /* 0x00000004ff037819 */ | |
| 614 | + /* 0x000fe40000011403 */ | |
| 615 | + /*0ba0*/ SHF.R.S32.HI R21, RZ, 0x4, R13 ; /* 0x00000004ff157819 */ | |
| 616 | + /* 0x000fc4000001140d */ | |
| 617 | + /*0bb0*/ LOP3.LUT R14, R15, 0xff000000, R14, 0xf8, !PT ; /* 0xff0000000f0e7812 */ | |
| 618 | + /* 0x000fe400078ef80e */ | |
| 619 | + /*0bc0*/ LOP3.LUT R12, R19, 0xff000000, R2, 0xf8, !PT ; /* 0xff000000130c7812 */ | |
| 620 | + /* 0x000fe400078ef802 */ | |
| 621 | + /*0bd0*/ LOP3.LUT R13, R18, 0xff000000, R3, 0xf8, !PT ; /* 0xff000000120d7812 */ | |
| 622 | + /* 0x000fe400078ef803 */ | |
| 623 | + /*0be0*/ LOP3.LUT R15, R20, 0xff000000, R21, 0xf8, !PT ; /* 0xff000000140f7812 */ | |
| 624 | + /* 0x000fe200078ef815 */ | |
| 625 | + /*0bf0*/ MOV R2, R0 ; /* 0x0000000000027202 */ | |
| 626 | + /* 0x000fe20000000f00 */ | |
| 627 | + /*0c00*/ MOV R3, 0x0 ; /* 0x0000000000037802 */ | |
| 628 | + /* 0x000fca0000000f00 */ | |
| 629 | + /*0c10*/ IMMA.16832.S8.S8 R12, R12.ROW, R16.COL, RZ ; /* 0x000000100c0c7237 */ | |
| 630 | + /* 0x000fde0000405cff */ | |
| 631 | + /*0c20*/ NOP ; /* 0x0000000000007918 */ | |
| 632 | + /* 0x000fd60000000000 */ | |
| 633 | + /*0c30*/ IADD3 R8, PT, PT, R4, R8, R12 ; /* 0x0000000804087210 */ | |
| 634 | + /* 0x000fe40007ffe00c */ | |
| 635 | + /*0c40*/ IADD3 R9, PT, PT, R5, R9, R13 ; /* 0x0000000905097210 */ | |
| 636 | + /* 0x000fe40007ffe00d */ | |
| 637 | + /*0c50*/ IADD3 R10, PT, PT, R6, R10, R14 ; /* 0x0000000a060a7210 */ | |
| 638 | + /* 0x000fe40007ffe00e */ | |
| 639 | + /*0c60*/ IADD3 R11, PT, PT, R7, R11, R15 ; /* 0x0000000b070b7210 */ | |
| 640 | + /* 0x000fe20007ffe00f */ | |
| 641 | + /*0c70*/ RET.REL.NODEC R2 `(k) ; /* 0xfffffff002e07950 */ | |
| 642 | + /* 0x000fec0003c3ffff */ | |
| 643 | +.L_x_0: | |
| 644 | + /*0c80*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 645 | + /* 0x000fc0000383ffff */ | |
| 646 | + /*0c90*/ NOP; /* 0x0000000000007918 */ | |
| 647 | + /* 0x000fc00000000000 */ | |
| 648 | + /*0ca0*/ NOP; /* 0x0000000000007918 */ | |
| 649 | + /* 0x000fc00000000000 */ | |
| 650 | + /*0cb0*/ NOP; /* 0x0000000000007918 */ | |
| 651 | + /* 0x000fc00000000000 */ | |
| 652 | + /*0cc0*/ NOP; /* 0x0000000000007918 */ | |
| 653 | + /* 0x000fc00000000000 */ | |
| 654 | + /*0cd0*/ NOP; /* 0x0000000000007918 */ | |
| 655 | + /* 0x000fc00000000000 */ | |
| 656 | + /*0ce0*/ NOP; /* 0x0000000000007918 */ | |
| 657 | + /* 0x000fc00000000000 */ | |
| 658 | + /*0cf0*/ NOP; /* 0x0000000000007918 */ | |
| 659 | + /* 0x000fc00000000000 */ | |
| 660 | + /*0d00*/ NOP; /* 0x0000000000007918 */ | |
| 661 | + /* 0x000fc00000000000 */ | |
| 662 | + /*0d10*/ NOP; /* 0x0000000000007918 */ | |
| 663 | + /* 0x000fc00000000000 */ | |
| 664 | + /*0d20*/ NOP; /* 0x0000000000007918 */ | |
| 665 | + /* 0x000fc00000000000 */ | |
| 666 | + /*0d30*/ NOP; /* 0x0000000000007918 */ | |
| 667 | + /* 0x000fc00000000000 */ | |
| 668 | + /*0d40*/ NOP; /* 0x0000000000007918 */ | |
| 669 | + /* 0x000fc00000000000 */ | |
| 670 | + /*0d50*/ NOP; /* 0x0000000000007918 */ | |
| 671 | + /* 0x000fc00000000000 */ | |
| 672 | + /*0d60*/ NOP; /* 0x0000000000007918 */ | |
| 673 | + /* 0x000fc00000000000 */ | |
| 674 | + /*0d70*/ NOP; /* 0x0000000000007918 */ | |
| 675 | + /* 0x000fc00000000000 */ | |
| 676 | +.L_x_1: | |
| 677 | + | |
| 678 | + | |
| 679 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 680 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 681 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 682 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 683 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 684 | +__nv_reservedSMEM_offset_0_alias: | |
| 685 | + .zero 0 | |
| 686 | + .zero 64 | |
| 687 | + | |
| 688 | + | |
| 689 | +//--------------------- .nv.constant0.k -------------------------- | |
| 690 | + .section .nv.constant0.k,"a",@progbits | |
| 691 | + .sectionflags @"" | |
| 692 | + .align 4 | |
| 693 | +.nv.constant0.k: | |
| 694 | + .zero 904 | |
| 695 | + | |
| 696 | + | |
| 697 | +//--------------------- SYMBOLS -------------------------- | |
| 698 | + | |
| 699 | + .type .nv.reservedSmem.offset0,@object | |
| 700 | + .size .nv.reservedSmem.offset0,0x4 |
streams/own-fp4/asm/s8.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k32.row.col.s32.s8.s8.s32 {a0,a1,a2,a3},{a0,a1,a2,a3},{b0,b1},{a0,a1,a2,a3}; mov.b32 d0,a0; mov.b32 d1,a1; mov.b32 d2,a2; mov.b32 d3,a3; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/s8.sass
| new file mode 100644 | ||
| @@ -0,0 +1,282 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x20, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x0000000c | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x01, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0000 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x00000080 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ LDG.E.64 R8, desc[UR4][R2.64+0x10] ; /* 0x0000100402087981 */ | |
| 216 | + /* 0x001ea8000c1e1b00 */ | |
| 217 | + /*0040*/ LDG.E.128 R4, desc[UR4][R2.64] ; /* 0x0000000402047981 */ | |
| 218 | + /* 0x000ea4000c1e1d00 */ | |
| 219 | + /*0050*/ IMMA.16832.S8.S8 R4, R4.ROW, R8.COL, R4 ; /* 0x0000000804047237 */ | |
| 220 | + /* 0x004fde0000405c04 */ | |
| 221 | + /*0060*/ NOP ; /* 0x0000000000007918 */ | |
| 222 | + /* 0x000fd60000000000 */ | |
| 223 | + /*0070*/ STG.E.128 desc[UR4][R2.64], R4 ; /* 0x0000000402007986 */ | |
| 224 | + /* 0x000fe2000c101d04 */ | |
| 225 | + /*0080*/ EXIT ; /* 0x000000000000794d */ | |
| 226 | + /* 0x000fea0003800000 */ | |
| 227 | +.L_x_0: | |
| 228 | + /*0090*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 229 | + /* 0x000fc0000383ffff */ | |
| 230 | + /*00a0*/ NOP; /* 0x0000000000007918 */ | |
| 231 | + /* 0x000fc00000000000 */ | |
| 232 | + /*00b0*/ NOP; /* 0x0000000000007918 */ | |
| 233 | + /* 0x000fc00000000000 */ | |
| 234 | + /*00c0*/ NOP; /* 0x0000000000007918 */ | |
| 235 | + /* 0x000fc00000000000 */ | |
| 236 | + /*00d0*/ NOP; /* 0x0000000000007918 */ | |
| 237 | + /* 0x000fc00000000000 */ | |
| 238 | + /*00e0*/ NOP; /* 0x0000000000007918 */ | |
| 239 | + /* 0x000fc00000000000 */ | |
| 240 | + /*00f0*/ NOP; /* 0x0000000000007918 */ | |
| 241 | + /* 0x000fc00000000000 */ | |
| 242 | + /*0100*/ NOP; /* 0x0000000000007918 */ | |
| 243 | + /* 0x000fc00000000000 */ | |
| 244 | + /*0110*/ NOP; /* 0x0000000000007918 */ | |
| 245 | + /* 0x000fc00000000000 */ | |
| 246 | + /*0120*/ NOP; /* 0x0000000000007918 */ | |
| 247 | + /* 0x000fc00000000000 */ | |
| 248 | + /*0130*/ NOP; /* 0x0000000000007918 */ | |
| 249 | + /* 0x000fc00000000000 */ | |
| 250 | + /*0140*/ NOP; /* 0x0000000000007918 */ | |
| 251 | + /* 0x000fc00000000000 */ | |
| 252 | + /*0150*/ NOP; /* 0x0000000000007918 */ | |
| 253 | + /* 0x000fc00000000000 */ | |
| 254 | + /*0160*/ NOP; /* 0x0000000000007918 */ | |
| 255 | + /* 0x000fc00000000000 */ | |
| 256 | + /*0170*/ NOP; /* 0x0000000000007918 */ | |
| 257 | + /* 0x000fc00000000000 */ | |
| 258 | +.L_x_1: | |
| 259 | + | |
| 260 | + | |
| 261 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 262 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 263 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 264 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 265 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 266 | +__nv_reservedSMEM_offset_0_alias: | |
| 267 | + .zero 0 | |
| 268 | + .zero 64 | |
| 269 | + | |
| 270 | + | |
| 271 | +//--------------------- .nv.constant0.k -------------------------- | |
| 272 | + .section .nv.constant0.k,"a",@progbits | |
| 273 | + .sectionflags @"" | |
| 274 | + .align 4 | |
| 275 | +.nv.constant0.k: | |
| 276 | + .zero 904 | |
| 277 | + | |
| 278 | + | |
| 279 | +//--------------------- SYMBOLS -------------------------- | |
| 280 | + | |
| 281 | + .type .nv.reservedSmem.offset0,@object | |
| 282 | + .size .nv.reservedSmem.offset0,0x4 |
streams/own-fp4/asm/sp_nvf4.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sp::ordered_metadata.sync.aligned.m16n8k128.row.col.kind::mxf4nvf4.block_scale.scale_vec::4X.f32.e2m1.e2m1.f32.ue4m3 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1,b0,b1},{c0,c1,c2,c3},sa,0x0,sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/sp_nvf4.sass
| new file mode 100644 | ||
| @@ -0,0 +1,282 @@ | ||
| 1 | + .target sm_121a | |
| 2 | + | |
| 3 | + .elftype @"ET_EXEC" | |
| 4 | + | |
| 5 | + | |
| 6 | +//--------------------- .debug_frame -------------------------- | |
| 7 | + .section .debug_frame,"",@progbits | |
| 8 | +.debug_frame: | |
| 9 | + /*0000*/ .byte 0xff, 0xff, 0xff, 0xff, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff | |
| 10 | + /*0010*/ .byte 0xff, 0xff, 0xff, 0xff, 0x03, 0x00, 0x04, 0x7c, 0xff, 0xff, 0xff, 0xff, 0x0f, 0x0c, 0x81, 0x80 | |
| 11 | + /*0020*/ .byte 0x80, 0x28, 0x00, 0x08, 0xff, 0x81, 0x80, 0x28, 0x08, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00 | |
| 12 | + /*0030*/ .byte 0xff, 0xff, 0xff, 0xff, 0x2c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 13 | + /*0040*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 14 | + /*0044*/ .dword k | |
| 15 | + /*004c*/ .byte 0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x38, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00 | |
| 16 | + /*005c*/ .byte 0x00, 0x00, 0x0c, 0x81, 0x80, 0x80, 0x28, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 17 | + | |
| 18 | + | |
| 19 | +//--------------------- .note.nv.tkinfo -------------------------- | |
| 20 | + .section .note.nv.tkinfo,"",@"SHT_NOTE" | |
| 21 | + .sectionflags @"SHF_NOTE_NV_TKINFO" | |
| 22 | + .tkinfo | |
| 23 | + /*0018*/ .word 0x00000002 | |
| 24 | + /*0030*/ .string "" | |
| 25 | + /*0030*/ .string "ptxas" | |
| 26 | + /*0030*/ .string "Cuda compilation tools, release 13.0, V13.0.88" | |
| 27 | + /*0030*/ .string "Build cuda_13.0.r13.0/compiler.36424714_0" | |
| 28 | + /*0030*/ .string "-arch sm_121a " | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | +//--------------------- .note.nv.cuinfo -------------------------- | |
| 33 | + .section .note.nv.cuinfo,"",@"SHT_NOTE" | |
| 34 | + .sectionflags @"SHF_NOTE_NV_CUINFO" | |
| 35 | + /*0018*/ .short 0x0002 | |
| 36 | + /*001a*/ .short 0x0079 | |
| 37 | + /*001c*/ .short 0x0082 | |
| 38 | + .zero 2 | |
| 39 | + | |
| 40 | + | |
| 41 | +//--------------------- .nv.info -------------------------- | |
| 42 | + .section .nv.info,"",@"SHT_CUDA_INFO" | |
| 43 | + .align 4 | |
| 44 | + | |
| 45 | + | |
| 46 | + //----- nvinfo : EIATTR_REGCOUNT | |
| 47 | + .align 4 | |
| 48 | + /*0000*/ .byte 0x04, 0x2f | |
| 49 | + /*0002*/ .short (.L_1 - .L_0) | |
| 50 | + .align 4 | |
| 51 | +.L_0: | |
| 52 | + /*0004*/ .word index@(k) | |
| 53 | + /*0008*/ .word 0x00000016 | |
| 54 | + | |
| 55 | + | |
| 56 | + //----- nvinfo : EIATTR_FRAME_SIZE | |
| 57 | + .align 4 | |
| 58 | +.L_1: | |
| 59 | + /*000c*/ .byte 0x04, 0x11 | |
| 60 | + /*000e*/ .short (.L_3 - .L_2) | |
| 61 | + .align 4 | |
| 62 | +.L_2: | |
| 63 | + /*0010*/ .word index@(k) | |
| 64 | + /*0014*/ .word 0x00000000 | |
| 65 | + | |
| 66 | + | |
| 67 | + //----- nvinfo : EIATTR_MIN_STACK_SIZE | |
| 68 | + .align 4 | |
| 69 | +.L_3: | |
| 70 | + /*0018*/ .byte 0x04, 0x12 | |
| 71 | + /*001a*/ .short (.L_5 - .L_4) | |
| 72 | + .align 4 | |
| 73 | +.L_4: | |
| 74 | + /*001c*/ .word index@(k) | |
| 75 | + /*0020*/ .word 0x00000000 | |
| 76 | +.L_5: | |
| 77 | + | |
| 78 | + | |
| 79 | +//--------------------- .nv.compat -------------------------- | |
| 80 | + .section .nv.compat,"",@"SHT_CUDA_COMPAT_INFO" | |
| 81 | + .align 4 | |
| 82 | + /*0000*/ .byte 0x02, 0x09, 0x01, 0x00, 0x02, 0x02, 0x03, 0x00, 0x02, 0x05, 0x05, 0x00, 0x03, 0x07, 0x01, 0x01 | |
| 83 | + /*0010*/ .byte 0x02, 0x03, 0x00, 0x00, 0x02, 0x06, 0x01, 0x00, 0x04, 0x0b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00 | |
| 84 | + /*0020*/ .byte 0x00, 0x00, 0x00, 0x00 | |
| 85 | + | |
| 86 | + | |
| 87 | +//--------------------- .nv.info.k -------------------------- | |
| 88 | + .section .nv.info.k,"",@"SHT_CUDA_INFO" | |
| 89 | + .sectionflags @"" | |
| 90 | + .align 4 | |
| 91 | + | |
| 92 | + | |
| 93 | + //----- nvinfo : EIATTR_CUDA_API_VERSION | |
| 94 | + .align 4 | |
| 95 | + /*0000*/ .byte 0x04, 0x37 | |
| 96 | + /*0002*/ .short (.L_7 - .L_6) | |
| 97 | +.L_6: | |
| 98 | + /*0004*/ .word 0x00000082 | |
| 99 | + | |
| 100 | + | |
| 101 | + //----- nvinfo : EIATTR_KPARAM_INFO | |
| 102 | + .align 4 | |
| 103 | +.L_7: | |
| 104 | + /*0008*/ .byte 0x04, 0x17 | |
| 105 | + /*000a*/ .short (.L_9 - .L_8) | |
| 106 | +.L_8: | |
| 107 | + /*000c*/ .word 0x00000000 | |
| 108 | + /*0010*/ .short 0x0000 | |
| 109 | + /*0012*/ .short 0x0000 | |
| 110 | + /*0014*/ .byte 0x00, 0xf0, 0x21, 0x00 | |
| 111 | + | |
| 112 | + | |
| 113 | + //----- nvinfo : EIATTR_SPARSE_MMA_MASK | |
| 114 | + .align 4 | |
| 115 | +.L_9: | |
| 116 | + /*0018*/ .byte 0x03, 0x50 | |
| 117 | + /*001a*/ .short 0x0080 | |
| 118 | + | |
| 119 | + | |
| 120 | + //----- nvinfo : EIATTR_MAXREG_COUNT | |
| 121 | + .align 4 | |
| 122 | + /*001c*/ .byte 0x03, 0x1b | |
| 123 | + /*001e*/ .short 0x00ff | |
| 124 | + | |
| 125 | + | |
| 126 | + //----- nvinfo : EIATTR_MERCURY_ISA_VERSION | |
| 127 | + .align 4 | |
| 128 | + /*0020*/ .byte 0x03, 0x5f | |
| 129 | + /*0022*/ .short 0x0101 | |
| 130 | + | |
| 131 | + | |
| 132 | + //----- nvinfo : EIATTR_VRC_CTA_INIT_COUNT | |
| 133 | + .align 4 | |
| 134 | + /*0024*/ .byte 0x02, 0x4a | |
| 135 | + .zero 1 | |
| 136 | + .zero 1 | |
| 137 | + | |
| 138 | + | |
| 139 | + //----- nvinfo : EIATTR_EXIT_INSTR_OFFSETS | |
| 140 | + .align 4 | |
| 141 | + /*0028*/ .byte 0x04, 0x1c | |
| 142 | + /*002a*/ .short (.L_11 - .L_10) | |
| 143 | + | |
| 144 | + | |
| 145 | + // ....[0].... | |
| 146 | +.L_10: | |
| 147 | + /*002c*/ .word 0x000000e0 | |
| 148 | + | |
| 149 | + | |
| 150 | + //----- nvinfo : EIATTR_CBANK_PARAM_SIZE | |
| 151 | + .align 4 | |
| 152 | +.L_11: | |
| 153 | + /*0030*/ .byte 0x03, 0x19 | |
| 154 | + /*0032*/ .short 0x0008 | |
| 155 | + | |
| 156 | + | |
| 157 | + //----- nvinfo : EIATTR_PARAM_CBANK | |
| 158 | + .align 4 | |
| 159 | + /*0034*/ .byte 0x04, 0x0a | |
| 160 | + /*0036*/ .short (.L_13 - .L_12) | |
| 161 | + .align 4 | |
| 162 | +.L_12: | |
| 163 | + /*0038*/ .word index@(.nv.constant0.k) | |
| 164 | + /*003c*/ .short 0x0380 | |
| 165 | + /*003e*/ .short 0x0008 | |
| 166 | + | |
| 167 | + | |
| 168 | + //----- nvinfo : EIATTR_SW_WAR | |
| 169 | + .align 4 | |
| 170 | +.L_13: | |
| 171 | + /*0040*/ .byte 0x04, 0x36 | |
| 172 | + /*0042*/ .short (.L_15 - .L_14) | |
| 173 | +.L_14: | |
| 174 | + /*0044*/ .word 0x00000000 | |
| 175 | +.L_15: | |
| 176 | + | |
| 177 | + | |
| 178 | +//--------------------- .nv.callgraph -------------------------- | |
| 179 | + .section .nv.callgraph,"",@"SHT_CUDA_CALLGRAPH" | |
| 180 | + .align 4 | |
| 181 | + .sectionentsize 8 | |
| 182 | + .align 4 | |
| 183 | + /*0000*/ .word 0x00000000 | |
| 184 | + .align 4 | |
| 185 | + /*0004*/ .word 0xffffffff | |
| 186 | + .align 4 | |
| 187 | + /*0008*/ .word 0x00000000 | |
| 188 | + .align 4 | |
| 189 | + /*000c*/ .word 0xfffffffe | |
| 190 | + .align 4 | |
| 191 | + /*0010*/ .word 0x00000000 | |
| 192 | + .align 4 | |
| 193 | + /*0014*/ .word 0xfffffffd | |
| 194 | + .align 4 | |
| 195 | + /*0018*/ .word 0x00000000 | |
| 196 | + .align 4 | |
| 197 | + /*001c*/ .word 0xfffffffc | |
| 198 | + | |
| 199 | + | |
| 200 | +//--------------------- .text.k -------------------------- | |
| 201 | + .section .text.k,"ax",@progbits | |
| 202 | + .align 128 | |
| 203 | + .global k | |
| 204 | + .type k,@function | |
| 205 | + .size k,(.L_x_1 - k) | |
| 206 | + .other k,@"STO_CUDA_ENTRY STV_DEFAULT" | |
| 207 | +k: | |
| 208 | +.text.k: | |
| 209 | + /*0000*/ LDC R1, c[0x0][0x37c] ; /* 0x0000df00ff017b82 */ | |
| 210 | + /* 0x000fe20000000800 */ | |
| 211 | + /*0010*/ LDCU.64 UR4, c[0x0][0x358] ; /* 0x00006b00ff0477ac */ | |
| 212 | + /* 0x000e2e0008000a00 */ | |
| 213 | + /*0020*/ LDC.64 R2, c[0x0][0x380] ; /* 0x0000e000ff027b82 */ | |
| 214 | + /* 0x000e240000000a00 */ | |
| 215 | + /*0030*/ LDG.E.64 R16, desc[UR4][R2.64+0x30] ; /* 0x0000300402107981 */ | |
| 216 | + /* 0x001ea8000c1e1b00 */ | |
| 217 | + /*0040*/ LDG.E.64 R8, desc[UR4][R2.64+0x10] ; /* 0x0000100402087981 */ | |
| 218 | + /* 0x000ee8000c1e1b00 */ | |
| 219 | + /*0050*/ LDG.E.128 R4, desc[UR4][R2.64] ; /* 0x0000000402047981 */ | |
| 220 | + /* 0x000f28000c1e1d00 */ | |
| 221 | + /*0060*/ LDG.E.128 R12, desc[UR4][R2.64+0x20] ; /* 0x00002004020c7981 */ | |
| 222 | + /* 0x000f22000c1e1d00 */ | |
| 223 | + /*0070*/ MOV R18, R16.reuse ; /* 0x0000001000127202 */ | |
| 224 | + /* 0x084fe20000000f00 */ | |
| 225 | + /*0080*/ MOV R19, R16 ; /* 0x0000001000137202 */ | |
| 226 | + /* 0x000fe20000000f00 */ | |
| 227 | + /*0090*/ MOV R10, R8 ; /* 0x00000008000a7202 */ | |
| 228 | + /* 0x008fe20000000f00 */ | |
| 229 | + /*00a0*/ MOV R11, R9 ; /* 0x00000009000b7202 */ | |
| 230 | + /* 0x000fce0000000f00 */ | |
| 231 | + /*00b0*/ OMMA.SF.SP.168128.F32.E2M1.E2M1.UE4M3.4X R4, R4, R8, R12, R18, R17, URZ, 0x0 ; /* 0x711012080404747f */ | |
| 232 | + /* 0x010fde0000053e0c */ | |
| 233 | + /*00c0*/ NOP ; /* 0x0000000000007918 */ | |
| 234 | + /* 0x000fda0000000000 */ | |
| 235 | + /*00d0*/ STG.E.128 desc[UR4][R2.64], R4 ; /* 0x0000000402007986 */ | |
| 236 | + /* 0x000fe2000c101d04 */ | |
| 237 | + /*00e0*/ EXIT ; /* 0x000000000000794d */ | |
| 238 | + /* 0x000fea0003800000 */ | |
| 239 | +.L_x_0: | |
| 240 | + /*00f0*/ BRA `(.L_x_0); /* 0xfffffffc00fc7947 */ | |
| 241 | + /* 0x000fc0000383ffff */ | |
| 242 | + /*0100*/ NOP; /* 0x0000000000007918 */ | |
| 243 | + /* 0x000fc00000000000 */ | |
| 244 | + /*0110*/ NOP; /* 0x0000000000007918 */ | |
| 245 | + /* 0x000fc00000000000 */ | |
| 246 | + /*0120*/ NOP; /* 0x0000000000007918 */ | |
| 247 | + /* 0x000fc00000000000 */ | |
| 248 | + /*0130*/ NOP; /* 0x0000000000007918 */ | |
| 249 | + /* 0x000fc00000000000 */ | |
| 250 | + /*0140*/ NOP; /* 0x0000000000007918 */ | |
| 251 | + /* 0x000fc00000000000 */ | |
| 252 | + /*0150*/ NOP; /* 0x0000000000007918 */ | |
| 253 | + /* 0x000fc00000000000 */ | |
| 254 | + /*0160*/ NOP; /* 0x0000000000007918 */ | |
| 255 | + /* 0x000fc00000000000 */ | |
| 256 | + /*0170*/ NOP; /* 0x0000000000007918 */ | |
| 257 | + /* 0x000fc00000000000 */ | |
| 258 | +.L_x_1: | |
| 259 | + | |
| 260 | + | |
| 261 | +//--------------------- .nv.shared.reserved.0 -------------------------- | |
| 262 | + .section .nv.shared.reserved.0,"aw",@nobits | |
| 263 | + .weak __nv_reservedSMEM_offset_0_alias | |
| 264 | + .size __nv_reservedSMEM_offset_0_alias, 0, 64 | |
| 265 | + .other __nv_reservedSMEM_offset_0_alias,@"STO_CUDA_RESERVED_SHARED STV_DEFAULT" | |
| 266 | +__nv_reservedSMEM_offset_0_alias: | |
| 267 | + .zero 0 | |
| 268 | + .zero 64 | |
| 269 | + | |
| 270 | + | |
| 271 | +//--------------------- .nv.constant0.k -------------------------- | |
| 272 | + .section .nv.constant0.k,"a",@progbits | |
| 273 | + .sectionflags @"" | |
| 274 | + .align 4 | |
| 275 | +.nv.constant0.k: | |
| 276 | + .zero 904 | |
| 277 | + | |
| 278 | + | |
| 279 | +//--------------------- SYMBOLS -------------------------- | |
| 280 | + | |
| 281 | + .type .nv.reservedSmem.offset0,@object | |
| 282 | + .size .nv.reservedSmem.offset0,0x4 |
streams/own-fp4/asm/tcgen05_alloc.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + tcgen05.alloc.cta_group::1.sync.aligned.shared::cta.b32 [rp], 32; mov.f32 d0,c0; mov.f32 d1,c1; mov.f32 d2,c2; mov.f32 d3,c3; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/v_base.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/v_bida1.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{1,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/v_bidb1.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{1,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/v_nv.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4nvf4.block_scale.scale_vec::4X.f32.e2m1.e2m1.f32.ue4m3 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/v_nvsame.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4nvf4.block_scale.scale_vec::4X.f32.e2m1.e2m1.f32.ue4m3 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sb,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/v_same.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sb,{0,0},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/v_tida1.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,1},sb,{0,0}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/asm/v_tidb1.ptx
| new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +.version 9.0 | |
| 2 | +.target sm_121a | |
| 3 | +.address_size 64 | |
| 4 | +.visible .entry k(.param .u64 p){ | |
| 5 | + .reg .b32 a<4>; .reg .b32 b<2>; .reg .f32 c<4>; .reg .f32 d<4>; .reg .b32 sa; .reg .b32 sb; .reg .b64 rp; | |
| 6 | + ld.param.u64 rp,[p]; | |
| 7 | + ld.global.v4.b32 {a0,a1,a2,a3},[rp]; ld.global.v2.b32 {b0,b1},[rp+16]; ld.global.v4.f32 {c0,c1,c2,c3},[rp+32]; ld.global.b32 sa,[rp+48]; ld.global.b32 sb,[rp+52]; | |
| 8 | + mma.sync.aligned.m16n8k64.row.col.kind::mxf4.block_scale.scale_vec::2X.f32.e2m1.e2m1.f32.ue8m0 {d0,d1,d2,d3},{a0,a1,a2,a3},{b0,b1},{c0,c1,c2,c3},sa,{0,0},sb,{0,1}; | |
| 9 | + st.global.v4.f32 [rp],{d0,d1,d2,d3}; | |
| 10 | + ret;} |
streams/own-fp4/export_tern.py
| new file mode 100644 | ||
| @@ -0,0 +1,38 @@ | ||
| 1 | +# export_tern.py (L284 own-fp4): write one trained ternary layer + real activations for omega tests/gpu_tern_layer_test.c. | |
| 2 | +# ~/.venv/bin/python -I export_tern.py RUN_DIR LAYER(e.g. b2.fc2) M OUT.trn | |
| 3 | +# Codes follow fp4sim.ternary exactly (absmean, per tensor or per 16x16 tile), activations are the layer's real input on | |
| 4 | +# held-out text, quantized to int8 per vector by absmax (BitNet's A8). Yref = exact integer W x. | |
| 5 | +import json, os, sys, numpy as np, torch | |
| 6 | +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) | |
| 7 | +import train as TR | |
| 8 | + | |
| 9 | +run, layer, M, out = sys.argv[1], sys.argv[2], int(sys.argv[3]), sys.argv[4] | |
| 10 | +meta = json.load(open(f"{run}/meta.json")); a = meta["args"]; cfg = meta["cfg"] | |
| 11 | +torch.manual_seed(0) | |
| 12 | +TR.Ctx.dev = "cpu"; TR.Ctx.gen = torch.Generator().manual_seed(1) | |
| 13 | +TR.Ctx.H16 = TR.Q.hadamard(16, "cpu"); TR.Ctx.R16 = TR.Ctx.H16 | |
| 14 | +model = TR.GPT(32000, a["d"], a["layers"], a["heads"], a["ctx"], cfg) | |
| 15 | +model.load_state_dict(torch.load(f"{run}/model.pt")); model.eval() | |
| 16 | +mod = dict(model.named_modules())[layer] | |
| 17 | +w = mod.weight.detach().float() | |
| 18 | +if cfg.get("ternary") == "tensor": | |
| 19 | + T = (w / w.abs().mean().clamp(min=1e-8)).round().clamp(-1, 1) | |
| 20 | +else: | |
| 21 | + O, I = w.shape; t = w.reshape(O // 16, 16, I // 16, 16) | |
| 22 | + s = TR.Q.e4m3(t.abs().mean(dim=(1, 3), keepdim=True).clamp(min=1e-8)) | |
| 23 | + T = (t / s).round().clamp(-1, 1).reshape(O, I) | |
| 24 | +cap = {} | |
| 25 | +mod.register_forward_hook(lambda m_, i_, o_: cap.__setitem__("x", i_[0].detach().float().reshape(-1, i_[0].shape[-1]))) | |
| 26 | +va = np.memmap(os.path.expanduser("~/workspace/aien-train-own-fp4-data/validation.u16"), dtype=np.uint16, mode="r") | |
| 27 | +idx = torch.from_numpy(va[1000: 1000 + a["ctx"]].astype(np.int64))[None] | |
| 28 | +with torch.no_grad(): model(idx) | |
| 29 | +X = cap["x"][:M] | |
| 30 | +xs = X.abs().amax(1, keepdim=True).clamp(min=1e-8) / 127.0 | |
| 31 | +Xq = (X / xs).round().clamp(-127, 127) | |
| 32 | +Y = (Xq.double() @ T.double().T).round().to(torch.int64) | |
| 33 | +assert Y.abs().max() < 2 ** 31 | |
| 34 | +n, k = T.shape | |
| 35 | +with open(out, "wb") as f: | |
| 36 | + f.write(b"TRN1"); f.write(np.array([n, k, M], dtype=np.uint32).tobytes()) | |
| 37 | + f.write(T.to(torch.int8).numpy().tobytes()); f.write(Xq.to(torch.int8).numpy().tobytes()); f.write(Y.to(torch.int32).numpy().tobytes()) | |
| 38 | +print(json.dumps(dict(run=run, layer=layer, n=n, k=k, m=M, nonzero=float((T != 0).float().mean()), file=out))) |
streams/own-fp4/fp4sim.py
| new file mode 100644 | ||
| @@ -0,0 +1,118 @@ | ||
| 1 | +# fp4sim.py (L284 own-fp4, ORACLE ONLY, never shipped): simulated 4-bit numerics for training a small transformer. | |
| 2 | +# Every quantizer returns the dequantized tensor split as (q * block_scale) in bf16-exact form plus a float32 per-tensor | |
| 3 | +# scale, so the GEMM is run the way the GB10's OMMA.SF does it: block-scaled 4-bit products accumulated in FP32, then the | |
| 4 | +# per-tensor scale applied once to the output. | |
| 5 | +import math, torch | |
| 6 | + | |
| 7 | +E2M1 = torch.tensor([0.0, 0.5, 1.0, 1.5, 2.0, 3.0, 4.0, 6.0]) | |
| 8 | +_grid = {} | |
| 9 | +def grid(dev): | |
| 10 | + if dev not in _grid: _grid[dev] = E2M1.to(dev) | |
| 11 | + return _grid[dev] | |
| 12 | + | |
| 13 | +def round_e2m1(y, stochastic=False, gen=None): | |
| 14 | + """Same results as round_e2m1_ref, by arithmetic: the e2m1 grid has spacing 0.5 below 2, 1 in [2, 4), 2 in [4, 6]. | |
| 15 | + Nearest: torch.round is half-to-even, and an even multiple of the spacing is an even code in every region. | |
| 16 | + Stochastic: floor(a / step + u) * step lands on the two neighbouring grid points with the right odds.""" | |
| 17 | + a = y.abs().clamp(max=6.0) | |
| 18 | + step = torch.where(a < 2.0, 0.5, torch.where(a < 4.0, 1.0, 2.0)) | |
| 19 | + if stochastic: | |
| 20 | + u = torch.rand(a.shape, device=a.device, generator=gen) | |
| 21 | + r = a / step | |
| 22 | + q = torch.minimum(torch.floor(r + u), torch.ceil(r)) * step # never past the upper neighbour (fp32 rounding of r + u) | |
| 23 | + else: | |
| 24 | + q = torch.round(a / step) * step | |
| 25 | + return torch.copysign(q.clamp(max=6.0), y) | |
| 26 | + | |
| 27 | +def round_e2m1_ref(y, stochastic=False, gen=None): | |
| 28 | + """y already divided by its scale; returns values on the e2m1 grid (saturating at +-6). | |
| 29 | + RNE: ties go to the code with an even last bit (codes 0..7 = grid index). SR: up with probability (y-lo)/(hi-lo).""" | |
| 30 | + g = grid(y.device); s = torch.sign(y); a = y.abs().clamp(max=6.0) | |
| 31 | + i = torch.bucketize(a, g, right=True).clamp(1, 7) - 1 # lo index | |
| 32 | + lo = g[i]; hi = g[(i + 1).clamp(max=7)] | |
| 33 | + if stochastic: | |
| 34 | + p = torch.where(hi > lo, (a - lo) / (hi - lo), torch.zeros_like(a)) | |
| 35 | + r = torch.rand(a.shape, device=a.device, generator=gen) | |
| 36 | + q = torch.where(r < p, hi, lo) | |
| 37 | + else: | |
| 38 | + mid = (lo + hi) / 2 | |
| 39 | + up = (a > mid) | ((a == mid) & (((i + 1) % 2) == 0)) | |
| 40 | + q = torch.where(up, hi, lo) | |
| 41 | + return s * q | |
| 42 | + | |
| 43 | +def e4m3(x): # round to FP8 E4M3 (RNE, finite), as the hardware's UE4M3 scale | |
| 44 | + return x.clamp(max=448.0).to(torch.float8_e4m3fn).to(torch.float32) | |
| 45 | + | |
| 46 | +def _blocks(x, dim, b): | |
| 47 | + """move dim last and split it into blocks of b: returns view (..., n/b, b) and an undo function""" | |
| 48 | + xt = x.transpose(dim, -1) | |
| 49 | + sh = xt.shape | |
| 50 | + assert sh[-1] % b == 0, (sh, b) | |
| 51 | + return xt.reshape(*sh[:-1], sh[-1] // b, b), (lambda y: y.reshape(sh).transpose(dim, -1)) | |
| 52 | + | |
| 53 | +def quant_nv(x, dim, stochastic=False, gen=None, block=16, scale_mode="amax"): | |
| 54 | + """NVFP4: e2m1 values, one UE4M3 scale per `block` elements along `dim`, one FP32 tensor scale. | |
| 55 | + Returns (qs, g): qs = q*blockscale (bf16-exact), g = FP32 tensor scale; x ~= qs * g.""" | |
| 56 | + x = x.float() | |
| 57 | + amax_t = x.abs().max().clamp(min=1e-30) | |
| 58 | + g = amax_t / (6.0 * 448.0) | |
| 59 | + xb, undo = _blocks(x, dim, block) | |
| 60 | + amax_b = xb.abs().amax(-1, keepdim=True) | |
| 61 | + if scale_mode == "amax": | |
| 62 | + sb = e4m3(amax_b / 6.0 / g) | |
| 63 | + sb = torch.where(sb == 0, torch.ones_like(sb), sb) | |
| 64 | + q = round_e2m1(xb / (sb * g), stochastic, gen) | |
| 65 | + else: # "mse": best of 4 clip ratios per block (our candidate d); RNE only | |
| 66 | + best = None | |
| 67 | + for c in (6.0, 5.0, 4.5, 4.0): | |
| 68 | + s = e4m3(amax_b / c / g); s = torch.where(s == 0, torch.ones_like(s), s) | |
| 69 | + qq = round_e2m1(xb / (s * g)) | |
| 70 | + err = ((qq * s * g - xb) ** 2).sum(-1, keepdim=True) | |
| 71 | + if best is None: best = (err, qq, s) | |
| 72 | + else: | |
| 73 | + m = err < best[0] | |
| 74 | + best = (torch.where(m, err, best[0]), torch.where(m, qq, best[1]), torch.where(m, s, best[2])) | |
| 75 | + q, sb = best[1], best[2] | |
| 76 | + return undo(q * sb), g | |
| 77 | + | |
| 78 | +def quant_nv2d(w, stochastic=False, gen=None): | |
| 79 | + """16x16 2D blocks for weights (NVFP4 paper): one UE4M3 scale per 16x16 tile, replicated to 1x16 rows for the | |
| 80 | + tensor core; the same quantized W serves Fprop (contract over in) and Dgrad (contract over out).""" | |
| 81 | + w = w.float(); O, I = w.shape | |
| 82 | + amax_t = w.abs().max().clamp(min=1e-30); g = amax_t / (6.0 * 448.0) | |
| 83 | + t = w.reshape(O // 16, 16, I // 16, 16) | |
| 84 | + amax_b = t.abs().amax(dim=(1, 3), keepdim=True) | |
| 85 | + sb = e4m3(amax_b / 6.0 / g); sb = torch.where(sb == 0, torch.ones_like(sb), sb) | |
| 86 | + q = round_e2m1(t / (sb * g), stochastic, gen) | |
| 87 | + return (q * sb).reshape(O, I), g | |
| 88 | + | |
| 89 | +def quant_mx(x, dim, stochastic=False, gen=None): | |
| 90 | + """MXFP4 (OCP): e2m1, one E8M0 power-of-two scale per 32 along dim, X = 2^(floor(log2 amax) - 2), no tensor scale.""" | |
| 91 | + x = x.float(); xb, undo = _blocks(x, dim, 32) | |
| 92 | + amax_b = xb.abs().amax(-1, keepdim=True).clamp(min=2.0 ** -126) | |
| 93 | + s = torch.exp2(torch.floor(torch.log2(amax_b)) - 2) | |
| 94 | + q = round_e2m1(xb / s, stochastic, gen) | |
| 95 | + return undo(q * s), torch.ones((), device=x.device) | |
| 96 | + | |
| 97 | +def ternary(w, per="tensor"): | |
| 98 | + """BitNet b1.58 absmean ternary: W ~= alpha * round(clip(W/alpha, -1, 1)), values {-1,0,1} are e2m1 codes.""" | |
| 99 | + w = w.float() | |
| 100 | + if per == "tensor": | |
| 101 | + a = w.abs().mean().clamp(min=1e-8) | |
| 102 | + return (w / a).round().clamp(-1, 1) * a, torch.ones((), device=w.device) | |
| 103 | + O, I = w.shape; t = w.reshape(O // 16, 16, I // 16, 16) | |
| 104 | + a = e4m3(t.abs().mean(dim=(1, 3), keepdim=True).clamp(min=1e-8)) | |
| 105 | + return ((t / a).round().clamp(-1, 1) * a).reshape(O, I), torch.ones((), device=w.device) | |
| 106 | + | |
| 107 | +def hadamard(n, dev): | |
| 108 | + h = torch.ones(1, 1) | |
| 109 | + while h.shape[0] < n: h = torch.cat([torch.cat([h, h], 1), torch.cat([h, -h], 1)], 0) | |
| 110 | + return (h / math.sqrt(n)).to(dev) | |
| 111 | + | |
| 112 | +def rotate_tokens(x, R): | |
| 113 | + """apply orthogonal R (b x b) to blocks of b consecutive rows (the token / contraction dim of Wgrad)""" | |
| 114 | + T, C = x.shape; b = R.shape[0] | |
| 115 | + return (R @ x.float().reshape(T // b, b, C)).reshape(T, C) | |
| 116 | + | |
| 117 | +def rel_err(a, b): | |
| 118 | + return ((a - b).float().norm() / b.float().norm().clamp(min=1e-30)).item() |
streams/own-fp4/omma_window.sh
| new file mode 100644 | ||
| @@ -0,0 +1,11 @@ | ||
| 1 | +#!/bin/bash | |
| 2 | +# omma_window.sh (L284): one short chip window for the OMMA probe debugging. Waits its turn (spark-window --wait, first come first served), | |
| 3 | +# runs the proven FP8 control (gpu_qmma_probe_test) then the tiny OMMA probe, saves both outputs, closes the window. | |
| 4 | +set -u | |
| 5 | +O=$HOME/workspace/omega-own-fp4-omma; E=$HOME/workspace/aien-train-own-fp4/evidence/own-fp4/omma-peak; mkdir -p $E | |
| 6 | +export PHYSICS_DIR=$HOME/workspace/physics-bytes-6d7cf0d4 | |
| 7 | +id=$(spark-window open l284-omma --ledger L284 --lease 15 --wait | tail -1) || exit 1 | |
| 8 | +echo "window $id" | |
| 9 | +cd $O | |
| 10 | +spark-window run bash -c "build/gpu_qmma_probe_test > $E/ctl-qmma-probe.txt 2>&1; echo ctl rc=\$? >> $E/ctl-qmma-probe.txt; build/gpu_omma_peak_test --tiny > $E/tiny-boot1.txt 2>&1; echo rc=\$? >> $E/tiny-boot1.txt" | |
| 11 | +spark-window close "$id" |
streams/own-fp4/outlier_study.py
| new file mode 100644 | ||
| @@ -0,0 +1,57 @@ | ||
| 1 | +# outlier_study.py (L284 own-fp4 Part 2b, ORACLE): on real Wgrad operands dumped from the BF16 baseline (X and dY of four | |
| 2 | +# layers at three points of training), how much error does each outlier treatment leave in the weight gradient | |
| 3 | +# dW = dY^T X when both operands are quantized to NVFP4 (1x16 along the token dimension, X nearest, dY stochastic)? | |
| 4 | +# Metric: relative Frobenius error of dW against the FP32 product (the GEMM output, not per-element error). | |
| 5 | +# ~/.venv/bin/python -I outlier_study.py DUMP_DIR OUT.json | |
| 6 | +import glob, json, os, sys, torch | |
| 7 | +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) | |
| 8 | +import fp4sim as Q | |
| 9 | + | |
| 10 | +dev = "cuda" if torch.cuda.is_available() else "cpu" | |
| 11 | +gen = torch.Generator(device=dev); gen.manual_seed(5) | |
| 12 | +sgn = torch.where(torch.rand(16, generator=torch.Generator().manual_seed(11)) < 0.5, -1.0, 1.0).to(dev) | |
| 13 | +H16 = Q.hadamard(16, dev); R16 = H16 * sgn[None, :] | |
| 14 | +sgn128 = torch.where(torch.rand(128, generator=torch.Generator().manual_seed(12)) < 0.5, -1.0, 1.0).to(dev) | |
| 15 | +R128 = Q.hadamard(128, dev) * sgn128[None, :] | |
| 16 | + | |
| 17 | +def diag(x, dy): # exact per-token balancing with power-of-two factors (dW unchanged in exact arithmetic) | |
| 18 | + s = (dy.norm(dim=1) / x.norm(dim=1).clamp(min=1e-30)).clamp(min=1e-30).sqrt() | |
| 19 | + s = torch.exp2(torch.round(torch.log2(s))) | |
| 20 | + return x * s[:, None], dy / s[:, None] | |
| 21 | + | |
| 22 | +T = { | |
| 23 | + "none": lambda x, d: (x, d), | |
| 24 | + "signs_only": lambda x, d: (x * sgn.repeat(x.shape[0] // 16)[:, None], d * sgn.repeat(d.shape[0] // 16)[:, None]), | |
| 25 | + "h16_fixed": lambda x, d: (Q.rotate_tokens(x, H16), Q.rotate_tokens(d, H16)), | |
| 26 | + "rht16": lambda x, d: (Q.rotate_tokens(x, R16), Q.rotate_tokens(d, R16)), | |
| 27 | + "rht128": lambda x, d: (Q.rotate_tokens(x, R128), Q.rotate_tokens(d, R128)), | |
| 28 | + "diag_pow2": diag, | |
| 29 | + "diag+rht16": lambda x, d: T["rht16"](*diag(x, d)), | |
| 30 | +} | |
| 31 | +# cost per operand element on the chip (multiply-adds), for the table | |
| 32 | +COST = {"none": 0, "signs_only": 0, "h16_fixed": 16, "rht16": 16, "rht128": 128, "diag_pow2": 1, "diag+rht16": 17} | |
| 33 | + | |
| 34 | +def run(dump_dir, out): | |
| 35 | + rows = [] | |
| 36 | + for f in sorted(glob.glob(f"{dump_dir}/dump_step*.pt")): | |
| 37 | + step = int(f.split("dump_step")[1].split(".")[0]); d = torch.load(f) | |
| 38 | + for tag in sorted({k.rsplit(".", 1)[0] for k in d}): | |
| 39 | + x = d[tag + ".x"].float().to(dev); dy = d[tag + ".dy"].float().to(dev) | |
| 40 | + ref = dy.T @ x | |
| 41 | + for name, fn in T.items(): | |
| 42 | + for fmt in ("nv", "mx"): | |
| 43 | + xr, dr = fn(x, dy) | |
| 44 | + if fmt == "nv": xq, g1 = Q.quant_nv(xr, 0); dq, g2 = Q.quant_nv(dr, 0, True, gen) | |
| 45 | + else: xq, g1 = Q.quant_mx(xr, 0); dq, g2 = Q.quant_mx(dr, 0, True, gen) | |
| 46 | + dw = (dq.T @ xq) * (g1 * g2) | |
| 47 | + rows.append(dict(step=step, layer=tag, transform=name, fmt=fmt, dw_rel_err=Q.rel_err(dw, ref), | |
| 48 | + x_rel_err=Q.rel_err(xq * g1, xr), dy_rel_err=Q.rel_err(dq * g2, dr), cost_mac_per_elem=COST[name])) | |
| 49 | + json.dump(rows, open(out, "w"), indent=0) | |
| 50 | + # summary: mean dW error per transform and format over all layers and steps | |
| 51 | + summ = {} | |
| 52 | + for r in rows: summ.setdefault((r["fmt"], r["transform"]), []).append(r["dw_rel_err"]) | |
| 53 | + for (fmt, name), v in sorted(summ.items()): | |
| 54 | + print(f"{fmt} {name:12s} mean dW rel err {sum(v)/len(v):.4f} max {max(v):.4f} n {len(v)} cost {COST[name]} MAC/elem") | |
| 55 | + | |
| 56 | +if __name__ == "__main__": | |
| 57 | + run(sys.argv[1], sys.argv[2]) |
streams/own-fp4/prep_data.py
| new file mode 100644 | ||
| @@ -0,0 +1,19 @@ | ||
| 1 | +# prep_data.py (L284 oracle): SearchQA web-snippet text already on this Spark -> uint16 token files. | |
| 2 | +# Arrow files are read as raw bytes (no pyarrow here): every printable UTF-8 run of >= 200 chars is kept as text. | |
| 3 | +# Tokenizer: TinyLlama-1.1B tokenizer.json (32000 ids). Train = searchqa-train.arrow, held-out val = searchqa-validation.arrow. | |
| 4 | +import sys, re, hashlib, numpy as np | |
| 5 | +from tokenizers import Tokenizer | |
| 6 | +D = sys.argv[1]; OUT = sys.argv[2]; TOK = sys.argv[3] | |
| 7 | +tok = Tokenizer.from_file(TOK) | |
| 8 | +run = re.compile(rb'[\x20-\x7e\xc2-\xf4\x80-\xbf\n]{200,}') | |
| 9 | +for split, cap in (("validation", 4_000_000), ("train", 400_000_000)): | |
| 10 | + raw = open(f"{D}/searchqa-{split}.arrow", "rb").read() | |
| 11 | + texts = [m.group(0).decode("utf-8", "ignore") for m in run.finditer(raw)] | |
| 12 | + ids = []; n = 0 | |
| 13 | + for i in range(0, len(texts), 2000): | |
| 14 | + for enc in tok.encode_batch(texts[i:i + 2000], add_special_tokens=False): | |
| 15 | + ids.append(np.asarray([1] + enc.ids, dtype=np.uint16)); n += len(enc.ids) + 1 | |
| 16 | + if n >= cap: break | |
| 17 | + arr = np.concatenate(ids)[:cap] | |
| 18 | + arr.tofile(f"{OUT}/{split}.u16") | |
| 19 | + print(split, "texts", len(texts), "tokens", arr.size, "sha256", hashlib.sha256(arr.tobytes()).hexdigest()[:16], flush=True) |
streams/own-fp4/race.sh
| new file mode 100644 | ||
| @@ -0,0 +1,14 @@ | ||
| 1 | +#!/bin/bash | |
| 2 | +# race.sh (L284 oracle): run recipes one after another on the shared GPU; each waits until a CUDA context can be made | |
| 3 | +# (two 27B servers on this box sometimes leave none). Usage: race.sh "recipe:seed[:extra args] ..." | |
| 4 | +D=$HOME/workspace/aien-train-own-fp4-data; H=$(cd "$(dirname "$0")" && pwd); PY=$HOME/.venv/bin/python | |
| 5 | +mkdir -p $D/runs | |
| 6 | +until grep -q "^train " $D/prep.log 2>/dev/null; do sleep 30; done | |
| 7 | +for item in $1; do | |
| 8 | + IFS=: read -r rec seed extra <<<"$item"; out=$D/runs/$rec-s$seed | |
| 9 | + [ -f $out/result.json ] && { echo "skip $out"; continue; } | |
| 10 | + until timeout 120 $PY -I -c "import torch; torch.ones(1,device='cuda'); assert torch.cuda.mem_get_info()[0] > 6e9" >/dev/null 2>&1; do echo "$(date -u +%H:%MZ) waiting for GPU ($rec)"; sleep 120; done | |
| 11 | + echo "$(date -u +%H:%MZ) start $rec seed $seed" | |
| 12 | + nice -n 10 $PY -I $H/train.py --recipe $rec --seed $seed --out $out $extra > $out.log 2>&1; rc=$? | |
| 13 | + echo "$(date -u +%H:%MZ) end $rec rc=$rc $(tail -1 $out.log | cut -c1-200)" | |
| 14 | +done |
streams/own-fp4/race2.sh
| new file mode 100644 | ||
| @@ -0,0 +1,20 @@ | ||
| 1 | +#!/bin/bash | |
| 2 | +# race2.sh (L284 oracle): like race.sh, but waits for an earlier queue to end and retries a run up to 6 times when the | |
| 3 | +# GPU refuses a context at start-up (cuDevicePrimaryCtxRetain out of memory: other jobs' servers hold the GPU). | |
| 4 | +# Usage: race2.sh WAIT_PID "recipe:seed[:extra] ..." | |
| 5 | +D=$HOME/workspace/aien-train-own-fp4-data; H=$(cd "$(dirname "$0")" && pwd); PY=$HOME/.venv/bin/python | |
| 6 | +mkdir -p $D/runs | |
| 7 | +while kill -0 "$1" 2>/dev/null; do sleep 60; done | |
| 8 | +for item in $2; do | |
| 9 | + IFS=: read -r rec seed extra <<<"$item"; out=$D/runs/$rec-s$seed | |
| 10 | + [ -f $out/result.json ] && { echo "skip $out"; continue; } | |
| 11 | + for try in 1 2 3 4 5 6; do | |
| 12 | + until timeout 120 $PY -I -c "import torch; torch.ones(1,device='cuda'); assert torch.cuda.mem_get_info()[0] > 6e9" >/dev/null 2>&1; do echo "$(date -u +%H:%MZ) waiting for GPU ($rec)"; sleep 120; done | |
| 13 | + echo "$(date -u +%H:%MZ) start $rec seed $seed try $try" | |
| 14 | + nice -n 10 $PY -I $H/train.py --recipe $rec --seed $seed --out $out $extra > $out.log 2>&1; rc=$? | |
| 15 | + echo "$(date -u +%H:%MZ) end $rec rc=$rc $(tail -1 $out.log | cut -c1-200)" | |
| 16 | + [ $rc = 0 ] && break | |
| 17 | + grep -q "cuDevicePrimaryCtxRetain\|out of memory" $out.log || break | |
| 18 | + sleep 120 | |
| 19 | + done | |
| 20 | +done |
streams/own-fp4/race4.sh
| new file mode 100644 | ||
| @@ -0,0 +1,21 @@ | ||
| 1 | +#!/bin/bash | |
| 2 | +# race4.sh (L284 oracle): like race2.sh, but every run holds /tmp/aien-gb10.lock (shared GPU rule, L182 note 2026-10-20) | |
| 3 | +# so locked timing measurements by other jobs stay valid; the lock is released between runs. Usage: race4.sh "recipe:seed[:extra] ..." | |
| 4 | +D=$HOME/workspace/aien-train-own-fp4-data; H=$(cd "$(dirname "$0")" && pwd); PY=$HOME/.venv/bin/python | |
| 5 | +mkdir -p $D/runs | |
| 6 | +for item in $1; do | |
| 7 | + IFS=: read -r rec seed extra <<<"$item"; out=$D/runs/$rec-s$seed | |
| 8 | + [ -f $out/result.json ] && { echo "skip $out"; continue; } | |
| 9 | + for try in 1 2 3 4 5 6; do | |
| 10 | + echo "$(date -u +%H:%MZ) waiting for lock ($rec)" | |
| 11 | + flock -x /tmp/aien-gb10.lock bash -c " | |
| 12 | + until timeout 120 $PY -I -c \"import torch; torch.ones(1,device='cuda'); assert torch.cuda.mem_get_info()[0] > 6e9\" >/dev/null 2>&1; do echo \"\$(date -u +%H:%MZ) waiting for GPU ($rec)\"; sleep 60; done | |
| 13 | + echo \"\$(date -u +%H:%MZ) start $rec seed $seed try $try\" | |
| 14 | + nice -n 10 $PY -I $H/train.py --recipe $rec --seed $seed --out $out $extra > $out.log 2>&1" | |
| 15 | + rc=$? | |
| 16 | + echo "$(date -u +%H:%MZ) end $rec rc=$rc $(tail -1 $out.log | cut -c1-200)" | |
| 17 | + [ $rc = 0 ] && break | |
| 18 | + grep -q "cuDevicePrimaryCtxRetain\|out of memory" $out.log || break | |
| 19 | + sleep 60 | |
| 20 | + done | |
| 21 | +done |
streams/own-fp4/race5.sh
| new file mode 100644 | ||
| @@ -0,0 +1,4 @@ | ||
| 1 | +#!/bin/bash | |
| 2 | +# race5.sh (L284 oracle): second queue; starts when race4's process (pid in $1) is gone, then runs race4.sh on "$2". | |
| 3 | +while kill -0 "$1" 2>/dev/null; do sleep 60; done | |
| 4 | +exec "$(dirname "$0")/race4.sh" "$2" |
streams/own-fp4/race6.sh
| new file mode 100644 | ||
| @@ -0,0 +1,6 @@ | ||
| 1 | +#!/bin/bash | |
| 2 | +# race6.sh (L284 oracle): resume after Drake's 35B stop (22:20Z 2026-10-20). The chip belongs to L306 until the 35B serves on 18091; | |
| 3 | +# wait for that port, then run race4.sh (each run under /tmp/aien-gb10.lock) on the whole remaining queue. Usage: race6.sh "recipe:seed ..." | |
| 4 | +while ! ss -ltn | grep -q ':18091 '; do sleep 60; done | |
| 5 | +echo "$(date -u +%H:%MZ) 18091 is up, starting queue" | |
| 6 | +exec "$(dirname "$0")/race4.sh" "$1" |
streams/own-fp4/test_fp4sim.py
| new file mode 100644 | ||
| @@ -0,0 +1,27 @@ | ||
| 1 | +# test_fp4sim.py (L284): host checks of the oracle quantizers. ~/.venv/bin/python -I test_fp4sim.py | |
| 2 | +import os, sys; sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) | |
| 3 | +import torch, fp4sim as Q | |
| 4 | +y = torch.tensor([0.0, 0.25, 0.75, 1.25, 1.75, 2.5, 3.5, 5.0, 5.9, 7.0, -0.25, -2.5, -9.0]) | |
| 5 | +want = torch.tensor([0.0, 0.0, 1.0, 1.0, 2.0, 2.0, 4.0, 4.0, 6.0, 6.0, 0.0, -2.0, -6.0]) | |
| 6 | +assert torch.equal(Q.round_e2m1(y), want), Q.round_e2m1(y) | |
| 7 | +g = torch.Generator().manual_seed(0); v = torch.full((200000,), 2.6) | |
| 8 | +m = Q.round_e2m1(v, True, g).mean().item(); assert abs(m - 2.6) < 0.01, m # SR unbiased between 2 and 3 | |
| 9 | +x = torch.randn(64, 256) * torch.exp(torch.randn(64, 1)) | |
| 10 | +for dim in (0, 1): | |
| 11 | + qs, gg = Q.quant_nv(x, dim); e = Q.rel_err(qs * gg, x); assert 0.05 < e < 0.2, e | |
| 12 | + qs, gg = Q.quant_mx(x, dim); e2 = Q.rel_err(qs * gg, x); assert 0.05 < e2 < 0.3, e2 | |
| 13 | +w = torch.randn(64, 128); qs, gg = Q.quant_nv2d(w); assert Q.rel_err(qs * gg, w) < 0.2 | |
| 14 | +# bf16-exactness of q * blockscale (the claim the GEMM simulation rests on) | |
| 15 | +qs, gg = Q.quant_nv(x, 1); assert torch.equal(qs.bfloat16().float(), qs) | |
| 16 | +qs, gg = Q.quant_nv2d(w); assert torch.equal(qs.bfloat16().float(), qs) | |
| 17 | +H = Q.hadamard(16, "cpu"); assert torch.allclose(H @ H.T, torch.eye(16), atol=1e-6) | |
| 18 | +t, a = Q.ternary(w); assert set((t / t.abs().max()).unique().tolist()) <= {-1.0, 0.0, 1.0} | |
| 19 | +print("fp4sim host checks PASS") | |
| 20 | +# fast rounding == reference rounding (nearest: bit for bit; stochastic: same support and mean) | |
| 21 | +z = torch.randn(1_000_000) * 3 + torch.randint(-12, 13, (1_000_000,)) * 0.25 | |
| 22 | +assert torch.equal(Q.round_e2m1(z), Q.round_e2m1_ref(z)) | |
| 23 | +for v in (0.3, 1.9, 2.6, 3.99, 4.1, 5.5, 6.0, -1.2): | |
| 24 | + t = torch.full((400000,), v); f = Q.round_e2m1(t, True, torch.Generator().manual_seed(3)); r = Q.round_e2m1_ref(t, True, torch.Generator().manual_seed(4)) | |
| 25 | + assert set(f.unique().tolist()) == set(r.unique().tolist()), (v, f.unique(), r.unique()) | |
| 26 | + assert abs(f.mean().item() - min(abs(v), 6.0) * (1 if v > 0 else -1)) < 0.01, (v, f.mean()) | |
| 27 | +print("fast rounding matches reference PASS") |
streams/own-fp4/train.py
| new file mode 100644 | ||
| @@ -0,0 +1,220 @@ | ||
| 1 | +# train.py (L284 own-fp4, ORACLE ONLY): one small GPT trained under one numerics recipe. Same seed, same tokens, same | |
| 2 | +# schedule for every recipe; only the numbers inside the linear layers change. | |
| 3 | +# ~/.venv/bin/python -I train.py --recipe nvfp4 --out DIR [--steps N] | |
| 4 | +import argparse, json, math, os, sys, time | |
| 5 | +import numpy as np, torch, torch.nn as nn, torch.nn.functional as F | |
| 6 | +sys.path.insert(0, os.path.dirname(os.path.abspath(__file__))) | |
| 7 | +import fp4sim as Q | |
| 8 | +if os.environ.get("FP4SIM_COMPILE", "1") == "1": # fused quantizers: 11x faster; differ from eager on 1 in 25M values at | |
| 9 | + import torch._dynamo # exact rounding ties (fp32 division order), see OWN_FP4.md Part 3 | |
| 10 | + torch._dynamo.config.cache_size_limit = 64 | |
| 11 | + for _n in ("quant_nv", "quant_nv2d", "quant_mx"): setattr(Q, _n, torch.compile(getattr(Q, _n), dynamic=False)) | |
| 12 | + | |
| 13 | +# recipe -> settings. fwd/bwd formats: "bf16" | "nv" (1x16 UE4M3 + FP32 tensor) | "mx" (1x32 E8M0) | |
| 14 | +RECIPES = { | |
| 15 | + "bf16": dict(fmt="bf16"), | |
| 16 | + # NVIDIA's published recipe (arXiv 2509.25149): W 16x16 2D, X and dY 1x16, RNE fwd, SR on dY (Dgrad + Wgrad), | |
| 17 | + # 16x16 random Hadamard (one fixed sign vector) on Wgrad inputs, last ~15% of blocks in BF16, FP32 master. | |
| 18 | + "nvfp4": dict(fmt="nv", w2d=True, sr_dy=True, rot="rht16", hp_last=1), | |
| 19 | + # MXFP4 as the OCP spec quantizes it, no recipe extras (control) | |
| 20 | + "mxfp4": dict(fmt="mx", w2d=False, sr_dy=False, rot="none", hp_last=0), | |
| 21 | + # (a0) 4-bit weights with no master copy at all (updates below half a step are lost): negative control for (a) | |
| 22 | + "w4only": dict(fmt="nv", w2d=True, sr_dy=True, rot="rht16", hp_last=1, master="none"), | |
| 23 | + # (a) error feedback: no FP32 master; stored weight = 4-bit code + 8-bit residual of the last rounding | |
| 24 | + "ef8": dict(fmt="nv", w2d=True, sr_dy=True, rot="rht16", hp_last=1, master="ef8"), | |
| 25 | + "ef8sr": dict(fmt="nv", w2d=True, sr_dy=True, rot="rht16", hp_last=1, master="ef8sr"), | |
| 26 | + # (b) NVFP4 recipe with the Wgrad rotation swapped for a cheaper transform chosen by the outlier study | |
| 27 | + "b_none": dict(fmt="nv", w2d=True, sr_dy=True, rot="none", hp_last=1), | |
| 28 | + "b_h16": dict(fmt="nv", w2d=True, sr_dy=True, rot="h16", hp_last=1), | |
| 29 | + "b_diag": dict(fmt="nv", w2d=True, sr_dy=True, rot="diag", hp_last=1), | |
| 30 | + # (c) ternary weights {-1,0,+1} x scale (BitNet b1.58 absmean, per tensor), NVFP4 activations and gradients | |
| 31 | + "tern": dict(fmt="nv", w2d=True, sr_dy=True, rot="rht16", hp_last=1, ternary="tensor"), | |
| 32 | + "tern16": dict(fmt="nv", w2d=True, sr_dy=True, rot="rht16", hp_last=1, ternary="block"), | |
| 33 | + # (d) literature-inspired: rotate every GEMM's inputs (Quartet-style), per-block MSE-best clip on forward tensors | |
| 34 | + "d_rotmse": dict(fmt="nv", w2d=True, sr_dy=True, rot="rht16", hp_last=1, fwd_mse=True, rot_fwd=True), | |
| 35 | + # all 4-bit, nothing kept in BF16 (ablation of the 15% rule) | |
| 36 | + "nvfp4_all": dict(fmt="nv", w2d=True, sr_dy=True, rot="rht16", hp_last=0), | |
| 37 | +} | |
| 38 | + | |
| 39 | +class Ctx: # numerics state shared by all quantized layers | |
| 40 | + gen = None; R16 = None; H16 = None; RF = None; stats = None; dev = None | |
| 41 | + | |
| 42 | +def qa(x, dim, cfg, sr=False, mse=False): | |
| 43 | + if cfg["fmt"] == "mx": return Q.quant_mx(x, dim, sr, Ctx.gen) | |
| 44 | + return Q.quant_nv(x, dim, sr, Ctx.gen, scale_mode="mse" if mse else "amax") | |
| 45 | + | |
| 46 | +def qw(w, cfg, dim): | |
| 47 | + if cfg.get("ternary"): return Q.ternary(w, "tensor" if cfg["ternary"] == "tensor" else "block") | |
| 48 | + if cfg["w2d"]: return Q.quant_nv2d(w) | |
| 49 | + return qa(w, dim, cfg) | |
| 50 | + | |
| 51 | +def rot_tokens(x, dy, cfg): | |
| 52 | + r = cfg["rot"] | |
| 53 | + if r == "none": return x, dy | |
| 54 | + if r == "diag": # exact per-token balancing: X_t * s_t, dY_t / s_t with s_t = sqrt(|dY_t| / |X_t|) (dW unchanged) | |
| 55 | + s = (dy.float().norm(dim=1) / x.float().norm(dim=1).clamp(min=1e-30)).clamp(min=1e-30).sqrt() | |
| 56 | + s = torch.exp2(torch.round(torch.log2(s))) # power of two: exact on the chip | |
| 57 | + return x.float() * s[:, None], dy.float() / s[:, None] | |
| 58 | + R = Ctx.R16 if r == "rht16" else Ctx.H16 | |
| 59 | + return Q.rotate_tokens(x, R), Q.rotate_tokens(dy, R) | |
| 60 | + | |
| 61 | +def stat(name, a, b): | |
| 62 | + if Ctx.stats is not None: Ctx.stats.setdefault(name, []).append(Q.rel_err(a, b)) | |
| 63 | + | |
| 64 | +class QLinearFn(torch.autograd.Function): | |
| 65 | + @staticmethod | |
| 66 | + def forward(ctx, x, w, cfg, tag): | |
| 67 | + ctx.cfg, ctx.tag = cfg, tag | |
| 68 | + ctx.save_for_backward(x, w) | |
| 69 | + xin, win = x, w | |
| 70 | + if cfg.get("rot_fwd"): # rotate the contraction (in) dim of both operands: X R^T R W^T = X W^T | |
| 71 | + xin = (x.float().reshape(-1, x.shape[-1] // 16, 16) @ Ctx.R16.T).reshape(x.shape) | |
| 72 | + win = (w.float().reshape(w.shape[0], -1, 16) @ Ctx.R16.T).reshape(w.shape) | |
| 73 | + xs, gx = qa(xin, -1, cfg, mse=cfg.get("fwd_mse", False)) | |
| 74 | + if cfg.get("rot_fwd") and not cfg.get("ternary"): ws, gw = Q.quant_nv(win, -1, scale_mode="mse" if cfg.get("fwd_mse") else "amax") | |
| 75 | + else: ws, gw = qw(win, cfg, 1) | |
| 76 | + stat(tag + ".x", xs * gx, xin); stat(tag + ".w", ws * gw, win) | |
| 77 | + y = (xs.bfloat16() @ ws.bfloat16().T).float() * (gx * gw) | |
| 78 | + return y.bfloat16() | |
| 79 | + | |
| 80 | + @staticmethod | |
| 81 | + def backward(ctx, dy): | |
| 82 | + x, w = ctx.saved_tensors; cfg = ctx.cfg | |
| 83 | + dy = dy.reshape(-1, dy.shape[-1]); x2 = x.reshape(-1, x.shape[-1]) | |
| 84 | + # Dgrad: dX = dY W, contraction over out | |
| 85 | + dys, gd = qa(dy, -1, cfg, sr=cfg["sr_dy"]) | |
| 86 | + if cfg.get("ternary") or cfg["w2d"]: ws, gw = qw(w, cfg, 0) | |
| 87 | + else: ws, gw = qa(w, 0, cfg) | |
| 88 | + stat(ctx.tag + ".dy", dys * gd, dy) | |
| 89 | + dx = (dys.bfloat16() @ ws.bfloat16()).float() * (gd * gw) | |
| 90 | + # Wgrad: dW = dY^T X, contraction over tokens (rotated per recipe) | |
| 91 | + xr, dyr = rot_tokens(x2, dy, cfg) | |
| 92 | + xq, g1 = qa(xr, 0, cfg); dq, g2 = qa(dyr, 0, cfg, sr=cfg["sr_dy"]) | |
| 93 | + stat(ctx.tag + ".wg_x", xq * g1, xr); stat(ctx.tag + ".wg_dy", dq * g2, dyr) | |
| 94 | + dw = (dq.bfloat16().T @ xq.bfloat16()).float() * (g1 * g2) | |
| 95 | + return dx.reshape(x.shape).bfloat16(), dw, None, None | |
| 96 | + | |
| 97 | +class Lin(nn.Module): | |
| 98 | + def __init__(self, i, o, cfg, tag): | |
| 99 | + super().__init__(); self.weight = nn.Parameter(torch.randn(o, i) * 0.02); self.cfg = cfg; self.tag = tag | |
| 100 | + def forward(self, x): | |
| 101 | + if self.cfg["fmt"] == "bf16": return F.linear(x.bfloat16(), self.weight.bfloat16()) | |
| 102 | + sh = x.shape; y = QLinearFn.apply(x.reshape(-1, sh[-1]).bfloat16(), self.weight, self.cfg, self.tag) | |
| 103 | + return y.reshape(*sh[:-1], -1) | |
| 104 | + | |
| 105 | +class Block(nn.Module): | |
| 106 | + def __init__(self, d, h, cfg, i): | |
| 107 | + super().__init__(); self.h = h | |
| 108 | + self.n1 = nn.RMSNorm(d); self.n2 = nn.RMSNorm(d) | |
| 109 | + self.qkv = Lin(d, 3 * d, cfg, f"b{i}.qkv"); self.proj = Lin(d, d, cfg, f"b{i}.proj") | |
| 110 | + self.fc1 = Lin(d, 4 * d, cfg, f"b{i}.fc1"); self.fc2 = Lin(4 * d, d, cfg, f"b{i}.fc2") | |
| 111 | + def forward(self, x): | |
| 112 | + B, T, D = x.shape | |
| 113 | + q, k, v = self.qkv(self.n1(x)).split(D, -1) | |
| 114 | + q, k, v = (t.reshape(B, T, self.h, D // self.h).transpose(1, 2) for t in (q, k, v)) | |
| 115 | + a = F.scaled_dot_product_attention(q, k, v, is_causal=True).transpose(1, 2).reshape(B, T, D) | |
| 116 | + x = x + self.proj(a).float() | |
| 117 | + return x + self.fc2(F.gelu(self.fc1(self.n2(x)).float()).bfloat16()).float() | |
| 118 | + | |
| 119 | +class GPT(nn.Module): | |
| 120 | + def __init__(self, V, d, L, h, ctx, cfg): | |
| 121 | + super().__init__() | |
| 122 | + self.emb = nn.Embedding(V, d); self.pos = nn.Parameter(torch.randn(ctx, d) * 0.01) | |
| 123 | + bf = dict(fmt="bf16") | |
| 124 | + self.blocks = nn.ModuleList(Block(d, h, cfg if i < L - cfg.get("hp_last", 0) else bf, i) for i in range(L)) | |
| 125 | + self.nf = nn.RMSNorm(d) | |
| 126 | + nn.init.normal_(self.emb.weight, std=0.02) | |
| 127 | + def forward(self, idx): | |
| 128 | + x = self.emb(idx) + self.pos[: idx.shape[1]] | |
| 129 | + for b in self.blocks: x = b(x) | |
| 130 | + return F.linear(self.nf(x).bfloat16(), self.emb.weight.bfloat16()).float() # tied head, BF16 per recipe | |
| 131 | + | |
| 132 | +def ef_store(model, mode): | |
| 133 | + """master-copy handling after each optimizer step for quantized weights (a0 / a).""" | |
| 134 | + with torch.no_grad(): | |
| 135 | + for m in model.modules(): | |
| 136 | + if isinstance(m, Lin) and m.cfg["fmt"] != "bf16": | |
| 137 | + w = m.weight.data; ws, g = Q.quant_nv2d(w); wq = ws * g | |
| 138 | + if mode == "none": m.weight.data.copy_(wq); continue | |
| 139 | + r = (w - wq); O, I = r.shape; t = r.reshape(O // 16, 16, I // 16, 16) | |
| 140 | + s = torch.exp2(torch.ceil(torch.log2(t.abs().amax(dim=(1, 3), keepdim=True).clamp(min=1e-30) / 448.0))) | |
| 141 | + y = t / s | |
| 142 | + if mode == "ef8sr": # stochastic rounding into E4M3: keeps updates smaller than one residual step on average | |
| 143 | + ulp = torch.exp2(torch.floor(torch.log2(y.abs().clamp(min=2.0 ** -9))).clamp(min=-6) - 3) | |
| 144 | + lo = torch.floor(y / ulp) * ulp | |
| 145 | + yq = lo + ulp * (torch.rand(y.shape, device=y.device, generator=Ctx.gen) < (y - lo) / ulp).float() | |
| 146 | + else: yq = Q.e4m3(y) | |
| 147 | + rq = (yq * s).reshape(O, I) # residual in FP8 E4M3, power-of-two scale per 16x16 tile | |
| 148 | + m.weight.data.copy_(wq + rq) | |
| 149 | + | |
| 150 | +def main(): | |
| 151 | + ap = argparse.ArgumentParser() | |
| 152 | + ap.add_argument("--recipe", required=True); ap.add_argument("--out", required=True) | |
| 153 | + ap.add_argument("--data", default=os.path.expanduser("~/workspace/aien-train-own-fp4-data")) | |
| 154 | + ap.add_argument("--steps", type=int, default=3000); ap.add_argument("--batch", type=int, default=64) | |
| 155 | + ap.add_argument("--ctx", type=int, default=256); ap.add_argument("--d", type=int, default=384) | |
| 156 | + ap.add_argument("--layers", type=int, default=6); ap.add_argument("--heads", type=int, default=6) | |
| 157 | + ap.add_argument("--lr", type=float, default=1.5e-3); ap.add_argument("--eval_every", type=int, default=250) | |
| 158 | + ap.add_argument("--stats_every", type=int, default=500); ap.add_argument("--seed", type=int, default=0) | |
| 159 | + ap.add_argument("--dump_steps", default="") # save Wgrad operands (X, dY) of 4 layers at these steps (outlier study) | |
| 160 | + a = ap.parse_args(); cfg = RECIPES[a.recipe]; cfg.setdefault("master", "fp32") | |
| 161 | + os.makedirs(a.out, exist_ok=True); dev = "cuda"; Ctx.dev = dev | |
| 162 | + torch.manual_seed(a.seed); Ctx.gen = torch.Generator(device=dev); Ctx.gen.manual_seed(a.seed + 7) | |
| 163 | + sgn = torch.where(torch.rand(16, generator=torch.Generator().manual_seed(11)) < 0.5, -1.0, 1.0) | |
| 164 | + Ctx.H16 = Q.hadamard(16, dev); Ctx.R16 = Ctx.H16 * sgn.to(dev)[None, :] # one fixed random sign vector (paper) | |
| 165 | + tr = np.memmap(f"{a.data}/train.u16", dtype=np.uint16, mode="r"); va = np.memmap(f"{a.data}/validation.u16", dtype=np.uint16, mode="r") | |
| 166 | + V = 32000 | |
| 167 | + model = GPT(V, a.d, a.layers, a.heads, a.ctx, cfg).to(dev) | |
| 168 | + nparam = sum(p.numel() for p in model.parameters()) | |
| 169 | + decay = [p for n, p in model.named_parameters() if p.dim() == 2 and "pos" not in n] | |
| 170 | + other = [p for n, p in model.named_parameters() if not (p.dim() == 2 and "pos" not in n)] | |
| 171 | + opt = torch.optim.AdamW([{"params": decay, "weight_decay": 0.1}, {"params": other, "weight_decay": 0.0}], lr=a.lr, betas=(0.9, 0.95), eps=1e-8) | |
| 172 | + if cfg["master"] != "fp32": ef_store(model, cfg["master"]) | |
| 173 | + rng = np.random.default_rng(1234) # identical token order for every recipe | |
| 174 | + starts = rng.integers(0, len(tr) - a.ctx - 1, size=(a.steps, a.batch)) | |
| 175 | + vstarts = np.random.default_rng(99).integers(0, len(va) - a.ctx - 1, size=(100, a.batch)) | |
| 176 | + def batch(arr, st): | |
| 177 | + x = np.stack([arr[s: s + a.ctx + 1] for s in st]).astype(np.int64); t = torch.from_numpy(x).to(dev) | |
| 178 | + return t[:, :-1], t[:, 1:] | |
| 179 | + def evaluate(nb): | |
| 180 | + model.eval(); tot = 0.0 | |
| 181 | + with torch.no_grad(): | |
| 182 | + for i in range(nb): | |
| 183 | + x, y = batch(va, vstarts[i]); tot += F.cross_entropy(model(x).view(-1, V), y.reshape(-1)).item() | |
| 184 | + model.train(); return tot / nb | |
| 185 | + log = open(f"{a.out}/log.jsonl", "w"); t0 = time.time(); warm = 200 | |
| 186 | + meta = dict(recipe=a.recipe, cfg=cfg, params=nparam, args=vars(a), tokens=a.steps * a.batch * a.ctx, label="oracle", | |
| 187 | + torch=torch.__version__, device=torch.cuda.get_device_name(0)) | |
| 188 | + json.dump(meta, open(f"{a.out}/meta.json", "w"), indent=1); print(json.dumps(meta), flush=True) | |
| 189 | + for step in range(a.steps): | |
| 190 | + lr = a.lr * min(1.0, (step + 1) / warm) * (0.1 + 0.9 * 0.5 * (1 + math.cos(math.pi * min(1.0, step / a.steps)))) | |
| 191 | + for gp in opt.param_groups: gp["lr"] = lr | |
| 192 | + Ctx.stats = {} if (a.stats_every and step % a.stats_every == 0 and cfg["fmt"] != "bf16") else None | |
| 193 | + x, y = batch(tr, starts[step]) | |
| 194 | + hooks = []; dumps = {} | |
| 195 | + if a.dump_steps and step in [int(s) for s in a.dump_steps.split(",")]: | |
| 196 | + for m in model.modules(): | |
| 197 | + if isinstance(m, Lin) and m.tag in ("b0.fc1", "b2.qkv", "b3.proj", "b4.fc2"): | |
| 198 | + def fh(mod, inp, out, tag=m.tag): | |
| 199 | + dumps[tag + ".x"] = inp[0].detach().reshape(-1, inp[0].shape[-1])[:4096].bfloat16().cpu() | |
| 200 | + out.register_hook(lambda g, tag=tag: dumps.__setitem__(tag + ".dy", g.detach().reshape(-1, g.shape[-1])[:4096].bfloat16().cpu())) | |
| 201 | + hooks.append(m.register_forward_hook(fh)) | |
| 202 | + loss = F.cross_entropy(model(x).view(-1, V), y.reshape(-1)) | |
| 203 | + opt.zero_grad(set_to_none=True); loss.backward() | |
| 204 | + gn = torch.nn.utils.clip_grad_norm_(model.parameters(), 1.0).item() | |
| 205 | + for h in hooks: h.remove() | |
| 206 | + if dumps: torch.save(dumps, f"{a.out}/dump_step{step}.pt") | |
| 207 | + opt.step() | |
| 208 | + if cfg["master"] != "fp32": ef_store(model, cfg["master"]) | |
| 209 | + rec = dict(step=step, loss=loss.item(), lr=lr, gnorm=gn, t=round(time.time() - t0, 1)) | |
| 210 | + if Ctx.stats: rec["qerr"] = {k: float(np.mean(v)) for k, v in Ctx.stats.items()} | |
| 211 | + if step % a.eval_every == 0 or step == a.steps - 1: rec["val"] = evaluate(20 if step < a.steps - 1 else 100) | |
| 212 | + log.write(json.dumps(rec) + "\n"); log.flush() | |
| 213 | + if step % 100 == 0 or "val" in rec: print(json.dumps({k: v for k, v in rec.items() if k != "qerr"}), flush=True) | |
| 214 | + if not math.isfinite(rec["loss"]): print("DIVERGED"); break | |
| 215 | + if a.recipe.startswith("tern") or a.recipe == "nvfp4": torch.save({k: v.detach().cpu() for k, v in model.state_dict().items()}, f"{a.out}/model.pt") | |
| 216 | + res = dict(recipe=a.recipe, final_val=rec.get("val"), final_train=rec["loss"], seconds=round(time.time() - t0, 1), steps=step + 1, label="oracle") | |
| 217 | + json.dump(res, open(f"{a.out}/result.json", "w")); print("RESULT", json.dumps(res), flush=True) | |
| 218 | + | |
| 219 | +if __name__ == "__main__": | |
| 220 | + main() |
streams/physics-gb10/.gitignore
| new file mode 100644 | ||
| @@ -0,0 +1 @@ | ||
| 1 | +build/ |
streams/physics-gb10/build.sh
| new file mode 100644 | ||
| @@ -0,0 +1,13 @@ | ||
| 1 | +#!/bin/sh | |
| 2 | +# Build gr_info against the pinned physics checkout (omega physics.lock 6d7cf0d4). | |
| 3 | +set -eu | |
| 4 | +here=$(cd "$(dirname "$0")" && pwd) | |
| 5 | +P=${PHYSICS_DIR:-$HOME/workspace/physics-pf-6d7cf0d4} | |
| 6 | +NV=$P/third_party/nvidia-open-580.173.02 | |
| 7 | +out=${OUT_DIR:-$here/build} | |
| 8 | +mkdir -p "$out" | |
| 9 | +cc -std=gnu11 -Wall -Wextra -Werror -D_GNU_SOURCE -O2 \ | |
| 10 | + -I"$P/nvrm" -I"$NV/src/common/sdk/nvidia/inc" -I"$NV/kernel-open/common/inc" \ | |
| 11 | + -I"$NV/kernel-open/nvidia-uvm" -I"$NV/src/nvidia/arch/nvalloc/unix/include" \ | |
| 12 | + "$here/gr_info.c" "$P/nvrm/nvrm.c" -o "$out/gr_info" | |
| 13 | +echo "built $out/gr_info (physics $(git -C "$P" rev-parse --short=8 HEAD))" |
streams/physics-gb10/gr_info.c
| new file mode 100644 | ||
| @@ -0,0 +1,57 @@ | ||
| 1 | +/* gr_info: read-only GB10 inventory through our own path (physics nvrm, open nvidia.ko RM control). | |
| 2 | + * No channel, no allocation, no launch: one RM client, one NV2080_CTRL_CMD_GR_GET_INFO, close. | |
| 3 | + * Index meanings: physics/third_party/nvidia-open-580.173.02/src/common/sdk/nvidia/inc/ctrl/ctrl2080/ctrl2080gr.h. | |
| 4 | + * Build: see build.sh next to this file (PHYSICS_DIR pinned to physics.lock 6d7cf0d4). */ | |
| 5 | +#include "nvrm.h" | |
| 6 | +#include "nvos.h" | |
| 7 | +#include "nv-ioctl.h" | |
| 8 | +#include "nv-ioctl-numbers.h" | |
| 9 | +#include "nv_escape.h" | |
| 10 | +#include "ctrl/ctrl2080/ctrl2080gr.h" | |
| 11 | + | |
| 12 | +#include <stdio.h> | |
| 13 | +#include <string.h> | |
| 14 | +#include <sys/ioctl.h> | |
| 15 | + | |
| 16 | +/* same definition as physics nvrm/nvrm.c:48 and forge/forge_descriptor.c:20 */ | |
| 17 | +#define NV_IOWR(nr, sz) _IOC(_IOC_READ | _IOC_WRITE, NV_IOCTL_MAGIC, (nr), (sz)) | |
| 18 | + | |
| 19 | +#define Q(x) { NV2080_CTRL_GR_INFO_INDEX_##x, #x } | |
| 20 | +static const struct { uint32_t index; const char *name; } want[] = { | |
| 21 | + Q(SM_VERSION), Q(SHADER_PIPE_COUNT), Q(SHADER_PIPE_SUB_COUNT), Q(LITTER_NUM_GPCS), | |
| 22 | + Q(LITTER_NUM_TPC_PER_GPC), Q(LITTER_NUM_SM_PER_TPC), Q(MAX_WARPS_PER_SM), | |
| 23 | + Q(MAX_THREADS_PER_WARP), Q(MAX_SP_PER_SM), Q(GPU_CORE_COUNT), Q(SM_REG_BANK_COUNT), | |
| 24 | + Q(SM_REG_BANK_REG_COUNT), Q(LITTER_NUM_LTCS), Q(LITTER_NUM_LTC_SLICES), | |
| 25 | + Q(LITTER_NUM_SLICES_PER_LTC), Q(LITTER_NUM_FBPS), | |
| 26 | +}; | |
| 27 | +#define N (sizeof want / sizeof want[0]) | |
| 28 | + | |
| 29 | +int main(void) { | |
| 30 | + Nvrm rm; | |
| 31 | + memset(&rm, 0, sizeof rm); | |
| 32 | + if (nvrm_open(&rm)) { fprintf(stderr, "nvrm_open failed\n"); return 1; } | |
| 33 | + NV2080_CTRL_GR_INFO list[N]; | |
| 34 | + memset(list, 0, sizeof list); | |
| 35 | + for (size_t i = 0; i < N; i++) list[i].index = want[i].index; | |
| 36 | + NV2080_CTRL_GR_GET_INFO_PARAMS gp; | |
| 37 | + memset(&gp, 0, sizeof gp); | |
| 38 | + gp.grInfoListSize = N; | |
| 39 | + gp.grInfoList = (NvP64)(uintptr_t)list; | |
| 40 | + NVOS54_PARAMETERS p; | |
| 41 | + memset(&p, 0, sizeof p); | |
| 42 | + p.hClient = rm.root; | |
| 43 | + p.hObject = rm.subdevice; | |
| 44 | + p.cmd = NV2080_CTRL_CMD_GR_GET_INFO; | |
| 45 | + p.params = (NvP64)(uintptr_t)&gp; | |
| 46 | + p.paramsSize = sizeof gp; | |
| 47 | + int rc = ioctl(rm.fd_ctl, NV_IOWR(NV_ESC_RM_CONTROL, sizeof p), &p); | |
| 48 | + if (rc != 0 || p.status != 0) { | |
| 49 | + fprintf(stderr, "GR_GET_INFO rc %d status 0x%x\n", rc, p.status); | |
| 50 | + nvrm_close(&rm); | |
| 51 | + return 1; | |
| 52 | + } | |
| 53 | + printf("compute_class 0x%x\n", rm.compute_class); | |
| 54 | + for (size_t i = 0; i < N; i++) printf("%s %u\n", want[i].name, list[i].data); | |
| 55 | + nvrm_close(&rm); | |
| 56 | + return 0; | |
| 57 | +} |
tests/omegallm/build.sh
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | #!/bin/sh |
| 2 | 2 | # Build ollm (aien-train#52) from native/omegallm/*.om with the pinned seeded omc. |
| 3 | -# Usage: sh tests/omegallm/build.sh [--mutant a|b|c|d|e|g|h|m|f|k|s|p|t|r|x|q|w|u|l|o|v|n|y|z|j|i|smeth|spath|sbig|sjson|sloop|sseed|smid | --variant h5|h7|r0|bx] | |
| 3 | +# Usage: sh tests/omegallm/build.sh [--mutant a|b|c|d|e|g|h|m|f|k|s|p|t|r|x|q|w|u|l|o|v|n|y|z|j|i|kvo|smeth|spath|sbig|sjson|sloop|sseed|smid | --variant h5|h7|r0|bx|kvg] | |
| 4 | 4 | # Env: TARGET (aarch64, the default, gb10, x86linux, x86efi or a64efi), OMC (default |
| 5 | 5 | # ../omega-mv/seed/out/omc beside this clone for aarch64 and gb10, ../omega-mv-x86/seed/out/omc for |
| 6 | 6 | # x86linux, ../omega-efi-ident/seed/out/omc for x86efi, ../omega-mv-a64efi/seed/out/omc for a64efi), OUT (default ../build beside it), CORE (taskset core, |
| @@ -73,6 +73,11 @@ | ||
| 73 | 73 | # LAA = 1, BLK past OGC) for the bank-crossing test. Mutant y (four changed lines) is bx plus OMUTY 0: |
| 74 | 74 | # ostw stages the first bank-B layer for every layer, which the bank-crossing test must catch. (Until |
| 75 | 75 | # the BF16 merge this mutant was called v, OMUTV; v is now BF16's gk.om mutant.) |
| 76 | +# KV-cache decode (tests/omegallm/kv-check.py), both at the bx capacities, the only shapes with bank-B | |
| 77 | +# activation layers (l >= LAA) that fit: variant kvg (six changed lines) is bx plus the guard e993f179 | |
| 78 | +# removed from okvlcp (a bank-B layer makes ofwdi recompute every row: the guarded path); mutant kvo | |
| 79 | +# (five changed lines) is bx plus e993f179 without its bank-B slices (okvlay neither restores nor saves | |
| 80 | +# oak/oau and flips the windows with oaflip as before), the defect the guard hid, which kvcmp must catch. | |
| 76 | 81 | # Variants are made by sed on the concatenated copy only, and the number of changed lines is checked. |
| 77 | 82 | set -eu |
| 78 | 83 | here=$(cd "$(dirname "$0")/../.." && pwd) |
| @@ -93,7 +98,7 @@ OUT=${OUT:-$here/../build} | ||
| 93 | 98 | CORE=${CORE:-6} |
| 94 | 99 | mut= kind= |
| 95 | 100 | if [ $# -ge 1 ]; then |
| 96 | - { [ "$1" = --mutant ] || [ "$1" = --variant ]; } && [ $# -eq 2 ] || { echo "usage: build.sh [--mutant a|b|c|d|e|g|h|m|f|k|s|p|t|r|x|q|w|u|l|o|v|n|y|z|j|i|smeth|spath|sbig|sjson|sloop|sseed|smid | --variant h5|h7|r0|bx]" >&2; exit 2; } | |
| 101 | + { [ "$1" = --mutant ] || [ "$1" = --variant ]; } && [ $# -eq 2 ] || { echo "usage: build.sh [--mutant a|b|c|d|e|g|h|m|f|k|s|p|t|r|x|q|w|u|l|o|v|n|y|z|j|i|kvo|smeth|spath|sbig|sjson|sloop|sseed|smid | --variant h5|h7|r0|bx|kvg]" >&2; exit 2; } | |
| 97 | 102 | kind=$1 mut=$2 |
| 98 | 103 | fi |
| 99 | 104 | got=$(sha256sum "$OMC" | cut -d' ' -f1) |
| @@ -123,7 +128,7 @@ fi | ||
| 123 | 128 | [ "$TARGET" != a64efi ] || cat "$(dirname "$OMC")/../a64efi/efirt.om" |
| 124 | 129 | # shellcheck disable=SC2086 |
| 125 | 130 | [ -z "$pre" ] || cat $pre |
| 126 | - cat "$src/math.om" "$src/data.om" "$src/$pool" "$src/model.om" "$src/adam.om" "$src/ckpt.om" "$src/bpe.om" "$src/cli.om" "$src/$plat" "$post" | |
| 131 | + cat "$src/math.om" "$src/data.om" "$src/$pool" "$src/model.om" "$src/adam.om" "$src/ckpt.om" "$src/bpe.om" "$src/spec.om" "$src/cli.om" "$src/$plat" "$post" | |
| 127 | 132 | [ "$TARGET" = gb10 ] || cat "$src/nogpu.om" |
| 128 | 133 | } > "$OUT/ollm.om" |
| 129 | 134 | if [ "$TARGET" = gb10 ]; then |
| @@ -173,8 +178,10 @@ case "$kind$mut" in | ||
| 173 | 178 | --varianth5) pat='s/^const GCH f64 0\.000001$/const GCH f64 0.00001/;s/^const GCH2 f64 0\.00000025$/const GCH2 f64 0.00001/' want=2 ;; |
| 174 | 179 | --varianth7) pat='s/^const GCH f64 0\.000001$/const GCH f64 0.0000001/;s/^const GCH2 f64 0\.00000025$/const GCH2 f64 0.0000001/' want=2 ;; |
| 175 | 180 | --variantr0) pat='s/^const OKREU ulong 1$/const OKREU ulong 0/' want=1 ;; |
| 181 | + --mutantkvo) pat='s/^const OWC ulong 15833472$/const OWC ulong 8400/;s/^const OGC ulong 15833472$/const OGC ulong 5000/;s/^const OAC ulong 15016192$/const OAC ulong 12344/;s/^okvkv l 0 t0 false$/okvkv l 0 0 false/;s/^okvkv l t0 nr true$/oaflip l true/' want=5 ;; | |
| 182 | + --variantkvg) pat='s/^const OWC ulong 15833472$/const OWC ulong 8400/;s/^const OGC ulong 15833472$/const OGC ulong 5000/;s/^const OAC ulong 15016192$/const OAC ulong 12344/;s/^fn okvlcp to ulong$/fn okvlcp to ulong\nif lt get og 38 get og 5\nret 0\nend/' want=6 ;; | |
| 176 | 183 | --variantbx) pat='s/^const OWC ulong 15833472$/const OWC ulong 8400/;s/^const OGC ulong 15833472$/const OGC ulong 5000/;s/^const OAC ulong 15016192$/const OAC ulong 12344/' want=3 ;; |
| 177 | - *) echo "usage: build.sh [--mutant a|b|c|d|e|g|h|m|f|k|s|p|t|r|x|q|w|u|l|o|v|n|y|z|j|i|smeth|spath|sbig|sjson|sloop|sseed|smid | --variant h5|h7|r0|bx]" >&2; exit 2 ;; | |
| 184 | + *) echo "usage: build.sh [--mutant a|b|c|d|e|g|h|m|f|k|s|p|t|r|x|q|w|u|l|o|v|n|y|z|j|i|kvo|smeth|spath|sbig|sjson|sloop|sseed|smid | --variant h5|h7|r0|bx|kvg]" >&2; exit 2 ;; | |
| 178 | 185 | esac |
| 179 | 186 | if [ -n "$mut" ]; then |
| 180 | 187 | [ "$kind" = --mutant ] && name=ollm-mut-$mut || name=ollm-var-$mut |
tests/omegallm/gpu-disasm.sh
| @@ -33,7 +33,7 @@ src=$here/native/omegallm | ||
| 33 | 33 | g=$src/gpu |
| 34 | 34 | # gk.om calls gb.om's BF16 check hooks and gb.om calls gg.om, so the dump takes the whole gb10 source; |
| 35 | 35 | # gg.om's main becomes ggmain (gpu-dump.om's main runs) and gg.om supplies model.om's ogmask hook. |
| 36 | -cat "$src/math.om" "$src/data.om" "$src/lpool.om" "$src/model.om" "$src/adam.om" "$src/ckpt.om" "$src/bpe.om" "$src/cli.om" "$src/lio.om" | | |
| 36 | +cat "$src/math.om" "$src/data.om" "$src/lpool.om" "$src/model.om" "$src/adam.om" "$src/ckpt.om" "$src/bpe.om" "$src/spec.om" "$src/cli.om" "$src/lio.om" | | |
| 37 | 37 | sed 's/^fn main to int$/fn ocpumain to int/' > "$OUT/gpu-dump.om" |
| 38 | 38 | sed "s/^grset 256 32 64 2 128 2\$/grset $SHAPE/" "$here/tests/omegallm/gpu-dump.om" > "$OUT/gpu-dump-main.om" |
| 39 | 39 | grep -qx "grset $SHAPE" "$OUT/gpu-dump-main.om" || { echo "SHAPE_NOT_SET $SHAPE" >&2; exit 2; } |
tests/omegallm/kv-check.py
| new file mode 100755 | ||
| @@ -0,0 +1,108 @@ | ||
| 1 | +#!/usr/bin/env python3 | |
| 2 | +"""KV-cached decode check for e993f179 (native/omegallm/model.om okvlcp and okvkv), host CPU only. | |
| 3 | + | |
| 4 | +e993f179 removed okvlcp's guard (any bank-B activation layer, l >= LAA, made ofwdi recompute every | |
| 5 | +row) and made okvlay restore and save each bank-B layer's K/V slices (okvkv) instead of flipping the | |
| 6 | +windows with oaflip. This check builds three ollm binaries with tests/omegallm/build.sh, all at the bx | |
| 7 | +capacities (the only shapes with bank-B layers that init accepts; LAA = 1 for 258 8 16 2 32 4): | |
| 8 | + bx the product, at the bx capacities | |
| 9 | + kvg bx plus the removed guard: the guarded path | |
| 10 | + kvo bx plus e993f179 without its bank-B slices (old oaflip, no restore): the control | |
| 11 | +and runs `ollm kvcmp CK N PROMPT MERGES` (ofwdi then olast against ofwd 0 then olast, f64 bits of every | |
| 12 | +logit) on each case. Required per case: | |
| 13 | + bx exit 0, ndiff 0, and the cache was used (some step starts past row 0) | |
| 14 | + kvg exit 0, ndiff 0, every step starts at row 0 (so bank-B layers are present), and the same greedy | |
| 15 | + tokens as bx in both passes; ofwd is the same code in both binaries, so bx's incremental | |
| 16 | + logits are bit-identical to the guarded path's | |
| 17 | + kvo exit 43 with ndiff > 0 (the control must be caught) | |
| 18 | +Last line: KV_CHECK PASS cases=C controls=C caught=C, exit 0; else KV_CHECK FAIL ... and exit 1. | |
| 19 | +Env: OMC and CORE are passed to build.sh (its compiler pin is checked there). | |
| 20 | +""" | |
| 21 | +import os | |
| 22 | +from pathlib import Path | |
| 23 | +import re | |
| 24 | +import struct | |
| 25 | +import subprocess | |
| 26 | +import sys | |
| 27 | +import tempfile | |
| 28 | + | |
| 29 | +root = Path(__file__).resolve().parents[2] | |
| 30 | +build = root / "tests/omegallm/build.sh" | |
| 31 | +SHAPE = ["258", "8", "16", "2", "32", "4", "1"] | |
| 32 | +SEEDS = ["7", "11"] | |
| 33 | +PROMPTS = ["a", "ab"] | |
| 34 | +STEPS = ["6", "12"] | |
| 35 | + | |
| 36 | + | |
| 37 | +def fail(msg): | |
| 38 | + print(f"KV_CHECK FAIL {msg}") | |
| 39 | + sys.exit(1) | |
| 40 | + | |
| 41 | + | |
| 42 | +def merges(path): | |
| 43 | + # a valid OLLM BPE merges file, V = 258 (two merges), as tests/omegallm/ollm_metrics_bench.py writes it | |
| 44 | + payload = struct.pack("<HHHH", ord("t"), ord("h"), ord("i"), ord("n")) | |
| 45 | + h = 14695981039346656037 | |
| 46 | + for b in payload: | |
| 47 | + h = ((h ^ b) * 1099511628211) & 0xFFFFFFFFFFFFFFFF | |
| 48 | + path.write_bytes(struct.pack("<QQQ", 3550332126946413647, 258, h) + payload) | |
| 49 | + | |
| 50 | + | |
| 51 | +def kvcmp(binary, ck, n, prompt, m): | |
| 52 | + p = subprocess.run([str(binary), "kvcmp", str(ck), n, prompt, str(m)], | |
| 53 | + capture_output=True, text=True, timeout=600) | |
| 54 | + ki = [l.split() for l in p.stdout.splitlines() if l.startswith("KI ")] | |
| 55 | + kf = [l.split() for l in p.stdout.splitlines() if l.startswith("KF ")] | |
| 56 | + last = re.findall(r"^KVCMP (\d+) (\d+) (\d+) (\d+)$", p.stdout, re.M) | |
| 57 | + if len(ki) != int(n) or len(kf) != int(n) or len(last) != 1: | |
| 58 | + fail(f"{binary.name} kvcmp {n} {prompt!r}: rc={p.returncode} malformed output {p.stdout[-200:]!r} {p.stderr[-200:]!r}") | |
| 59 | + return {"rc": p.returncode, "ndiff": int(last[0][1]), | |
| 60 | + "t0": [int(r[3]) for r in ki], "ki": [r[4] for r in ki], "kf": [r[3] for r in kf]} | |
| 61 | + | |
| 62 | + | |
| 63 | +with tempfile.TemporaryDirectory(prefix="kv-check-") as tmp: | |
| 64 | + tmp = Path(tmp) | |
| 65 | + env = dict(os.environ, OUT=str(tmp)) | |
| 66 | + bins = {} | |
| 67 | + for name, args, out in [("bx", ["--variant", "bx"], "ollm-var-bx"), | |
| 68 | + ("kvg", ["--variant", "kvg"], "ollm-var-kvg"), | |
| 69 | + ("kvo", ["--mutant", "kvo"], "ollm-mut-kvo")]: | |
| 70 | + p = subprocess.run(["sh", str(build)] + args, env=env, capture_output=True, text=True, timeout=1800) | |
| 71 | + if p.returncode != 0: | |
| 72 | + fail(f"build.sh {' '.join(args)} rc={p.returncode}: {(p.stderr or p.stdout).strip()[-300:]}") | |
| 73 | + bins[name] = tmp / out | |
| 74 | + m = tmp / "m258" | |
| 75 | + merges(m) | |
| 76 | + cases = caught = 0 | |
| 77 | + for seed in SEEDS: | |
| 78 | + ck = tmp / f"ck{seed}" | |
| 79 | + p = subprocess.run([str(bins["bx"]), "init", str(ck)] + SHAPE + [seed, "10", "1000"], | |
| 80 | + capture_output=True, text=True, timeout=600) | |
| 81 | + if p.returncode != 0: | |
| 82 | + fail(f"init seed {seed} rc={p.returncode}") | |
| 83 | + for prompt in PROMPTS: | |
| 84 | + for n in STEPS: | |
| 85 | + case = f"seed={seed} prompt={prompt!r} steps={n}" | |
| 86 | + a = kvcmp(bins["bx"], ck, n, prompt, m) | |
| 87 | + g = kvcmp(bins["kvg"], ck, n, prompt, m) | |
| 88 | + o = kvcmp(bins["kvo"], ck, n, prompt, m) | |
| 89 | + if a["rc"] != 0 or a["ndiff"] != 0: | |
| 90 | + fail(f"{case}: KV-cached decode differs from the full forward: rc={a['rc']} ndiff={a['ndiff']}") | |
| 91 | + if max(a["t0"]) == 0: | |
| 92 | + fail(f"{case}: the cache was never used (every step started at row 0)") | |
| 93 | + if g["rc"] != 0 or g["ndiff"] != 0: | |
| 94 | + fail(f"{case}: guarded path rc={g['rc']} ndiff={g['ndiff']}") | |
| 95 | + if max(g["t0"]) != 0: | |
| 96 | + fail(f"{case}: guarded path reused rows (no bank-B layer at this shape): t0={g['t0']}") | |
| 97 | + if a["ki"] != g["ki"] or a["kf"] != g["kf"]: | |
| 98 | + fail(f"{case}: tokens differ from the guarded path: {a['ki']} {g['ki']}") | |
| 99 | + print(f"ok case {case} ndiff=0 t0={','.join(map(str, a['t0']))} guarded=identical") | |
| 100 | + cases += 1 | |
| 101 | + if o["rc"] == 43 and o["ndiff"] > 0: | |
| 102 | + print(f"ok control kvo {case} caught ndiff={o['ndiff']}") | |
| 103 | + caught += 1 | |
| 104 | + else: | |
| 105 | + print(f"FAIL control kvo {case} ESCAPED rc={o['rc']} ndiff={o['ndiff']}") | |
| 106 | + if caught != cases: | |
| 107 | + fail(f"cases={cases} controls={cases} caught={caught}") | |
| 108 | + print(f"KV_CHECK PASS cases={cases} controls={cases} caught={caught}") |
tests/omegallm/ollm_metrics_bench.py
| new file mode 100755 | ||
| @@ -0,0 +1,686 @@ | ||
| 1 | +#!/usr/bin/env python3 | |
| 2 | +"""One-command OLLM metrics & readiness benchmark suite. | |
| 3 | + | |
| 4 | +Measures and reports all host-verifiable OLLM metrics in structured JSON and a | |
| 5 | +clean Markdown summary table, while explicitly marking unrun hardware slots | |
| 6 | +(GB10 GPU, Aienux/GB20B) as NOT_RUN. | |
| 7 | + | |
| 8 | +Stdlib-only. Zero hardcoded machine paths. Does not touch any GPU. | |
| 9 | +""" | |
| 10 | + | |
| 11 | +from __future__ import annotations | |
| 12 | + | |
| 13 | +import argparse | |
| 14 | +import hashlib | |
| 15 | +import json | |
| 16 | +import os | |
| 17 | +import platform | |
| 18 | +import re | |
| 19 | +import shutil | |
| 20 | +import struct | |
| 21 | +import subprocess | |
| 22 | +import sys | |
| 23 | +import tempfile | |
| 24 | +import time | |
| 25 | +from pathlib import Path | |
| 26 | +from typing import Dict, List, Optional, Tuple | |
| 27 | + | |
| 28 | + | |
| 29 | +REPO_ROOT = Path(__file__).resolve().parents[2] | |
| 30 | +BPE_MAGIC = 3550332126946413647 | |
| 31 | +FNV_OFFSET = 14695981039346656037 | |
| 32 | +FNV_PRIME = 1099511628211 | |
| 33 | + | |
| 34 | + | |
| 35 | +def sha256_file(path: Path) -> str: | |
| 36 | + h = hashlib.sha256() | |
| 37 | + with path.open("rb") as f: | |
| 38 | + for chunk in iter(lambda: f.read(1 << 20), b""): | |
| 39 | + h.update(chunk) | |
| 40 | + return h.hexdigest() | |
| 41 | + | |
| 42 | + | |
| 43 | +def fnv1a64(data: bytes) -> int: | |
| 44 | + h = FNV_OFFSET | |
| 45 | + for b in data: | |
| 46 | + h = ((h ^ b) * FNV_PRIME) & 0xFFFFFFFFFFFFFFFF | |
| 47 | + return h | |
| 48 | + | |
| 49 | + | |
| 50 | +def write_synthetic_merges(path: Path) -> None: | |
| 51 | + """Write a minimal valid OLLM BPE merges file (V=258, 2 merges) for self-contained kvcmp.""" | |
| 52 | + payload = struct.pack("<HHHH", ord("t"), ord("h"), ord("i"), ord("n")) | |
| 53 | + h = fnv1a64(payload) | |
| 54 | + header = struct.pack("<QQQ", BPE_MAGIC, 258, h) | |
| 55 | + path.write_bytes(header + payload) | |
| 56 | + | |
| 57 | + | |
| 58 | +def write_synthetic_tokens(path: Path, n_tokens: int, seed: int = 1) -> None: | |
| 59 | + """Write deterministic u16 byte-range tokens (0..255) for small-model chain checks.""" | |
| 60 | + vals = [] | |
| 61 | + x = seed & 0xFFFFFFFF | |
| 62 | + for i in range(n_tokens): | |
| 63 | + if i % 16 == 0: | |
| 64 | + vals.append(0) | |
| 65 | + else: | |
| 66 | + x = (1664525 * x + 1013904223) & 0xFFFFFFFF | |
| 67 | + vals.append(32 + ((x >> 16) % 95)) | |
| 68 | + path.write_bytes(struct.pack("<" + "H" * len(vals), *vals)) | |
| 69 | + | |
| 70 | + | |
| 71 | +def find_omc(explicit: Optional[str]) -> Path: | |
| 72 | + if explicit: | |
| 73 | + p = Path(explicit).expanduser() | |
| 74 | + if p.is_file(): | |
| 75 | + return p | |
| 76 | + raise FileNotFoundError(f"omc not found at {p}") | |
| 77 | + cand = Path.home() / ".local/bin/omc" | |
| 78 | + if cand.is_file(): | |
| 79 | + return cand | |
| 80 | + found = shutil.which("omc") | |
| 81 | + if found: | |
| 82 | + return Path(found) | |
| 83 | + raise FileNotFoundError("omc not found; pass --omc PATH") | |
| 84 | + | |
| 85 | + | |
| 86 | +def concat_ollm_source(target: str, out_om: Path) -> None: | |
| 87 | + """Concatenate native/omegallm/*.om for darwin-arm64, linux-aarch64, or gb10.""" | |
| 88 | + src = REPO_ROOT / "native/omegallm" | |
| 89 | + core = [ | |
| 90 | + src / "math.om", | |
| 91 | + src / "data.om", | |
| 92 | + src / "lpool.om", | |
| 93 | + src / "model.om", | |
| 94 | + src / "adam.om", | |
| 95 | + src / "ckpt.om", | |
| 96 | + src / "bpe.om", | |
| 97 | + src / "spec.om", | |
| 98 | + src / "cli.om", | |
| 99 | + ] | |
| 100 | + parts: List[str] = [] | |
| 101 | + if target == "darwin-arm64": | |
| 102 | + parts.append("target a64macos\n") | |
| 103 | + files = core + [src / "mio.om", src / "noserve.om", src / "nogpu.om"] | |
| 104 | + elif target == "linux-aarch64": | |
| 105 | + parts.append("om2\n") | |
| 106 | + files = [src / "net/http.om", src / "net/json.om", src / "net/jsonw.om"] + core + [ | |
| 107 | + src / "lio.om", | |
| 108 | + src / "serve.om", | |
| 109 | + src / "nogpu.om", | |
| 110 | + ] | |
| 111 | + elif target == "gb10": | |
| 112 | + parts.append("om2\n") | |
| 113 | + files = [src / "net/http.om", src / "net/json.om", src / "net/jsonw.om"] + core + [ | |
| 114 | + src / "lio.om", | |
| 115 | + src / "serve.om", | |
| 116 | + ] | |
| 117 | + else: | |
| 118 | + raise ValueError(f"Unknown target: {target}") | |
| 119 | + | |
| 120 | + for fp in files: | |
| 121 | + parts.append(fp.read_text(encoding="utf-8")) | |
| 122 | + combined = "".join(parts) | |
| 123 | + | |
| 124 | + if target == "gb10": | |
| 125 | + matches = re.findall(r"^fn main to int$", combined, flags=re.MULTILINE) | |
| 126 | + if len(matches) != 1: | |
| 127 | + raise RuntimeError(f"Expected 1 fn main in gb10 concat, found {len(matches)}") | |
| 128 | + combined = re.sub(r"^fn main to int$", "fn ocpumain to int", combined, count=1, flags=re.MULTILINE) | |
| 129 | + g = src / "gpu" | |
| 130 | + for gp in ( | |
| 131 | + g / "context.om", | |
| 132 | + g / "vector.om", | |
| 133 | + g / "launch.om", | |
| 134 | + g / "batch.om", | |
| 135 | + g / "gk.om", | |
| 136 | + g / "gr.om", | |
| 137 | + g / "gb.om", | |
| 138 | + g / "gg.om", | |
| 139 | + ): | |
| 140 | + combined += gp.read_text(encoding="utf-8") | |
| 141 | + | |
| 142 | + out_om.write_text(combined, encoding="utf-8") | |
| 143 | + | |
| 144 | + | |
| 145 | +def run_cmd(cmd: List[str], timeout: int = 120, cwd: Optional[Path] = None) -> Tuple[int, bytes, bytes, float]: | |
| 146 | + t0 = time.perf_counter() | |
| 147 | + p = subprocess.run(cmd, capture_output=True, timeout=timeout, cwd=str(cwd) if cwd else None) | |
| 148 | + dt_ms = (time.perf_counter() - t0) * 1000.0 | |
| 149 | + return p.returncode, p.stdout, p.stderr, dt_ms | |
| 150 | + | |
| 151 | + | |
| 152 | +def compile_omc_file(omc: Path, src_om: Path, out_bin: Path) -> dict: | |
| 153 | + data = src_om.read_bytes() | |
| 154 | + t0 = time.perf_counter() | |
| 155 | + p = subprocess.run([str(omc)], input=data, capture_output=True, timeout=60) | |
| 156 | + dt_ms = (time.perf_counter() - t0) * 1000.0 | |
| 157 | + if p.returncode != 0: | |
| 158 | + return { | |
| 159 | + "status": "FAIL", | |
| 160 | + "rc": p.returncode, | |
| 161 | + "stderr": p.stderr.decode("utf-8", errors="replace").strip(), | |
| 162 | + "compile_ms": round(dt_ms, 2), | |
| 163 | + } | |
| 164 | + out_bin.write_bytes(p.stdout) | |
| 165 | + out_bin.chmod(0o755) | |
| 166 | + return { | |
| 167 | + "status": "PASS", | |
| 168 | + "rc": 0, | |
| 169 | + "compile_ms": round(dt_ms, 2), | |
| 170 | + "bytes": len(p.stdout), | |
| 171 | + "sha256": sha256_file(out_bin), | |
| 172 | + } | |
| 173 | + | |
| 174 | + | |
| 175 | +def parse_eval_line(out: str) -> Tuple[int, int, int, int]: | |
| 176 | + """Parse `E step W loss_micro bpb_micro`.""" | |
| 177 | + for line in reversed(out.strip().splitlines()): | |
| 178 | + parts = line.split() | |
| 179 | + if len(parts) >= 5 and parts[0] == "E": | |
| 180 | + return int(parts[1]), int(parts[2]), int(parts[3]), int(parts[4]) | |
| 181 | + raise RuntimeError(f"Could not parse E line from: {out!r}") | |
| 182 | + | |
| 183 | + | |
| 184 | +def section_gate_and_build(omc: Path, workdir: Path, explicit_ollm: Optional[str]) -> Tuple[dict, Path]: | |
| 185 | + rc_pr, out_pr, err_pr, ms_pr = run_cmd([sys.executable, str(REPO_ROOT / "tests/omegallm/pre-review.py")], cwd=REPO_ROOT) | |
| 186 | + pre_review = { | |
| 187 | + "status": "PASS" if rc_pr == 0 else "FAIL", | |
| 188 | + "rc": rc_pr, | |
| 189 | + "output": (out_pr.decode("utf-8", errors="replace").strip() or err_pr.decode("utf-8", errors="replace").strip()), | |
| 190 | + "ms": round(ms_pr, 2), | |
| 191 | + } | |
| 192 | + | |
| 193 | + builds: Dict[str, dict] = {} | |
| 194 | + darwin_bin: Optional[Path] = None | |
| 195 | + for target in ("darwin-arm64", "linux-aarch64", "gb10"): | |
| 196 | + om_path = workdir / f"ollm-{target}.om" | |
| 197 | + bin_path = workdir / f"ollm-{target}" | |
| 198 | + concat_ollm_source(target, om_path) | |
| 199 | + res = compile_omc_file(omc, om_path, bin_path) | |
| 200 | + builds[target] = res | |
| 201 | + if target == "darwin-arm64" and res["status"] == "PASS": | |
| 202 | + darwin_bin = bin_path | |
| 203 | + | |
| 204 | + if explicit_ollm: | |
| 205 | + ollm_bin = Path(explicit_ollm).expanduser() | |
| 206 | + if not ollm_bin.is_file(): | |
| 207 | + raise FileNotFoundError(f"--ollm-bin not found: {ollm_bin}") | |
| 208 | + elif darwin_bin is not None: | |
| 209 | + ollm_bin = darwin_bin | |
| 210 | + else: | |
| 211 | + raise RuntimeError("Failed to build darwin-arm64 ollm binary and no --ollm-bin supplied") | |
| 212 | + | |
| 213 | + return {"pre_review": pre_review, "builds": builds}, ollm_bin | |
| 214 | + | |
| 215 | + | |
| 216 | +def section_kv_cache(ollm: Path, workdir: Path) -> dict: | |
| 217 | + ck = workdir / "kv_l8.ck" | |
| 218 | + merges = workdir / "merges_258.bin" | |
| 219 | + write_synthetic_merges(merges) | |
| 220 | + rc, _, err, _ = run_cmd([str(ollm), "init", str(ck), "258", "32", "32", "2", "64", "8", "1", "7", "10", "1000"]) | |
| 221 | + if rc != 0: | |
| 222 | + raise RuntimeError(f"init kv_l8 failed rc={rc}: {err.decode('utf-8', errors='replace')}") | |
| 223 | + | |
| 224 | + n_steps = 20 | |
| 225 | + rc, out, err, wall_ms = run_cmd([str(ollm), "kvcmp", str(ck), str(n_steps), "hello world", str(merges)]) | |
| 226 | + text = out.decode("utf-8", errors="replace") | |
| 227 | + if rc != 0: | |
| 228 | + raise RuntimeError(f"kvcmp failed rc={rc}: {text} {err.decode('utf-8', errors='replace')}") | |
| 229 | + | |
| 230 | + m = re.search(r"KVCMP\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)", text) | |
| 231 | + if not m: | |
| 232 | + raise RuntimeError(f"Failed to parse KVCMP line: {text!r}") | |
| 233 | + n_got, ndiff, inc_ns, full_ns = (int(m.group(i)) for i in range(1, 5)) | |
| 234 | + inc_s = max(inc_ns, 1) / 1e9 | |
| 235 | + full_s = max(full_ns, 1) / 1e9 | |
| 236 | + return { | |
| 237 | + "status": "PASS" if ndiff == 0 else "FAIL", | |
| 238 | + "layers": 8, | |
| 239 | + "vocab": 258, | |
| 240 | + "steps": n_got, | |
| 241 | + "ndiff_logits": ndiff, | |
| 242 | + "inc_ms": round(inc_ns / 1e6, 3), | |
| 243 | + "full_ms": round(full_ns / 1e6, 3), | |
| 244 | + "inc_tok_per_s": round(n_got / inc_s, 1), | |
| 245 | + "full_tok_per_s": round(n_got / full_s, 1), | |
| 246 | + "speedup_x": round(full_ns / max(inc_ns, 1), 2), | |
| 247 | + "wall_ms": round(wall_ms, 2), | |
| 248 | + } | |
| 249 | + | |
| 250 | + | |
| 251 | +def section_chains_and_spclip(ollm: Path, workdir: Path) -> Tuple[dict, dict]: | |
| 252 | + base_ck = workdir / "base_l2.ck" | |
| 253 | + tr_tok = workdir / "chain_train.tok" | |
| 254 | + he_tok = workdir / "chain_held.tok" | |
| 255 | + write_synthetic_tokens(tr_tok, 16 * 12 + 1, seed=11) | |
| 256 | + write_synthetic_tokens(he_tok, 16 * 6 + 1, seed=29) | |
| 257 | + | |
| 258 | + rc, _, err, _ = run_cmd([str(ollm), "init", str(base_ck), "256", "16", "32", "2", "64", "2", "1", "42", "5", "5000"]) | |
| 259 | + if rc != 0: | |
| 260 | + raise RuntimeError(f"init base_l2 failed: {err.decode()}") | |
| 261 | + | |
| 262 | + _, out_b, _, _ = run_cmd([str(ollm), "eval", str(base_ck), str(he_tok), "4"]) | |
| 263 | + _, _, base_loss, _ = parse_eval_line(out_b.decode()) | |
| 264 | + | |
| 265 | + # Grow L2 -> L3 via growpro and verify step-0 bit-identity | |
| 266 | + l3_ck = workdir / "l3.ck" | |
| 267 | + rc, _, err, _ = run_cmd([str(ollm), "growpro", str(base_ck), str(l3_ck), "3", "5", "5000"]) | |
| 268 | + if rc != 0: | |
| 269 | + raise RuntimeError(f"growpro L2->3 failed: {err.decode()}") | |
| 270 | + _, out_g0, _, _ = run_cmd([str(ollm), "eval", str(l3_ck), str(he_tok), "4"]) | |
| 271 | + _, _, g0_loss, _ = parse_eval_line(out_g0.decode()) | |
| 272 | + growpro_delta_unats = g0_loss - base_loss | |
| 273 | + | |
| 274 | + # Train Link 1 (L2->3) and extract P1.sp | |
| 275 | + rc, _, err, _ = run_cmd([str(ollm), "trainf", str(l3_ck), str(tr_tok), "5", "5", "2", "1"]) | |
| 276 | + if rc != 0: | |
| 277 | + raise RuntimeError(f"trainf L2->3 failed: {err.decode()}") | |
| 278 | + p1_sp = workdir / "p1.sp" | |
| 279 | + rc, _, err, _ = run_cmd([str(ollm), "spext", str(base_ck), str(l3_ck), str(p1_sp)]) | |
| 280 | + if rc != 0: | |
| 281 | + raise RuntimeError(f"spext p1 failed: {err.decode()}") | |
| 282 | + | |
| 283 | + prefix_l3 = workdir / "prefix_l3.ck" | |
| 284 | + rc, _, err, _ = run_cmd([str(ollm), "spapp", str(base_ck), str(p1_sp), str(prefix_l3)]) | |
| 285 | + if rc != 0: | |
| 286 | + raise RuntimeError(f"spapp p1 failed: {err.decode()}") | |
| 287 | + | |
| 288 | + # Train 3 distinct Link-2 sibling branches (P2_a, P2_b, P2_c) pinned to base + P1 | |
| 289 | + branch_packs: List[Path] = [] | |
| 290 | + l4_a_ck = workdir / "l4_a.ck" | |
| 291 | + for idx, (tag, lr, steps) in enumerate([("a", "5000", "5"), ("b", "8000", "4"), ("c", "3000", "3")]): | |
| 292 | + ck4 = l4_a_ck if idx == 0 else workdir / f"l4_{tag}.ck" | |
| 293 | + sp4 = workdir / f"p2_{tag}.sp" | |
| 294 | + rc, _, err, _ = run_cmd([str(ollm), "growpro", str(prefix_l3), str(ck4), "4", steps, lr]) | |
| 295 | + if rc != 0: | |
| 296 | + raise RuntimeError(f"growpro L3->4 ({tag}) failed: {err.decode()}") | |
| 297 | + rc, _, err, _ = run_cmd([str(ollm), "trainf", str(ck4), str(tr_tok), steps, steps, "3", "1"]) | |
| 298 | + if rc != 0: | |
| 299 | + raise RuntimeError(f"trainf L3->4 ({tag}) failed: {err.decode()}") | |
| 300 | + rc, _, err, _ = run_cmd([str(ollm), "spext", str(prefix_l3), str(ck4), str(sp4)]) | |
| 301 | + if rc != 0: | |
| 302 | + raise RuntimeError(f"spext p2_{tag} failed: {err.decode()}") | |
| 303 | + branch_packs.append(sp4) | |
| 304 | + | |
| 305 | + p2_a, p2_b, p2_c = branch_packs | |
| 306 | + | |
| 307 | + # Verify spchainapp + spchaineval + spchainsamp bit-identity against l4_a_ck | |
| 308 | + rebuilt_l4 = workdir / "rebuilt_l4.ck" | |
| 309 | + rc, _, err, _ = run_cmd([str(ollm), "spchainapp", str(base_ck), str(rebuilt_l4), "2", str(p1_sp), str(p2_a)]) | |
| 310 | + if rc != 0: | |
| 311 | + raise RuntimeError(f"spchainapp failed: {err.decode()}") | |
| 312 | + | |
| 313 | + _, out_ref_e, _, _ = run_cmd([str(ollm), "eval", str(l4_a_ck), str(he_tok), "4"]) | |
| 314 | + _, out_ch_e, _, _ = run_cmd([str(ollm), "spchaineval", str(base_ck), str(he_tok), "4", "-", "2", str(p1_sp), str(p2_a)]) | |
| 315 | + _, out_rb_e, _, _ = run_cmd([str(ollm), "eval", str(rebuilt_l4), str(he_tok), "4"]) | |
| 316 | + _, _, ref_loss, ref_bpb = parse_eval_line(out_ref_e.decode()) | |
| 317 | + _, _, ch_loss, ch_bpb = parse_eval_line(out_ch_e.decode()) | |
| 318 | + _, _, rb_loss, rb_bpb = parse_eval_line(out_rb_e.decode()) | |
| 319 | + chain_eval_match = (ref_loss == ch_loss == rb_loss) and (ref_bpb == ch_bpb == rb_bpb) | |
| 320 | + | |
| 321 | + rc_s0, samp_ref, _, _ = run_cmd([str(ollm), "sample", str(l4_a_ck), "7", "24", "0", "hi"]) | |
| 322 | + rc_s1, samp_ch, _, _ = run_cmd([str(ollm), "spchainsamp", str(base_ck), "24", "0", "hi", "7", "-", "2", str(p1_sp), str(p2_a)]) | |
| 323 | + chain_samp_match = (rc_s0 == 0 and rc_s1 == 0 and samp_ref == samp_ch) | |
| 324 | + | |
| 325 | + # Negative controls: truncated (60), 1-bit flip (61), swapped order (62), skipped link (62) | |
| 326 | + trunc_sp = workdir / "trunc.sp" | |
| 327 | + trunc_sp.write_bytes(p2_a.read_bytes()[:32]) | |
| 328 | + rc_trunc, _, _, _ = run_cmd([str(ollm), "spchaineval", str(base_ck), str(he_tok), "4", "-", "2", str(p1_sp), str(trunc_sp)]) | |
| 329 | + | |
| 330 | + flip_sp = workdir / "flip.sp" | |
| 331 | + fb = bytearray(p2_a.read_bytes()) | |
| 332 | + fb[-1] ^= 0x01 | |
| 333 | + flip_sp.write_bytes(bytes(fb)) | |
| 334 | + rc_flip, _, _, _ = run_cmd([str(ollm), "spchaineval", str(base_ck), str(he_tok), "4", "-", "2", str(p1_sp), str(flip_sp)]) | |
| 335 | + | |
| 336 | + rc_swap, _, _, _ = run_cmd([str(ollm), "spchaineval", str(base_ck), str(he_tok), "4", "-", "2", str(p2_a), str(p1_sp)]) | |
| 337 | + rc_skip, _, _, _ = run_cmd([str(ollm), "spchaineval", str(base_ck), str(he_tok), "4", "-", "1", str(p2_a)]) | |
| 338 | + | |
| 339 | + neg_ok = (rc_trunc == 60 and rc_flip == 61 and rc_swap == 62 and rc_skip == 62) | |
| 340 | + | |
| 341 | + pack_total_bytes = p1_sp.stat().st_size + p2_a.stat().st_size | |
| 342 | + full_ck_bytes = l4_a_ck.stat().st_size | |
| 343 | + | |
| 344 | + chains_res = { | |
| 345 | + "status": "PASS" if (growpro_delta_unats == 0 and chain_eval_match and chain_samp_match and neg_ok) else "FAIL", | |
| 346 | + "growpro_step0_delta_unats": growpro_delta_unats, | |
| 347 | + "spchaineval_bit_identical": chain_eval_match, | |
| 348 | + "spchainsamp_bit_identical": chain_samp_match, | |
| 349 | + "chain_pack_bytes": pack_total_bytes, | |
| 350 | + "full_ck_bytes": full_ck_bytes, | |
| 351 | + "compression_ratio_x": round(full_ck_bytes / max(pack_total_bytes, 1), 2), | |
| 352 | + "neg_controls": { | |
| 353 | + "truncated_rc": rc_trunc, | |
| 354 | + "bitflip_rc": rc_flip, | |
| 355 | + "swapped_order_rc": rc_swap, | |
| 356 | + "skipped_link_rc": rc_skip, | |
| 357 | + "all_exact": neg_ok, | |
| 358 | + }, | |
| 359 | + } | |
| 360 | + | |
| 361 | + # Multi-Helix DNA Clipping (spclip S=2 and S=3) | |
| 362 | + # 1. Double-helix identity (A, A) == A in MODE=0 and MODE=1 | |
| 363 | + dh_m0_rc, dh_m0, _, _ = run_cmd([ | |
| 364 | + str(ollm), "spclip", str(base_ck), "0", "hi", "24", "0", "7", "-", "2", | |
| 365 | + "500", "2", str(p1_sp), str(p2_a), | |
| 366 | + "500", "2", str(p1_sp), str(p2_a), | |
| 367 | + ]) | |
| 368 | + dh_m1_rc, dh_m1, _, _ = run_cmd([ | |
| 369 | + str(ollm), "spclip", str(base_ck), "1", "hi", "24", "0", "7", "-", "2", | |
| 370 | + "500", "2", str(p1_sp), str(p2_a), | |
| 371 | + "500", "2", str(p1_sp), str(p2_a), | |
| 372 | + ]) | |
| 373 | + double_id_m0 = (dh_m0_rc == 0 and dh_m0 == samp_ch) | |
| 374 | + double_id_m1 = (dh_m1_rc == 0 and dh_m1 == samp_ch) | |
| 375 | + | |
| 376 | + # 2. Triple-helix identity (A, A, A) == A in MODE=0 and MODE=1 | |
| 377 | + th_m0_rc, th_m0, _, _ = run_cmd([ | |
| 378 | + str(ollm), "spclip", str(base_ck), "0", "hi", "24", "0", "7", "-", "3", | |
| 379 | + "334", "2", str(p1_sp), str(p2_a), | |
| 380 | + "333", "2", str(p1_sp), str(p2_a), | |
| 381 | + "333", "2", str(p1_sp), str(p2_a), | |
| 382 | + ]) | |
| 383 | + th_m1_rc, th_m1, _, _ = run_cmd([ | |
| 384 | + str(ollm), "spclip", str(base_ck), "1", "hi", "24", "0", "7", "-", "3", | |
| 385 | + "334", "2", str(p1_sp), str(p2_a), | |
| 386 | + "333", "2", str(p1_sp), str(p2_a), | |
| 387 | + "333", "2", str(p1_sp), str(p2_a), | |
| 388 | + ]) | |
| 389 | + triple_id_m0 = (th_m0_rc == 0 and th_m0 == samp_ch) | |
| 390 | + triple_id_m1 = (th_m1_rc == 0 and th_m1 == samp_ch) | |
| 391 | + | |
| 392 | + # 3. Distinct Triple-Helix (A, B, C) in MODE=1 (entropy-gated), 32 tokens | |
| 393 | + n_clip = 32 | |
| 394 | + d3_rc, d3_out, _, d3_ms = run_cmd([ | |
| 395 | + str(ollm), "spclip", str(base_ck), "1", "hi", str(n_clip), "200", "7", "-", "3", | |
| 396 | + "334", "2", str(p1_sp), str(p2_a), | |
| 397 | + "333", "2", str(p1_sp), str(p2_b), | |
| 398 | + "333", "2", str(p1_sp), str(p2_c), | |
| 399 | + ]) | |
| 400 | + distinct_ok = (d3_rc == 0 and len(d3_out) > 0) | |
| 401 | + | |
| 402 | + spclip_res = { | |
| 403 | + "status": "PASS" if (double_id_m0 and double_id_m1 and triple_id_m0 and triple_id_m1 and distinct_ok) else "FAIL", | |
| 404 | + "double_helix_identity_mode0": double_id_m0, | |
| 405 | + "double_helix_identity_mode1": double_id_m1, | |
| 406 | + "triple_helix_identity_mode0": triple_id_m0, | |
| 407 | + "triple_helix_identity_mode1": triple_id_m1, | |
| 408 | + "distinct_triple_helix_rc": d3_rc, | |
| 409 | + "distinct_triple_helix_bytes": len(d3_out), | |
| 410 | + "distinct_triple_helix_tokens": n_clip, | |
| 411 | + "distinct_triple_helix_ms_per_tok": round(d3_ms / n_clip, 3), | |
| 412 | + } | |
| 413 | + return chains_res, spclip_res | |
| 414 | + | |
| 415 | + | |
| 416 | +def section_om_feedback(omc: Path, workdir: Path) -> dict: | |
| 417 | + # 1. Live 30-error refusal-repair coverage | |
| 418 | + rc_r, out_r, err_r, ms_r = run_cmd([ | |
| 419 | + sys.executable, | |
| 420 | + str(REPO_ROOT / "tools/om_bundle_data.py"), | |
| 421 | + "refusals", | |
| 422 | + "--omc", | |
| 423 | + str(omc), | |
| 424 | + "--include-err24", | |
| 425 | + ]) | |
| 426 | + ref_line = out_r.decode("utf-8", errors="replace").strip() | |
| 427 | + m_ref = re.search(r"Verified (\d+) live omc refusal-repair pairs covering (\d+) error codes", ref_line) | |
| 428 | + pairs_n = int(m_ref.group(1)) if m_ref else 0 | |
| 429 | + codes_n = int(m_ref.group(2)) if m_ref else 0 | |
| 430 | + | |
| 431 | + # 2. Local omc compile latency benchmark (20 runs) | |
| 432 | + bench_json = workdir / "omc_bench.json" | |
| 433 | + rc_b, _, err_b, _ = run_cmd([ | |
| 434 | + sys.executable, | |
| 435 | + str(REPO_ROOT / "tools/om_compile_loop.py"), | |
| 436 | + "bench", | |
| 437 | + "--omc", | |
| 438 | + str(omc), | |
| 439 | + "--runs", | |
| 440 | + "20", | |
| 441 | + "--json-out", | |
| 442 | + str(bench_json), | |
| 443 | + ]) | |
| 444 | + bench_rows = json.loads(bench_json.read_text()) if (rc_b == 0 and bench_json.is_file()) else [] | |
| 445 | + | |
| 446 | + # 3. Deterministic refusal -> repair check | |
| 447 | + broken = "fn main to int\nx = 5\nret x\nend\n" | |
| 448 | + repaired = "fn main to int\nx = int 5\nret x\nend\n" | |
| 449 | + t0 = time.perf_counter() | |
| 450 | + p0 = subprocess.run([str(omc)], input=broken.encode(), capture_output=True, timeout=15) | |
| 451 | + ms0 = (time.perf_counter() - t0) * 1000.0 | |
| 452 | + t1 = time.perf_counter() | |
| 453 | + p1 = subprocess.run([str(omc)], input=repaired.encode(), capture_output=True, timeout=15) | |
| 454 | + ms1 = (time.perf_counter() - t1) * 1000.0 | |
| 455 | + repair_ok = (p0.returncode == 11 and p1.returncode == 0 and len(p1.stdout) > 0) | |
| 456 | + | |
| 457 | + ok = (rc_r == 0 and codes_n == 30 and rc_b == 0 and len(bench_rows) >= 3 and repair_ok) | |
| 458 | + return { | |
| 459 | + "status": "PASS" if ok else "FAIL", | |
| 460 | + "refusal_pairs": pairs_n, | |
| 461 | + "refusal_error_codes": codes_n, | |
| 462 | + "refusal_check_ms": round(ms_r, 1), | |
| 463 | + "omc_bench": bench_rows, | |
| 464 | + "deterministic_refusal_repair": { | |
| 465 | + "attempt0_rc": p0.returncode, | |
| 466 | + "attempt0_stderr": p0.stderr.decode("utf-8", errors="replace").strip(), | |
| 467 | + "attempt0_ms": round(ms0, 3), | |
| 468 | + "attempt1_rc": p1.returncode, | |
| 469 | + "attempt1_bin_bytes": len(p1.stdout), | |
| 470 | + "attempt1_ms": round(ms1, 3), | |
| 471 | + "passed": repair_ok, | |
| 472 | + }, | |
| 473 | + } | |
| 474 | + | |
| 475 | + | |
| 476 | +def section_real_checkpoint( | |
| 477 | + ollm: Path, | |
| 478 | + base_ck: Optional[Path], | |
| 479 | + spec_pack: Optional[Path], | |
| 480 | + held_tok: Optional[Path], | |
| 481 | + merges: Optional[Path], | |
| 482 | +) -> dict: | |
| 483 | + if not (base_ck and spec_pack and held_tok and base_ck.is_file() and spec_pack.is_file() and held_tok.is_file()): | |
| 484 | + return { | |
| 485 | + "status": "NOT_RUN", | |
| 486 | + "reason": "optional real checkpoint/pack/held-tok not supplied or not present", | |
| 487 | + } | |
| 488 | + he_toks = held_tok.stat().st_size // 2 | |
| 489 | + wins = max(1, min(9, (he_toks - 1) // 256)) | |
| 490 | + m_args = [str(merges)] if (merges and merges.is_file()) else [] | |
| 491 | + | |
| 492 | + rc_b, out_b, err_b, ms_b = run_cmd([str(ollm), "eval", str(base_ck), str(held_tok), str(wins)] + m_args, timeout=300) | |
| 493 | + if rc_b != 0: | |
| 494 | + raise RuntimeError(f"real base eval failed rc={rc_b}: {err_b.decode()}") | |
| 495 | + _, _, b_loss, b_bpb = parse_eval_line(out_b.decode()) | |
| 496 | + | |
| 497 | + rc_s, out_s, err_s, ms_s = run_cmd( | |
| 498 | + [str(ollm), "speval", str(base_ck), str(spec_pack), str(held_tok), str(wins)] + m_args, timeout=300 | |
| 499 | + ) | |
| 500 | + if rc_s != 0: | |
| 501 | + raise RuntimeError(f"real speval failed rc={rc_s}: {err_s.decode()}") | |
| 502 | + _, _, s_loss, s_bpb = parse_eval_line(out_s.decode()) | |
| 503 | + | |
| 504 | + delta_pct = ((s_loss - b_loss) / b_loss) * 100.0 | |
| 505 | + ck_bytes = base_ck.stat().st_size | |
| 506 | + sp_bytes = spec_pack.stat().st_size | |
| 507 | + return { | |
| 508 | + "status": "PASS", | |
| 509 | + "base_ck_name": base_ck.name, | |
| 510 | + "spec_pack_name": spec_pack.name, | |
| 511 | + "windows": wins, | |
| 512 | + "base_nats_per_tok": round(b_loss / 1e6, 6), | |
| 513 | + "base_bpb": round(b_bpb / 1e6, 6), | |
| 514 | + "spec_nats_per_tok": round(s_loss / 1e6, 6), | |
| 515 | + "spec_bpb": round(s_bpb / 1e6, 6), | |
| 516 | + "delta_nats_pct": round(delta_pct, 2), | |
| 517 | + "base_ck_bytes": ck_bytes, | |
| 518 | + "spec_pack_bytes": sp_bytes, | |
| 519 | + "pack_compression_vs_base_x": round(ck_bytes / max(sp_bytes, 1), 2), | |
| 520 | + "base_eval_ms": round(ms_b, 1), | |
| 521 | + "spec_eval_ms": round(ms_s, 1), | |
| 522 | + } | |
| 523 | + | |
| 524 | + | |
| 525 | +def render_markdown(rep: dict) -> str: | |
| 526 | + m = rep["metrics"] | |
| 527 | + gb = m["gate_and_build"] | |
| 528 | + kv = m["kv_cache"] | |
| 529 | + ch = m["merkle_chains"] | |
| 530 | + cl = m["multi_helix_spclip"] | |
| 531 | + fb = m["om_feedback_loop"] | |
| 532 | + rc = m["real_checkpoint"] | |
| 533 | + hw = m["hardware_unrun"] | |
| 534 | + | |
| 535 | + b_summary = ", ".join( | |
| 536 | + f"{k}: {v['status']} ({v.get('bytes', 0):,} B)" for k, v in gb["builds"].items() | |
| 537 | + ) | |
| 538 | + small_b = next((r for r in fb["omc_bench"] if r["unit"] == "small_6loc"), None) | |
| 539 | + large_b = next((r for r in fb["omc_bench"] if r["unit"] == "large_564loc"), None) | |
| 540 | + omc_lat = ( | |
| 541 | + f"6 LOC p50={small_b['median_ms']} ms (p95={small_b['p95_ms']} ms); " | |
| 542 | + f"565 LOC p50={large_b['median_ms']} ms (p95={large_b['p95_ms']} ms)" | |
| 543 | + if (small_b and large_b) | |
| 544 | + else "n/a" | |
| 545 | + ) | |
| 546 | + | |
| 547 | + if rc["status"] == "PASS": | |
| 548 | + rc_detail = ( | |
| 549 | + f"{rc['spec_pack_name']} on {rc['base_ck_name']} (W={rc['windows']}): " | |
| 550 | + f"{rc['base_nats_per_tok']} -> {rc['spec_nats_per_tok']} nats/tok " | |
| 551 | + f"({rc['delta_nats_pct']:+.2f}%), bpb {rc['base_bpb']} -> {rc['spec_bpb']}, " | |
| 552 | + f"pack {rc['spec_pack_bytes']:,} B ({rc['pack_compression_vs_base_x']}x smaller than base)" | |
| 553 | + ) | |
| 554 | + else: | |
| 555 | + rc_detail = rc.get("reason", "NOT_RUN") | |
| 556 | + | |
| 557 | + lines = [ | |
| 558 | + f"# OLLM Metrics & Readiness Report (`--mode {rep['mode']}`)", | |
| 559 | + "", | |
| 560 | + f"- **Host:** `{rep['host']['system']} {rep['host']['release']} ({rep['host']['machine']})`", | |
| 561 | + f"- **Git HEAD:** `{rep['git_head']}`", | |
| 562 | + f"- **Total runtime:** `{rep['elapsed_s']} s`", | |
| 563 | + "", | |
| 564 | + "| Category | Status | Key Measured Metrics |", | |
| 565 | + "|---|---|---|", | |
| 566 | + f"| **Pre-review gate** | `{gb['pre_review']['status']}` | `{gb['pre_review']['output']}` |", | |
| 567 | + f"| **Cross-target `omc` build** | `{'PASS' if all(v['status']=='PASS' for v in gb['builds'].values()) else 'FAIL'}` | {b_summary} |", | |
| 568 | + f"| **KV-cache (`kvcmp`, L={kv['layers']})** | `{kv['status']}` | `ndiff={kv['ndiff_logits']}`, `{kv['inc_tok_per_s']} tok/s` vs `{kv['full_tok_per_s']} tok/s` (`{kv['speedup_x']}x` speedup) |", | |
| 569 | + f"| **Merkle chains (`OLLMSP01`, L=2->3->4)** | `{ch['status']}` | `growpro` step-0 `Δ={ch['growpro_step0_delta_unats']} µnats`, `spchaineval/samp` bit-identical, `{ch['compression_ratio_x']}x` smaller, neg controls `rc={ch['neg_controls']['truncated_rc']}/{ch['neg_controls']['bitflip_rc']}/{ch['neg_controls']['swapped_order_rc']}/{ch['neg_controls']['skipped_link_rc']}` |", | |
| 570 | + f"| **Multi-helix `spclip` (`S=2,3`)** | `{cl['status']}` | Double `(A,A)==A` & Triple `(A,A,A)==A` bit-identical (`MODE=0,1`); distinct 3-strand `(A,B,C)` `{cl['distinct_triple_helix_ms_per_tok']} ms/tok` |", | |
| 571 | + f"| **`.om` refusals & `omc` loop** | `{fb['status']}` | `{fb['refusal_pairs']}` pairs covering `{fb['refusal_error_codes']}/30` errors (`1..30`); {omc_lat}; repair `rc=11 -> rc=0` |", | |
| 572 | + f"| **Real checkpoint specialist eval** | `{rc['status']}` | {rc_detail} |", | |
| 573 | + f"| **GB10 GPU (`gtrainb`/`geval`/`v3 L=16` Rung 11)** | `{hw['gb10_gpu_training']['status']}` | {hw['gb10_gpu_training']['reason']} |", | |
| 574 | + f"| **Aienux / GB20B live decode** | `{hw['aienux_gb20b_live_decode']['status']}` | {hw['aienux_gb20b_live_decode']['reason']} |", | |
| 575 | + "", | |
| 576 | + ] | |
| 577 | + return "\n".join(lines) | |
| 578 | + | |
| 579 | + | |
| 580 | +def main() -> int: | |
| 581 | + ap = argparse.ArgumentParser(description="One-command OLLM metrics & readiness benchmark suite.") | |
| 582 | + ap.add_argument("--mode", choices=("quick", "full"), default="quick") | |
| 583 | + ap.add_argument("--json-out", default="") | |
| 584 | + ap.add_argument("--md-out", default="") | |
| 585 | + ap.add_argument("--ollm-bin", default="") | |
| 586 | + ap.add_argument("--omc", default="") | |
| 587 | + ap.add_argument("--base-ck", default="") | |
| 588 | + ap.add_argument("--spec-pack", default="") | |
| 589 | + ap.add_argument("--held-tok", default="") | |
| 590 | + ap.add_argument("--merges", default="") | |
| 591 | + args = ap.parse_args() | |
| 592 | + | |
| 593 | + t_start = time.perf_counter() | |
| 594 | + omc = find_omc(args.omc or None) | |
| 595 | + | |
| 596 | + rc_g, out_g, _, _ = run_cmd(["git", "-C", str(REPO_ROOT), "rev-parse", "--short", "HEAD"]) | |
| 597 | + git_head = out_g.decode().strip() if rc_g == 0 else "unknown" | |
| 598 | + | |
| 599 | + base_ck = Path(args.base_ck).expanduser() if args.base_ck else None | |
| 600 | + spec_pack = Path(args.spec_pack).expanduser() if args.spec_pack else None | |
| 601 | + held_tok = Path(args.held_tok).expanduser() if args.held_tok else None | |
| 602 | + merges = Path(args.merges).expanduser() if args.merges else None | |
| 603 | + | |
| 604 | + if args.mode == "full": | |
| 605 | + home = Path.home() | |
| 606 | + if base_ck is None: | |
| 607 | + cand = home / "workspace/aien-train-macbook/local-mac/omega-v2.ck" | |
| 608 | + if cand.is_file(): | |
| 609 | + base_ck = cand | |
| 610 | + if merges is None: | |
| 611 | + cand = home / "workspace/aien-train-macbook/local-mac/merges4096.bin" | |
| 612 | + if cand.is_file(): | |
| 613 | + merges = cand | |
| 614 | + if held_tok is None: | |
| 615 | + cand = home / "workspace/aien-train-macbook/specialists/data_m/tool-call_held.tok" | |
| 616 | + if cand.is_file(): | |
| 617 | + held_tok = cand | |
| 618 | + if spec_pack is None: | |
| 619 | + cand = home / "workspace/aien-train-macbook/specialists/packs/tool-call_pro.sp" | |
| 620 | + if cand.is_file(): | |
| 621 | + spec_pack = cand | |
| 622 | + | |
| 623 | + with tempfile.TemporaryDirectory(prefix="ollm-metrics-") as tmp: | |
| 624 | + workdir = Path(tmp) | |
| 625 | + gate_build, ollm_bin = section_gate_and_build(omc, workdir, args.ollm_bin or None) | |
| 626 | + kv_res = section_kv_cache(ollm_bin, workdir) | |
| 627 | + chains_res, spclip_res = section_chains_and_spclip(ollm_bin, workdir) | |
| 628 | + fb_res = section_om_feedback(omc, workdir) | |
| 629 | + real_res = section_real_checkpoint(ollm_bin, base_ck, spec_pack, held_tok, merges) | |
| 630 | + | |
| 631 | + elapsed_s = round(time.perf_counter() - t_start, 2) | |
| 632 | + report = { | |
| 633 | + "mode": args.mode, | |
| 634 | + "git_head": git_head, | |
| 635 | + "elapsed_s": elapsed_s, | |
| 636 | + "host": { | |
| 637 | + "system": platform.system(), | |
| 638 | + "release": platform.release(), | |
| 639 | + "machine": platform.machine(), | |
| 640 | + }, | |
| 641 | + "metrics": { | |
| 642 | + "gate_and_build": gate_build, | |
| 643 | + "kv_cache": kv_res, | |
| 644 | + "merkle_chains": chains_res, | |
| 645 | + "multi_helix_spclip": spclip_res, | |
| 646 | + "om_feedback_loop": fb_res, | |
| 647 | + "real_checkpoint": real_res, | |
| 648 | + "hardware_unrun": { | |
| 649 | + "gb10_gpu_training": { | |
| 650 | + "status": "NOT_RUN", | |
| 651 | + "reason": "requires authorized DGX Spark spark-window (no GPU touched)", | |
| 652 | + }, | |
| 653 | + "aienux_gb20b_live_decode": { | |
| 654 | + "status": "NOT_RUN", | |
| 655 | + "reason": "requires authorized Aienux/GB20B hardware window", | |
| 656 | + }, | |
| 657 | + }, | |
| 658 | + }, | |
| 659 | + } | |
| 660 | + | |
| 661 | + md = render_markdown(report) | |
| 662 | + print(md) | |
| 663 | + | |
| 664 | + if args.json_out: | |
| 665 | + p = Path(args.json_out).expanduser() | |
| 666 | + p.parent.mkdir(parents=True, exist_ok=True) | |
| 667 | + p.write_text(json.dumps(report, indent=2) + "\n", encoding="utf-8") | |
| 668 | + if args.md_out: | |
| 669 | + p = Path(args.md_out).expanduser() | |
| 670 | + p.parent.mkdir(parents=True, exist_ok=True) | |
| 671 | + p.write_text(md, encoding="utf-8") | |
| 672 | + | |
| 673 | + all_pass = ( | |
| 674 | + gate_build["pre_review"]["status"] == "PASS" | |
| 675 | + and all(v["status"] == "PASS" for v in gate_build["builds"].values()) | |
| 676 | + and kv_res["status"] == "PASS" | |
| 677 | + and chains_res["status"] == "PASS" | |
| 678 | + and spclip_res["status"] == "PASS" | |
| 679 | + and fb_res["status"] == "PASS" | |
| 680 | + and real_res["status"] in ("PASS", "NOT_RUN") | |
| 681 | + ) | |
| 682 | + return 0 if all_pass else 1 | |
| 683 | + | |
| 684 | + | |
| 685 | +if __name__ == "__main__": | |
| 686 | + sys.exit(main()) |
tests/omegallm/pre-review.py
| @@ -11,6 +11,18 @@ import tempfile | ||
| 11 | 11 | root = Path(sys.argv[1]).resolve() if len(sys.argv) == 2 else Path(__file__).resolve().parents[2] |
| 12 | 12 | referee = root / "tests/omegallm/serve-check.py" |
| 13 | 13 | wrapper = root / "tests/omegallm/serve-check.sh" |
| 14 | + | |
| 15 | + | |
| 16 | +def kv_check(): | |
| 17 | + """e993f179's KV-cached decode (model.om okvlcp, okvkv) against the guarded path: tests/omegallm/kv-check.py.""" | |
| 18 | + p = subprocess.run([sys.executable, str(root / "tests/omegallm/kv-check.py")], capture_output=True, text=True) | |
| 19 | + sys.stdout.write(p.stdout) | |
| 20 | + sys.stderr.write(p.stderr) | |
| 21 | + if p.returncode != 0: | |
| 22 | + print(f"PRE_REVIEW FAIL: tests/omegallm/kv-check.py exit {p.returncode}") | |
| 23 | + sys.exit(1) | |
| 24 | + | |
| 25 | + | |
| 14 | 26 | tree = ast.parse(referee.read_text()) |
| 15 | 27 | samplers = [] |
| 16 | 28 | for node in ast.walk(tree): |
| @@ -25,6 +37,7 @@ configurable = any(isinstance(x, ast.Name) and x.id == "SAMPLE_VERB" for x in sa | ||
| 25 | 37 | if not configurable: |
| 26 | 38 | assert all(isinstance(x, ast.Constant) and x.value == "sample" for x in samplers) |
| 27 | 39 | print("PRE_REVIEW PASS: referee sampler is hardcoded to sample; environment cannot select it") |
| 40 | + kv_check() | |
| 28 | 41 | sys.exit(0) |
| 29 | 42 | assert all(isinstance(x, ast.Name) and x.id == "SAMPLE_VERB" for x in samplers) |
| 30 | 43 | assert any(isinstance(x, ast.Call) and len(x.args) == 2 |
| @@ -62,3 +75,4 @@ with tempfile.TemporaryDirectory(prefix="omega-review-") as tmp: | ||
| 62 | 75 | assert changed, "No sampler assignments found" |
| 63 | 76 | assert selected(mutant, "serve", "gsampb") != "sample", "Control did not expose inherited sampler" |
| 64 | 77 | print(f"PRE_REVIEW PASS: sampler environments={count}, unprotected control caught") |
| 78 | +kv_check() |
tools/om_bundle_data.py
| new file mode 100755 | ||
| @@ -0,0 +1,1012 @@ | ||
| 1 | +#!/usr/bin/env python3 | |
| 2 | +"""Audit local .om corpus, generate live omc refusal-repair pairs (errors 1..30), | |
| 3 | +and build deterministic, zero-leakage OLLM specialist bundle datasets (.tok + .msk). | |
| 4 | + | |
| 5 | +Bundles: | |
| 6 | + - om-core: core .om language, stdlib, compiler, OLLM CPU, omc refusal-repair pairs | |
| 7 | + - gb20b-mmio: GB20B / Blackwell / GPU / CUDApp / GSP / SEC2 / MMIO / VFIO / KFD | |
| 8 | + - aienux-kernel: Aienux OS / ARM64/x86 EFI / boot / MMU / drivers (e.g. rtl8127) | |
| 9 | + - libos-rpc: LibosLog / RPC / HTTP / JSON / wire protocols / IPC / net | |
| 10 | + | |
| 11 | +Zero machine-specific paths are hardcoded; override via CLI flags. | |
| 12 | +""" | |
| 13 | + | |
| 14 | +from __future__ import annotations | |
| 15 | + | |
| 16 | +import argparse | |
| 17 | +import hashlib | |
| 18 | +import json | |
| 19 | +import os | |
| 20 | +import re | |
| 21 | +import struct | |
| 22 | +import subprocess | |
| 23 | +import sys | |
| 24 | +import tempfile | |
| 25 | +from collections import defaultdict | |
| 26 | +from pathlib import Path | |
| 27 | +from typing import Dict, List, Optional, Tuple | |
| 28 | + | |
| 29 | +T_CTX = 256 | |
| 30 | +BUNDLES = ("om-core", "aienux-kernel", "gb20b-mmio", "libos-rpc") | |
| 31 | + | |
| 32 | +# Merkle specialist chain hierarchy (parent -> child links; each child's OLLMSP01 | |
| 33 | +# base_hash cryptographically pins its frozen prefix layers 0..freeze_layers-1). | |
| 34 | +CHAIN_TOPOLOGY = { | |
| 35 | + "om-core": { | |
| 36 | + "link_depth": 1, | |
| 37 | + "parent": "base", | |
| 38 | + "freeze_layers": 8, | |
| 39 | + "target_layers": 10, | |
| 40 | + "strand": "trunk", | |
| 41 | + "role": "Core .om syntax/stdlib/OLLM CPU + live omc refusal-repair pairs (errors 1..30)", | |
| 42 | + }, | |
| 43 | + "aienux-kernel": { | |
| 44 | + "link_depth": 2, | |
| 45 | + "parent": "om-core", | |
| 46 | + "freeze_layers": 10, | |
| 47 | + "target_layers": 12, | |
| 48 | + "strand": "trunk", | |
| 49 | + "role": "Aienux OS, ARM64/x86 UEFI, MMU/boot, bare-metal drivers", | |
| 50 | + }, | |
| 51 | + "gb20b-mmio": { | |
| 52 | + "link_depth": 3, | |
| 53 | + "parent": "aienux-kernel", | |
| 54 | + "freeze_layers": 12, | |
| 55 | + "target_layers": 14, | |
| 56 | + "strand": "branch-a", | |
| 57 | + "role": "GB20B / Blackwell GPU, GSP/SEC2, MMIO, CUDApp, VFIO/KFD", | |
| 58 | + }, | |
| 59 | + "libos-rpc": { | |
| 60 | + "link_depth": 3, | |
| 61 | + "parent": "aienux-kernel", | |
| 62 | + "freeze_layers": 12, | |
| 63 | + "target_layers": 14, | |
| 64 | + "strand": "branch-b", | |
| 65 | + "role": "LibosLog, GSP/host RPC, HTTP/JSON/TLS wire codecs, serve.om, IPC", | |
| 66 | + }, | |
| 67 | +} | |
| 68 | + | |
| 69 | +CANONICAL_REPO_ORDER = ( | |
| 70 | + "omega-mv", | |
| 71 | + "aien-train", | |
| 72 | + "aienux-arm64-model", | |
| 73 | + "aienux-macbook", | |
| 74 | + "omega-arm64efi", | |
| 75 | + "omega-harness", | |
| 76 | + "rtl8127-omega", | |
| 77 | + "interplane-forge", | |
| 78 | + "ipl-hop", | |
| 79 | + "ggml-omega-macbook", | |
| 80 | + "astra-inference-cache", | |
| 81 | + "omega-bridge-macbook", | |
| 82 | + "si-plain-start", | |
| 83 | + "aien-train-voice-ui", | |
| 84 | + "interplane.io", | |
| 85 | +) | |
| 86 | + | |
| 87 | +SKIP_DIRS = {".git", "node_modules", "__pycache__", "target", "build", ".venv"} | |
| 88 | + | |
| 89 | +NEGATIVE_FILE_RE = re.compile( | |
| 90 | + r"(^|/)(err\d{2}_|mistake_|.*-mut\d*\.om$|.*mutants\.om$|.*_bad\.om$|.*_fail\.om$)", | |
| 91 | + re.IGNORECASE, | |
| 92 | +) | |
| 93 | + | |
| 94 | + | |
| 95 | +def sha256_bytes(data: bytes) -> str: | |
| 96 | + return hashlib.sha256(data).hexdigest() | |
| 97 | + | |
| 98 | + | |
| 99 | +def is_negative_control(rel_path: str) -> bool: | |
| 100 | + p = rel_path.lower() | |
| 101 | + if "/controls/" in p and ("mut" in p or "e13" in p or "bad" in p): | |
| 102 | + return True | |
| 103 | + return bool(NEGATIVE_FILE_RE.search(p)) | |
| 104 | + | |
| 105 | + | |
| 106 | +def classify_domain(repo: str, rel_path: str, head_lower: str) -> Tuple[str, str]: | |
| 107 | + """Return (bundle_name, audit_category). | |
| 108 | + | |
| 109 | + audit_category separates OLLM CPU from general om-core for reporting, | |
| 110 | + while bundle_name maps every file to one of the 4 specialist bundles. | |
| 111 | + """ | |
| 112 | + p = rel_path.lower() | |
| 113 | + | |
| 114 | + # 1. GB20B / GPU / MMIO / CUDApp / GSP / SEC2 | |
| 115 | + if ( | |
| 116 | + "/gpu/" in p | |
| 117 | + or any( | |
| 118 | + k in p | |
| 119 | + for k in ( | |
| 120 | + "gb20", | |
| 121 | + "blackwell", | |
| 122 | + "cudapp", | |
| 123 | + "nvrm", | |
| 124 | + "gsp", | |
| 125 | + "sec2", | |
| 126 | + "mmio", | |
| 127 | + "vfio", | |
| 128 | + "kfd", | |
| 129 | + "uvm", | |
| 130 | + ) | |
| 131 | + ) | |
| 132 | + or ( | |
| 133 | + "omegallm/gpu/" in p | |
| 134 | + or any( | |
| 135 | + p.endswith(s) | |
| 136 | + for s in ( | |
| 137 | + "/gg.om", | |
| 138 | + "/gk.om", | |
| 139 | + "/gr.om", | |
| 140 | + "/gb.om", | |
| 141 | + "/launch.om", | |
| 142 | + "/vector.om", | |
| 143 | + "/context.om", | |
| 144 | + "/batch.om", | |
| 145 | + ) | |
| 146 | + ) | |
| 147 | + ) | |
| 148 | + ): | |
| 149 | + return "gb20b-mmio", "gb20b-mmio" | |
| 150 | + | |
| 151 | + if any( | |
| 152 | + w in head_lower | |
| 153 | + for w in ("devctl ", "devcall ", "uvmctl ", "vfioctl ", "mapget ", "mapset ", "kfdctl ") | |
| 154 | + ): | |
| 155 | + return "gb20b-mmio", "gb20b-mmio" | |
| 156 | + | |
| 157 | + # 2. LibosLog / RPC / net / HTTP / JSON / wire / IPC | |
| 158 | + if any( | |
| 159 | + k in p | |
| 160 | + for k in ( | |
| 161 | + "libos", | |
| 162 | + "rpc", | |
| 163 | + "/net/", | |
| 164 | + "http", | |
| 165 | + "json", | |
| 166 | + "wire", | |
| 167 | + "serve.om", | |
| 168 | + "ipc", | |
| 169 | + "proto", | |
| 170 | + "sock", | |
| 171 | + "tls-", | |
| 172 | + ) | |
| 173 | + ): | |
| 174 | + return "libos-rpc", "libos-rpc" | |
| 175 | + | |
| 176 | + # 3. Aienux kernel / EFI / MMU / bare-metal drivers (excluding benchmark kernels/) | |
| 177 | + if ( | |
| 178 | + repo in ("aienux-arm64-model", "aienux-macbook", "omega-arm64efi", "rtl8127-omega") | |
| 179 | + or any(k in p for k in ("aienux", "mmu", "a64efi", "x86efi", "efirt", "pagetable", "rtl8127")) | |
| 180 | + or ("target a64efi" in head_lower or "target x86efi" in head_lower) | |
| 181 | + ): | |
| 182 | + return "aienux-kernel", "aienux-kernel" | |
| 183 | + | |
| 184 | + # 4. OLLM CPU / native trainer (audited separately, bundled into om-core) | |
| 185 | + if ( | |
| 186 | + "omegallm" in p | |
| 187 | + or repo in ("aien-train", "aien-train-macbook", "ggml-omega-macbook", "astra-inference-cache") | |
| 188 | + ): | |
| 189 | + return "om-core", "ollm" | |
| 190 | + | |
| 191 | + return "om-core", "om-core" | |
| 192 | + | |
| 193 | + | |
| 194 | +def scan_workspace(workspace: Path) -> dict: | |
| 195 | + """Scan all .om files under workspace, deduplicating by SHA-256 content hash.""" | |
| 196 | + if not workspace.is_dir(): | |
| 197 | + raise FileNotFoundError(f"Workspace not found: {workspace}") | |
| 198 | + | |
| 199 | + entries = sorted( | |
| 200 | + d for d in os.listdir(workspace) if not d.startswith(".") and (workspace / d).is_dir() | |
| 201 | + ) | |
| 202 | + ordered_repos = [r for r in CANONICAL_REPO_ORDER if r in entries] | |
| 203 | + ordered_repos += [r for r in entries if r not in ordered_repos] | |
| 204 | + | |
| 205 | + by_repo = defaultdict(lambda: {"files": 0, "loc": 0, "bytes": 0}) | |
| 206 | + by_category = defaultdict(lambda: {"files": 0, "loc": 0, "bytes": 0, "clean_files": 0, "clean_loc": 0}) | |
| 207 | + by_bundle = defaultdict(lambda: {"files": 0, "loc": 0, "bytes": 0, "clean_files": 0, "clean_loc": 0}) | |
| 208 | + | |
| 209 | + seen_hashes: Dict[str, dict] = {} | |
| 210 | + total_files = total_loc = total_bytes = dup_files = 0 | |
| 211 | + | |
| 212 | + for repo in ordered_repos: | |
| 213 | + rpath = workspace / repo | |
| 214 | + for dirpath, dirnames, filenames in os.walk(rpath): | |
| 215 | + dirnames[:] = sorted(d for d in dirnames if d not in SKIP_DIRS) | |
| 216 | + for fn in sorted(filenames): | |
| 217 | + if not fn.endswith(".om"): | |
| 218 | + continue | |
| 219 | + fpath = Path(dirpath) / fn | |
| 220 | + if fpath.is_symlink(): | |
| 221 | + continue | |
| 222 | + try: | |
| 223 | + data = fpath.read_bytes() | |
| 224 | + except OSError: | |
| 225 | + continue | |
| 226 | + loc = data.count(b"\n") + (1 if data and not data.endswith(b"\n") else 0) | |
| 227 | + nbytes = len(data) | |
| 228 | + total_files += 1 | |
| 229 | + total_loc += loc | |
| 230 | + total_bytes += nbytes | |
| 231 | + by_repo[repo]["files"] += 1 | |
| 232 | + by_repo[repo]["loc"] += loc | |
| 233 | + by_repo[repo]["bytes"] += nbytes | |
| 234 | + | |
| 235 | + h = sha256_bytes(data) | |
| 236 | + if h in seen_hashes: | |
| 237 | + dup_files += 1 | |
| 238 | + continue | |
| 239 | + | |
| 240 | + rel = str(fpath.relative_to(workspace)) | |
| 241 | + head_lower = data[:8192].decode("latin1").lower() | |
| 242 | + bundle, cat = classify_domain(repo, rel, head_lower) | |
| 243 | + neg = is_negative_control(rel) | |
| 244 | + | |
| 245 | + rec = { | |
| 246 | + "sha256": h, | |
| 247 | + "repo": repo, | |
| 248 | + "rel": rel, | |
| 249 | + "path": str(fpath), | |
| 250 | + "loc": loc, | |
| 251 | + "bytes": nbytes, | |
| 252 | + "bundle": bundle, | |
| 253 | + "category": cat, | |
| 254 | + "negative_control": neg, | |
| 255 | + } | |
| 256 | + seen_hashes[h] = rec | |
| 257 | + | |
| 258 | + by_category[cat]["files"] += 1 | |
| 259 | + by_category[cat]["loc"] += loc | |
| 260 | + by_category[cat]["bytes"] += nbytes | |
| 261 | + by_bundle[bundle]["files"] += 1 | |
| 262 | + by_bundle[bundle]["loc"] += loc | |
| 263 | + by_bundle[bundle]["bytes"] += nbytes | |
| 264 | + if not neg: | |
| 265 | + by_category[cat]["clean_files"] += 1 | |
| 266 | + by_category[cat]["clean_loc"] += loc | |
| 267 | + by_bundle[bundle]["clean_files"] += 1 | |
| 268 | + by_bundle[bundle]["clean_loc"] += loc | |
| 269 | + | |
| 270 | + unique_recs = list(seen_hashes.values()) | |
| 271 | + return { | |
| 272 | + "total_all_dirs": { | |
| 273 | + "files": total_files, | |
| 274 | + "loc": total_loc, | |
| 275 | + "bytes": total_bytes, | |
| 276 | + "duplicates": dup_files, | |
| 277 | + }, | |
| 278 | + "unique_dedup": { | |
| 279 | + "files": len(unique_recs), | |
| 280 | + "loc": sum(r["loc"] for r in unique_recs), | |
| 281 | + "bytes": sum(r["bytes"] for r in unique_recs), | |
| 282 | + "clean_files": sum(1 for r in unique_recs if not r["negative_control"]), | |
| 283 | + "clean_loc": sum(r["loc"] for r in unique_recs if not r["negative_control"]), | |
| 284 | + }, | |
| 285 | + "by_repo": dict(sorted(by_repo.items(), key=lambda kv: -kv[1]["loc"])), | |
| 286 | + "by_category": dict(by_category), | |
| 287 | + "by_bundle": dict(by_bundle), | |
| 288 | + "records": unique_recs, | |
| 289 | + } | |
| 290 | + | |
| 291 | + | |
| 292 | +def refusal_specs(include_err24: bool = False) -> List[dict]: | |
| 293 | + """Controlled defective/repaired .om pairs spanning omc error codes 1..30 | |
| 294 | + plus common out-of-distribution mistakes (infix, C calls, comments, etc.). | |
| 295 | + """ | |
| 296 | + specs: List[dict] = [ | |
| 297 | + { | |
| 298 | + "id": "err01_stdin_dir", | |
| 299 | + "code": 1, | |
| 300 | + "kind": "io", | |
| 301 | + "desc": "stdin read failed (directory passed as stdin)", | |
| 302 | + "bad": "fn main to int\nret 0\nend\n", | |
| 303 | + "good": "fn main to int\nret 0\nend\n", | |
| 304 | + "trigger": "stdin_dir", | |
| 305 | + }, | |
| 306 | + { | |
| 307 | + "id": "err02_stdout_ro", | |
| 308 | + "code": 2, | |
| 309 | + "kind": "io", | |
| 310 | + "desc": "stdout write failed (read-only stdout descriptor)", | |
| 311 | + "bad": "fn main to int\nret 0\nend\n", | |
| 312 | + "good": "fn main to int\nret 0\nend\n", | |
| 313 | + "trigger": "stdout_ro", | |
| 314 | + }, | |
| 315 | + { | |
| 316 | + "id": "err03_unknown_name", | |
| 317 | + "code": 3, | |
| 318 | + "kind": "source", | |
| 319 | + "desc": "unknown variable name", | |
| 320 | + "bad": "fn main to int\nret foo\nend\n", | |
| 321 | + "good": "fn main to int\nfoo = int 0\nret foo\nend\n", | |
| 322 | + }, | |
| 323 | + { | |
| 324 | + "id": "err03_char_literal", | |
| 325 | + "code": 3, | |
| 326 | + "kind": "source", | |
| 327 | + "desc": "C char literal instead of uchar byte value", | |
| 328 | + "bad": "fn main to int\nc = 'A'\nret int c\nend\n", | |
| 329 | + "good": "fn main to int\nc = uchar 65\nret int c\nend\n", | |
| 330 | + }, | |
| 331 | + { | |
| 332 | + "id": "err03_rotr_without_om2", | |
| 333 | + "code": 3, | |
| 334 | + "kind": "source", | |
| 335 | + "desc": "rotr used without om2 header", | |
| 336 | + "bad": "fn main to int\nx = rotr uint 1 1\nret int x\nend\n", | |
| 337 | + "good": "om2\nfn main to int\nx = rotr uint 1 1\nret int x\nend\n", | |
| 338 | + }, | |
| 339 | + { | |
| 340 | + "id": "err04_line_ends_early", | |
| 341 | + "code": 4, | |
| 342 | + "kind": "source", | |
| 343 | + "desc": "missing operand in prefix add", | |
| 344 | + "bad": "fn main to int\nx = add int 1\nret x\nend\n", | |
| 345 | + "good": "fn main to int\nx = add int 1 2\nret x\nend\n", | |
| 346 | + }, | |
| 347 | + { | |
| 348 | + "id": "err05_extra_words", | |
| 349 | + "code": 5, | |
| 350 | + "kind": "source", | |
| 351 | + "desc": "extra trailing token on line", | |
| 352 | + "bad": "fn main to int\nx = int 1 2\nret x\nend\n", | |
| 353 | + "good": "fn main to int\nx = int 1\nret x\nend\n", | |
| 354 | + }, | |
| 355 | + { | |
| 356 | + "id": "err05_infix_plus", | |
| 357 | + "code": 5, | |
| 358 | + "kind": "source", | |
| 359 | + "desc": "infix x + 1 instead of prefix add x 1", | |
| 360 | + "bad": "fn main to int\nx = int 1\ny = x + 1\nret y\nend\n", | |
| 361 | + "good": "fn main to int\nx = int 1\ny = add x 1\nret y\nend\n", | |
| 362 | + }, | |
| 363 | + { | |
| 364 | + "id": "err05_else_if", | |
| 365 | + "code": 5, | |
| 366 | + "kind": "source", | |
| 367 | + "desc": "else if on one line instead of nested if inside else", | |
| 368 | + "bad": "fn main to int\nx = int 1\nif eq x 0\nret 0\nelse if eq x 1\nret 1\nend\nret 2\nend\n", | |
| 369 | + "good": "fn main to int\nx = int 1\nif eq x 0\nret 0\nelse\nif eq x 1\nret 1\nend\nend\nret 2\nend\n", | |
| 370 | + }, | |
| 371 | + { | |
| 372 | + "id": "err06_semicolon", | |
| 373 | + "code": 6, | |
| 374 | + "kind": "source", | |
| 375 | + "desc": "trailing semicolon on number literal", | |
| 376 | + "bad": "fn main to int\nx = int 1;\nret x\nend\n", | |
| 377 | + "good": "fn main to int\nx = int 1\nret x\nend\n", | |
| 378 | + }, | |
| 379 | + { | |
| 380 | + "id": "err06_upper_hex", | |
| 381 | + "code": 6, | |
| 382 | + "kind": "source", | |
| 383 | + "desc": "uppercase hex literal in om2", | |
| 384 | + "bad": "om2\nfn main to int\nx = uint 0xFF\nret int x\nend\n", | |
| 385 | + "good": "om2\nfn main to int\nx = uint 0xff\nret int x\nend\n", | |
| 386 | + }, | |
| 387 | + { | |
| 388 | + "id": "err07_type_mismatch", | |
| 389 | + "code": 7, | |
| 390 | + "kind": "source", | |
| 391 | + "desc": "implicit int + ulong mismatch without explicit cast", | |
| 392 | + "bad": "fn main to int\na = int 1\nb = ulong 2\nret add a b\nend\n", | |
| 393 | + "good": "fn main to int\na = int 1\nb = ulong 2\nret add a int b\nend\n", | |
| 394 | + }, | |
| 395 | + { | |
| 396 | + "id": "err07_value_as_stmt", | |
| 397 | + "code": 7, | |
| 398 | + "kind": "source", | |
| 399 | + "desc": "non-void function called as bare statement", | |
| 400 | + "bad": "fn f x int to int\nret add x 1\nend\nfn main to int\nf 1\nret 0\nend\n", | |
| 401 | + "good": "fn f x int to int\nret add x 1\nend\nfn main to int\nv = f 1\nret v\nend\n", | |
| 402 | + }, | |
| 403 | + { | |
| 404 | + "id": "err08_out_of_range", | |
| 405 | + "code": 8, | |
| 406 | + "kind": "source", | |
| 407 | + "desc": "uchar literal exceeds 255", | |
| 408 | + "bad": "fn main to int\nx = uchar 300\nret int x\nend\n", | |
| 409 | + "good": "fn main to int\nx = uchar 255\nret int x\nend\n", | |
| 410 | + }, | |
| 411 | + { | |
| 412 | + "id": "err08_bound_zero", | |
| 413 | + "code": 8, | |
| 414 | + "kind": "source", | |
| 415 | + "desc": "while loop bound 0 is out of range", | |
| 416 | + "bad": "fn main to int\nwhile false bound 0\nend\nret 0\nend\n", | |
| 417 | + "good": "fn main to int\nwhile false bound 1\nend\nret 0\nend\n", | |
| 418 | + }, | |
| 419 | + { | |
| 420 | + "id": "err09_free_disallowed", | |
| 421 | + "code": 9, | |
| 422 | + "kind": "source", | |
| 423 | + "desc": "free is refused (no heap in Omega)", | |
| 424 | + "bad": "fn main to int\na = new uchar 4 0\nfree a\nret 0\nend\n", | |
| 425 | + "good": "fn main to int\na = new uchar 4 0\nret int get a 0\nend\n", | |
| 426 | + }, | |
| 427 | + { | |
| 428 | + "id": "err09_main_params", | |
| 429 | + "code": 9, | |
| 430 | + "kind": "source", | |
| 431 | + "desc": "fn main cannot take parameters (use argcnt/argread)", | |
| 432 | + "bad": "fn main argc int to int\nret argc\nend\n", | |
| 433 | + "good": "fn main to int\nn = argcnt\nret int n\nend\n", | |
| 434 | + }, | |
| 435 | + { | |
| 436 | + "id": "err10_duplicate_fn", | |
| 437 | + "code": 10, | |
| 438 | + "kind": "source", | |
| 439 | + "desc": "duplicate function name", | |
| 440 | + "bad": "fn main to int\nret 0\nend\nfn main to int\nret 1\nend\n", | |
| 441 | + "good": "fn helper to int\nret 1\nend\nfn main to int\nret helper\nend\n", | |
| 442 | + }, | |
| 443 | + { | |
| 444 | + "id": "err11_ambiguous_bare_number", | |
| 445 | + "code": 11, | |
| 446 | + "kind": "source", | |
| 447 | + "desc": "bare untyped integer literal on new variable", | |
| 448 | + "bad": "fn main to int\nx = 5\nret x\nend\n", | |
| 449 | + "good": "fn main to int\nx = int 5\nret x\nend\n", | |
| 450 | + }, | |
| 451 | + { | |
| 452 | + "id": "err12_register_pool", | |
| 453 | + "code": 12, | |
| 454 | + "kind": "source", | |
| 455 | + "desc": "more than 16 live registers in one function", | |
| 456 | + "bad": "fn main to int\n" + "".join(f"v{i} = int {i}\n" for i in range(18)) + "ret v0\nend\n", | |
| 457 | + "good": "fn main to int\ns = int 0\nfor i int 18\ns = add s i\nend\nret s\nend\n", | |
| 458 | + }, | |
| 459 | + { | |
| 460 | + "id": "err13_name_too_long", |
The diff is too large to show in full here; it was cut.