1. Validate a Spec
CLI messages are translated into ko / en / zh / ja / es. Use
eulerstack --lang en ...(orEULERSTACK_LANG=en) for English. Default is Korean. For deep mixer explanations see mixers/00_overview.md.
This tutorial covers the first step in any EulerStack workflow: validating a YAML spec. Before building any model, you want to confirm the YAML you wrote is structurally correct and free of internal contradictions. Skipping this step tends to turn into silent failures deep inside training loops, wasting GPU time.
Why Validation Matters
An LLM architecture spec is a tightly-coupled bundle of dozens of parameters. For
example, d_model must be divisible by n_heads, and a layer using
mixer.type: mamba cannot also enable state.kv_cache: true. There are dozens
of such constraints, and they are impossible to check reliably by eye.
Feeding an unvalidated spec straight into training produces three typical failure modes:
- Immediate failure — the model constructor raises
RuntimeErrorwith a vague message, requiring long debugging. - Silent failure — the model is built but the parameter counts or layer topology differ from expectations. Training is slow or does not converge, and you only find out after hours of GPU time.
- Suboptimal choices — the spec is technically valid but
head_dimis unusually small or large, hurting efficiency at the same parameter budget. These cases surface as realism warnings.
EulerStack's validation catches all three before any GPU allocation.
Three Validation Layers
Validation runs in three independent stages. Each stage must pass before moving to the next.
-
Schema validation (structural) Checks that the YAML follows the defined key structure and that types / enums are correct. Typos, missing required fields, and invalid enum values are caught here. Example:
modle.d_model(typo),mixer.type: "transformer"(not a real enum). -
Cross-field validation (compatibility) Catches cases where individual fields are valid but their combination is contradictory. Example:
n_heads=8withn_kv_heads=3fails because 8÷3 is not an integer, which would break GQA grouping. -
Realism checks (empirical sanity) Warns about configurations that are mathematically possible but empirically poor. Example:
head_dim=16is unusually small,head_dim=512is unusually large. Realism checks produce warnings only; they never block validation.
The reason for three layers is separation of concerns. Schema violations are bugs, cross-field violations are design errors, and realism warnings are judgment calls. Each has a different severity and a different fix path.
Basic Usage
The simplest validation command is:
eulerstack validate --preset my_model.yml
On success you get one line:
OK: my_model.yml is a valid spec.
On failure you get a three-line error format that tells you what went wrong, how to fix it, and where to read more:
ValidationError: model.d_model (65) must be divisible by model.n_heads (8)
Fix: Adjust d_model or n_heads so that d_model % n_heads == 0
See: docs/architectures/yaml_v1_spec.md
This format is shared across every CLI command. Whenever an error surfaces, the output always shows what, how to fix it, and where to look in one compact block.
Language Selection
All CLI messages are available in five languages. Use the --lang flag to
switch:
eulerstack --lang en validate --preset my_model.yml # English
eulerstack --lang zh validate --preset my_model.yml # Chinese (Simplified)
eulerstack --lang ja validate --preset my_model.yml # Japanese
eulerstack --lang es validate --preset my_model.yml # Spanish
The default is Korean (ko). You can also set the environment variable
EULERSTACK_LANG:
export EULERSTACK_LANG=en
eulerstack validate --preset my_model.yml # now outputs in English
Precedence: --lang option > EULERSTACK_LANG env var > default (ko).
Detailed Report
Adding --report gives much more than OK/FAIL. The report includes results from
all three validation layers plus an estimated parameter count and a
layer-composition breakdown.
eulerstack validate --preset configs/presets/arch_advanced_jamba.yml --report
The report contains:
- Schema: OK or a specific error
- Estimated parameters: e.g.
1.20B (1,199,582,208) - Total layers and breakdown: e.g.
32 (attention:8, mamba:24) - Realism warnings: head_dim range, MoE ratio, seq_len/d_model ratio
- INFO: per-template layer composition
The report is also the most convenient way to visually confirm that the model is configured the way you intended before spending GPU time on it.
What Kinds of Errors Get Caught?
Below are representative errors caught by schema and cross-field validation. The leftmost column is the error type, middle is an example of invalid YAML, and rightmost is the internal rule ID.
| Error type | Example | Rule |
|---|---|---|
| Unknown key (typo) | modle.d_model (model typo) |
R1 |
| Invalid enum value | mixer.type: "transformer" |
R3 |
| Missing required field | no model.d_model |
R2 |
| Dimension mismatch | d_model=65, n_heads=8 |
R12 |
| GQA mismatch | n_heads=8, n_kv_heads=3 |
R11 |
| Mixer/state conflict | mamba + kv_cache=true |
R5 |
| MoE on non-MoE FFN | gated_mlp + moe section |
R6 |
| top_k > experts | top_k=8, experts=4 |
R14 |
| Negative dropout | dropout: -0.1 |
R13 |
Realism warnings (non-blocking) include:
head_dim < 32orhead_dim > 256target_paramsdiffers from estimate by more than 30%- Excessive
experts > 64 max_seq_len / d_model > 64(unusual ratio)family_hintinconsistent with the actual mixer composition
Next Steps
Once validation passes, the next step is to inspect the model structure visually.
- Tutorial 2: Use Presets — explore the 39 validated presets
- Tutorial 4: Compile and Explain —
explainin detail - Mixer overview — what each mixer does