Skip to content

Fix #3246: Correctly check .pyx/.pxd dependencies, and fix inline lints - #3255

Merged
leofang merged 1 commit into
NVIDIA:mainfrom
mdboom:fix-inlines
Oct 27, 2026
Merged

leofang merged 1 commit into
NVIDIA:mainfrom
mdboom:fix-inlines

Conversation

@mdboom

@mdboom mdboom commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

#3209 upgraded cython-lint which added a new lint for inline functions that wouldn't be properly inlined across modules. To fix the lints, inline was removed from some functions, creating a performance regression, rather than moving the function definitions to the .pxd files.

Additionally, if cython-lint doesn't see all the files together, it can not correctly detect these cross-file issues. The fix is to always pass all of the cython files to cython-lint when any file in cuda_core/cuda changes.

@mdboom
mdboom requested a review from rwgk October 27, 2026 21:27
@github-actions github-actions Bot added the cuda.core Everything related to the cuda.core module label Oct 27, 2026
@mdboom mdboom self-assigned this Oct 27, 2026
@mdboom mdboom added CI/CD CI/CD infrastructure P0 High priority - Must do! performance labels Oct 27, 2026
@mdboom mdboom added this to the cuda.core 1.3.0 milestone Oct 27, 2026
@coderabbitai

coderabbitai Bot commented Oct 27, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between 5d65e6f and b0f9c38.

Files selected for processing: 9
  • .pre-commit-config.yaml
  • cuda_core/cuda/core/_memory/_legacy.py
  • cuda_core/cuda/core/_stream.pxd
  • cuda_core/cuda/core/_stream.pyx
  • cuda_core/cuda/core/_utils/cuda_utils.pxd
  • cuda_core/cuda/core/_utils/cuda_utils.pyi
  • cuda_core/cuda/core/_utils/cuda_utils.pyx
  • cuda_core/cuda/core/graph/_graph_node.pxd
  • cuda_core/cuda/core/graph/_graph_node.pyx
Files with no reviewable changes: 1
  • cuda_core/cuda/core/_stream.pyx

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

📝 Summary

Summary by CodeRabbit

  • Bug Fixes
    • Improved handling of memory-copy operations in CUDA graphs, including validation of buffer allocations and attachment owners.
    • Updated CUDA error handling and default-stream checks for more consistent behavior.
  • Chores
    • Updated pre-commit linting to check the CUDA source directory when matching files change.

The changes move Cython helper implementations into declaration files, revise CUDA error-checking helpers, update memcpy operand resolution, and adjust the Cython lint hook and a type-checking annotation.

Changes: Cython helper updates

Layer / File(s) Summary
Error checks and Cython support
cuda_core/cuda/core/_utils/cuda_utils.pxd, cuda_core/cuda/core/_utils/cuda_utils.pyx, cuda_core/cuda/core/_utils/cuda_utils.pyi, cuda_core/cuda/core/_memory/_legacy.py, .pre-commit-config.yaml
Error-check declarations now return success or delegate failures to renamed helpers. The stub adds success constants and removes private checker declarations. The lint hook targets cuda_core/cuda, runs serially, and does not pass filenames. An import gains a type-checking annotation.
Stream-token checks
cuda_core/cuda/core/_stream.pxd, cuda_core/cuda/core/_stream.pyx
Inline checks in the declaration file recognize both default-stream tokens, while the legacy-only check recognizes only the legacy token. The former implementations are removed from the .pyx file.
Memcpy operand resolution
cuda_core/cuda/core/graph/_graph_node.pxd, cuda_core/cuda/core/graph/_graph_node.pyx
Inline helpers resolve Buffer and integer-address operands to device pointers and attachment owners. The former local helpers are removed from the .pyx file.

Possibly related issues

Possibly related PRs

Suggested reviewers: andy-jost, juenglin, jpascucci-nv

Priority: Low

Change: Bug fix

Merge Risk: Minimal · up to b0f9c

No merge-blocking issue was established; the change is ready for normal checks.

Finishing Touches: 💡 1
🛠️ Fix failing CI checks: 💡
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@github-actions

github-actions Bot commented Oct 27, 2026 •

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

@leofang
leofang merged commit d05d625 into NVIDIA:main Oct 27, 2026
123 of 125 checks passed
github-actions Bot pushed a commit that referenced this pull request Oct 28, 2026
Removed preview folders for the following PRs:
- PR #2713
- PR #3128
- PR #3149
- PR #3229
- PR #3244
- PR #3248
- PR #3249
- PR #3255
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD CI/CD infrastructure cuda.core Everything related to the cuda.core module P0 High priority - Must do! performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants