cuda.bindings: make cythonization warnings clean
A recent PR added -Werror to the cythonization step in cuda.core. This fails a build when cython warns about code issues (see the mentioned PR for examples).
We want to add the -Werror flag to the cythonization step in cuda.bindings as well but first need to work on the cybind bindings generator for it to produce warnings-free cython code.
Working on this in a PR.
Inventory (local Cythonize of cuda.bindings with warning_errors=True against CTK headers from pip wheels):
cudla.pxd/cudla.pyx—noexcept clause is ignored for function returning Python objectondevice_get_attribute/module_get_attributes(except *on Python-returningcpdefs)_lib/windll.pxd—Assignment in pxd file will not be executedforLOAD_LIBRARY_SEARCH_SYSTEM32
Fix (see upcoming PR):
- Remove ignored
except *on those cudla cpdefs (resealed) - Declare the Win32 flag as
const DWORD(hand-written_lib) - Enable
_CythonOptions.warning_errors = Trueincuda_bindings/build_hooks.py - Add source-level regression tests
Note for cybind: the cudla emitter should stop attaching exception clauses to cpdefs that return Python objects, so the next sync does not reintroduce warning (1).
PR opened: https://github.com/NVIDIA/cuda-python/pull/2463
Hi maintainers — I've opened a fix for this in https://github.com/NVIDIA/cuda-python/pull/2463 and would like to continue owning the follow-through (review feedback, cybind sync note, CI).
Could you please assign this issue to me (@atiaomar1978-hub)? Happy to adjust the PR based on your guidance.
Follow-up: the fix PR is ready at https://github.com/NVIDIA/cuda-python/pull/2463 (still awaiting CPR vetting + review).
Could a maintainer please assign this issue to me (@atiaomar1978-hub)? I’ll keep owning review feedback and any follow-ups. cc @juenglin
Hi @juenglin,
Thank you for assigning this issue to me, and for the helpful guidance on coordinating with the cybind generator work.
I've prepared a PR for this: https://github.com/NVIDIA/cuda-python/pull/2463
Whenever you have time, I'd really appreciate a review (and assigning yourself as reviewer if that's helpful). I'm happy to make any changes you suggest.
Thanks again for your support.