llm.asm Mini-GPT trainer (`asm-gpt-train`) argument validation.
Raw Developer Origin & Technical Request
GitHub Issue
Nov 26, 2026
The trainer worked very well for me: the TinyShakespeare loss table reproduced to four decimals at every logged step, and the PyTorch gradient check passed all gates. One rough edge is argument validation.
### What happens
There is no validation between argument parsing and model setup (`03-minigpt-train/main.asm:240` onwards), and `head_dim` is computed with an integer division whose remainder is ignored (`03-minigpt-train/model.asm:90-94`). Shapes that the help text and README rule out are accepted and train with exit code 0.
### Reproduce
```bash
BASE="./build/asm-gpt-train --data data/tinyshakespeare.txt --steps 40 --seq 128 -t 8 --plain --log-every 20"
$BASE # baseline
$BASE --heads 5 # README: heads must divide D (192)
$BASE --dim 100 # help: "mult of 16"
```
### Measured
| Arguments | step 1 gnorm | step 40 gnorm | val_loss @40 | exit |
|---|---:|---:|---:|---:|
| baseline (D=192, H=6) | 9.50 | 0.49 | 2.5981 | 0 |
| `--heads 5` | 216.69 | 6.01 | 2.5534 | 0 |
| `--dim 100` | 5.54 | 2.63 | 2.8874 | 0 |
With `--heads 5` the gradient norm is about 20x the baseline, which suggests the attention math is no longer what was intended (head_dim becomes 38, so 190 of 192 dims are covered and head_dim is not a multiple of 16). I did not check whether anything reads out of bounds.
Minor: `-t 0` is silently clamped to 1 by `tp_init` (`shared/threads.asm:51-53`); harmless, but a warning would be nice.
### Suggested fix
After `.args_done`, reject with a clear ...
Developer Debate & Comments
No active discussions extracted for this entry yet.
Adjacent Repository Pain Points
Other highly discussed features and pain points extracted from alesha-pro/llm.asm.
asm-llm: decode drops ~20x when -t equals hardware threads and other processes compete for the cores
Frequently Asked Questions
Market intelligence mapped to llm.asm Mini-GPT trainer (`asm-gpt-train`) argument validation..
What is the technical positioning of llm.asm Mini-GPT trainer (`asm-gpt-train`) argument validation.?
Which technical concepts are associated with llm.asm Mini-GPT trainer (`asm-gpt-train`) argument validation.?
Engagement Signals
Cross-Market Term Frequency
Counts stored text matches for foundational terms like README and BASE in analysed public discussions. These counts do not measure adoption.
Stored text matches, not adoption or market-share measurements.
- README: 32 records
- BASE: 11 records
- argument parsing: 3 records
- head_dim: 3 records
- help text: 3 records
- exit code 0: 3 records
- asm-gpt-train: 2 records
- integer division: 2 records
- TinyShakespeare loss table: 1 records
- PyTorch gradient check: 1 records
- argument validation: 1 records
- model setup: 1 records
- 03-minigpt-train/main.asm:240: 1 records
- 03-minigpt-train/model.asm:90-94: 1 records
- --heads 5: 1 records
- D (192): 1 records
- --dim 100: 1 records
- mult of 16: 1 records
- gradient norm: 1 records
- attention math: 1 records
- head_dim becomes 38: 1 records
- 190 of 192 dims: 1 records
- reads out of bounds: 1 records
- -t 0: 1 records
- clamped to 1: 1 records
- tp_init: 1 records
- shared/threads.asm:51-53: 1 records
- .args_done: 1 records
SaaS Metrics