Python bindings: Module path gives device-tagged unplanned outputs host memory
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 領域
- backend, mobile-dev
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
🐛 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.
- 主要言語
- Python
- スター
- 5.1k
- フォーク
- 1.2k
- 平均マージ
- 2日 9時間
- マージ済み PR(30日)
- 632
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pytorch/executorch のほかの issue
-
Portable remainder kernel: wrong sign for integers and float64 rounded to float対応中かも @usmanmateen が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
pytorch/executorch#23682 ·
メンテナーはふだん 1 日以内に返信
-
enhancement triaged
難易度 2/5 半日 初心者へのやさしさ 68/100
pytorch/executorch#21640 ·
メンテナーはふだん 1 日以内に返信
-
Portable floor_divide returns non-whole numbers for floats and wrong values for a zero divisor対応中かも @usmanmateen が 1 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 52/100
pytorch/executorch#23684 ·
メンテナーはふだん 1 日以内に返信
-
torch.var_mean and torch.std_mean fail in to_edge: aten.var_mean.correction is not core ATen and has no core decomposition対応中かも @usmanmateen が 1 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
pytorch/executorch#23680 ·
メンテナーはふだん 1 日以内に返信
-
Prompts of max_seq_len tokens fail to prefill: export_llm bounds the KV-cache token input at max_seq_len - 1 but publishes get_max_seq_len = max_seq_len対応中かも @alpharomercoma が 2 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 20/100
pytorch/executorch#23678 ·
メンテナーはふだん 1 日以内に返信
pytorch/executorch の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
KalicoCrew/kalico#1012 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
esphome/esphome.io#7657 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
VNG-Realisatie/gemma-zaken#2658 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
comp/gateway comp/plugins duplicate P3 type/bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
NousResearch/hermes-agent#137019 ·
メンテナーはふだん 1 日以内に返信