Skip to content

Conversation

@mdboom
Copy link
Contributor

@mdboom mdboom commented Jan 16, 2026

cuda.bindings.nvml has a bunch of enums which are written by hand because they are #defines in the nvml header. In hindsight, these didn't all need full names, but the common prefixes of the individual values can be removed. (Since Python enums are a namespace, unlike C, the prefixes aren't necessary).

@copy-pr-bot
Copy link
Contributor

copy-pr-bot bot commented Jan 16, 2026

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.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request simplifies the naming convention for manually-written enums in cuda.bindings.nvml by removing redundant prefixes from enum member names. Since Python enums provide their own namespace, the common prefixes that were necessary in C (where these were #defines) are no longer needed.

Changes:

  • Simplified enum member names by removing redundant prefixes (e.g., EVENT_TYPE_SINGLE_BIT_ECC_ERRORSINGLE_BIT_ECC_ERROR)
  • Updated test references to use the new simplified enum names
  • Updated documentation references to use the new enum names

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
cuda_bindings/cuda/bindings/_nvml.pyx Simplified enum member names across ~30 enum classes by removing redundant prefixes
cuda_core/tests/system/test_system_device.py Updated test to use new EventType enum names without EVENT_TYPE_ prefix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

mdboom and others added 3 commits January 16, 2026 12:57
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@mdboom
Copy link
Contributor Author

mdboom commented Jan 16, 2026

/ok to test

@github-actions

This comment has been minimized.

@mdboom
Copy link
Contributor Author

mdboom commented Jan 16, 2026

/ok to test

Copy link
Collaborator

@kkraus14 kkraus14 left a comment

Choose a reason for hiding this comment

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

LGTM

@mdboom mdboom merged commit 3257477 into NVIDIA:main Jan 16, 2026
82 checks passed
@github-actions
Copy link

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

@leofang
Copy link
Member

leofang commented Jan 17, 2026

Good catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants