Commit e5c3769d authored by raramer01's avatar raramer01 Committed by Scott Cyphers

Becky/enable more python gpu tests (#830)

* unskipping passing gpu tests

* skipping failing gpu tests

* import pytest as needed

* fix style issues

* unskip passing test

* add additional skip reason, unable to compile
parent 10ef07e6
......@@ -24,6 +24,7 @@ from test.ngraph.util import get_runtime, run_op_node
@pytest.mark.parametrize('dtype', [np.float32, np.float64,
np.int8, np.int16, np.int32, np.int64,
np.uint8, np.uint16, np.uint32, np.uint64])
@pytest.config.gpu_skip(reason='Not implemented')
def test_simple_computation_on_ndarrays(dtype):
runtime = get_runtime()
......
......@@ -16,10 +16,12 @@
import numpy as np
import pytest
import ngraph as ng
from test.ngraph.util import get_runtime
@pytest.config.gpu_skip(reason='Not implemented')
def test_convolution_2d():
runtime = get_runtime()
# input_x should have shape N(batch) x C x H x W
......
......@@ -38,6 +38,7 @@ from test.ngraph.util import run_op_node
([2, 3, 4, 5], [5, 2, 3], None, 1),
([2, 3, 4, 5], [4, 5, 2, 4], 2, 2),
])
@pytest.config.gpu_skip(reason='under investigation, runtime error is: function failed to compile')
def test_dot(left_shape, right_shape, reduction_axes_count, numpy_axes):
np.random.seed(133391)
left_input = -100.0 + np.random.rand(*left_shape) * 200.0
......@@ -48,6 +49,7 @@ def test_dot(left_shape, right_shape, reduction_axes_count, numpy_axes):
assert np.allclose(result, expected)
@pytest.config.gpu_skip(reason='under investigation, runtime error is: function failed to compile')
def test_dot_tensor_scalar():
np.random.seed(133391)
left_input = 10.0
......
......@@ -20,6 +20,7 @@ import ngraph as ng
from test.ngraph.util import get_runtime, run_op_numeric_data
@pytest.config.gpu_skip(reason='Not implemented')
def test_concat():
a = np.array([[1, 2], [3, 4]])
b = np.array([[5, 6]])
......@@ -39,6 +40,7 @@ def test_concat():
(bool, False),
(bool, np.empty((2, 2), dtype=bool)),
])
@pytest.config.gpu_skip(reason='under investigation, runtime error is: function failed to compile')
def test_constant_from_bool(val_type, value):
expected = np.array(value, dtype=val_type)
result = run_op_numeric_data(value, ng.constant, val_type)
......@@ -57,6 +59,7 @@ def test_constant_from_bool(val_type, value):
(np.uint32, np.uint32(123456)),
(np.uint64, np.uint64(1234567)),
])
@pytest.config.gpu_skip(reason='under investigation, runtime error is: function failed to compile')
def test_constant_from_scalar(val_type, value):
expected = np.array(value, dtype=val_type)
result = run_op_numeric_data(value, ng.constant, val_type)
......@@ -67,6 +70,7 @@ def test_constant_from_scalar(val_type, value):
np.float32,
np.float64,
])
@pytest.config.gpu_skip(reason='under investigation, runtime error is: function failed to compile')
def test_constant_from_float_array(val_type):
np.random.seed(133391)
input_data = np.array(-1 + np.random.rand(2, 3, 4) * 2, dtype=val_type)
......@@ -84,6 +88,7 @@ def test_constant_from_float_array(val_type):
(np.uint32, 0, 1024),
(np.uint64, 0, 16383),
])
@pytest.config.gpu_skip(reason='under investigation, runtime error is: function failed to compile')
def test_constant_from_integer_array(val_type, range_start, range_end):
np.random.seed(133391)
input_data = np.array(np.random.randint(range_start, range_end, size=(2, 2)), dtype=val_type)
......
......@@ -55,6 +55,7 @@ def test_unary_op_array_err(ng_api_fn, numpy_fn, range_start, range_end):
(ng.tan, np.tan, -1., 1.),
(ng.tanh, np.tanh, -100., 100.),
])
@pytest.config.gpu_skip(reason='under investigation, runtime error is: function failed to compile')
def test_unary_op_array(ng_api_fn, numpy_fn, range_start, range_end):
np.random.seed(133391)
input_data = range_start + np.random.rand(2, 3, 4) * (range_end - range_start)
......@@ -88,6 +89,7 @@ def test_unary_op_array(ng_api_fn, numpy_fn, range_start, range_end):
(ng.tan, np.tan, np.float32(np.pi / 4.0)),
(ng.tanh, np.tanh, np.float32(0.1234)),
])
@pytest.config.gpu_skip(reason='under investigation, runtime error is: function failed to compile')
def test_unary_op_scalar(ng_api_fn, numpy_fn, input_data):
expected = numpy_fn(input_data)
......
......@@ -25,6 +25,7 @@ def _ndarray_1x1x4x4():
return np.arange(11, 27, dtype=np.float32).reshape(1, 1, 4, 4)
@pytest.config.gpu_skip(reason='Not implemented')
def test_avg_pool_2d(_ndarray_1x1x4x4):
runtime = get_runtime()
input_data = _ndarray_1x1x4x4
......@@ -73,6 +74,7 @@ def test_avg_pool_2d(_ndarray_1x1x4x4):
assert np.allclose(result, expected)
@pytest.config.gpu_skip(reason='Not implemented')
def test_avg_pooling_3d(_ndarray_1x1x4x4):
rt = get_runtime()
data = _ndarray_1x1x4x4
......
......@@ -34,6 +34,7 @@ from test.ngraph.util import run_op_node
(ng.sum, np.sum, (0, 2)),
(ng.prod, np.prod, (0, 2)),
])
@pytest.config.gpu_skip(reason='Not implemented')
def test_reduction_ops(ng_api_helper, numpy_function, reduction_axes):
shape = [2, 4, 3, 2]
np.random.seed(133391)
......
......@@ -184,12 +184,10 @@ def test_add_op():
binary_op_exec('Add')
@pytest.config.gpu_skip(reason="Not implemented")
def test_sub():
binary_op_exec('-')
@pytest.config.gpu_skip(reason="Not implemented")
def test_sub_op():
binary_op_exec('Sub')
......@@ -202,17 +200,14 @@ def test_mul_op():
binary_op_exec('Mul')
@pytest.config.gpu_skip(reason="Not implemented")
def test_div():
binary_op_exec('/')
@pytest.config.gpu_skip(reason="Not implemented")
def test_div_op():
binary_op_exec('Div')
@pytest.config.gpu_skip(reason="Not implemented")
def test_dot():
binary_op_exec('Dot')
......@@ -225,37 +220,30 @@ def test_minimum():
binary_op_exec('Minimum')
@pytest.config.gpu_skip(reason="Not implemented")
def test_power():
binary_op_exec('Power')
@pytest.config.gpu_skip(reason="Not implemented")
def test_greater():
binary_op_comparison('Greater')
@pytest.config.gpu_skip(reason="Not implemented")
def test_greater_eq():
binary_op_comparison('GreaterEq')
@pytest.config.gpu_skip(reason="Not implemented")
def test_less():
binary_op_comparison('Less')
@pytest.config.gpu_skip(reason="Not implemented")
def test_less_eq():
binary_op_comparison('LessEq')
@pytest.config.gpu_skip(reason="Not implemented")
def test_not_equal():
binary_op_comparison('NotEqual')
@pytest.config.gpu_skip(reason="Not implemented")
def test_add_with_mul():
element_type = Type.f32
......@@ -395,119 +383,102 @@ def unary_op_exec(op_str, input_list):
assert np.allclose(result_arr, result_arr_ref)
@pytest.config.gpu_skip(reason="Not implemented")
def test_abs():
input_list = [-1, 0, 1, 2]
op_str = 'Abs'
unary_op_exec(op_str, input_list)
@pytest.config.gpu_skip(reason="Not implemented")
def test_acos():
input_list = [-1, 0, 0.5, 1]
op_str = 'Acos'
unary_op_exec(op_str, input_list)
@pytest.config.gpu_skip(reason="Not implemented")
def test_asin():
input_list = [-1, 0, 0.5, 1]
op_str = 'Asin'
unary_op_exec(op_str, input_list)
@pytest.config.gpu_skip(reason="Not implemented")
def test_atan():
input_list = [-1, 0, 0.5, 1]
op_str = 'Atan'
unary_op_exec(op_str, input_list)
@pytest.config.gpu_skip(reason="Not implemented")
def test_ceiling():
input_list = [0.5, 0, 0.4, 0.5]
op_str = 'Ceiling'
unary_op_exec(op_str, input_list)
@pytest.config.gpu_skip(reason="Not implemented")
def test_cos():
input_list = [0, 0.7, 1.7, 3.4]
op_str = 'Cos'
unary_op_exec(op_str, input_list)
@pytest.config.gpu_skip(reason="Not implemented")
def test_cosh():
input_list = [-1, 0., 0.5, 1]
op_str = 'Cosh'
unary_op_exec(op_str, input_list)
@pytest.config.gpu_skip(reason="Not implemented")
def test_floor():
input_list = [-0.5, 0, 0.4, 0.5]
op_str = 'Floor'
unary_op_exec(op_str, input_list)
@pytest.config.gpu_skip(reason="Not implemented")
def test_log():
input_list = [1, 2, 3, 4]
op_str = 'log'
unary_op_exec(op_str, input_list)
@pytest.config.gpu_skip(reason="Not implemented")
def test_exp():
input_list = [-1, 0, 1, 2]
op_str = 'exp'
unary_op_exec(op_str, input_list)
@pytest.config.gpu_skip(reason="Not implemented")
def test_negative():
input_list = [-1, 0, 1, 2]
op_str = 'negative'
unary_op_exec(op_str, input_list)
@pytest.config.gpu_skip(reason="Not implemented")
def test_sign():
input_list = [-1, 0, 0.5, 1]
op_str = 'Sign'
unary_op_exec(op_str, input_list)
@pytest.config.gpu_skip(reason="Not implemented")
def test_sin():
input_list = [0, 0.7, 1.7, 3.4]
op_str = 'Sin'
unary_op_exec(op_str, input_list)
@pytest.config.gpu_skip(reason="Not implemented")
def test_sinh():
input_list = [-1, 0., 0.5, 1]
op_str = 'Sinh'
unary_op_exec(op_str, input_list)
@pytest.config.gpu_skip(reason="Not implemented")
def test_sqrt():
input_list = [0., 0.5, 1, 2]
op_str = 'Sqrt'
unary_op_exec(op_str, input_list)
@pytest.config.gpu_skip(reason="Not implemented")
def test_tan():
input_list = [-np.pi / 4, 0, np.pi / 8, np.pi / 8]
op_str = 'Tan'
unary_op_exec(op_str, input_list)
@pytest.config.gpu_skip(reason="Not implemented")
def test_tanh():
input_list = [-1, 0, 0.5, 1]
op_str = 'Tanh'
......@@ -521,7 +492,6 @@ def test_reverse():
unary_op_exec(op_str, input_list)
@pytest.config.gpu_skip(reason="Not implemented")
def test_not():
element_type = Type.boolean
shape = Shape([2])
......@@ -546,7 +516,6 @@ def test_not():
assert np.allclose(result_arr, result_arr_ref)
@pytest.config.gpu_skip(reason="Not implemented")
def test_sum():
element_type = Type.f32
......@@ -572,7 +541,6 @@ def test_sum():
assert np.allclose(result_arr[0], result_arr_ref)
@pytest.config.gpu_skip(reason="Not implemented")
def test_reshape():
element_type = Type.f32
......@@ -598,7 +566,6 @@ def test_reshape():
assert np.allclose(result_arr, result_arr_ref)
@pytest.config.gpu_skip(reason="Not implemented")
def test_convert():
element_type = Type.f32
......@@ -642,7 +609,6 @@ def test_convert():
assert np.allclose(result_arr, result_arr_ref)
@pytest.config.gpu_skip(reason="Not implemented")
def test_broadcast():
element_type = Type.f32
......@@ -668,7 +634,6 @@ def test_broadcast():
assert np.allclose(result_arr, result_arr_ref)
@pytest.config.gpu_skip(reason="Not implemented")
def test_constant():
element_type = Type.f32
......@@ -723,7 +688,6 @@ def test_reduce():
assert np.allclose(result_arr, result_arr_ref)
@pytest.config.gpu_skip(reason="Not implemented")
def test_onehot():
element_type = Type.f32
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment