Repository navigation
Accept Python buffer inputs (#23088) - #23088
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/23088
Note: Links to docs will display an error until the docs builds have been completed. ❌ 2 New Failures, 7 PendingAs of commit c86d6eb with merge base 27d124f ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
ef50af1 to
2700b02
Compare
2700b02 to
cbfeb13
Compare
cbfeb13 to
851b305
Compare
851b305 to
b9c0b0e
Compare
b9c0b0e to
aa799c3
Compare
aa799c3 to
a5984ca
Compare
This comment has been minimized.
This comment has been minimized.
shoumikhin
left a comment
There was a problem hiding this comment.
Awesome improvement!
PTAL at the unresolved comments.
|
@JacobSzwejbka has imported this pull request. If you are a Meta employee, you can view this in D123775944. |
Summary: ## PR stack 1. **[#23088 — Accept Python buffer inputs](#23088 ← current 2. [#23089 — Remove ATen dependency from portable bindings](#23089) 3. [#23090 — Add zero-copy DLPack interchange](#23090) - accept NumPy arrays and other CPU objects implementing the Python buffer protocol directly, without a new public tensor type - alias dense buffer storage for execution and retain the exporter for the full runtime input lifetime - preserve shapes, strides, and dimension order, including channels-last layouts - treat a bare buffer as one input instead of iterating its first dimension - reject calls that mix buffer-backed and torch tensor inputs - keep the existing torch output behavior in ATen-enabled builds Test Plan: - `cmake --build cmake-out-pr1 --target portable_lib -- -j4` - focused tests for NumPy inputs, bare single-buffer dispatch, mixed-protocol rejection, and non-dense views - `python3 -m py_compile extension/pybindings/test/test_pybindings.py extension/pybindings/pybindings.pyi` - `git diff --check` Authored with Codex. Differential Revision: D123775944 Pulled By: JacobSzwejbka
a872db6 to
a9d73d7
Compare
|
@JacobSzwejbka has exported this pull request. If you are a Meta employee, you can view the originating Diff in D123775944. |
Summary: ## PR stack 1. **[#23088 — Accept Python buffer inputs](#23088 ← current 2. [#23089 — Remove ATen dependency from portable bindings](#23089) 3. [#23090 — Add zero-copy DLPack interchange](#23090) - accept NumPy arrays and other CPU objects implementing the Python buffer protocol directly, without a new public tensor type - alias dense buffer storage for execution and retain the exporter for the full runtime input lifetime - preserve shapes, strides, and dimension order, including channels-last layouts - treat a bare buffer as one input instead of iterating its first dimension - reject calls that mix buffer-backed and torch tensor inputs - keep the existing torch output behavior in ATen-enabled builds Test Plan: - `cmake --build cmake-out-pr1 --target portable_lib -- -j4` - focused tests for NumPy inputs, bare single-buffer dispatch, mixed-protocol rejection, and non-dense views - `python3 -m py_compile extension/pybindings/test/test_pybindings.py extension/pybindings/pybindings.pyi` - `git diff --check` Authored with Codex. Differential Revision: D123775944 Pulled By: JacobSzwejbka
de4657b to
c86d6eb
Compare
|
Heads up: the last change before the merge stopped validating torch inputs, and two tests now fail The abort is reachable from user code, and it is not about rank. In the portable build, x = torch.randn(1, 2, 3, 4, 5).to(memory_format=torch.channels_last_3d)
module.forward([x]) # aborts, whatever the method expectsThe new channels-last-3d branch in Restoring the rank check would make both tests pass, but it would hide the abort, not remove it. |
Summary:
PR stack
Test Plan:
cmake --build cmake-out-pr1 --target portable_lib -- -j4python3 -m py_compile extension/pybindings/test/test_pybindings.py extension/pybindings/pybindings.pyigit diff --checkAuthored with Codex.
Differential Revision: D123775944
Pulled By: JacobSzwejbka