Skip to content

Adds CUDA FP16 arithmetic operators - #7885

Merged
sklam merged 34 commits into
numba:mainfrom
testhound:testhound/fp16-operators1
Sep 13, 2022
Merged

sklam merged 34 commits into
numba:mainfrom
testhound:testhound/fp16-operators1

Conversation

@testhound

@testhound testhound commented Mar 4, 2022 •

Copy link
Copy Markdown
Contributor

This pull request add operator support for the following fp 16 operations: +, -, *, neg, abs. This PR partly addresses the meta issue "add fp16 support": #4402.

This PR builds on: #7460 which added intrinsic support for the above operators.

@testhound
testhound requested a review from gmarkall as a code owner March 4, 2022 20:23
@testhound

Copy link
Copy Markdown
Contributor Author

gpuci run tests

@sklam sklam added 3 - Ready for Review CUDA CUDA related issue/PR labels Mar 7, 2022

@isVoid isVoid left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got a small Q below.

Comment thread numba/cuda/cudadecl.py
@gmarkall

gmarkall commented Apr 1, 2022

Copy link
Copy Markdown
Member

gpuci run tests

@gmarkall gmarkall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With this branch, the following:

from numba import cuda
from numba.types import float16, float32

def f(x, y):
    return x + y

ptx_16, resty_16 = cuda.compile_ptx(f, (float16, float16), device=True)
ptx_32, resty_32 = cuda.compile_ptx(f, (float32, float32), device=True)

print(ptx_16)
print(resty_16)

print(ptx_32)
print(resty_32)

When run with

numba --annotate-html scalar.html scalar.py

Seems to give the following typing for the addition of float16s (in the HTML output):

x = arg(0, name=x)  :: float16
y = arg(1, name=y)  :: float16
$6binary_add.2 = x + y  :: float32

and corresponding PTX:

	// begin inline asm
	cvt.f32.f16 %f1, %rs1;
	// end inline asm
	// begin inline asm
	cvt.f32.f16 %f2, %rs2;
	// end inline asm
	add.f32 	%f3, %f1, %f2;
	st.f32 	[%rd1], %f3;

Is it expected with this PR that float16 + float16 should be typed as returning a float16?

(Does this reproduce for you? Perhaps I am missing something / running something incorrectly?)

@gmarkall gmarkall added 4 - Waiting on author Waiting for author to respond to review and removed 3 - Ready for Review labels Apr 11, 2022
@testhound

Copy link
Copy Markdown
Contributor Author

With this branch, the following:

from numba import cuda
from numba.types import float16, float32

def f(x, y):
    return x + y

ptx_16, resty_16 = cuda.compile_ptx(f, (float16, float16), device=True)
ptx_32, resty_32 = cuda.compile_ptx(f, (float32, float32), device=True)

print(ptx_16)
print(resty_16)

print(ptx_32)
print(resty_32)

When run with

numba --annotate-html scalar.html scalar.py

Seems to give the following typing for the addition of float16s (in the HTML output):

x = arg(0, name=x)  :: float16
y = arg(1, name=y)  :: float16
$6binary_add.2 = x + y  :: float32

and corresponding PTX:

	// begin inline asm
	cvt.f32.f16 %f1, %rs1;
	// end inline asm
	// begin inline asm
	cvt.f32.f16 %f2, %rs2;
	// end inline asm
	add.f32 	%f3, %f1, %f2;
	st.f32 	[%rd1], %f3;

Is it expected with this PR that float16 + float16 should be typed as returning a float16?

(Does this reproduce for you? Perhaps I am missing something / running something incorrectly?)

@gmarkall this reproduces for me and you definitely found a issue. Thanks.

Comment thread numba/cuda/cudaimpl.py

@sklam sklam left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out the template should be using @register_global for the operator.*.

You can check it without CUDA hardware with:

import operator
from numba.core import types, typing
from numba.cuda.descriptor import cuda_target

fp16 = types.float16

typingctx = cuda_target.typing_context
typingctx.refresh()
fnty = typingctx.resolve_value_type(operator.add)
out = typingctx.resolve_function_type(fnty, (fp16, fp16), {})
print(out)
if out != typing.signature(fp16, fp16, fp16):
    raise AssertionError(out)

