Skip to content

Add Nvfatbin Bindings#1467

Merged
leofang merged 21 commits into
NVIDIA:mainfrom
isVoid:wangm/nvfatbin-bindings
Jan 16, 2026
Merged

Add Nvfatbin Bindings#1467
leofang merged 21 commits into
NVIDIA:mainfrom
isVoid:wangm/nvfatbin-bindings

Conversation

@isVoid

@isVoid isVoid commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

Description

closes #156

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@copy-pr-bot

copy-pr-bot Bot commented Jan 13, 2026

Copy link
Copy Markdown
Contributor

Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

Comment thread cuda_bindings/cuda/bindings/_internal/nvfatbin.pxd Outdated
Comment thread cuda_bindings/cuda/bindings/_internal/nvfatbin.pxd
@leofang leofang requested review from leofang and mdboom January 13, 2026 19:00
@leofang leofang added P0 High priority - Must do! feature New feature or request cuda.bindings Everything related to the cuda.bindings module labels Jan 13, 2026
@leofang leofang added this to the cuda-python 13-next, 12-next milestone Jan 13, 2026
Comment thread cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx
Comment thread cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx
@leofang

leofang commented Jan 13, 2026

Copy link
Copy Markdown
Member

FYI @rparolin all of these are generated code except for the tests. There is an internal MR targeting the codegen for this.

Comment thread cuda_bindings/tests/test_nvfatbin.py Outdated
Comment thread cuda_bindings/tests/test_nvfatbin.py Outdated
Comment thread cuda_bindings/tests/test_nvfatbin.py Outdated
if err != nvrtc.nvrtcResult.NVRTC_SUCCESS:
raise RuntimeError(repr(err))

err, program_handle = nvrtc.nvrtcCreateProgram(CODE.encode(), b"", 0, [], [])

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.

Not a blocker for this PR, but I think we have some helper functions for NVRTC that can be used in cuda-bindings tests, so that we do not have to reimplement them in this file.

@isVoid isVoid Jan 15, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Agreed, I saw this pattern showed up in test_nvjitlink as well. Perhaps a shared fixture that returns an nvrtc artifact.

@leofang leofang added the to-be-backported Trigger the bot to raise a backport PR upon merge label Jan 15, 2026
@leofang

leofang commented Jan 15, 2026

Copy link
Copy Markdown
Member

/ok to test 8e75d8a

Comment thread cuda_bindings/cuda/bindings/_internal/nvfatbin.pxd Outdated
@github-actions

This comment has been minimized.

@isVoid

isVoid commented Jan 15, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 965c53b

@leofang

leofang commented Jan 15, 2026

Copy link
Copy Markdown
Member
E   cuda.bindings._internal.utils.FunctionNotFoundError: function nvFatbinAddTileIR is not found

Need to skip the tile IR test for nvFatbin < 13.1

@isVoid

isVoid commented Jan 15, 2026

Copy link
Copy Markdown
Contributor Author

stderr = b'gcc: No such file or directory\nnvcc fatal : Failed to preprocess host compiler properties.\n'

This shows in some CI environment there's nvcc installed but it's not properly setup due to missing host compiler.

@isVoid

isVoid commented Jan 15, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 4baeecd

@isVoid

isVoid commented Jan 16, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 4c2f3f3

@leofang

leofang commented Jan 16, 2026

Copy link
Copy Markdown
Member

stderr = b'gcc: No such file or directory\nnvcc fatal : Failed to preprocess host compiler properties.\n'

This shows in some CI environment there's nvcc installed but it's not properly setup due to missing host compiler.

Yup! See #1467 (comment).

[project.optional-dependencies]
all = [
"cuda-toolkit[nvrtc,nvjitlink,nvvm]==13.*",
"cuda-toolkit[nvrtc,nvjitlink,nvvm,nvfatbin]==13.*",

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.

@kkraus14 this minds me a discussion we had a few months ago -- One day installing cuda-binding[all] would bring in the whole CTK 😂

@leofang

leofang commented Jan 16, 2026

Copy link
Copy Markdown
Member

LGTM! Thanks, @isVoid!

Comment thread cuda_bindings/docs/source/api.rst
@leofang

leofang commented Jan 16, 2026

Copy link
Copy Markdown
Member

/ok to test 3e071e2

@leofang leofang enabled auto-merge (squash) January 16, 2026 15:01
@leofang leofang merged commit 1af5db9 into NVIDIA:main Jan 16, 2026
80 checks passed
@github-actions

Copy link
Copy Markdown

Backport failed for 12.9.x, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin 12.9.x
git worktree add -d .worktree/backport-1467-to-12.9.x origin/12.9.x
cd .worktree/backport-1467-to-12.9.x
git switch --create backport-1467-to-12.9.x
git cherry-pick -x 1af5db98e2f39a11c3ebd82190ca63156e052a09

@leofang

leofang commented Jan 16, 2026

Copy link
Copy Markdown
Member

@isVoid because of #965 the backport bot does not work (a workflow file is touched). Could you manually cherry pick?

@github-actions

Copy link
Copy Markdown
Doc Preview CI
Preview removed because the pull request was closed or merged.

isVoid added a commit to isVoid/cuda-python that referenced this pull request Jan 16, 2026
* initial localized test

* add rest of APIs

* remove local skips

* regenerate for CUDA 13.1 and with tile IR API

* nvfatbinError -> nvFatbinError

* regenerate for get_error_string

* enable object creation and testing

* remove the LTOIR mismatching arch failure test

* encode a legal tileIR into test

* update the license year

* add an embedded tile program for re-generation

* license date: 2026

* cdef const char *

* add dependency for CI

* add TODO to locate nvcc file

* add documentation and release notes

* skip tileIR test for <13.1 installation

* add an nvcc smoke test to better determine compiler usability

* fix typo

* add nvfatbin.rst

---------

Co-authored-by: Michael Wang <isVoid@users.noreply.github.com>
leofang pushed a commit that referenced this pull request Jan 16, 2026
* initial localized test

* add rest of APIs

* remove local skips

* regenerate for CUDA 13.1 and with tile IR API

* nvfatbinError -> nvFatbinError

* regenerate for get_error_string

* enable object creation and testing

* remove the LTOIR mismatching arch failure test

* encode a legal tileIR into test

* update the license year

* add an embedded tile program for re-generation

* license date: 2026

* cdef const char *

* add dependency for CI

* add TODO to locate nvcc file

* add documentation and release notes

* skip tileIR test for <13.1 installation

* add an nvcc smoke test to better determine compiler usability

* fix typo

* add nvfatbin.rst

---------

Co-authored-by: Michael Wang <isVoid@users.noreply.github.com>
@leofang leofang modified the milestones: cuda.bindings 13.1.2 & 12.9.6, cuda.bindings next Feb 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.bindings Everything related to the cuda.bindings module feature New feature or request P0 High priority - Must do! to-be-backported Trigger the bot to raise a backport PR upon merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add nvfatbin bindings

4 participants