Skip to content

Commit 0abd20b

Browse files
committed
New test moons_demo_mini; updates test expectations; unfortunately, bigram is nondeterministic; and moons_demo is broken on multicore_cc but probably an unlucky random seed because moons_demo_parallel works well
1 parent 797c8a1 commit 0abd20b

File tree

9 files changed

+576
-393
lines changed

9 files changed

+576
-393
lines changed

test/einsum/einsum_trivia.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ let%expect_test "outer_sum simulating axis concatenation" =
11241124
Train.printf ~here:[%here] ~with_code:false ~with_grad:false tk;
11251125
[%expect
11261126
{|
1127-
HERE: test/einsum/einsum_trivia.ml:1134:21
1127+
HERE: test/einsum/einsum_trivia.ml:1124:21
11281128
┌───────────────────────────┐
11291129
│[7]: =>_tk shape 0:6,1:3
11301130
│┌──────┬──────────────────┐│
@@ -1162,7 +1162,7 @@ let%expect_test "einsum with a leftmost input axis preserved as output axis" =
11621162
Train.printf ~here:[%here] ~with_code:false ~with_grad:false c;
11631163
[%expect
11641164
{|
1165-
HERE: test/einsum/einsum_trivia.ml:1172:21
1165+
HERE: test/einsum/einsum_trivia.ml:1162:21
11661166
┌─────────────────────────────────────────────────────────────────┐
11671167
│[2]: ;=>_c shape 0:3|1:4,2:2
11681168
│┌──────┬──────────────────┬──────────────────┬──────────────────┐│
@@ -1196,7 +1196,7 @@ let%expect_test "einsum permuting two leftmost input axes as output axes" =
11961196
Train.printf ~here:[%here] ~with_code:false ~with_grad:false c;
11971197
[%expect
11981198
{|
1199-
HERE: test/einsum/einsum_trivia.ml:1206:21
1199+
HERE: test/einsum/einsum_trivia.ml:1196:21
12001200
┌───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
12011201
│[2]: ;=>_c shape 2:4->0:3,1:2
12021202
│┌──────┬────────────────────────────────────┬────────────────────────────────────┬────────────────────────────────────┐│
Lines changed: 74 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,82 @@
11
Retrieving commandline, environment, or config file variable ocannl_log_level
22
Found 0, in the config file
33
Tnode: collecting accessible arrays...
4-
n0 moons_flat as moons_flat: Host&shared/38039; single prec 40x10x2; mem in bytes: 3_200
5-
n1 moons_classes as moons_classes: Host&shared/38039; single prec 40x10x1; mem in bytes: 1_600
6-
n2 range_over_offsets as range_over_offsets: Virt/15; single prec 4; mem in bytes: <not-in-yet>
7-
n3 !@self_id as n3: Virt/40; single prec 1; mem in bytes: <not-in-yet>
8-
n4 threefry4x32 as threefry4x32: Virt/15; single prec 4; mem in bytes: <not-in-yet>
9-
n5 b1 as b1: Host&stream/412410; single prec 16; mem in bytes: <not-in-yet>
10-
n6 grad_b1 as b1.grad: Local/26046; single prec 16; mem in bytes: <not-in-yet>
11-
n7 range_over_offsets as range_over_offsets: Virt/15; single prec 8; mem in bytes: <not-in-yet>
12-
n8 !@self_id as n8: Virt/40; single prec 1; mem in bytes: <not-in-yet>
13-
n9 threefry4x32 as threefry4x32: Virt/15; single prec 8; mem in bytes: <not-in-yet>
14-
n10 w1 as w1: Host&stream/412410; single prec 16x2; mem in bytes: <not-in-yet>
15-
n11 grad_w1 as w1.grad: Local/26046; single prec 16x2; mem in bytes: <not-in-yet>
16-
n12 range_over_offsets as range_over_offsets: Virt/15; single prec 4; mem in bytes: <not-in-yet>
17-
n13 !@self_id as n13: Virt/40; single prec 1; mem in bytes: <not-in-yet>
18-
n14 threefry4x32 as threefry4x32: Virt/15; single prec 4; mem in bytes: <not-in-yet>
19-
n15 w2 as w2: Host&stream/412410; single prec 1x16; mem in bytes: <not-in-yet>
20-
n16 grad_w2 as w2.grad: Local/26046; single prec 1x16; mem in bytes: <not-in-yet>
21-
n17 @|_moons_input as moons_input: Local/1046; single prec 10x2; mem in bytes: <not-in-yet>
22-
n20 @|_moons_class as moons_class: Local/1046; single prec 10x1; mem in bytes: <not-in-yet>
23-
n23 * as n23: Local/1046; single prec 10x16; mem in bytes: <not-in-yet>
24-
n24 grad_* as n23.grad: Local/1046; single prec 10x16; mem in bytes: <not-in-yet>
25-
n25 + as n25: Local/1046; single prec 10x16; mem in bytes: <not-in-yet>
26-
n26 grad_+ as n25.grad: Local/1046; single prec 10x16; mem in bytes: <not-in-yet>
27-
n27 relu as relu: Local/1046; single prec 10x16; mem in bytes: <not-in-yet>
28-
n28 grad_relu as relu.grad: Local/1046; single prec 10x16; mem in bytes: <not-in-yet>
29-
n29 *_mlp_@|_moons_input as mlp_moons_input: Local/1046; single prec 10x1; mem in bytes: <not-in-yet>
30-
n30 grad_*_mlp_@|_moons_input as mlp_moons_input.grad: Local/1046; single prec 10x1; mem in bytes: <not-in-yet>
31-
n31 *. as n31: Virt/15; single prec 10x1; mem in bytes: <not-in-yet>
32-
n32 grad_*. as n31.grad: Local/1046; single prec 10x1; mem in bytes: <not-in-yet>
33-
n33 1 as 1: Virt/40; single prec 1; mem in bytes: <not-in-yet>
34-
n34 - as n34: Local/1046; single prec 10x1; mem in bytes: <not-in-yet>
35-
n35 grad_- as n34.grad: Local/1046; single prec 10x1; mem in bytes: <not-in-yet>
36-
n36 relu_margin_loss as relu_margin_loss: Virt/15; single prec 10x1; mem in bytes: <not-in-yet>
37-
n37 grad_relu_margin_loss as relu_margin_loss.grad: Local/1046; single prec 10x1; mem in bytes: <not-in-yet>
38-
n38 10 as 10: Virt/40; single prec 1; mem in bytes: <not-in-yet>
39-
n39 => as n39: Local/1046; single prec 1; mem in bytes: <not-in-yet>
40-
n40 grad_=> as n39.grad: Virt/40; single prec 1; mem in bytes: <not-in-yet>
41-
n42 grad_/._scalar_loss as scalar_loss.grad: Virt/40; single prec 1; mem in bytes: <not-in-yet>
42-
n43 2 as 2: Virt/40; single prec 1; mem in bytes: <not-in-yet>
43-
n44 **. as n44: Virt/40; single prec 1; mem in bytes: <not-in-yet>
44-
n45 -1 as n45: Virt/40; single prec 1; mem in bytes: <not-in-yet>
45-
n46 *. as n46: Virt/152; single prec 1; mem in bytes: <not-in-yet>
46-
n48 1 as 1: Virt/40; single prec 1; mem in bytes: <not-in-yet>
47-
n49 200 as 200: Virt/40; single prec 1; mem in bytes: <not-in-yet>
48-
n50 !@ as n50: Virt/152; single prec 1; mem in bytes: <not-in-yet>
49-
n51 200 as 200: Virt/40; single prec 1; mem in bytes: <not-in-yet>
50-
n52 2 as 2: Virt/40; single prec 1; mem in bytes: <not-in-yet>
51-
n53 *. as n53: Virt/40; single prec 1; mem in bytes: <not-in-yet>
52-
n54 - as n54: Virt/152; single prec 1; mem in bytes: <not-in-yet>
53-
n55 0.1 as n55: Virt/40; single prec 1; mem in bytes: <not-in-yet>
54-
n56 *. as n56: Virt/152; single prec 1; mem in bytes: <not-in-yet>
55-
n58 sgd_delta_b1 as sgd_delta_b1: Virt/15; single prec 16; mem in bytes: <not-in-yet>
56-
n59 sgd_momentum_b1 as sgd_momentum_b1: unknown; single prec <not-in-yet>; mem in bytes: <not-in-yet>
57-
n60 0.0001 as n60: Virt/40; single prec 1; mem in bytes: <not-in-yet>
58-
n61 *. as n61: Virt/15; single prec 16; mem in bytes: <not-in-yet>
59-
n62 sgd_delta_w1 as sgd_delta_w1: Virt/15; single prec 16x2; mem in bytes: <not-in-yet>
60-
n63 sgd_momentum_w1 as sgd_momentum_w1: unknown; single prec <not-in-yet>; mem in bytes: <not-in-yet>
4+
n0 moons_flat as moons_flat: Host&shared/49039; single prec 40x10x2; mem in bytes: 3_200
5+
n1 moons_classes as moons_classes: Host&shared/49039; single prec 40x10x1; mem in bytes: 1_600
6+
n2 range_over_offsets as range_over_offsets: Virt/15; uint4x32 prec 4; mem in bytes: <not-in-yet>
7+
n3 42_random_seed as random_seed_42: Host-const/36; uint4x32 prec 1; mem in bytes: 16
8+
n4 !@self_id as n4: Virt/40; uint4x32 prec 1; mem in bytes: <not-in-yet>
9+
n5 threefry4x32 as threefry4x32: Virt/15; uint4x32 prec 4; mem in bytes: <not-in-yet>
10+
n6 threefry4x32 as threefry4x32: Virt/15; uint4x32 prec 4; mem in bytes: <not-in-yet>
11+
n7 b1 as b1: Host&stream/412410; single prec 16; mem in bytes: <not-in-yet>
12+
n8 grad_b1 as b1.grad: Local/26046; single prec 16; mem in bytes: <not-in-yet>
13+
n9 range_over_offsets as range_over_offsets: Virt/15; uint4x32 prec 8; mem in bytes: <not-in-yet>
14+
n10 !@self_id as n10: Virt/40; uint4x32 prec 1; mem in bytes: <not-in-yet>
15+
n11 threefry4x32 as threefry4x32: Virt/15; uint4x32 prec 8; mem in bytes: <not-in-yet>
16+
n12 threefry4x32 as threefry4x32: Virt/15; uint4x32 prec 8; mem in bytes: <not-in-yet>
17+
n13 w1 as w1: Host&stream/412410; single prec 16x2; mem in bytes: <not-in-yet>
18+
n14 grad_w1 as w1.grad: Local/26046; single prec 16x2; mem in bytes: <not-in-yet>
19+
n15 range_over_offsets as range_over_offsets: Virt/15; uint4x32 prec 4; mem in bytes: <not-in-yet>
20+
n16 !@self_id as n16: Virt/40; uint4x32 prec 1; mem in bytes: <not-in-yet>
21+
n17 threefry4x32 as threefry4x32: Virt/15; uint4x32 prec 4; mem in bytes: <not-in-yet>
22+
n18 threefry4x32 as threefry4x32: Virt/15; uint4x32 prec 4; mem in bytes: <not-in-yet>
23+
n19 w2 as w2: Host&stream/412410; single prec 1x16; mem in bytes: <not-in-yet>
24+
n20 grad_w2 as w2.grad: Local/26046; single prec 1x16; mem in bytes: <not-in-yet>
25+
n21 @|_moons_input as moons_input: Local/1046; single prec 10x2; mem in bytes: <not-in-yet>
26+
n24 @|_moons_class as moons_class: Local/1046; single prec 10x1; mem in bytes: <not-in-yet>
27+
n27 * as n27: Local/1046; single prec 10x16; mem in bytes: <not-in-yet>
28+
n28 grad_* as n27.grad: Local/1046; single prec 10x16; mem in bytes: <not-in-yet>
29+
n29 + as n29: Local/1046; single prec 10x16; mem in bytes: <not-in-yet>
30+
n30 grad_+ as n29.grad: Local/1046; single prec 10x16; mem in bytes: <not-in-yet>
31+
n31 relu as relu: Local/1046; single prec 10x16; mem in bytes: <not-in-yet>
32+
n32 grad_relu as relu.grad: Local/1046; single prec 10x16; mem in bytes: <not-in-yet>
33+
n33 *_mlp_@|_moons_input as mlp_moons_input: Local/1046; single prec 10x1; mem in bytes: <not-in-yet>
34+
n34 grad_*_mlp_@|_moons_input as mlp_moons_input.grad: Local/1046; single prec 10x1; mem in bytes: <not-in-yet>
35+
n35 *. as n35: Virt/15; single prec 10x1; mem in bytes: <not-in-yet>
36+
n36 grad_*. as n35.grad: Local/1046; single prec 10x1; mem in bytes: <not-in-yet>
37+
n37 1 as _1: Virt/40; single prec 1; mem in bytes: <not-in-yet>
38+
n38 - as n38: Local/1046; single prec 10x1; mem in bytes: <not-in-yet>
39+
n39 grad_- as n38.grad: Local/1046; single prec 10x1; mem in bytes: <not-in-yet>
40+
n40 relu_margin_loss as relu_margin_loss: Virt/15; single prec 10x1; mem in bytes: <not-in-yet>
41+
n41 grad_relu_margin_loss as relu_margin_loss.grad: Local/1046; single prec 10x1; mem in bytes: <not-in-yet>
42+
n42 10 as _10: Virt/40; single prec 1; mem in bytes: <not-in-yet>
43+
n43 => as n43: Local/1046; single prec 1; mem in bytes: <not-in-yet>
44+
n44 grad_=> as n43.grad: Virt/40; single prec 1; mem in bytes: <not-in-yet>
45+
n46 grad_/._scalar_loss as scalar_loss.grad: Virt/40; single prec 1; mem in bytes: <not-in-yet>
46+
n47 2 as _2: Virt/40; single prec 1; mem in bytes: <not-in-yet>
47+
n48 **. as n48: Virt/40; single prec 1; mem in bytes: <not-in-yet>
48+
n49 -1 as n49: Virt/40; single prec 1; mem in bytes: <not-in-yet>
49+
n50 *. as n50: Virt/152; single prec 1; mem in bytes: <not-in-yet>
50+
n52 1 as _1: Virt/40; single prec 1; mem in bytes: <not-in-yet>
51+
n53 200 as _200: Virt/40; single prec 1; mem in bytes: <not-in-yet>
52+
n54 !@ as n54: Virt/152; single prec 1; mem in bytes: <not-in-yet>
53+
n55 200 as _200: Virt/40; single prec 1; mem in bytes: <not-in-yet>
54+
n56 2 as _2: Virt/40; single prec 1; mem in bytes: <not-in-yet>
55+
n57 *. as n57: Virt/40; single prec 1; mem in bytes: <not-in-yet>
56+
n58 - as n58: Virt/152; single prec 1; mem in bytes: <not-in-yet>
57+
n59 0.1 as n59: Virt/40; single prec 1; mem in bytes: <not-in-yet>
58+
n60 *. as n60: Virt/152; single prec 1; mem in bytes: <not-in-yet>
59+
n62 sgd_delta_b1 as sgd_delta_b1: Virt/15; single prec 16; mem in bytes: <not-in-yet>
60+
n63 sgd_momentum_b1 as sgd_momentum_b1: unknown; single prec <not-in-yet>; mem in bytes: <not-in-yet>
6161
n64 0.0001 as n64: Virt/40; single prec 1; mem in bytes: <not-in-yet>
62-
n65 *. as n65: Virt/15; single prec 16x2; mem in bytes: <not-in-yet>
63-
n66 sgd_delta_w2 as sgd_delta_w2: Virt/15; single prec 1x16; mem in bytes: <not-in-yet>
64-
n67 sgd_momentum_w2 as sgd_momentum_w2: unknown; single prec <not-in-yet>; mem in bytes: <not-in-yet>
62+
n65 *. as n65: Virt/15; single prec 16; mem in bytes: <not-in-yet>
63+
n66 sgd_delta_w1 as sgd_delta_w1: Virt/15; single prec 16x2; mem in bytes: <not-in-yet>
64+
n67 sgd_momentum_w1 as sgd_momentum_w1: unknown; single prec <not-in-yet>; mem in bytes: <not-in-yet>
6565
n68 0.0001 as n68: Virt/40; single prec 1; mem in bytes: <not-in-yet>
66-
n69 *. as n69: Virt/15; single prec 1x16; mem in bytes: <not-in-yet>
67-
n70 point_mlp_result as point_mlp_result: Host&shared/38039; single prec 2; mem in bytes: <not-in-yet>
68-
n71 * as n71: Local/1046; single prec 16; mem in bytes: <not-in-yet>
69-
n72 grad_* as n71.grad: unknown; single prec 16; mem in bytes: <not-in-yet>
70-
n73 + as n73: Virt/15; single prec 16; mem in bytes: <not-in-yet>
71-
n74 grad_+ as n73.grad: unknown; single prec 16; mem in bytes: <not-in-yet>
72-
n75 relu as relu: Virt/15; single prec 16; mem in bytes: <not-in-yet>
73-
n76 grad_relu as relu.grad: unknown; single prec 16; mem in bytes: <not-in-yet>
74-
n77 *_mlp_point_mlp_result as mlp_point_mlp_result: Host&stream/412410; single prec 1; mem in bytes: <not-in-yet>
75-
n78 grad_*_mlp_point_mlp_result as mlp_point_mlp_result.grad: unknown; single prec 1; mem in bytes: <not-in-yet>
66+
n69 *. as n69: Virt/15; single prec 16x2; mem in bytes: <not-in-yet>
67+
n70 sgd_delta_w2 as sgd_delta_w2: Virt/15; single prec 1x16; mem in bytes: <not-in-yet>
68+
n71 sgd_momentum_w2 as sgd_momentum_w2: unknown; single prec <not-in-yet>; mem in bytes: <not-in-yet>
69+
n72 0.0001 as n72: Virt/40; single prec 1; mem in bytes: <not-in-yet>
70+
n73 *. as n73: Virt/15; single prec 1x16; mem in bytes: <not-in-yet>
71+
n74 point_mlp_result as point_mlp_result: Host&shared/37039; single prec 2; mem in bytes: <not-in-yet>
72+
n75 * as n75: Local/1046; single prec 16; mem in bytes: <not-in-yet>
73+
n76 grad_* as n75.grad: unknown; single prec 16; mem in bytes: <not-in-yet>
74+
n77 + as n77: Virt/15; single prec 16; mem in bytes: <not-in-yet>
75+
n78 grad_+ as n77.grad: unknown; single prec 16; mem in bytes: <not-in-yet>
76+
n79 relu as relu: Virt/15; single prec 16; mem in bytes: <not-in-yet>
77+
n80 grad_relu as relu.grad: unknown; single prec 16; mem in bytes: <not-in-yet>
78+
n81 *_mlp_point_mlp_result as mlp_point_mlp_result: Host&stream/412410; single prec 1; mem in bytes: <not-in-yet>
79+
n82 grad_*_mlp_point_mlp_result as mlp_point_mlp_result.grad: unknown; single prec 1; mem in bytes: <not-in-yet>
7680
Tnode: Finished printing headers.
7781
mlp_result's name: mlp_point_mlp_result
7882
(mlp moons_input) name: mlp_moons_input

test/operations/test_threefry4x32.ml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ let%expect_test "threefry4x32 basic test" =
3838
[%expect
3939
{|
4040
First 5 uniform random values:
41-
[0]: 0.756113
42-
[1]: 0.758716
43-
[2]: 0.479668
44-
[3]: 0.865075
45-
[4]: 0.490017
41+
[0]: 0.237546
42+
[1]: 0.120910
43+
[2]: 0.485426
44+
[3]: 0.235820
45+
[4]: 0.007262
4646
All values in [0, 1) range: true
4747
|}]
4848

@@ -76,8 +76,8 @@ let%expect_test "uint4x32_to_prec_uniform different precisions" =
7676

7777
[%expect
7878
{|
79-
Single precision - first value: 0.756113, second value: 0.758716
79+
Single precision - first value: 0.237546, second value: 0.120910
8080
All values in [0, 1) range: true
81-
Half precision - first value: 0.756113, second value: 0.758716
81+
Half precision - first value: 0.831543, second value: 0.237549
8282
All values in [0, 1) range: true
8383
|}]
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Retrieving commandline, environment, or config file variable ocannl_log_level
22
Found 0, in the config file
33
Generated 4 uniform random numbers:
4-
[0]: 0.756113
5-
[1]: 0.758716
6-
[2]: 0.479668
7-
[3]: 0.865075
4+
[0]: 0.237546
5+
[1]: 0.120910
6+
[2]: 0.485426
7+
[3]: 0.235820
Lines changed: 49 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,51 @@
11
Retrieving commandline, environment, or config file variable ocannl_log_level
22
Found 0, in the config file
3-
Generated 44 uniform random numbers:
4-
[0]: 0.756113
5-
[1]: 0.758716
6-
[2]: 0.479668
7-
[3]: 0.865075
8-
[4]: 0.490017
9-
[5]: 0.828125
10-
[6]: 0.845653
11-
[7]: 0.383373
12-
[8]: 0.943452
13-
[9]: 0.663022
14-
[10]: 0.675966
15-
[11]: 0.206998
16-
[12]: 0.862081
17-
[13]: 0.316310
18-
[14]: 0.923034
19-
[15]: 0.271412
20-
[16]: 0.659129
21-
[17]: 0.473695
22-
[18]: 0.785375
23-
[19]: 0.694083
24-
[20]: 0.499545
25-
[21]: 0.936835
26-
[22]: 0.175210
27-
[23]: 0.002862
28-
[24]: 0.225633
29-
[25]: 0.638001
30-
[26]: 0.083278
31-
[27]: 0.809498
32-
[28]: 0.061526
33-
[29]: 0.410366
34-
[30]: 0.361402
35-
[31]: 0.602626
36-
[32]: 0.952481
37-
[33]: 0.862708
38-
[34]: 0.708908
39-
[35]: 0.231687
40-
[36]: 0.748360
41-
[37]: 0.196777
42-
[38]: 0.321022
43-
[39]: 0.576774
44-
[40]: 0.413620
45-
[41]: 0.028902
46-
[42]: 0.607390
47-
[43]: 0.788146
3+
Generated 48 uniform random numbers:
4+
[0]: 0.831543
5+
[1]: 0.237549
6+
[2]: 0.951172
7+
[3]: 0.120911
8+
[4]: 0.862793
9+
[5]: 0.485352
10+
[6]: 0.674316
11+
[7]: 0.235840
12+
[8]: 0.940918
13+
[9]: 0.007248
14+
[10]: 0.228271
15+
[11]: 0.902832
16+
[12]: 0.403564
17+
[13]: 0.635254
18+
[14]: 0.440674
19+
[15]: 0.443604
20+
[16]: 0.985352
21+
[17]: 0.635254
22+
[18]: 0.252686
23+
[19]: 0.655762
24+
[20]: 0.506836
25+
[21]: 0.048828
26+
[22]: 0.914551
27+
[23]: 0.854004
28+
[24]: 0.942871
29+
[25]: 0.836426
30+
[26]: 0.276855
31+
[27]: 0.749023
32+
[28]: 0.879883
33+
[29]: 0.045044
34+
[30]: 0.203247
35+
[31]: 0.380127
36+
[32]: 0.145630
37+
[33]: 0.250000
38+
[34]: 0.541016
39+
[35]: 0.626953
40+
[36]: 0.852051
41+
[37]: 0.109009
42+
[38]: 0.480713
43+
[39]: 0.904785
44+
[40]: 0.415039
45+
[41]: 0.346924
46+
[42]: 0.269287
47+
[43]: 0.016891
48+
[44]: 0.469238
49+
[45]: 0.454346
50+
[46]: 0.672852
51+
[47]: 0.538086

0 commit comments

Comments
 (0)