Realm

tu_nlp_byte_gru — Byte × GRU

Source-owned OA v0.12.0 SDK tutorial. Recorded results qualify the named device and driver.

Experimental

The byte-tokenizer × GRU cell of the — same 576-character corpus, same 300-step recipe and captured training lifecycle. This entry selects the tokenizer and model shown below. See for the full walkthrough.

This cell

Tokenizerthe 256-token packed-U8 byte vocabulary (ByteSampler) — one token per source byte
ModelByteEmbedding(32) → GRU(64) → ByteHead(256)
Parameters43,648
OptimizerAdamW(lr=0.01) — the canonical recipe

The loop is a prepare/record pair per step — GradientTape → cross_entropy → backward → AdamW — driven by oa::ml::ItTraining, so the whole run is one captured GPU program replayed 299 times (19 nodes for this model).

Measured — Surface Laptop 5 (ADL GT2)

Byte × GRU training loss

Canonical 300-step training loss, recorded by this tutorial.

Loss init→finalAccuracyProgram nodesWall ms/stepToken/s
5.618→0.17892.7%1915.0867.9K

Reference generation on the default recipe (asserted by the tutorial):

1prompt: "to be"
2generated: "to be that is the question whether tis nobler in the mind to suffer the slings and ar"
3

Run

cargo run --release -p sdk --example tu_nlp_byte_gru

Regenerate the training-loss image from the repository root:

cargo run --release -p sdk --example tu_nlp_byte_gru -- --plot sdk/rs/tutorials/ml/nlp/tu_nlp_byte_gru/asset/training-curve.png

On the default recipe the tutorial self-tests: loss regime, accuracy floor, exact reference generation, and .oam checkpoint round-trip.

Terminal output

Recorded canonical 300-step run on Intel Iris Xe (ADL GT2), Mesa 26.2.7. Startup logs, intermediate progress updates and the plot-save path are omitted. Timings vary by run; these are not new benchmark baselines.

╔══════════════════════════════════════════════════════════════════╗
║ OA Tutorial — Byte GRU · all-position LM (autograd) ║
╚══════════════════════════════════════════════════════════════════╝
tokenizer: raw bytes · vocab=256
Task: dense next-byte prediction at every position
Model: ByteEmbedding(32) → GRU(64) → ByteHead(256)
params: 43648 Optimizer: AdamW(lr=0.01)
300/300 |██████████| 4.87s · 16.24 ms/step · 3.94K sample/s · 63.04K byte token/s · 63.04K byte/s · loss: 0.1783
Summary:
loss: initial 5.618298 · final 0.178275 · mean 0.503147
Wall: 16.24 ms/step · 3.94K sample/s · 63.04K byte token/s · 63.04K byte/s
GPU (byte_gru_training_step): mean 14.865 ms/step · p50 16.772 · p95 19.638 · min 9.339 · max 26.553 · 4.31K sample/s · 68.89K byte token/s · 68.89K byte/s · wall-GPU gap 8%
run: 4.87s · 300 steps · batch 64 · sequence 16 byte token/sample
Evaluation:
Random-loss baseline ln(256) = 5.5452
byte-token accuracy: 92.7%
post-update evaluation loss: 0.176507
Generation:
prompt: "to be"
generated: "to be that is the question whether tis nobler in the mind to suffer the slings and ar"
program: 19 nodes · 1 recording · 299 cache hits · 0 uploads
checkpoint: optimizer step, accuracy, and exact generation restored

Source