NVIDIA / NVIDIA/cuvs

Remove duplicate kernel instantiations across `libcuvs`

Open
#1,513 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Cuda
Stars
854
Forks
236
Avg merge
3d 3h
Merged PRs (30d)
62

Description

The rule of thumb is that any-time a kernel is launched from a TU (directly or indirectly) using the triple chevron syntax kernel<<<...>>>, a copy of the kernel will be included in that TU. This starts becoming a problem when the library has the same kernel instance being launched from multiple TUs.

The only solution is to make sure that the kernel is launched as part of a pre-compiled function, and other functions that need to launch the kernel only have visibility of the declaration of that pre-compiled function.

There are two ways to do this:

  1. Call the function from the public API wherever possible
  2. Create an internal shared header in src with only the declaration and defer the definition in a self-contained TU

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect libcuvs kernel launches under src and identify kernels instantiated from multiple translation units. Use public APIs where possible or add internal shared declarations with self-contained definitions, then verify that duplicate kernel instantiations are removed.

Written by the indexing model from the issue text.

Assessment

Domain
performance
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.