-
Notifications
You must be signed in to change notification settings - Fork 754
Add FlatTensorDataMap to low-level pybindings #15900
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/15900
Note: Links to docs will display an error until the docs builds have been completed. ❌ 4 New Failures, 1 Unrelated FailureAs of commit 49cc0e9 with merge base ee236cb ( NEW FAILURES - The following jobs have failed:
UNSTABLE - The following job is marked as unstable, possibly due to flakiness on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
Summary:
Create pybindings around the FlatTensorDataMap::load function
This allows us to use the low-level program data separation APIs in pybindings, through program/method as well as Module.
Use `py::capsule` to capture the type `const NamedDataMap*` that is passed into method_load.
Example usage:
```
>>> inputs = (torch.randn(3),)
>>> program = _load_program_from_buffer(program_buffer)
>>> data_map = _load_flat_tensor_data_map("model.ptd")
>>> method = program.load_method("forward", data_map.get_named_data_map())
>>> outputs = method(inputs)[0]
```
Differential Revision: D87461455
e135cbe to
0b6cdef
Compare
Summary:
Create pybindings around the FlatTensorDataMap::load function
This allows us to use the low-level program data separation APIs in pybindings, through program/method as well as Module.
Use `py::capsule` to capture the type `const NamedDataMap*` that is passed into method_load.
Example usage:
```
>>> inputs = (torch.randn(3),)
>>> program = _load_program_from_buffer(program_buffer)
>>> data_map = _load_flat_tensor_data_map("model.ptd")
>>> method = program.load_method("forward", data_map.get_named_data_map())
>>> outputs = method(inputs)[0]
```
Differential Revision: D87461455
0b6cdef to
fcd6560
Compare
Summary:
Create pybindings around the FlatTensorDataMap::load function
This allows us to use the low-level program data separation APIs in pybindings, through program/method as well as Module.
Use `py::capsule` to capture the type `const NamedDataMap*` that is passed into method_load.
Example usage:
```
>>> inputs = (torch.randn(3),)
>>> program = _load_program_from_buffer(program_buffer)
>>> data_map = _load_flat_tensor_data_map("model.ptd")
>>> method = program.load_method("forward", data_map.get_named_data_map())
>>> outputs = method(inputs)[0]
```
Differential Revision: D87461455
fcd6560 to
3f3c2da
Compare
3f3c2da to
ff52ef7
Compare
Summary:
Create pybindings around the FlatTensorDataMap::load function
This allows us to use the low-level program data separation APIs in pybindings, through program/method as well as Module.
Use `py::capsule` to capture the type `const NamedDataMap*` that is passed into method_load.
Example usage:
```
>>> inputs = (torch.randn(3),)
>>> program = _load_program_from_buffer(program_buffer)
>>> data_map = _load_flat_tensor_data_map("model.ptd")
>>> method = program.load_method("forward", data_map.get_named_data_map())
>>> outputs = method(inputs)[0]
```
Reviewed By: JacobSzwejbka
Differential Revision: D87461455
Summary:
Create pybindings around the FlatTensorDataMap::load function
This allows us to use the low-level program data separation APIs in pybindings, through program/method as well as Module.
Use `py::capsule` to capture the type `const NamedDataMap*` that is passed into method_load.
Example usage:
```
>>> inputs = (torch.randn(3),)
>>> program = _load_program_from_buffer(program_buffer)
>>> data_map = _load_flat_tensor_data_map("model.ptd")
>>> method = program.load_method("forward", data_map.get_named_data_map())
>>> outputs = method(inputs)[0]
```
Reviewed By: JacobSzwejbka
Differential Revision: D87461455
ff52ef7 to
49cc0e9
Compare
Summary:
Create pybindings around the FlatTensorDataMap::load function
This allows us to use the low-level program data separation APIs in pybindings, through program/method as well as Module.
Use
py::capsuleto capture the typeconst NamedDataMap*that is passed into method_load.Example usage:
Differential Revision: D87461455