Python bindings: Module path gives device-tagged unplanned outputs host memory
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- backend, mobile-dev
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
🐛 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.
- Lingua principale
- Python
- Stelle
- 5.1k
- Fork
- 1.2k
- Merge medio
- 2g 10h
- PR unite (30g)
- 632
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
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/executorch
-
Portable remainder kernel: wrong sign for integers and float64 rounded to floatForse già presa @JakeStevens l’ha presa 1 giorno fa. Apertabug module: kernels triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
pytorch/executorch#23682 · 2 assegnatari ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement triaged
Difficoltà 2/5 Mezza giornata Idoneità per principianti 68/100
pytorch/executorch#21640 ·
I maintainer di solito rispondono entro 1 giorno
-
macOS Python wheel _portable_lib has non-relocatable libtorch rpathForse già presa @shoumikhin l’ha presa oggi. Aperta
pytorch/executorch#23742 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Feedback about ToolsApertainvalid module: doc
Difficoltà 3/5 1-2 giorni Idoneità per principianti 35/100
pytorch/executorch#23706 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Portable floor_divide returns non-whole numbers for floats and wrong values for a zero divisorForse già presa @JakeStevens l’ha presa 1 giorno fa. Apertabug module: kernels
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
pytorch/executorch#23684 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di pytorch/executorch
Issue simili
-
vis.image() reports "Unsupported number of image channels: 224" for an HxWxC imageForse già presa @piyush182004 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
fossasia/visdom#1997 · 3 commenti ·
I maintainer di solito rispondono entro 6 giorni
-
Byse new domainAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Gujal00/ResolveURL#1525 ·
I maintainer di solito rispondono entro 1 giorno
-
Serialisation fails with pydantic 2.14: wrap serialisers pass SerializationInfo as index_keyForse già presa @hugohills-regnosys l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
finos/rune-python-runtime#45 ·
-
[Bug]: LangGraph Store sync put bypasses namespace validationForse già presa @ktz03 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
volcengine/OpenViking#6050 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
hummingbot/condor#283 ·
I maintainer di solito rispondono entro 1 giorno