@@ -44,9 +44,9 @@ without passing L2, or have L4 golden data without passing L3.
4444
4545| Level | Name | What it verifies | Data source |
4646| -------| ------| -----------------| -------------|
47- | ** L1** | Graph builds | ONNX graph builds from a tiny synthetic config | ` tests/_test_configs.py ` + ` tests/build_graph_test.py ` |
47+ | ** L1** | Graph builds | ONNX graph builds from a tiny synthetic config | ` tests/_test_configs.py ` + ` tests/build_graph ` |
4848| ** L2** | Config compatible | Full-size HF config produces a valid graph | ` test_model_id ` in YAML test case (` testdata/cases/ ` ) |
49- | ** L3** | Synthetic parity | Random-weight forward pass matches HF numerically | ` tests/integration_test .py ` parametrized tests |
49+ | ** L3** | Synthetic parity | Random-weight forward pass matches HF numerically | ` tests/synthetic_parity_test .py ` and focused integration suites |
5050| ** L4** | Golden match | Real-weight prefill logits match pre-computed reference | ` testdata/golden/<cat>/<model>.json ` |
5151| ** L5** | Generation verified | Full multi-token generation matches golden output | ` testdata/golden/<cat>/<model>_generation.json ` |
5252
@@ -60,17 +60,17 @@ models.
6060
6161``` bash
6262# All non-integration tests (fast, no downloads)
63- python -m pytest tests/build_graph_test.py tests/cli_test.py src/ -q \
63+ python -m pytest tests/build_graph tests/cli_test.py src/ -q \
6464 -k " not phi4mm and not apply_weights_unknown" --tb=short
6565
6666# Representative models only (~5 seconds)
67- python -m pytest tests/build_graph_test.py --fast
67+ python -m pytest tests/build_graph --fast
6868
6969# Single model type
70- python -m pytest tests/build_graph_test.py -k " phi4mm"
70+ python -m pytest tests/build_graph -k " phi4mm"
7171
7272# Integration tests (slow, downloads models)
73- python -m pytest tests/integration_test .py -m integration -k " qwen2.5-0.5b"
73+ python -m pytest tests/integration/text_test .py -m integration -k " qwen2.5-0.5b"
7474
7575# L4/L5 golden tests
7676python -m pytest tests/e2e_golden_test.py -m golden --level L4 -v
@@ -86,9 +86,20 @@ python scripts/generate_golden.py --level L4 --filter 'my-model*'
8686
8787```
8888tests/
89- ├── build_graph_test.py # L1: graph construction (no weights)
89+ ├── build_graph/ # L1: graph construction by model domain
90+ │ ├── _support.py # shared helpers and coverage inventory
91+ │ ├── core_test.py
92+ │ ├── cache_test.py
93+ │ ├── diffusion_audio_test.py
94+ │ ├── recurrent_test.py
95+ │ ├── speech_test.py
96+ │ └── vision_language_test.py
9097├── _test_configs.py # shared model configs for all tests
91- ├── integration_test.py # L3: real-weight numerical parity
98+ ├── integration/ # focused real-weight and architecture parity suites
99+ │ ├── _support.py # shared session/feed helpers and text cases
100+ │ ├── text_test.py
101+ │ ├── generation_test.py
102+ │ └── ... # VLM, encoder/media, architecture, and heavy suites
92103├── e2e_golden_test.py # L4 + L5: golden file comparison
93104├── yaml_schema_test.py # YAML test case schema validation
94105├── weight_alignment_test.py # L1: preprocess_weights correctness
@@ -132,15 +143,15 @@ CAUSAL_LM_CONFIGS: list[tuple[str, dict, bool]] = [
132143
133144## L1: Graph build tests
134145
135- Located in ` tests/build_graph_test.py ` . Uses tiny synthetic configs
146+ Located in ` tests/build_graph ` . Uses tiny synthetic configs
136147(64 hidden, 2 layers, 256 vocab) — no weights, no network.
137148
138149The framework checks: inputs exist (` input_ids ` , ` attention_mask ` ,
139150` position_ids ` ), outputs exist (` logits ` , KV cache), and initializers
140151are present.
141152
142- VLM/audio models use dedicated test methods tracked in
143- ` _SPECIALIZED_TEST_MODEL_TYPES ` .
153+ Models with dedicated test methods are tracked in
154+ ` tests/build_graph/_support.py::specialized_test_model_types() ` .
144155
145156### Weight alignment tests
146157
@@ -166,9 +177,10 @@ set to a real HF model ID.
166177
167178## L3: Integration tests
168179
169- Located in ` tests/integration_test.py ` . Parametrized with
170- ` (model_id, trust_remote_code) ` . Prefer models ≤ 1B, publicly accessible,
171- one per distinct model class.
180+ Located in focused ` tests/integration/*_test.py ` modules. The generic text
181+ suite is parametrized with ` (model_id, trust_remote_code) ` from
182+ ` tests/integration/_support.py ` . Prefer models ≤ 1B, publicly accessible, one
183+ per distinct model class.
172184
173185> Read [ ` references/test-examples.md ` ] ( references/test-examples.md ) for
174186> full prefill/decode/generation code patterns.
0 commit comments