Fix CUDA checkpoint restore args and generated API docs#2144
Merged
Conversation
Contributor
|
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. |
Collaborator
Author
|
/ok to test |
This comment has been minimized.
This comment has been minimized.
rparolin
approved these changes
May 27, 2026
ae8888c to
9ba2616
Compare
Collaborator
Author
|
/ok to test |
9ba2616 to
d9fa9ba
Compare
Contributor
|
I just added a reference to #2149 to the PR description. |
rwgk
approved these changes
May 28, 2026
d9fa9ba to
990f15f
Compare
leofang
reviewed
May 29, 2026
Comment on lines
2460
to
+2475
| cdef struct CUcheckpointRestoreArgs_st: | ||
| {{if 'CUcheckpointRestoreArgs_st.gpuPairs' in found_struct}} | ||
| CUcheckpointGpuPair* gpuPairs | ||
| {{endif}} | ||
| {{if 'CUcheckpointRestoreArgs_st.gpuPairsCount' in found_struct}} | ||
| unsigned int gpuPairsCount | ||
| char reserved[52] | ||
| {{endif}} | ||
| {{if struct_field_types.get('CUcheckpointRestoreArgs_st.reserved') == 'char'}} | ||
| char reserved[{{struct_field_array_lengths['CUcheckpointRestoreArgs_st.reserved']}}] | ||
| {{endif}} | ||
| {{if struct_field_types.get('CUcheckpointRestoreArgs_st.reserved') == 'cuuint64_t'}} | ||
| cuuint64_t reserved[{{struct_field_array_lengths['CUcheckpointRestoreArgs_st.reserved']}}] | ||
| {{endif}} | ||
| {{if 'CUcheckpointRestoreArgs_st.reserved1' in found_struct}} | ||
| cuuint64_t reserved1 | ||
| {{endif}} |
Member
There was a problem hiding this comment.
This seems very complicated. I don't think we ever have code that does conditional logic for struct members? Is it possible to keep it simple, to make it easier to reason about what code would be eventually used to generate a binary?
- cython-gen does not use megaheader, so whether or not we expose the complete member list in a
cdef extern fromblock does not matter, the C compiler will do the right job - the tempita + pyclibrary template approach will be killed soon-ish
|
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
sizeof(...)reserved-field spelling that causedCUcheckpointRestoreArgsto disappear.CUcheckpointRestoreArgs_stand related checkpoint structs are emitted with the correct fields.0.3.1.dev1711+g9f37ce73) so the generated files capture the fixed generator commit for traceability.cuda.bindingsAPI docs and remove the temporaryconf.pydocstring sanitizer now that cybind emits docstrings that Sphinx can parse directly.Validation
CUcheckpointRestoreArgsis present in all three and the generated layouts match the corresponding headers.cuda.hcheckpoint structs,sizeof(...)array expressions, and empty named structs; no additional checkpoint struct breakages were found.python -m py_compile cuda_bindings/docs/source/conf.pyCUcheckpointRestoreArgs, its fields, andcuCheckpointProcessRestorelinks as API objects, with no raw.. attribute::,.. method::,:param,:rtype, orcode-block:: textartifacts in the generated module pages.Notes
conf.pysanitizer.Related