The above code is what the compiler does for function resolution. I'd recommend adding tests like this to numba/cuda/tests/nocuda.

Comment thread numba/cuda/cudadecl.py
Comment thread numba/cuda/cudadecl.py Outdated
@testhound

Copy link
Copy Markdown
Contributor Author

gpuci run tests

@gmarkall gmarkall added 4 - Waiting on reviewer Waiting for reviewer to respond to author and removed 4 - Waiting on author Waiting for author to respond to review labels Apr 15, 2022
@testhound

Copy link
Copy Markdown
Contributor Author

gpuci run tests

@testhound

Copy link
Copy Markdown
Contributor Author

gpuci run tests

@testhound

Copy link
Copy Markdown
Contributor Author

@gmarkall I added the skip_unless_cc_53 back to the testcase.

@gmarkall

gmarkall commented Sep 6, 2022

Copy link
Copy Markdown
Member

@esc Could this have another buildfarm run please?

@esc

esc commented Sep 7, 2022

Copy link
Copy Markdown
Member

@esc Could this have another buildfarm run please?

numba_smoketest_cuda_yaml_156

@esc

esc commented Sep 8, 2022

Copy link
Copy Markdown
Member

@esc Could this have another buildfarm run please?

numba_smoketest_cuda_yaml_156

So, I tested `` on the Anaconda build farm and still received the following errors on Windows.

@testhound could you take a look, please?

======================================================================
ERROR: test_float_to_float (numba.cuda.tests.cudapy.test_casting.TestCasting) (fromty=<class 'numpy.float16'>, toty=<class 'numpy.float16'>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\cudadrv\driver.py", line 2705, in add_ptx
    driver.cuLinkAddData(self.handle, enums.CU_JIT_INPUT_PTX,
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\cudadrv\driver.py", line 320, in safe_cuda_api_call
    self._check_ctypes_error(fname, retcode)
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\cudadrv\driver.py", line 388, in _check_ctypes_error
    raise CudaAPIError(retcode, msg)
numba.cuda.cudadrv.driver.CudaAPIError: [218] Call to cuLinkAddData results in UNKNOWN_CUDA_ERROR

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\tests\cudapy\test_casting.py", line 210, in test_float_to_float
    np.testing.assert_allclose(cfunc(12.3),
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\tests\cudapy\test_casting.py", line 111, in wrapper_fn
    cuda_wrapper_fn[1, 1](argarray, resarray)
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 505, in __call__
    return self.dispatcher.call(args, self.griddim, self.blockdim,
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 639, in call
    kernel = _dispatcher.Dispatcher._cuda_call(self, *args)
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 647, in _compile_for_args
    return self.compile(tuple(argtypes))
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 849, in compile
    kernel.bind()
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 178, in bind
    self._codelibrary.get_cufunc()
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\codegen.py", line 208, in get_cufunc
    cubin = self.get_cubin(cc=device.compute_capability)
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\codegen.py", line 181, in get_cubin
    linker.add_ptx(ptx.encode())
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\cudadrv\driver.py", line 2708, in add_ptx
    raise LinkerError("%s\n%s" % (e, self.error_log))
numba.cuda.cudadrv.driver.LinkerError: [218] Call to cuLinkAddData results in UNKNOWN_CUDA_ERROR
ptxas application ptx input, line 56; error   : Feature 'f16 arithemetic and compare instructions' requires .target sm_53 or higher
ptxas fatal   : Ptx assembly aborted due to errors

======================================================================
ERROR: test_float_to_float (numba.cuda.tests.cudapy.test_casting.TestCasting) (fromty=<class 'numpy.float16'>, toty=<class 'numpy.float32'>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\cudadrv\driver.py", line 2705, in add_ptx
    driver.cuLinkAddData(self.handle, enums.CU_JIT_INPUT_PTX,
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\cudadrv\driver.py", line 320, in safe_cuda_api_call
    self._check_ctypes_error(fname, retcode)
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\cudadrv\driver.py", line 388, in _check_ctypes_error
    raise CudaAPIError(retcode, msg)
numba.cuda.cudadrv.driver.CudaAPIError: [218] Call to cuLinkAddData results in UNKNOWN_CUDA_ERROR

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\tests\cudapy\test_casting.py", line 210, in test_float_to_float
    np.testing.assert_allclose(cfunc(12.3),
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\tests\cudapy\test_casting.py", line 111, in wrapper_fn
    cuda_wrapper_fn[1, 1](argarray, resarray)
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 505, in __call__
    return self.dispatcher.call(args, self.griddim, self.blockdim,
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 639, in call
    kernel = _dispatcher.Dispatcher._cuda_call(self, *args)
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 647, in _compile_for_args
    return self.compile(tuple(argtypes))
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 849, in compile
    kernel.bind()
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 178, in bind
    self._codelibrary.get_cufunc()
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\codegen.py", line 208, in get_cufunc
    cubin = self.get_cubin(cc=device.compute_capability)
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\codegen.py", line 181, in get_cubin
    linker.add_ptx(ptx.encode())
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\cudadrv\driver.py", line 2708, in add_ptx
    raise LinkerError("%s\n%s" % (e, self.error_log))
numba.cuda.cudadrv.driver.LinkerError: [218] Call to cuLinkAddData results in UNKNOWN_CUDA_ERROR
ptxas application ptx input, line 57; error   : Feature 'f16 arithemetic and compare instructions' requires .target sm_53 or higher
ptxas fatal   : Ptx assembly aborted due to errors

======================================================================
ERROR: test_float_to_float (numba.cuda.tests.cudapy.test_casting.TestCasting) (fromty=<class 'numpy.float16'>, toty=<class 'numpy.float64'>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\cudadrv\driver.py", line 2705, in add_ptx
    driver.cuLinkAddData(self.handle, enums.CU_JIT_INPUT_PTX,
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\cudadrv\driver.py", line 320, in safe_cuda_api_call
    self._check_ctypes_error(fname, retcode)
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\cudadrv\driver.py", line 388, in _check_ctypes_error
    raise CudaAPIError(retcode, msg)
numba.cuda.cudadrv.driver.CudaAPIError: [218] Call to cuLinkAddData results in UNKNOWN_CUDA_ERROR

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\tests\cudapy\test_casting.py", line 210, in test_float_to_float
    np.testing.assert_allclose(cfunc(12.3),
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\tests\cudapy\test_casting.py", line 111, in wrapper_fn
    cuda_wrapper_fn[1, 1](argarray, resarray)
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 505, in __call__
    return self.dispatcher.call(args, self.griddim, self.blockdim,
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 639, in call
    kernel = _dispatcher.Dispatcher._cuda_call(self, *args)
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 647, in _compile_for_args
    return self.compile(tuple(argtypes))
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 849, in compile
    kernel.bind()
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 178, in bind
    self._codelibrary.get_cufunc()
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\codegen.py", line 208, in get_cufunc
    cubin = self.get_cubin(cc=device.compute_capability)
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\codegen.py", line 181, in get_cubin
    linker.add_ptx(ptx.encode())
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\cudadrv\driver.py", line 2708, in add_ptx
    raise LinkerError("%s\n%s" % (e, self.error_log))
numba.cuda.cudadrv.driver.LinkerError: [218] Call to cuLinkAddData results in UNKNOWN_CUDA_ERROR
ptxas application ptx input, line 56; error   : Feature 'f16 arithemetic and compare instructions' requires .target sm_53 or higher
ptxas fatal   : Ptx assembly aborted due to errors

======================================================================
ERROR: test_int_to_float (numba.cuda.tests.cudapy.test_casting.TestCasting) (toty=<class 'numpy.float16'>)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\cudadrv\driver.py", line 2705, in add_ptx
    driver.cuLinkAddData(self.handle, enums.CU_JIT_INPUT_PTX,
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\cudadrv\driver.py", line 320, in safe_cuda_api_call
    self._check_ctypes_error(fname, retcode)
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\cudadrv\driver.py", line 388, in _check_ctypes_error
    raise CudaAPIError(retcode, msg)
numba.cuda.cudadrv.driver.CudaAPIError: [218] Call to cuLinkAddData results in UNKNOWN_CUDA_ERROR

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\tests\cudapy\test_casting.py", line 167, in test_int_to_float
    self.assertEqual(cfunc(321), pyfunc(321))
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\tests\cudapy\test_casting.py", line 111, in wrapper_fn
    cuda_wrapper_fn[1, 1](argarray, resarray)
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 505, in __call__
    return self.dispatcher.call(args, self.griddim, self.blockdim,
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 639, in call
    kernel = _dispatcher.Dispatcher._cuda_call(self, *args)
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 647, in _compile_for_args
    return self.compile(tuple(argtypes))
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 849, in compile
    kernel.bind()
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\dispatcher.py", line 178, in bind
    self._codelibrary.get_cufunc()
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\codegen.py", line 208, in get_cufunc
    cubin = self.get_cubin(cc=device.compute_capability)
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\codegen.py", line 181, in get_cubin
    linker.add_ptx(ptx.encode())
  File "F:\ci_envs\64\Miniconda3\envs\testenv_9ce6cbd8-4fe8-4839-bd6c-bfb4871ad7e2\lib\site-packages\numba\cuda\cudadrv\driver.py", line 2708, in add_ptx
    raise LinkerError("%s\n%s" % (e, self.error_log))
numba.cuda.cudadrv.driver.LinkerError: [218] Call to cuLinkAddData results in UNKNOWN_CUDA_ERROR
ptxas application ptx input, line 59; error   : Feature 'f16 arithemetic and compare instructions' requires .target sm_53 or higher
ptxas fatal   : Ptx assembly aborted due to errors

----------------------------------------------------------------------
Ran 1360 tests in 468.759s

FAILED (errors=4, skipped=82, expected failures=10)
Parallel: 351. Serial: 1009
Command exited with return code 1

@testhound

Copy link
Copy Markdown
Contributor Author

@esc thank you for the feedback, looking into the failures.

@testhound

Copy link
Copy Markdown
Contributor Author

gpuci run tests

@testhound

Copy link
Copy Markdown
Contributor Author

@esc can I request another buildfarm run? I fixed the failing tests by skipping if the compute capability requirements are not met. I am confused as to why these tests just started failing, since this code has been in main for quite some time.

@testhound

Copy link
Copy Markdown
Contributor Author

@gmarkall FYI: I updated the PR to fix tests that should be skipped.

@gmarkall

gmarkall commented Sep 8, 2022

Copy link
Copy Markdown
Member

I am confused as to why these tests just started failing, since this code has been in main for quite some time.

It suggests that there is something wrong with these tests that we never picked up on before.

Comment on lines +20 to +21
if out != typing.signature(fp16, fp16, fp16):
raise AssertionError(out)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be self.assertEqual(out, typing.signature(fp16, fp16, fp16), msg=str(out)) or similar? (same for the other test in this class).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@gmarkall gmarkall added the 4 - Waiting on author Waiting for author to respond to review label Sep 9, 2022
@testhound

Copy link
Copy Markdown
Contributor Author

gpuci run tests

@testhound

Copy link
Copy Markdown
Contributor Author

@stuartarchibald and @gmarkall code update per your request to use assertEqual.

@testhound

Copy link
Copy Markdown
Contributor Author

gpuci run tests

@gmarkall gmarkall left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Could this have another buildfarm run please @stuartarchibald ?

@stuartarchibald stuartarchibald left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the patch and fixes.

@stuartarchibald stuartarchibald removed the 4 - Waiting on author Waiting for author to respond to review label Sep 13, 2022
@esc

esc commented Sep 13, 2022

Copy link
Copy Markdown
Member

I ran this on the farm as numba_smoketest_cuda_yaml_160 and it was fine for most tasks. Our Linux builder can't run with cudatoolkit 11.3 so I couldn't test that -- but the Windows one can and that passed.

@esc esc added BuildFarm Passed For PRs that have been through the buildfarm and passed 5 - Ready to merge Review and testing done, is ready to merge and removed Pending BuildFarm For PRs that have been reviewed but pending a push through our buildfarm 4 - Waiting on CI Review etc done, waiting for CI to finish labels Sep 13, 2022
@sklam sklam changed the title Testhound/fp16 operators1 Adds CUDA FP16 arithmetic operators Sep 13, 2022
@sklam
sklam merged commit 33bd8b5 into numba:main Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

5 - Ready to merge Review and testing done, is ready to merge BuildFarm Passed For PRs that have been through the buildfarm and passed CUDA CUDA related issue/PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants