Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation remove gpu dependency #398

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

ksimpson-work
Copy link
Contributor

@ksimpson-work ksimpson-work commented Jan 15, 2025

close #326

mock the import of cuda so that non explicit imports (cuda.core.XXX) do not try to import and cause a gpu runner dependency

Copy link
Contributor

copy-pr-bot bot commented Jan 15, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@ksimpson-work
Copy link
Contributor Author

/ok to test

2 similar comments
@ksimpson-work
Copy link
Contributor Author

/ok to test

@ksimpson-work
Copy link
Contributor Author

/ok to test

Copy link

Doc Preview CI

🚀 View preview at
https://nvidia.github.io/cuda-python/pr-preview/pr-398/


Preview will be ready when the GitHub Pages deployment is complete.

@ksimpson-work ksimpson-work self-assigned this Jan 16, 2025
@ksimpson-work ksimpson-work added cuda.core Everything related to the cuda.core module P1 Medium priority - Should do test Addition or improved tests labels Jan 16, 2025
@ksimpson-work ksimpson-work added this to the cuda.core beta 3 milestone Jan 16, 2025
@ksimpson-work ksimpson-work requested a review from leofang January 16, 2025 21:38
@ksimpson-work ksimpson-work marked this pull request as ready for review January 16, 2025 21:38
@ksimpson-work
Copy link
Contributor Author

/ok to test

@ksimpson-work
Copy link
Contributor Author

Preview looks good. merged main and removed the todo comments. Kicked a fresh CI for the requirements and sanity

Copy link
Member

@leofang leofang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'll need to hold off and fix both doc issues at once, see below.

.github/workflows/build-docs.yml Outdated Show resolved Hide resolved
cuda_core/docs/build_docs.sh Outdated Show resolved Hide resolved
@@ -95,6 +95,8 @@

section_titles = ["Returns"]

autodoc_mock_imports = ["cuda"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Q: What does this do?

Copy link
Contributor Author

@ksimpson-work ksimpson-work Jan 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From the sphinx autodoc documentation:

This value contains a list of modules to be mocked up. This is useful when some external dependencies are not met at build time and break the building process. You may only specify the root package of the dependencies themselves and omit the sub-modules:

autodoc_mock_imports = ['django']
Will mock all imports under the django package.

Added in version 1.3.

Changed in version 1.6: This config value only requires to declare the top-level modules that should be mocked.

Effectively what this does is prevent cuda.XXX from being imported for use in the documentation build process. Explicitely importing cuda.core.XXX works around the mock so the documentation whcih gets generated is correct per the doc preview.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is basically the only change. It exposed a syntax error in the memeoryview documentation, hence that change. Otherwise it would be a 1-liner

@ksimpson-work ksimpson-work force-pushed the documentation-remove-gpu-dependency branch from da6310d to dfd383d Compare January 20, 2025 18:51
@ksimpson-work ksimpson-work requested a review from leofang January 22, 2025 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuda.core Everything related to the cuda.core module P1 Medium priority - Should do test Addition or improved tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Building cuda.core docs requires the presence of a physical GPU & valid driver
2 participants