NVIDIA / NVIDIA/cuda-python

[DOC]: `PinnedMemoryResource.allocate` documents no parameters

Open Beginner friendly
#2,712 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

triage
Dominant language
Cython
Stars
3.4k
Forks
329
Avg merge
1d 23h
Merged PRs (30d)
116

Description

Is this a duplicate?
Is this for new documentation, or an update to existing docs?

Update

Describe the incorrect/future/missing documentation

The rendered page for PinnedMemoryResource.allocate is a single sentence. It does not say what the required keyword-only stream argument must be, what the method returns, or that the method raises RuntimeError when the device does not support the requested host memory pool. The one-line docstring on the override in cuda_core/cuda/core/_memory/_pinned_memory_resource.pyx is all autodoc has to render.

from cuda.core import PinnedMemoryResource

doc = PinnedMemoryResource.allocate.__doc__
print(doc)
print("documents the 'stream' parameter:", "stream :" in doc)
print("documents a return value:", "Returns" in doc)
PinnedMemoryResource.allocate(self, size_t size, *, stream: Stream | GraphBuilder) -> Buffer

Allocate a host-pinned buffer asynchronously on the supplied stream.
documents the 'stream' parameter: False
documents a return value: False

Expected: the page states that stream is required and has no default, what allocate returns, and that it raises RuntimeError on a device without the required host memory pool support. Either the full numpydoc body or a cross-reference to the base class would fill the gap, and both shapes are already used elsewhere in cuda.core.

If this is a correction, please provide a link to the incorrect documentation. If this is a new documentation request, please link to where you have looked.

https://nvidia.github.io/cuda-python/cuda-core/latest/generated/cuda.core.PinnedMemoryResource.html

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the one-line override docstring in cuda_core/cuda/core/_memory/_pinned_memory_resource.pyx and compare the full numpydoc bodies or base-class cross-references used elsewhere in cuda.core. Done means the rendered PinnedMemoryResource.allocate page documents the required keyword-only stream argument, return value, and RuntimeError condition.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
90/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.