Skip to content

Commit 6f9d38d

Browse files
committed
Refactoring and a small cleanup of test organization
1 parent 90bf5fc commit 6f9d38d

26 files changed

+241
-384
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ ocannl_config
3535
!arrayjit/test/ocannl_config
3636
!test/ocannl_config
3737
!test/config/ocannl_config
38-
!test_ppx/ocannl_config
3938
# Convenience for storing particular configurations, not used by OCANNL
4039
ocannl_config-*
4140

.ocamlformat-ignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
test_ppx/test_ppx_op_expected.ml
1+
test/ppx/test_ppx_op_expected.ml

test/einsum/dune

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,22 @@
2424
(libraries ocannl)
2525
(preprocess
2626
(pps ppx_ocannl)))
27+
28+
(test
29+
(name test_print_style)
30+
(deps ocannl_config)
31+
(modules test_print_style)
32+
(libraries ocannl)
33+
(preprocess
34+
(pps ppx_ocannl)))
35+
36+
(library
37+
(name einsum_tutorials)
38+
(package neural_nets_lib)
39+
(inline_tests
40+
(deps ocannl_config))
41+
(libraries base dynlink ocannl)
42+
(modules einsum_trivia)
43+
(preprocess
44+
(pps ppx_here ppx_expect ppx_inline_test ppx_ocannl))
45+
(modes best))

test/einsum_trivia.ml renamed to test/einsum/einsum_trivia.ml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ module Rand = Ir.Rand.Lib
99

1010
module type Backend = Ir.Backend_intf.Backend
1111

12+
(* FIXME: after all tests are brought to pass again with properly updated expectations, remove this
13+
file and rename the test einsum_trivia_exec to einsum_trivia. *)
14+
1215
let%expect_test "einsum1 permute axes" =
1316
Tensor.unsafe_reinitialize ();
1417
let module Backend = (val Backends.fresh_backend ()) in
File renamed without changes.
File renamed without changes.

test/moons_demo_parallel_run.ml

Lines changed: 0 additions & 82 deletions
This file was deleted.

test/operations/config/dune

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
(copy_files
2+
(files ../../config/ocannl_config))
Lines changed: 9 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,5 @@
1-
; A non-crash run counts as a success for moons_demo_parallel_run.
2-
3-
(test
4-
(name moons_demo_parallel_run)
5-
(package neural_nets_lib)
6-
(modules moons_demo_parallel_run)
7-
(deps ocannl_config)
8-
(libraries ocannl datasets)
9-
(preprocess
10-
(pps ppx_ocannl)))
1+
(copy_files
2+
(files ../config/ocannl_config))
113

124
(executable
135
(name micrograd_demo_logging)
@@ -22,10 +14,7 @@
2214
(target ocannl_backend.txt)
2315
(deps ocannl_config)
2416
(action
25-
(run %{dep:../../arrayjit/bin/read_config.exe} "--read=backend"))))
26-
27-
(copy_files
28-
(files config/ocannl_config))
17+
(run %{dep:../../../arrayjit/bin/read_config.exe} "--read=backend"))))
2918

3019
(rule
3120
(alias runtest)
@@ -45,19 +34,19 @@
4534
(action
4635
(progn
4736
(run
48-
%{dep:../tools/minised.exe}
37+
%{dep:../../tools/minised.exe}
4938
" = 0x[0-9a-fA-F]+"
5039
" = 0xNNNN"
5140
"log_files/%{read:config/ocannl_backend.txt}-0-0.log"
5241
"%{read:config/ocannl_backend.txt}-0-0.log.actual")
5342
(run
54-
%{dep:../tools/minised.exe}
43+
%{dep:../../tools/minised.exe}
5544
" = 00[0-9a-fA-F]+"
5645
" = 0xNNNN"
5746
"%{read:config/ocannl_backend.txt}-0-0.log.actual"
5847
"%{read:config/ocannl_backend.txt}-0-0.log.actual")
5948
(run
60-
%{dep:../tools/minised.exe}
49+
%{dep:../../tools/minised.exe}
6150
"\\([a-z0-9_]+\\)\\[0\\]{=[-.e0-9]+} = "
6251
"\\1[0]{=MAYBE UNINITIALIZED} = "
6352
"%{read:config/ocannl_backend.txt}-0-0.log.actual"
@@ -70,27 +59,13 @@
7059
"micrograd_demo_logging-%{read:config/ocannl_backend.txt}-0-0.log.expected"
7160
"%{read:config/ocannl_backend.txt}-0-0.log.actual")))
7261

73-
(test
74-
(name test_print_style)
75-
(deps ocannl_config)
76-
(modules test_print_style)
77-
(libraries ocannl)
78-
(preprocess
79-
(pps ppx_ocannl)))
80-
8162
(library
82-
(name tutorials)
63+
(name operations_tutorials)
8364
(package neural_nets_lib)
8465
(inline_tests
8566
(deps ocannl_config))
86-
(libraries base dynlink ocannl datasets)
87-
(modules
88-
einsum_trivia
89-
hello_world_op
90-
micrograd_demo
91-
zero2hero_1of7
92-
primitive_ops
93-
moons_demo_parallel)
67+
(libraries base dynlink ocannl)
68+
(modules hello_world_op zero2hero_1of7 primitive_ops)
9469
(preprocess
9570
(pps ppx_here ppx_expect ppx_inline_test ppx_ocannl))
9671
(modes best))
File renamed without changes.

0 commit comments

Comments
 (0)