Commit dd28da3
[Tests] Reorganize tests/ into ops/<family>, models, system
tests/ was a flat mix of op-level files, single-file model tests, and
multi-file model directories with inconsistent capitalization. This PR
introduces a hierarchy:
tests/
_utils.py
ops/
elementwise/ reduce/ gemm/ conv/ attention/
view/ sort/ sparsity/ misc/ fusion/
models/
DeepSeek/ Diffusion/ Llama/ MLP/ MoE/
MobileNet/ Mixtral8x7B/ Yolov5/
test_mlp.py test_resnet.py test_single_perceptron.py
test_transformer.py test_vit.py
system/
test_eager.py test_hetro.py test_scheduler.py
test_stonne.py test_vectorops.py
Mixtral_8x7B renamed to Mixtral8x7B for consistency with the other
PascalCase model dirs. Existing single-file model dirs are kept as
dirs (they may grow companion files like the Mixtral model.py).
All file moves use git mv to preserve history. External path
references rewritten across .github/workflows/pytorchsim_test.yml,
README.md, CLAUDE.md, .github/ISSUE_TEMPLATE/bug_report.md, and the
scripts/{sparsity,stonne}_experiment/ shell scripts.
Cross-test imports updated:
- tests/system/test_hetro.py
- tests/system/test_scheduler.py
- tests/system/test_vectorops.py
- tests/ops/sparsity/test_sparsity.py
__init__.py added to each new subdir so `from tests.ops.X.test_Y
import ...` resolves.
Six files (test_resnet, test_vit, test_stonne, test_sparse_core,
test_gqa, test_diffusion) had their `sys.path.append` inside an
`if __name__ == "__main__":` block, which made the PR-A migration
script insert the import at the wrong indent level. Moved the
import + path append to the module top.
Sample-verified locally on tests/ops/elementwise/test_add.py,
tests/ops/gemm/test_matmul.py, tests/ops/view/test_transpose2D.py,
tests/ops/sort/test_sort.py, tests/ops/fusion/test_matmul_vector.py
(all pass) plus import-only checks on the cross-import files.
Stacks on top of PR #234 (tests/_utils.py extraction).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 73ab1b4 commit dd28da3
78 files changed
Lines changed: 132 additions & 109 deletions
File tree
- .github
- ISSUE_TEMPLATE
- workflows
- scripts
- sparsity_experiment
- stonne_experiment
- tests
- models
- DeepSeek
- Diffusion
- Llama
- MLP
- Mixtral8x7B
- MoE
- MobileNet
- Yolov5
- ops
- attention
- conv
- elementwise
- fusion
- gemm
- misc
- reduce
- sort
- sparsity
- view
- system
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
10 | | - | |
11 | | - | |
12 | | - | |
13 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | | - | |
7 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
File renamed without changes.
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
620 | 622 | | |
621 | 623 | | |
622 | 624 | | |
623 | | - | |
624 | 625 | | |
625 | 626 | | |
626 | 627 | | |
| |||
File renamed without changes.
0 commit comments