How can I access data in cuda kernel like in pytorch?
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Necesita aclaración
- Estado de actividad
- Estancado
- Área
- machine-learning
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
- 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.....
- Lenguaje dominante
- Python
- Estrellas
- 1.2k
- Forks
- 250
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de pytorch/extension-cpp
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
pytorch/extension-cpp#100 · 5 comentarios ·
-
Deprecation warningAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
pytorch/extension-cpp#82 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
pytorch/extension-cpp#124 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
pytorch/extension-cpp#123 ·
-
Dificultad 4/5 1-2 días Aptitud para principiantes 12/100
pytorch/extension-cpp#121 · 3 comentarios ·
Todos los issues de pytorch/extension-cpp
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
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"Posiblemente ocupada @cestercian la tomó hoy. Abiertocomp/cli P2 type/bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
NousResearch/hermes-agent#162259 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
[request] gRpc/1.86.0Abiertoupstream update
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
conan-io/conan-center-index#31597 ·
Los mantenedores suelen responder en 1 día
-
bug enhancement
Dificultad 1/5 Menos de una hora Aptitud para principiantes 90/100
AOSSIE-Org/PictoPy#1802 · 2 comentarios ·
Los mantenedores suelen responder en 3 días
-
community-request
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
NVIDIA-NeMo/Run#727 ·
Los mantenedores suelen responder en 1 día