Realm

tu_nlp_byte_rnn — Byte × RNN

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

Experimental

The byte-tokenizer × RNN 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) → RNN(64) → ByteHead(256)
Parameters31,104
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 × RNN training loss

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

Loss init→finalAccuracyProgram nodesWall ms/stepToken/s
5.569→0.19192.2%197.98128.3K

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_rnn

Regenerate the training-loss image from the repository root:

cargo run --release -p sdk --example tu_nlp_byte_rnn -- --plot sdk/rs/tutorials/ml/nlp/tu_nlp_byte_rnn/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 RNN · all-position LM (autograd) ║
╚══════════════════════════════════════════════════════════════════╝
tokenizer: raw bytes · vocab=256
Task: dense next-byte prediction at every position
Model: ByteEmbedding(32) → RNN(64) → ByteHead(256)
params: 31104 Optimizer: AdamW(lr=0.01)
300/300 |██████████| 2.51s · 8.37 ms/step · 7.64K sample/s · 122.31K byte token/s · 122.31K byte/s · loss: 0.1910
Summary:
loss: initial 5.569197 · final 0.190961 · mean 0.615927
Wall: 8.37 ms/step · 7.64K sample/s · 122.31K byte token/s · 122.31K byte/s
GPU (byte_rnn_training_step): mean 7.135 ms/step · p50 5.531 · p95 15.493 · min 4.253 · max 18.264 · 8.97K sample/s · 143.51K byte token/s · 143.51K byte/s · wall-GPU gap 15%
run: 2.51s · 300 steps · batch 64 · sequence 16 byte token/sample
Evaluation:
Random-loss baseline ln(256) = 5.5452
byte-token accuracy: 92.2%
post-update evaluation loss: 0.186080
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