Skip to content

Commit 0ead67f

Browse files
authored
Merge pull request #829 from InfiniTensor/issue/824
issue/824 - reduce test sizes
2 parents 6a5b111 + e0014ba commit 0ead67f

File tree

2 files changed

+57
-21
lines changed

2 files changed

+57
-21
lines changed

test/infinicore/framework/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ def rearrange_tensor(tensor, new_strides):
391391
new_positions += offset
392392

393393
# Copy the original data to the new tensor
394-
new_tensor.view(-1).index_add_(0, new_positions, tensor.view(-1))
394+
new_tensor.reshape(-1).index_add_(0, new_positions, tensor.reshape(-1))
395395
new_tensor.set_(new_tensor.untyped_storage(), offset, shape, tuple(new_strides))
396396

397397
return new_tensor

test/infinicore/ops/rope.py

Lines changed: 56 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -34,71 +34,107 @@
3434
20,
3535
16,
3636
128,
37-
(20 * 16 * 128 * 16, 16 * 128 * 4, 128 * 2, 1),
38-
(20 * 16 * 128 * 16, 16 * 128 * 4, 128 * 2, 1),
37+
(655360, 8192, 256, 1),
38+
(655360, 8192, 256, 1),
3939
RopeAlgo.GPT_NEOX,
4040
),
4141
(
4242
2,
4343
20,
4444
16,
4545
128,
46-
(20 * 16 * 128 * 16, 16 * 128 * 4, 128 * 2, 1),
47-
(20 * 16 * 128 * 16, 16 * 128 * 4, 128 * 2, 1),
46+
(655360, 8192, 256, 1),
47+
(655360, 8192, 256, 1),
4848
RopeAlgo.GPT_J,
4949
),
5050
(
5151
4,
5252
50,
5353
32,
54-
256,
55-
(50 * 32 * 256 * 16, 32 * 256 * 4, 256 * 2, 1),
56-
(50 * 32 * 256 * 36, 32 * 256 * 6, 256 * 3, 1),
54+
8,
55+
(204800, 1024, 16, 1),
56+
(460800, 1536, 24, 1),
5757
RopeAlgo.GPT_NEOX,
5858
),
5959
(
6060
4,
6161
50,
6262
32,
63-
256,
64-
(50 * 32 * 256 * 16, 32 * 256 * 4, 256 * 2, 1),
65-
(50 * 32 * 256 * 36, 32 * 256 * 6, 256 * 3, 1),
63+
8,
64+
(204800, 1024, 16, 1),
65+
(460800, 1536, 24, 1),
6666
RopeAlgo.GPT_J,
6767
),
6868
(
6969
32,
7070
64,
7171
8,
7272
128,
73-
(64 * 8 * 128 * 16, 8 * 128 * 4, 128 * 2, 1),
74-
(64 * 8 * 128 * 16, 8 * 128 * 4, 128 * 2, 1),
73+
(1048576, 4096, 256, 1),
74+
(1048576, 4096, 256, 1),
7575
RopeAlgo.GPT_NEOX,
7676
),
7777
(
7878
32,
7979
64,
8080
8,
8181
128,
82-
(64 * 8 * 128 * 16, 8 * 128 * 4, 128 * 2, 1),
83-
(64 * 8 * 128 * 16, 8 * 128 * 4, 128 * 2, 1),
82+
(1048576, 4096, 256, 1),
83+
(1048576, 4096, 256, 1),
8484
RopeAlgo.GPT_J,
8585
),
8686
(
8787
64,
88-
128,
88+
17,
8989
32,
9090
64,
91-
(128 * 32 * 64 * 16, 32 * 64 * 4, 64 * 2, 1),
92-
(128 * 32 * 64 * 36, 32 * 64 * 6, 64 * 3, 1),
91+
(557056, 8192, 128, 1),
92+
(1253376, 12288, 192, 1),
9393
RopeAlgo.GPT_NEOX,
9494
),
9595
(
9696
64,
97-
128,
97+
17,
98+
32,
99+
64,
100+
(557056, 8192, 128, 1),
101+
(1253376, 12288, 192, 1),
102+
RopeAlgo.GPT_J,
103+
),
104+
(
105+
8,
106+
20,
107+
4,
108+
64,
109+
(1048576, 64, 262144, 1),
110+
(1048576, 64, 262144, 1),
111+
RopeAlgo.GPT_NEOX,
112+
),
113+
(
114+
8,
115+
20,
116+
4,
117+
64,
118+
(1048576, 64, 262144, 1),
119+
(1048576, 64, 262144, 1),
120+
RopeAlgo.GPT_J,
121+
),
122+
(
123+
8,
124+
20,
125+
32,
126+
64,
127+
(40960, 64, 1280, 1),
128+
(40960, 64, 1280, 1),
129+
RopeAlgo.GPT_NEOX,
130+
),
131+
(
132+
8,
133+
20,
98134
32,
99135
64,
100-
(128 * 32 * 64 * 16, 32 * 64 * 4, 64 * 2, 1),
101-
(128 * 32 * 64 * 36, 32 * 64 * 6, 64 * 3, 1),
136+
(40960, 64, 1280, 1),
137+
(40960, 64, 1280, 1),
102138
RopeAlgo.GPT_J,
103139
),
104140
]

0 commit comments

Comments
 (0)