On 03/08/2010, at 06:27, Andreas Kloeckner wrote: > On Tue, 03 Aug 2010 00:16:21 -0400, Andreas Kloeckner > <li...@informa.tiker.net> wrote: >> On Wed, 21 Jul 2010 14:12:22 +0200, Peter Schmidtke <pschmid...@ub.edu> >> wrote: >>> however seen the imprecision issues with gpuarrays I suppose >>> I'd better not use them on Fermis right now? >> >> A week and a half or so back, I loosened the test bounds for these >> functions to accommodate Fermi. (perhaps CUDA 3.1 in general) I wouldn't >> make too much of this. Yes, precision has somewhat regressed. But a) not >> catastrophically, and probably for a handsome speed gain, and b) the >> purpose of these tests is to make sure that something reasonable (i.e. >> not garbage) is returned. >> >> (Just to clarify: These precision issues are in Nvidia's special >> functions, and have nothing to do with GPUArray itself, which just uses >> them.) > > I must be getting old. The loosening of the test bounds was in PyOpenCL, > not PyCUDA. Sorry for the confusion. In any case, test_gpuarray fully > passes for me on Fermi with current git. Peter, Julien, anyone: are you > still seeing problems/failures? >
I see 4 failures in test_gpuarray using the svn version of pycuda (6fbf2a5), however test_driver works fine now. I also tried the undistributed tests and on the measure_speed.py I get a cuMemAlloc failed error after 268435456. The Tesla has 3Gb of RAM. Here are the errors I get on test_gpuarray on a S2050 : =================================== FAILURES =================================== ___________________________ TestGPUArray.test_minmax ___________________________ def f(*args, **kwargs): import pycuda.driver # appears to be idempotent, i.e. no harm in calling it more than once pycuda.driver.init() ctx = make_default_context() try: assert isinstance(ctx.get_device().name(), str) assert isinstance(ctx.get_device().compute_capability(), tuple) assert isinstance(ctx.get_device().get_attributes(), dict) > inner_f(*args, **kwargs) /usr/local/lib/python2.7/site-packages/pycuda-0.94rc-py2.7-linux-x86_64.egg/pycuda/tools.py:503: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <test_gpuarray.TestGPUArray instance at 0xd05a200> @mark_cuda_test def test_minmax(self): from pycuda.curandom import rand as curand if has_double_support(): dtypes = [numpy.float64, numpy.float32, numpy.int32] else: dtypes = [numpy.float32, numpy.int32] for what in ["min", "max"]: for dtype in dtypes: a_gpu = curand((200000,), dtype) a = a_gpu.get() op_a = getattr(numpy, what)(a) op_a_gpu = getattr(gpuarray, what)(a_gpu).get() > assert op_a_gpu == op_a, (op_a_gpu, op_a, dtype, what) E AssertionError: (array(3.697862848639488e-05, dtype=float32), 2.9394869e-06, <type 'numpy.float32'>, 'min') test_gpuarray.py:424: AssertionError _______________________ TestGPUArray.test_subset_minmax ________________________ def f(*args, **kwargs): import pycuda.driver # appears to be idempotent, i.e. no harm in calling it more than once pycuda.driver.init() ctx = make_default_context() try: assert isinstance(ctx.get_device().name(), str) assert isinstance(ctx.get_device().compute_capability(), tuple) assert isinstance(ctx.get_device().get_attributes(), dict) > inner_f(*args, **kwargs) /usr/local/lib/python2.7/site-packages/pycuda-0.94rc-py2.7-linux-x86_64.egg/pycuda/tools.py:503: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <test_gpuarray.TestGPUArray instance at 0xd084b48> @mark_cuda_test def test_subset_minmax(self): from pycuda.curandom import rand as curand l_a = 200000 gran = 5 l_m = l_a - l_a // gran + 1 if has_double_support(): dtypes = [numpy.float64, numpy.float32, numpy.int32] else: dtypes = [numpy.float32, numpy.int32] for dtype in dtypes: a_gpu = curand((l_a,), dtype) a = a_gpu.get() meaningful_indices_gpu = gpuarray.zeros(l_m, dtype=numpy.int32) meaningful_indices = meaningful_indices_gpu.get() j = 0 for i in range(len(meaningful_indices)): meaningful_indices[i] = j j = j + 1 if j % gran == 0: j = j + 1 meaningful_indices_gpu = gpuarray.to_gpu(meaningful_indices) b = a[meaningful_indices] min_a = numpy.min(b) min_a_gpu = gpuarray.subset_min(meaningful_indices_gpu, a_gpu).get() > assert min_a_gpu == min_a E assert array(0.00017937482334673405, dtype=float32) == 4.4573098e-06 test_gpuarray.py:458: AssertionError ____________________________ TestGPUArray.test_sum _____________________________ def f(*args, **kwargs): import pycuda.driver # appears to be idempotent, i.e. no harm in calling it more than once pycuda.driver.init() ctx = make_default_context() try: assert isinstance(ctx.get_device().name(), str) assert isinstance(ctx.get_device().compute_capability(), tuple) assert isinstance(ctx.get_device().get_attributes(), dict) > inner_f(*args, **kwargs) /usr/local/lib/python2.7/site-packages/pycuda-0.94rc-py2.7-linux-x86_64.egg/pycuda/tools.py:503: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <test_gpuarray.TestGPUArray instance at 0xd085638> @mark_cuda_test def test_sum(self): from pycuda.curandom import rand as curand a_gpu = curand((200000,)) a = a_gpu.get() sum_a = numpy.sum(a) from pycuda.reduction import get_sum_kernel sum_a_gpu = gpuarray.sum(a_gpu).get() > assert abs(sum_a_gpu-sum_a)/abs(sum_a) < 1e-4 E assert (abs((array(1553.26220703125, dtype=float32) - 99926.32)) / abs(99926.32)) < 0.0001 test_gpuarray.py:405: AssertionError ------------------------------- Captured stdout -------------------------------- *** compiler output in /tmp/tmpKfGlhU *** compiler output in /tmp/tmpvekHdO ____________________________ TestGPUArray.test_dot _____________________________ def f(*args, **kwargs): import pycuda.driver # appears to be idempotent, i.e. no harm in calling it more than once pycuda.driver.init() ctx = make_default_context() try: assert isinstance(ctx.get_device().name(), str) assert isinstance(ctx.get_device().compute_capability(), tuple) assert isinstance(ctx.get_device().get_attributes(), dict) > inner_f(*args, **kwargs) /usr/local/lib/python2.7/site-packages/pycuda-0.94rc-py2.7-linux-x86_64.egg/pycuda/tools.py:503: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = <test_gpuarray.TestGPUArray instance at 0xd09de60> @mark_cuda_test def test_dot(self): from pycuda.curandom import rand as curand a_gpu = curand((200000,)) a = a_gpu.get() b_gpu = curand((200000,)) b = b_gpu.get() dot_ab = numpy.dot(a, b) dot_ab_gpu = gpuarray.dot(a_gpu, b_gpu).get() > assert abs(dot_ab_gpu-dot_ab)/abs(dot_ab) < 1e-4 E assert (abs((array(754.5011596679688, dtype=float32) - 49924.496)) / abs(49924.496)) < 0.0001 test_gpuarray.py:472: AssertionError > Andreas > Peter Schmidtke ----------------- PhD Student Department of Physical Chemistry School of Pharmacy University of Barcelona Barcelona, Spain _______________________________________________ PyCUDA mailing list PyCUDA@tiker.net http://lists.tiker.net/listinfo/pycuda