Skip to content

CUDA Dispatcher refactor - #7814

Merged
sklam merged 8 commits into
numba:mainfrom
gmarkall:dispatcher-refactor-20220204
Feb 7, 2022
Merged

sklam merged 8 commits into
numba:mainfrom
gmarkall:dispatcher-refactor-20220204

Conversation

@gmarkall

@gmarkall gmarkall commented Feb 4, 2022

Copy link
Copy Markdown
Member

This PR moves classes around in the CUDA target to better mirror the structure of the CPU target and core of Numba (see #7739)

Fixes #7739.

@gmarkall gmarkall added 3 - Ready for Review CUDA CUDA related issue/PR labels Feb 4, 2022
@gmarkall gmarkall added this to the Numba 0.56 RC milestone Feb 4, 2022
@gmarkall

gmarkall commented Feb 4, 2022

Copy link
Copy Markdown
Member Author

gpuci run tests

@gmarkall

gmarkall commented Feb 4, 2022

Copy link
Copy Markdown
Member Author

gpuci run tests

stuartarchibald
stuartarchibald previously approved these changes Feb 4, 2022

@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 doing this refactor, looks good on inspection.

Comment thread numba/cuda/compiler.py
return cres


def compile_kernel(pyfunc, args, link, debug=False, lineinfo=False,

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.

NOTE: it was determined that this was unused, so is removed.

Comment thread numba/cuda/compiler.py
self.sig = sig


class ForAll(object):

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.

Note: ForAll was considered a configuration like object so moved to dispatcher.py

Comment thread numba/cuda/compiler.py
return tpb


class _Kernel(serialize.ReduceMixin):

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.

Note: moved to dispatcher.py

Comment thread numba/cuda/compiler.py
raise NotImplementedError(ty, val)


class _KernelConfiguration:

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.

Note: moved to dispatcher.py

Comment thread numba/cuda/compiler.py
self.stream, self.sharedmem)


class Dispatcher(_dispatcher.Dispatcher, serialize.ReduceMixin):

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.

Note: moved to dispatcher.py

Comment thread numba/cuda/vectorizers.py
GUFuncCallSteps)


class CUDAUFuncDispatcher(object):

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.

Note: moved from dispatcher.py to here, keeping the ufunc logic together.

Comment thread numba/cuda/dispatcher.py

def get_template_info(cls):
basepath = os.path.dirname(
os.path.dirname(os.path.dirname(cuda.__file__)))

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.

NOTE: Changed to avoid import of numba itself.

@gmarkall

gmarkall commented Feb 4, 2022

Copy link
Copy Markdown
Member Author

gpuci run tests

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

Re-approved following doc change. Thanks for the patch.

@stuartarchibald

Copy link
Copy Markdown
Contributor

Buildfarm ID: numba_smoketest_cuda_yaml_115.

@stuartarchibald

Copy link
Copy Markdown
Contributor

Buildfarm ID: numba_smoketest_cuda_yaml_115.

Passed.

@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 3 - Ready for Review labels Feb 4, 2022
@sklam
sklam merged commit 0399584 into numba:main Feb 7, 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.

Refactor CUDA target module and conceptual layout to match CPU

3 participants