Skip to content

Fix string support in CUDA target - #7052

Merged
sklam merged 1 commit into
numba:masterfrom
gmarkall:grm-fix-master
May 21, 2021
Merged

sklam merged 1 commit into
numba:masterfrom
gmarkall:grm-fix-master

Conversation

@gmarkall

Copy link
Copy Markdown
Member

This fixes the following failure, which occurred because unicode typing and lowering was not registered with the CUDA target:

======================================================================
ERROR: test_string (numba.cuda.tests.cudapy.test_print.TestPrint)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\work\numbadev\numba\numba\core\base.py", line 710, in cast
    impl = self._casts.find((fromty, toty))
  File "C:\work\numbadev\numba\numba\core\base.py", line 48, in find
    out = self._find(sig)
  File "C:\work\numbadev\numba\numba\core\base.py", line 57, in _find
    raise NotImplementedError(self, sig)
NotImplementedError: (<numba.core.base.OverloadSelector object at 0x000001F7C7756160>, (Literal[str](hop!), unicode_type))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\work\numbadev\numba\numba\core\errors.py", line 744, in new_error_context
    yield
  File "C:\work\numbadev\numba\numba\core\lowering.py", line 230, in lower_block
    self.lower_inst(inst)
  File "C:\work\numbadev\numba\numba\core\lowering.py", line 374, in lower_inst
    self.lower_print(inst)
  File "C:\work\numbadev\numba\numba\core\lowering.py", line 729, in lower_print
    argvals = self.fold_call_args(fnty, sig, pos_args, inst.vararg, {})
  File "C:\work\numbadev\numba\numba\core\lowering.py", line 680, in fold_call_args
    argvals = [self._cast_var(var, sigty)
  File "C:\work\numbadev\numba\numba\core\lowering.py", line 680, in <listcomp>
    argvals = [self._cast_var(var, sigty)
  File "C:\work\numbadev\numba\numba\core\lowering.py", line 663, in _cast_var
    return self.context.cast(self.builder, val, varty, ty)
  File "C:\work\numbadev\numba\numba\core\base.py", line 713, in cast
    raise NotImplementedError(
NotImplementedError: Cannot cast Literal[str](hop!) to unicode_type: %".41" = load i8*, i8** %"$const16.6"

This fixes the following failure, which occurred because unicode typing and
lowering was not registered with the CUDA target:

```
======================================================================
ERROR: test_string (numba.cuda.tests.cudapy.test_print.TestPrint)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\work\numbadev\numba\numba\core\base.py", line 710, in cast
    impl = self._casts.find((fromty, toty))
  File "C:\work\numbadev\numba\numba\core\base.py", line 48, in find
    out = self._find(sig)
  File "C:\work\numbadev\numba\numba\core\base.py", line 57, in _find
    raise NotImplementedError(self, sig)
NotImplementedError: (<numba.core.base.OverloadSelector object at 0x000001F7C7756160>, (Literal[str](hop!), unicode_type))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\work\numbadev\numba\numba\core\errors.py", line 744, in new_error_context
    yield
  File "C:\work\numbadev\numba\numba\core\lowering.py", line 230, in lower_block
    self.lower_inst(inst)
  File "C:\work\numbadev\numba\numba\core\lowering.py", line 374, in lower_inst
    self.lower_print(inst)
  File "C:\work\numbadev\numba\numba\core\lowering.py", line 729, in lower_print
    argvals = self.fold_call_args(fnty, sig, pos_args, inst.vararg, {})
  File "C:\work\numbadev\numba\numba\core\lowering.py", line 680, in fold_call_args
    argvals = [self._cast_var(var, sigty)
  File "C:\work\numbadev\numba\numba\core\lowering.py", line 680, in <listcomp>
    argvals = [self._cast_var(var, sigty)
  File "C:\work\numbadev\numba\numba\core\lowering.py", line 663, in _cast_var
    return self.context.cast(self.builder, val, varty, ty)
  File "C:\work\numbadev\numba\numba\core\base.py", line 713, in cast
    raise NotImplementedError(
NotImplementedError: Cannot cast Literal[str](hop!) to unicode_type: %".41" = load i8*, i8** %"$const16.6"
```
@gmarkall gmarkall added 3 - Ready for Review CUDA CUDA related issue/PR Effort - short Short size effort needed labels May 21, 2021
@gmarkall gmarkall added this to the Numba 0.54 RC milestone May 21, 2021

@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.

@stuartarchibald

Copy link
Copy Markdown
Contributor

Buildfarm ID: numba_smoketest_cuda_yaml_64 is running mainline to see if this error will appear without this patch.
Buildfarm ID: numba_smoketest_cuda_yaml_65 is running this patch.

@stuartarchibald stuartarchibald added 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 and removed 3 - Ready for Review labels May 21, 2021
@stuartarchibald

Copy link
Copy Markdown
Contributor

Buildfarm ID: numba_smoketest_cuda_yaml_64 is running mainline to see if this error will appear without this patch.
Buildfarm ID: numba_smoketest_cuda_yaml_65 is running this patch.

Both of these passed. Given this error is likely transient, @gmarkall if this fixes it for you on a setup that reproduces it more regularly then I think this is fine. It makes sense logically given the changes made prior to this and there having been similar fixes for similar problems.

@gmarkall

Copy link
Copy Markdown
Member Author

@stuartarchibald Thanks - should this be "Buildfarm passed" now?

@stuartarchibald stuartarchibald added 5 - Ready to merge Review and testing done, is ready to merge BuildFarm Passed For PRs that have been through the buildfarm and passed and removed 4 - Waiting on CI Review etc done, waiting for CI to finish Pending BuildFarm For PRs that have been reviewed but pending a push through our buildfarm labels May 21, 2021
@stuartarchibald

Copy link
Copy Markdown
Contributor

@stuartarchibald Thanks - should this be "Buildfarm passed" now?

Done!

@stuartarchibald

Copy link
Copy Markdown
Contributor

Note: once merged this should also sort out #6840

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 Effort - short Short size effort needed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants