How can I access data in cuda kernel like in pytorch?
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 25/100
- Issue-Typ
- Bug
- Klarheit
- Muss geklärt werden
- Aktivitätsstatus
- Veraltet
- Bereich
- machine-learning
Rechercherichtung
Start by reproducing with delete.py after building the add3 extension via setup.py install, since the attached test.zip is the only example. Compare the tensor's strides and contiguity on the Python side with the raw data pointer the kernel receives, and check how the extension's wrapper gets its input. Done means the reporter's question about transposed views is answered, with a reproduction showing why the kernel sees the original memory layout. The linear.cpp link in the issue points to code that is not in the payload.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
- OS: win10
- PyTorch version: 1.10
- How you installed PyTorch (conda, pip, source): pip
- Python version: 3.9
- CUDA/cuDNN version: 11.3
- GPU models and configuration: 1650 geforce PC
- GCC version (if compiling from source): not sure/.....
I have a tensor a in pytorch, a. And then I transpose it to have a1. But it will not really transpose in memory, but just change the way we read it. And then we pass this pointer to the cuda kernel like is written in the tutorial. Then we access it within the kernel. It is not transposed!!!!! But we enter the pytorch interface and print out the transposed a1, it is correct!
How can we access the tensor within the kernel? We do not know whether it is
transposed or not!!!!
Thank you!!!
test.zip
I have attached a file here. You can reproduce it by unzip it.
Then open a python env with pytorch. Also have GPU
Then enter: python pytorch/setup.py install
You will install the "add3" library.
Then run the "delete.py" file within it. You will see how the bug appears like I discribe above!!
Another way to solve it is to understand how nn.linear solve it. How they can access data correctly? I think this is the implementation for nn.linear inside:
https://github.com/pytorch/pytorch/blob/4cb534f92ef6f5b2ec99109b0329f93a859ae831/torch/csrc/api/src/nn/modules/linear.cpp
But again it links to "torch::nn::linear" And I really can not find the cpp code for it.....
- Vorherrschende Sprache
- Python
- Sterne
- 1.2k
- Forks
- 250
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus pytorch/extension-cpp
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 68/100
pytorch/extension-cpp#100 · 5 Kommentare ·
-
Deprecation warningOffen
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 78/100
pytorch/extension-cpp#82 ·
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 45/100
pytorch/extension-cpp#124 ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
pytorch/extension-cpp#123 ·
-
Schwierigkeit 4/5 1-2 Tage Anfängerfreundlichkeit 12/100
pytorch/extension-cpp#121 · 3 Kommentare ·
Alle Issues in pytorch/extension-cpp
Ähnliche Issues
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
hermes hooks doctor smoke test never checks the hook exit code — a crashing hook (exit=1) renders ✓ "ran clean" and "All shell hooks look healthy"Evtl. vergeben @cestercian hat das heute übernommen. Offencomp/cli P2 type/bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
NousResearch/hermes-agent#162259 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
[request] gRpc/1.86.0Offenupstream update
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
conan-io/conan-center-index#31597 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug enhancement
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
AOSSIE-Org/PictoPy#1802 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 3 Tagen
-
community-request
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
NVIDIA-NeMo/Run#727 ·
Maintainer antworten meist innerhalb von 1 Tag