From patchwork Wed Apr 4 23:37:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: bugzilla-daemon@freedesktop.org X-Patchwork-Id: 10323619 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0723060318 for ; Wed, 4 Apr 2018 23:38:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9E9C23F88 for ; Wed, 4 Apr 2018 23:37:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DD1F026E35; Wed, 4 Apr 2018 23:37:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,HTML_MESSAGE, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5090E23F88 for ; Wed, 4 Apr 2018 23:37:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BFF4F6E295; Wed, 4 Apr 2018 23:37:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from culpepper.freedesktop.org (culpepper.freedesktop.org [131.252.210.165]) by gabe.freedesktop.org (Postfix) with ESMTP id D92336E295 for ; Wed, 4 Apr 2018 23:37:56 +0000 (UTC) Received: by culpepper.freedesktop.org (Postfix, from userid 33) id CF4D572155; Wed, 4 Apr 2018 23:37:56 +0000 (UTC) From: bugzilla-daemon@freedesktop.org To: dri-devel@lists.freedesktop.org Subject: [Bug 100105] Make Theano OpenCL support work on Clover and RadeonSI Date: Wed, 04 Apr 2018 23:37:57 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Mesa X-Bugzilla-Component: Drivers/Gallium/radeonsi X-Bugzilla-Version: git X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: jan.vesely@rutgers.edu X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: medium X-Bugzilla-Assigned-To: dri-devel@lists.freedesktop.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://bugs.freedesktop.org/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP https://bugs.freedesktop.org/show_bug.cgi?id=100105 --- Comment #2 from Jan Vesely --- Latest update: >>> pygpu.test() pygpu is installed in /home/jvesely/.local/lib/python3.6/site-packages/pygpu-0.7.5+12.g6f0132c.dirty-py3.6-linux-x86_64.egg/pygpu NumPy version 1.13.3 NumPy relaxed strides checking option: True NumPy is installed in /usr/lib64/python3.6/site-packages/numpy Python version 3.6.4 (default, Mar 13 2018, 18:18:20) [GCC 7.3.1 20180303 (Red Hat 7.3.1-5)] nose version 1.3.7 *** Testing for AMD Radeon R7 Graphics (CARRIZO / DRM 3.23.0 / 4.15.14-300.fc27.x86_64, LLVM 6.0.0) ---------------------------------------------------------------------- Ran 6670 tests in 995.728s FAILED (SKIP=12, errors=580, failures=2) All errors are: TypeError: This is for CUDA arrays. The two failures are: FAIL: pygpu.tests.test_elemwise.test_elemwise_f16(, 'float16', 'float16', (50,)) FAIL: pygpu.tests.test_elemwise.test_elemwise_f16(, 'float16', 'float16', (50,)) Which fail on half precision rounding error. for example: 7.0390625+7.20703125 is expected to be 14.25 but gpu returns 14.2421875 the fp32 result is 14.24609375. The GPU result is rounded down (towards zero) The CPU result is rounded up (away from zero) It looks like our vstore_half_rtn is not working as expected, which is weird because it passes CTS. diff --git a/src/cluda_opencl.h b/src/cluda_opencl.h index 6e0095c..8ba2d14 100644 --- a/src/cluda_opencl.h +++ b/src/cluda_opencl.h @@ -48,7 +48,7 @@ typedef struct _ga_half { } ga_half; #define ga_half2float(p) vload_half(0, &((p).data)) -static inline ga_half ga_float2half(ga_float f) { +inline ga_half ga_float2half(ga_float f) { ga_half r; vstore_half_rtn(f, 0, &r.data); return r; diff --git a/src/gpuarray_buffer_opencl.c b/src/gpuarray_buffer_opencl.c index 8f12811..2041ca2 100644 --- a/src/gpuarray_buffer_opencl.c +++ b/src/gpuarray_buffer_opencl.c @@ -146,7 +146,7 @@ cl_ctx *cl_make_ctx(cl_context ctx, gpucontext_props *p) { CL_CHECKN(global_err, clGetDeviceInfo(id, CL_DEVICE_VERSION, device_version_size, device_version, NULL)); - if (device_version[7] == '1' && device_version[9] < '2') { + if (device_version[7] == '1' && device_version[9] < '1') { error_set(global_err, GA_UNSUPPORTED_ERROR, "We only support OpenCL 1.2 and up"); return NULL