提交 ec2f55b8 authored 作者: Arnaud Bergeron's avatar Arnaud Bergeron

Tag a bunch of slow tests according to the linux timings.

上级 b725ce72
...@@ -16,6 +16,7 @@ if cuda_available: ...@@ -16,6 +16,7 @@ if cuda_available:
import unittest import unittest
from theano.tests import unittest_tools as utt from theano.tests import unittest_tools as utt
from nose.plugins.skip import SkipTest from nose.plugins.skip import SkipTest
from nose.plugins.attrib import attr
#TODO: test gpu #TODO: test gpu
# Done in test_consistency_GPU_{serial,parallel} # Done in test_consistency_GPU_{serial,parallel}
...@@ -445,6 +446,7 @@ def test_uniform(): ...@@ -445,6 +446,7 @@ def test_uniform():
allow_01=True, inputs=input) allow_01=True, inputs=input)
@attr('slow')
def test_binomial(): def test_binomial():
#TODO: test size=None, ndim=X #TODO: test size=None, ndim=X
#TODO: test size=X, ndim!=X.ndim #TODO: test size=X, ndim!=X.ndim
...@@ -532,6 +534,7 @@ def test_binomial(): ...@@ -532,6 +534,7 @@ def test_binomial():
inputs=input, target_avg=mean, mean_rtol=rtol) inputs=input, target_avg=mean, mean_rtol=rtol)
@attr('slow')
def test_normal0(): def test_normal0():
steps = 50 steps = 50
......
...@@ -1620,6 +1620,7 @@ class T_Scan(unittest.TestCase): ...@@ -1620,6 +1620,7 @@ class T_Scan(unittest.TestCase):
analytic_grad[max_err_pos], analytic_grad[max_err_pos],
num_grad.gx[max_err_pos])) num_grad.gx[max_err_pos]))
@attr('slow')
def test_grad_multiple_outs_taps_backwards(self): def test_grad_multiple_outs_taps_backwards(self):
l = 5 l = 5
rng = numpy.random.RandomState(utt.fetch_seed()) rng = numpy.random.RandomState(utt.fetch_seed())
...@@ -2601,6 +2602,7 @@ class T_Scan(unittest.TestCase): ...@@ -2601,6 +2602,7 @@ class T_Scan(unittest.TestCase):
f2 = theano.function([], gx) f2 = theano.function([], gx)
utt.assert_allclose(f2(), numpy.ones((10,))) utt.assert_allclose(f2(), numpy.ones((10,)))
@attr('slow')
def test_rop2(self): def test_rop2(self):
seed = utt.fetch_seed() seed = utt.fetch_seed()
rng = numpy.random.RandomState(seed) rng = numpy.random.RandomState(seed)
......
from nose.plugins.skip import SkipTest from nose.plugins.skip import SkipTest
from nose.plugins.attrib import attr
import sys import sys
import time import time
import unittest import unittest
...@@ -128,6 +129,7 @@ class TestSP(unittest.TestCase): ...@@ -128,6 +129,7 @@ class TestSP(unittest.TestCase):
#profmode.print_summary() #profmode.print_summary()
@attr('slow')
def test_sparse(self): def test_sparse(self):
# print '\n\n*************************************************' # print '\n\n*************************************************'
......
import time import time
from nose.plugins.skip import SkipTest from nose.plugins.skip import SkipTest
from nose.plugins.attrib import attr
import numpy import numpy
import theano import theano
...@@ -246,6 +247,7 @@ class TestConv2D(utt.InferShapeTester): ...@@ -246,6 +247,7 @@ class TestConv2D(utt.InferShapeTester):
N_image_shape=(2, 3, 3, 3), N_filter_shape=(5, 3, 2, 2), N_image_shape=(2, 3, 3, 3), N_filter_shape=(5, 3, 2, 2),
should_raise=True) should_raise=True)
@attr('slow')
def test_subsample(self): def test_subsample(self):
""" """
Tests convolution where subsampling != (1,1) Tests convolution where subsampling != (1,1)
...@@ -282,6 +284,7 @@ class TestConv2D(utt.InferShapeTester): ...@@ -282,6 +284,7 @@ class TestConv2D(utt.InferShapeTester):
(3, 2, 8, 8), (4, 3, 5, 5), (3, 2, 8, 8), (4, 3, 5, 5),
'valid') 'valid')
@attr('slow')
def test_invalid_input_shape(self): def test_invalid_input_shape(self):
""" """
Tests that when the shape gived at build time is not the same as Tests that when the shape gived at build time is not the same as
......
...@@ -12,6 +12,7 @@ import theano.sparse ...@@ -12,6 +12,7 @@ import theano.sparse
if theano.sparse.enable_sparse: if theano.sparse.enable_sparse:
from scipy import sparse from scipy import sparse
from nose.plugins.skip import SkipTest from nose.plugins.skip import SkipTest
from nose.plugins.attrib import attr
floatX = theano.config.floatX floatX = theano.config.floatX
...@@ -222,6 +223,7 @@ class TestConv3D(utt.InferShapeTester): ...@@ -222,6 +223,7 @@ class TestConv3D(utt.InferShapeTester):
self.randomize() self.randomize()
self.check_c_against_python(self.V.get_value(borrow=True).shape[1:4]) self.check_c_against_python(self.V.get_value(borrow=True).shape[1:4])
@attr('slow')
def test_c_against_mat_mul(self): def test_c_against_mat_mul(self):
# Use a filter of the same size as the image, so the convolution is # Use a filter of the same size as the image, so the convolution is
# just a dense matrix multiply. # just a dense matrix multiply.
......
...@@ -864,6 +864,7 @@ def test_dot22(): ...@@ -864,6 +864,7 @@ def test_dot22():
cmp((0, 0), (0, 0)) cmp((0, 0), (0, 0))
@attr('slow')
def test_dot22scalar(): def test_dot22scalar():
## including does not seem to work for 'local_dot_to_dot22' and ## including does not seem to work for 'local_dot_to_dot22' and
## 'local_dot22_to_dot22scalar' ## 'local_dot22_to_dot22scalar'
......
...@@ -5,6 +5,7 @@ import unittest ...@@ -5,6 +5,7 @@ import unittest
import numpy import numpy
from nose.plugins.skip import SkipTest from nose.plugins.skip import SkipTest
from nose.plugins.attrib import attr
import theano import theano
from theano.gof.python25 import all, any from theano.gof.python25 import all, any
...@@ -454,6 +455,7 @@ class test_CAReduce(unittest_tools.InferShapeTester): ...@@ -454,6 +455,7 @@ class test_CAReduce(unittest_tools.InferShapeTester):
self.with_linker(gof.PerformLinker(), scalar.and_, dtype=dtype, self.with_linker(gof.PerformLinker(), scalar.and_, dtype=dtype,
test_nan=True, tensor_op=tensor.all) test_nan=True, tensor_op=tensor.all)
@attr('slow')
def test_c(self): def test_c(self):
if not theano.config.cxx: if not theano.config.cxx:
raise SkipTest("G++ not available, so we need to skip this test.") raise SkipTest("G++ not available, so we need to skip this test.")
...@@ -624,6 +626,7 @@ class test_Prod(unittest.TestCase): ...@@ -624,6 +626,7 @@ class test_Prod(unittest.TestCase):
fn_a0 = theano.function([x], pwz_a0, mode=self.mode) fn_a0 = theano.function([x], pwz_a0, mode=self.mode)
assert numpy.allclose(fn_a0(x_val), [1, 10, 162]) assert numpy.allclose(fn_a0(x_val), [1, 10, 162])
@attr('slow')
def test_other_grad_tests(self): def test_other_grad_tests(self):
x = theano.tensor.dmatrix() x = theano.tensor.dmatrix()
x_val1 = numpy.array([[1, 2, 3], [0, 5, 6], [0, 0, 9]], x_val1 = numpy.array([[1, 2, 3], [0, 5, 6], [0, 0, 9]],
...@@ -753,6 +756,7 @@ class T_sum_dtype(unittest.TestCase): ...@@ -753,6 +756,7 @@ class T_sum_dtype(unittest.TestCase):
data = data.astype(dtype) data = data.astype(dtype)
f(data) f(data)
@attr('slow')
def test_sum_custom_dtype(self): def test_sum_custom_dtype(self):
""" """
Test the ability to provide your own output dtype for a sum. Test the ability to provide your own output dtype for a sum.
...@@ -853,6 +857,7 @@ class T_mean_dtype(unittest.TestCase): ...@@ -853,6 +857,7 @@ class T_mean_dtype(unittest.TestCase):
data = data.astype(dtype) data = data.astype(dtype)
f(data) f(data)
@attr('slow')
def test_mean_custom_dtype(self): def test_mean_custom_dtype(self):
""" """
Test the ability to provide your own output dtype for a mean. Test the ability to provide your own output dtype for a mean.
...@@ -960,6 +965,7 @@ class T_prod_dtype(unittest.TestCase): ...@@ -960,6 +965,7 @@ class T_prod_dtype(unittest.TestCase):
data = data.astype(dtype) data = data.astype(dtype)
f(data) f(data)
@attr('slow')
def test_prod_custom_dtype(self): def test_prod_custom_dtype(self):
""" """
Test the ability to provide your own output dtype for a prod. Test the ability to provide your own output dtype for a prod.
...@@ -991,6 +997,7 @@ class T_prod_dtype(unittest.TestCase): ...@@ -991,6 +997,7 @@ class T_prod_dtype(unittest.TestCase):
tensor.grad(prod_var.sum(), x, tensor.grad(prod_var.sum(), x,
disconnected_inputs='ignore') disconnected_inputs='ignore')
@attr('slow')
def test_prod_custom_acc_dtype(self): def test_prod_custom_acc_dtype(self):
""" """
Test the ability to provide your own acc_dtype for a prod. Test the ability to provide your own acc_dtype for a prod.
...@@ -1079,6 +1086,7 @@ class T_prod_without_zeros_dtype(unittest.TestCase): ...@@ -1079,6 +1086,7 @@ class T_prod_without_zeros_dtype(unittest.TestCase):
data = data.astype(dtype) data = data.astype(dtype)
f(data) f(data)
@attr('slow')
def test_prod_without_zeros_custom_dtype(self): def test_prod_without_zeros_custom_dtype(self):
""" """
Test ability to provide your own output dtype for a ProdWithoutZeros(). Test ability to provide your own output dtype for a ProdWithoutZeros().
...@@ -1102,6 +1110,7 @@ class T_prod_without_zeros_dtype(unittest.TestCase): ...@@ -1102,6 +1110,7 @@ class T_prod_without_zeros_dtype(unittest.TestCase):
data = data.astype(input_dtype) data = data.astype(input_dtype)
f(data) f(data)
@attr('slow')
def test_prod_without_zeros_custom_acc_dtype(self): def test_prod_without_zeros_custom_acc_dtype(self):
""" """
Test ability to provide your own acc_dtype for a ProdWithoutZeros(). Test ability to provide your own acc_dtype for a ProdWithoutZeros().
......
from nose.plugins.attrib import attr
import numpy import numpy
from theano import tensor, function from theano import tensor, function
import unittest
class TestKeepDims: # this tests other ops to ensure they keep the dimensions of their
# inputs correctly
@attr('slow')
class TestKeepDims(unittest.TestCase):
def makeKeepDims_local(self, x, y, axis): def makeKeepDims_local(self, x, y, axis):
x = tensor.as_tensor_variable(x) x = tensor.as_tensor_variable(x)
...@@ -95,7 +101,3 @@ class TestKeepDims: ...@@ -95,7 +101,3 @@ class TestKeepDims:
assert numpy.allclose(keep_param(a), keep_synth(a)) assert numpy.allclose(keep_param(a), keep_synth(a))
assert keep_param(a).shape == keep_synth(a).shape assert keep_param(a).shape == keep_synth(a).shape
if __name__ == '__main__':
TestKeepDims().test_keepdims()
...@@ -12,6 +12,8 @@ import sys ...@@ -12,6 +12,8 @@ import sys
from theano.tests import unittest_tools from theano.tests import unittest_tools
from numpy.testing.noseclasses import KnownFailureTest from numpy.testing.noseclasses import KnownFailureTest
from nose.plugins.attrib import attr
def cross_entropy(target, output, axis=1): def cross_entropy(target, output, axis=1):
""" """
...@@ -557,6 +559,7 @@ def create_realistic(window_size=3, # 7, ...@@ -557,6 +559,7 @@ def create_realistic(window_size=3, # 7,
return model return model
@attr('slow')
def test_naacl_model(iters_per_unsup=3, iters_per_sup=3, def test_naacl_model(iters_per_unsup=3, iters_per_sup=3,
optimizer=None, realistic=False): optimizer=None, realistic=False):
#print "BUILDING MODEL" #print "BUILDING MODEL"
...@@ -643,13 +646,7 @@ def jtest_main(): ...@@ -643,13 +646,7 @@ def jtest_main():
test_naacl_model(optimizer, 10, 10, realistic=False) test_naacl_model(optimizer, 10, 10, realistic=False)
def real_main():
test_naacl_model()
def profile_main(): def profile_main():
# This is the main function for profiling
# We've renamed our original main() above to real_main()
import cProfile import cProfile
import pstats import pstats
from theano.compat.six import StringIO from theano.compat.six import StringIO
...@@ -664,5 +661,4 @@ def profile_main(): ...@@ -664,5 +661,4 @@ def profile_main():
# stats.print_callers() # stats.print_callers()
if __name__ == '__main__': if __name__ == '__main__':
#real_main()
profile_main() profile_main()
...@@ -408,6 +408,7 @@ class test_canonize(unittest.TestCase): ...@@ -408,6 +408,7 @@ class test_canonize(unittest.TestCase):
assert(len(f.maker.fgraph.toposort()) == nb_elemwise) assert(len(f.maker.fgraph.toposort()) == nb_elemwise)
assert(out_dtype == out.dtype) assert(out_dtype == out.dtype)
@attr('slow')
def test_multiple_case(self): def test_multiple_case(self):
""" test those case take from the comment in Canonizer """ test those case take from the comment in Canonizer
x / x -> 1 x / x -> 1
...@@ -1135,6 +1136,7 @@ class test_fusion(unittest.TestCase): ...@@ -1135,6 +1136,7 @@ class test_fusion(unittest.TestCase):
'local_elemwise_fusion', 'canonicalize') 'local_elemwise_fusion', 'canonicalize')
self.do(mode, shared, shp) self.do(mode, shared, shp)
@attr('slow')
def test_elemwise_fusion_4d(self): def test_elemwise_fusion_4d(self):
shp = (3, 3, 3, 3) shp = (3, 3, 3, 3)
mode = copy.copy(compile.mode.get_default_mode()) mode = copy.copy(compile.mode.get_default_mode())
...@@ -1159,6 +1161,7 @@ class test_fusion(unittest.TestCase): ...@@ -1159,6 +1161,7 @@ class test_fusion(unittest.TestCase):
self.do(mode, cuda.float32_shared_constructor, shp, gpu=True) self.do(mode, cuda.float32_shared_constructor, shp, gpu=True)
@attr('slow')
def test_gpu_fusion_Xd(self): def test_gpu_fusion_Xd(self):
#we need the optimisation enabled, debug do this. #we need the optimisation enabled, debug do this.
if theano.config.mode == "FAST_COMPILE": if theano.config.mode == "FAST_COMPILE":
...@@ -1859,6 +1862,7 @@ class test_local_subtensor_merge(unittest.TestCase): ...@@ -1859,6 +1862,7 @@ class test_local_subtensor_merge(unittest.TestCase):
self.assertRaises(IndexError, f, x_val, idx) self.assertRaises(IndexError, f, x_val, idx)
self.assertRaises(IndexError, g, x_val, idx) self.assertRaises(IndexError, g, x_val, idx)
@attr('slow')
def test_const2(self): def test_const2(self):
# var[::-1][const] -> var[-1] # var[::-1][const] -> var[-1]
x = tensor.matrix('x') x = tensor.matrix('x')
...@@ -3156,6 +3160,7 @@ class T_local_switch_sink(unittest.TestCase): ...@@ -3156,6 +3160,7 @@ class T_local_switch_sink(unittest.TestCase):
resm[idx])).sum() == self.resm[idx].size resm[idx])).sum() == self.resm[idx].size
idx += 1 idx += 1
@attr('slow')
def test_local_div_switch_sink(self): def test_local_div_switch_sink(self):
c = T.dscalar() c = T.dscalar()
idx = 0 idx = 0
......
...@@ -4,6 +4,7 @@ import sys ...@@ -4,6 +4,7 @@ import sys
import unittest import unittest
from nose.plugins.skip import SkipTest from nose.plugins.skip import SkipTest
from nose.plugins.attrib import attr
import numpy import numpy
import theano import theano
...@@ -499,6 +500,7 @@ class T_subtensor(unittest.TestCase, utt.TestOptimizationMixin): ...@@ -499,6 +500,7 @@ class T_subtensor(unittest.TestCase, utt.TestOptimizationMixin):
self.assertTrue(isinstance(topo_[0].op, self.adv_sub1)) self.assertTrue(isinstance(topo_[0].op, self.adv_sub1))
self.assertTrue(numpy.allclose(f([0]), ones[0] * 5)) self.assertTrue(numpy.allclose(f([0]), ones[0] * 5))
@attr('slow')
def test_shape_i_const(self): def test_shape_i_const(self):
# Each axis is treated independently by shape_i/shape operators # Each axis is treated independently by shape_i/shape operators
...@@ -756,6 +758,7 @@ class T_subtensor(unittest.TestCase, utt.TestOptimizationMixin): ...@@ -756,6 +758,7 @@ class T_subtensor(unittest.TestCase, utt.TestOptimizationMixin):
except TypeError: except TypeError:
pass pass
@attr('slow')
def test_grad_list(self): def test_grad_list(self):
data = rand(4) data = rand(4)
data = numpy.asarray(data, dtype=self.dtype) data = numpy.asarray(data, dtype=self.dtype)
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论