How can I access data in cuda kernel like in pytorch?
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Da chiarire
- Stato di attività
- Ferma
- Ambito
- machine-learning
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
- 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.....
- Lingua principale
- Python
- Stelle
- 1.2k
- Fork
- 250
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di pytorch/extension-cpp
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 68/100
pytorch/extension-cpp#100 · 5 commenti ·
-
Deprecation warningAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
pytorch/extension-cpp#82 ·
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
pytorch/extension-cpp#124 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
pytorch/extension-cpp#123 ·
-
Difficoltà 4/5 1-2 giorni Idoneità per principianti 12/100
pytorch/extension-cpp#121 · 3 commenti ·
Tutte le issue di pytorch/extension-cpp
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
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"Forse già presa @cestercian l’ha presa oggi. Apertacomp/cli P2 type/bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
NousResearch/hermes-agent#162259 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[request] gRpc/1.86.0Apertaupstream update
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
conan-io/conan-center-index#31597 ·
I maintainer di solito rispondono entro 1 giorno
-
bug enhancement
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
AOSSIE-Org/PictoPy#1802 · 2 commenti ·
I maintainer di solito rispondono entro 3 giorni
-
community-request
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
NVIDIA-NeMo/Run#727 ·
I maintainer di solito rispondono entro 1 giorno