NVIDIA / NVIDIA/cuda-python

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

Aperta Adatta ai principianti
#2,712 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

triage
Lingua principale
Cython
Stelle
3.4k
Fork
329
Merge medio
1g 23h
PR unite (30g)
116

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con la docstring di override di una riga in cuda_core/cuda/core/_memory/_pinned_memory_resource.pyx e confronta i corpi numpydoc completi o i riferimenti incrociati alla classe base utilizzati altrove in cuda.core. Il lavoro è completato quando la pagina renderizzata di PinnedMemoryResource.allocate documenta l'argomento stream obbligatorio e passabile solo per nome, il valore restituito e la condizione RuntimeError.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
documentation
Tipo di issue
Documentazione
Difficoltà
1/5
Tempo stimato
1-3 ore
Stato di attività
Attiva
Chiarezza
Specificata chiaramente
Idoneità per principianti
90/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.