Repository navigation
Conversation
Signed-off-by: Ralf W. Grosse-Kunstleve <rgrossekunst@nvidia.com>
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Run cython-lint serially .pre-commit-config.yaml |
The cython-lint hook now runs serially so its cross-file checks process declarations and implementations in one invocation. |
Remove inline qualifiers cuda_core/cuda/core/_stream.pyx, cuda_core/cuda/core/graph/_graph_node.pyx |
The inline qualifier was removed from Stream_handle_is_default_token, Stream_is_default_token, and _resolve_memcpy_operand. The adjacent Stream_is_legacy_default_token declaration remains unchanged. |
Assessment against linked issues
| Objective | Addressed | Explanation |
|---|---|---|
Fix the cross-file lint blind spot and remove the reported ineffective inline qualifiers [#3246] |
❌ | Stream_is_legacy_default_token remains inline, so one reported violation is not removed. |
Out-of-scope changes
| Code Change | Explanation |
|---|---|
Remove inline from _resolve_memcpy_operand (cuda_core/cuda/core/graph/_graph_node.pyx:926) |
Issue #3246 does not identify this helper. It may be another instance of the same lint violation, but the supplied context does not establish that connection. |
Possibly related PRs
- NVIDIA/cuda-python#3209: It introduced the cython-lint version whose cross-file rule is involved here.
- NVIDIA/cuda-python#3173: It expanded cython-lint coverage to CUDA 12 and CUDA 13 source trees, which are subject to the serial execution change.
Suggested reviewers: andy-jost, mdboom
Priority:
Change: Bug fix · Severity of issue fixed: Low
Merge Risk: 
Minimal · up to 76487
-
No actionable merge-blocking risk remains in the reviewed changes.
Comment @coderabbitai help to get the list of available commands.
mdboom
left a comment
There was a problem hiding this comment.
The way these are being fixed here is a performance regression. Prior to this change, _resolve_memcpy_operand was inlined within other functions in the same _graph_node.pyx file, but it wasn't inlined where it was cimport'ed from _subclasses.pyx. Now, it's not inlined anywhere.
Instead, we need to move the function definitions entirely to the .pxd files which should silence the lint (haven't checked) but also keep these functions inlined as intended.
There is an additional bug in the precommit hook. While putting all of the files in a single process /helps/ it doesn't entirely fix the bug. If only the .pyx file or the .pxd file changes, only the changed files are sent to the precommit hook, so again the thing this is trying to detect could slip through the cracks. The fix is to either run all files all the time or, if possible, configure precommit to always look at .pyx/.pxd pairs.
Description
Closes #3246.
Follow-on to #3209.
Run cython-lint serially so its cross-file rules see matching
.pxddeclarations and.pyximplementations together. With parallel pre-commit batches, the same files can pass or fail depending on the worker count because the linter keeps this information within one process.Remove the ineffective
inlinekeyword from the three stream helpers identified in the issue (Stream_handle_is_default_token,Stream_is_default_token, andStream_is_legacy_default_token) and from_resolve_memcpy_operandin_graph_node.pyx, which serial linting also exposed. Their signatures, implementations, and exception/GIL specifications otherwise stay the same.Runtime impact
On my main development machine, the added
require_serial: trueadds about 1.3 seconds to an all-files run for cython-lint only, with negligible impact on small commits.Measured wall-clock times, using warm hook environments and the median of three runs:
_stream.pyx+.pxd)My main development machine has 128 Xeon CPUs and uses pre-commit 3.6.2. For up to four files, pre-commit already uses one process, so ordinary small commits see essentially no difference.
pre-commit run --all-filesfor all hooks exceptlychee:Validation
pre-commit run --all-files.Full CI is deferred while this PR is a draft.
Checklist