Skip to content

Commit ba1d8c0

Browse files
committed
fix: for the iluvatar platform, remove the parts of the test scripts whose data type is F64
1 parent 81b6dc7 commit ba1d8c0

File tree

10 files changed

+90
-0
lines changed

10 files changed

+90
-0
lines changed

test/infiniop/all_equal.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import torch
66
from libinfiniop import (
77
LIBINFINIOP,
8+
InfiniDeviceEnum,
89
InfiniDeviceNames,
910
InfiniDtype,
1011
InfiniDtypeNames,
@@ -189,6 +190,17 @@ def lib_all_equal():
189190
NUM_ITERATIONS = args.num_iterations
190191

191192
for device in get_test_devices(args):
193+
if device == InfiniDeviceEnum.ILUVATAR:
194+
_TENSOR_DTYPES = [
195+
InfiniDtype.BOOL,
196+
InfiniDtype.I8,
197+
InfiniDtype.I16,
198+
InfiniDtype.I32,
199+
InfiniDtype.I64,
200+
InfiniDtype.BF16,
201+
InfiniDtype.F16,
202+
InfiniDtype.F32,
203+
]
192204
test_operator(device, test, _TEST_CASES, _TENSOR_DTYPES)
193205

194206
print("\033[92mTest passed!\033[0m")

test/infiniop/cross_entropy_loss_backward.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import torch
77
from libinfiniop import (
88
LIBINFINIOP,
9+
InfiniDeviceEnum,
910
InfiniDeviceNames,
1011
InfiniDtype,
1112
InfiniDtypeNames,
@@ -198,6 +199,12 @@ def lib_cross_entropy_loss_backward():
198199
NUM_ITERATIONS = args.num_iterations
199200

200201
for device in get_test_devices(args):
202+
if device == InfiniDeviceEnum.ILUVATAR:
203+
_TENSOR_DTYPES = [
204+
InfiniDtype.BF16,
205+
InfiniDtype.F16,
206+
InfiniDtype.F32,
207+
]
201208
test_operator(device, test, _TEST_CASES, _TENSOR_DTYPES)
202209

203210
print("\033[92mTest passed!\033[0m")

test/infiniop/div.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import torch
66
from libinfiniop import (
77
LIBINFINIOP,
8+
InfiniDeviceEnum,
89
InfiniDeviceNames,
910
InfiniDtype,
1011
InfiniDtypeNames,
@@ -179,6 +180,12 @@ def lib_div():
179180
NUM_ITERATIONS = args.num_iterations
180181

181182
for device in get_test_devices(args):
183+
if device == InfiniDeviceEnum.ILUVATAR:
184+
_TENSOR_DTYPES = [
185+
InfiniDtype.BF16,
186+
InfiniDtype.F16,
187+
InfiniDtype.F32,
188+
]
182189
test_operator(device, test, _TEST_CASES, _TENSOR_DTYPES)
183190

184191
print("\033[92mTest passed!\033[0m")

test/infiniop/equal.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import torch
66
from libinfiniop import (
77
LIBINFINIOP,
8+
InfiniDeviceEnum,
89
InfiniDeviceNames,
910
InfiniDtype,
1011
InfiniDtypeNames,
@@ -192,6 +193,17 @@ def lib_equal():
192193
NUM_ITERATIONS = args.num_iterations
193194

194195
for device in get_test_devices(args):
196+
if device == InfiniDeviceEnum.ILUVATAR:
197+
_TENSOR_DTYPES = [
198+
InfiniDtype.BOOL,
199+
InfiniDtype.I8,
200+
InfiniDtype.I16,
201+
InfiniDtype.I32,
202+
InfiniDtype.I64,
203+
InfiniDtype.BF16,
204+
InfiniDtype.F16,
205+
InfiniDtype.F32,
206+
]
195207
test_operator(device, test, _TEST_CASES, _TENSOR_DTYPES)
196208

197209
print("\033[92mTest passed!\033[0m")

test/infiniop/gelu.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import torch
66
from libinfiniop import (
77
LIBINFINIOP,
8+
InfiniDeviceEnum,
89
InfiniDeviceNames,
910
InfiniDtype,
1011
InfiniDtypeNames,
@@ -168,6 +169,12 @@ def lib_gelu():
168169
NUM_ITERATIONS = args.num_iterations
169170

170171
for device in get_test_devices(args):
172+
if device == InfiniDeviceEnum.ILUVATAR:
173+
_TENSOR_DTYPES = [
174+
InfiniDtype.BF16,
175+
InfiniDtype.F16,
176+
InfiniDtype.F32,
177+
]
171178
test_operator(device, test, _TEST_CASES, _TENSOR_DTYPES)
172179

173180
print("\033[92mTest passed!\033[0m")

test/infiniop/gelu_backward.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import torch
66
from libinfiniop import (
77
LIBINFINIOP,
8+
InfiniDeviceEnum,
89
InfiniDeviceNames,
910
InfiniDtype,
1011
InfiniDtypeNames,
@@ -201,6 +202,12 @@ def lib_gelu_backward():
201202
NUM_ITERATIONS = args.num_iterations
202203

203204
for device in get_test_devices(args):
205+
if device == InfiniDeviceEnum.ILUVATAR:
206+
_TENSOR_DTYPES = [
207+
InfiniDtype.BF16,
208+
InfiniDtype.F16,
209+
InfiniDtype.F32,
210+
]
204211
test_operator(device, test, _TEST_CASES, _TENSOR_DTYPES)
205212

206213
print("\033[92mTest passed!\033[0m")

test/infiniop/logical_and.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import torch
66
from libinfiniop import (
77
LIBINFINIOP,
8+
InfiniDeviceEnum,
89
InfiniDeviceNames,
910
InfiniDtype,
1011
InfiniDtypeNames,
@@ -192,6 +193,17 @@ def lib_logical_and():
192193
NUM_ITERATIONS = args.num_iterations
193194

194195
for device in get_test_devices(args):
196+
if device == InfiniDeviceEnum.ILUVATAR:
197+
_TENSOR_DTYPES = [
198+
InfiniDtype.BOOL,
199+
InfiniDtype.I8,
200+
InfiniDtype.I16,
201+
InfiniDtype.I32,
202+
InfiniDtype.I64,
203+
InfiniDtype.BF16,
204+
InfiniDtype.F16,
205+
InfiniDtype.F32,
206+
]
195207
test_operator(device, test, _TEST_CASES, _TENSOR_DTYPES)
196208

197209
print("\033[92mTest passed!\033[0m")

test/infiniop/logical_or.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import torch
66
from libinfiniop import (
77
LIBINFINIOP,
8+
InfiniDeviceEnum,
89
InfiniDeviceNames,
910
InfiniDtype,
1011
InfiniDtypeNames,
@@ -192,6 +193,17 @@ def lib_logical_or():
192193
NUM_ITERATIONS = args.num_iterations
193194

194195
for device in get_test_devices(args):
196+
if device == InfiniDeviceEnum.ILUVATAR:
197+
_TENSOR_DTYPES = [
198+
InfiniDtype.BOOL,
199+
InfiniDtype.I8,
200+
InfiniDtype.I16,
201+
InfiniDtype.I32,
202+
InfiniDtype.I64,
203+
InfiniDtype.BF16,
204+
InfiniDtype.F16,
205+
InfiniDtype.F32,
206+
]
195207
test_operator(device, test, _TEST_CASES, _TENSOR_DTYPES)
196208

197209
print("\033[92mTest passed!\033[0m")

test/infiniop/relu_backward.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import torch
66
from libinfiniop import (
77
LIBINFINIOP,
8+
InfiniDeviceEnum,
89
InfiniDeviceNames,
910
InfiniDtype,
1011
InfiniDtypeNames,
@@ -187,6 +188,12 @@ def lib_relu_backward():
187188
NUM_ITERATIONS = args.num_iterations
188189

189190
for device in get_test_devices(args):
191+
if device == InfiniDeviceEnum.ILUVATAR:
192+
_TENSOR_DTYPES = [
193+
InfiniDtype.BF16,
194+
InfiniDtype.F16,
195+
InfiniDtype.F32,
196+
]
190197
test_operator(device, test, _TEST_CASES, _TENSOR_DTYPES)
191198

192199
print("\033[92mTest passed!\033[0m")

test/infiniop/silu.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import torch
66
from libinfiniop import (
77
LIBINFINIOP,
8+
InfiniDeviceEnum,
89
InfiniDeviceNames,
910
InfiniDtype,
1011
InfiniDtypeNames,
@@ -168,6 +169,12 @@ def lib_silu():
168169
NUM_ITERATIONS = args.num_iterations
169170

170171
for device in get_test_devices(args):
172+
if device == InfiniDeviceEnum.ILUVATAR:
173+
_TENSOR_DTYPES = [
174+
InfiniDtype.BF16,
175+
InfiniDtype.F16,
176+
InfiniDtype.F32,
177+
]
171178
test_operator(device, test, _TEST_CASES, _TENSOR_DTYPES)
172179

173180
print("\033[92mTest passed!\033[0m")

0 commit comments

Comments
 (0)