Python bindings: Module path gives device-tagged unplanned outputs host memory
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- backend, mobile-dev
Línea de trabajo
Read extension/pybindings/pybindings.cpp, especially PyModule::allocate_output_tensors, and compare its behavior with the Method path fixed in #23547. Investigate how output tensors can own device buffers while preserving the ownership behavior described in the issue. Done means unplanned device-tagged outputs through the Module path use appropriate device memory and repeated calls remain safe while callers retain prior results.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
🐛 Describe the bug
PyModule::allocate_output_tensors in extension/pybindings/pybindings.cpp (the _load_for_executorch / Module path) backs every unplanned tensor output with std::vector<uint8_t>(nbytes) through make_tensor_ptr, whatever device the program tagged the output with.
So a program exported device resident (skip_d2h_for_method_outputs=True with alloc_graph_output=False) fails through this path the same way the Method path did before #23547:
- The CUDA backend rejects the host buffer with
InvalidArgument(0x12), because itscudaPointerGetAttributescheck finds no CUDA allocation. - A delegate without that check writes into the host buffer. The CUDA tensor returned over it then fails to clone on a GPU that cannot read pageable host memory, with
CUDA error: invalid argumentand "Allocation not found" fromcuMemcpyDtoDAsync_v2.
#23547 fixes the Method path (PyMethod::allocate_output_storages). This path needs the same choice, with one more requirement: make_tensor_ptr takes ownership of the host bytes, so a device buffer has to be owned by the tensor the same way, or the next call writes through a result the caller still holds.
Reported by @Gasoonjia in review of #23547. Part of #23101.
Versions
ExecuTorch main at 1802bcf030.
- Lenguaje dominante
- Python
- Estrellas
- 5.1k
- Forks
- 1.2k
- Merge medio
- 2 d 51 min
- PR fusionados (30 d)
- 712
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
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/executorch
-
Portable remainder kernel: wrong sign for integers and float64 rounded to floatPosiblemente ocupada @JakeStevens la tomó hace 3 días. Abiertobug module: kernels triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
pytorch/executorch#23682 · 2 asignados ·
Los mantenedores suelen responder en 1 día
-
enhancement triaged
Dificultad 2/5 Medio día Aptitud para principiantes 68/100
pytorch/executorch#21640 ·
Los mantenedores suelen responder en 1 día
-
bug module: microcontrollers partner: arm
Dificultad 4/5 3-5 días Aptitud para principiantes 38/100
pytorch/executorch#23812 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
[muse-glimmer] interpolate_pos_emb returns corrupted bf16 values on CPU and can segfaultPosiblemente ocupada @JakeStevens la tomó hace 1 día. Abiertobug module: examples triaged
pytorch/executorch#23797 · 2 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
macOS Python wheel _portable_lib has non-relocatable libtorch rpathPosiblemente ocupada @JacobSzwejbka la tomó hoy. Abierto
pytorch/executorch#23742 · 1 comentario · 2 asignados ·
Los mantenedores suelen responder en 1 día
Todos los issues de pytorch/executorch
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
aws-samples/sample-per-model-bedrock#243 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
FuRongJun-1999/dsh-memory#404 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
bug frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
PennyLaneAI/catalyst#3337 ·
Los mantenedores suelen responder en 1 día
-
Workflow.schedule stops when a cron deadline passes before sleepPosiblemente ocupada @HuaTNA la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día