[DRAFT] Replace nvrtc Tempita templates with pre-generated Cython files#1900
Draft
leofang wants to merge 7 commits intoNVIDIA:mainfrom
Draft
[DRAFT] Replace nvrtc Tempita templates with pre-generated Cython files#1900leofang wants to merge 7 commits intoNVIDIA:mainfrom
leofang wants to merge 7 commits intoNVIDIA:mainfrom
Conversation
Replace .pyx.in / .pxd.in Tempita templates with plain .pyx / .pxd files generated by the refactored cython-gen (cybind leof/cybind\!369). Changes: - Remove 6 Tempita template files (.pyx.in / .pxd.in) for nvrtc - Add 7 pre-generated Cython files with zero Tempita - Move internal layer from _bindings/ to _internal/ following cybind convention - Split platform-specific code into nvrtc_linux.pyx / nvrtc_windows.pyx - Internal layer now uses cybind-style loading (RTLD_DEFAULT + fallback, FunctionNotFoundError, _init_nvrtc/_check_or_init_nvrtc naming) This is a companion PR to cybind leof/cybind\!369. Build system changes (build_hooks.py, pyproject.toml) to remove pyclibrary are not yet included — this PR shows the generated output for review. Part of https://gitlab-master.nvidia.com/leof/cybind/-/issues/173 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Update generated artifacts to use cybind-style templates: - Fix excessive blank lines from Tempita stripping - Internal layer files now generated from template files under cybind/assets/templates/ via string.Template.substitute() - Proper license headers from templates Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- cynvrtc.pyx now uses "from ._internal cimport nvrtc as _nvrtc" instead of the legacy "cimport _bindings.cynvrtc as cynvrtc" - Function wrappers reference _nvrtc._funcName() matching cybind style - cynvrtc.pxd gets proper template header Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove nvrtc from _REQUIRED_HEADERS (no pyclibrary parsing needed; nvrtc .pyx/.pxd files are now pre-generated by cybind) - Update sources_list: cynvrtc.pyx moved from _bindings/ to bindings/ - _rename_architecture_specific_files already handles _internal/nvrtc_linux.pyx -> _internal/nvrtc.pyx Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
… entry - Regenerate files with generator version in header comments - Remove explicit cynvrtc.pyx from sources_list (already covered by cuda_bindings_files glob) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Regenerated from latest cybind which now cleans up trailing whitespace and ensures files end with exactly one newline. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Member
Author
|
/ok to test 3317324 |
|
Member
Author
|
/ok to test 8016408 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Replace NVRTC's Tempita
.pyx.in/.pxd.intemplates with pre-generated plain Cython files, and update the build system to skip pyclibrary header parsing for NVRTC.Generated artifacts (all Tempita-free):
.pyx.in/.pxd.intemplate files.pyx/.pxdfiles following cybind convention_bindings/to_internal/with platform split (nvrtc_linux.pyx/nvrtc_windows.pyx)Build system (
build_hooks.py):nvrtcfrom_REQUIRED_HEADERS— no pyclibrary parsing neededsources_list:cynvrtc.pyxsource path changed from_bindings/tobindings/_rename_architecture_specific_filesalready handles_internal/nvrtc_linux.pyx→_internal/nvrtc.pyxThis is a companion PR to cybind !369. When driver/runtime are also migrated, pyclibrary can be removed from
pyproject.tomlbuild-system.requiresentirely.Test plan
-- Leo's bot
🤖 Generated with Claude Code