-
Notifications
You must be signed in to change notification settings - Fork 748
add cpp serializer for flat tensor (ptd) #7841
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
add cpp serializer for flat tensor (ptd) #7841
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/7841
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit c35b15e with merge base 1f1a96f ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
This pull request was exported from Phabricator. Differential Revision: D67992901 |
376e7f8 to
ec6e3c8
Compare
Summary: Leverage the flatbuffer builder apis to generate a .ptd on device. This will be used by training for checkpointing. No other use cases really exist for generating a .ptd on device right now, so I didnt worry about making this more easily extensible by coming up with a cpp equivalent of a cord or by trying to think ahead of how this might integrate with delegates. Later if we add support for delegates owning the weights under ET training we can revisit this. Differential Revision: D67992901
|
This pull request was exported from Phabricator. Differential Revision: D67992901 |
Summary: Leverage the flatbuffer builder apis to generate a .ptd on device. This will be used by training for checkpointing. No other use cases really exist for generating a .ptd on device right now, so I didnt worry about making this more easily extensible by coming up with a cpp equivalent of a cord or by trying to think ahead of how this might integrate with delegates. Later if we add support for delegates owning the weights under ET training we can revisit this. Differential Revision: D67992901
ec6e3c8 to
fd69719
Compare
|
This pull request was exported from Phabricator. Differential Revision: D67992901 |
Summary: Leverage the flatbuffer builder apis to generate a .ptd on device. This will be used by training for checkpointing. No other use cases really exist for generating a .ptd on device right now, so I didnt worry about making this more easily extensible by coming up with a cpp equivalent of a cord or by trying to think ahead of how this might integrate with delegates. Later if we add support for delegates owning the weights under ET training we can revisit this. Differential Revision: D67992901
fd69719 to
978d9ce
Compare
|
This pull request was exported from Phabricator. Differential Revision: D67992901 |
Summary: Leverage the flatbuffer builder apis to generate a .ptd on device. This will be used by training for checkpointing. No other use cases really exist for generating a .ptd on device right now, so I didnt worry about making this more easily extensible by coming up with a cpp equivalent of a cord or by trying to think ahead of how this might integrate with delegates. Later if we add support for delegates owning the weights under ET training we can revisit this. Differential Revision: D67992901
978d9ce to
4a8ff3b
Compare
|
This pull request was exported from Phabricator. Differential Revision: D67992901 |
Summary: Leverage the flatbuffer builder apis to generate a .ptd on device. This will be used by training for checkpointing. No other use cases really exist for generating a .ptd on device right now, so I didnt worry about making this more easily extensible by coming up with a cpp equivalent of a cord or by trying to think ahead of how this might integrate with delegates. Later if we add support for delegates owning the weights under ET training we can revisit this. Differential Revision: D67992901
4a8ff3b to
f5916c5
Compare
|
This pull request was exported from Phabricator. Differential Revision: D67992901 |
Summary: Leverage the flatbuffer builder apis to generate a .ptd on device. This will be used by training for checkpointing. No other use cases really exist for generating a .ptd on device right now, so I didnt worry about making this more easily extensible by coming up with a cpp equivalent of a cord or by trying to think ahead of how this might integrate with delegates. Later if we add support for delegates owning the weights under ET training we can revisit this. Differential Revision: D67992901
f5916c5 to
11d2496
Compare
|
This pull request was exported from Phabricator. Differential Revision: D67992901 |
Summary: Leverage the flatbuffer builder apis to generate a .ptd on device. This will be used by training for checkpointing. No other use cases really exist for generating a .ptd on device right now, so I didnt worry about making this more easily extensible by coming up with a cpp equivalent of a cord or by trying to think ahead of how this might integrate with delegates. Later if we add support for delegates owning the weights under ET training we can revisit this. Differential Revision: D67992901
11d2496 to
a2012d9
Compare
|
This pull request was exported from Phabricator. Differential Revision: D67992901 |
dbort
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the changes -- the tests look great
a2012d9 to
32223b4
Compare
Summary: Leverage the flatbuffer builder apis to generate a .ptd on device. This will be used by training for checkpointing. No other use cases really exist for generating a .ptd on device right now, so I didnt worry about making this more easily extensible by coming up with a cpp equivalent of a cord or by trying to think ahead of how this might integrate with delegates. Later if we add support for delegates owning the weights under ET training we can revisit this. Differential Revision: D67992901
|
This pull request was exported from Phabricator. Differential Revision: D67992901 |
dbort
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for all of the changes -- looks great apart from the new bugs.
| if (i != 1) { | ||
| // Precalculate the size of the data blob. | ||
| total_segment_size += aligned_size(tensor.nbytes(), tensor_alignment); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing the --i like in the loop below. Please add a test that would have caught these issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah the existing test does catch this bug. I ran the wrong test (python) before pushing this version
| # points to all the data segments. It will be serialized to flatbuffer. | ||
| flat_tensor = FlatTensor( | ||
| version=0, | ||
| version=0, # Keep in sync with c++ version number in serialize.h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a top-level _SCHEMA_VERSION: int = 0 to raise visibility of this, and to make it map more clearly to the C++ equivalent.
Summary: Leverage the flatbuffer builder apis to generate a .ptd on device. This will be used by training for checkpointing. No other use cases really exist for generating a .ptd on device right now, so I didnt worry about making this more easily extensible by coming up with a cpp equivalent of a cord or by trying to think ahead of how this might integrate with delegates. Later if we add support for delegates owning the weights under ET training we can revisit this. Differential Revision: D67992901
32223b4 to
fc6046c
Compare
|
This pull request was exported from Phabricator. Differential Revision: D67992901 |
Summary: Leverage the flatbuffer builder apis to generate a .ptd on device. This will be used by training for checkpointing. No other use cases really exist for generating a .ptd on device right now, so I didnt worry about making this more easily extensible by coming up with a cpp equivalent of a cord or by trying to think ahead of how this might integrate with delegates. Later if we add support for delegates owning the weights under ET training we can revisit this. Differential Revision: D67992901
fc6046c to
c35b15e
Compare
|
This pull request was exported from Phabricator. Differential Revision: D67992901 |
Differential Revision: D67992901 Pull Request resolved: #7841
Differential Revision: D67992901 Pull Request resolved: pytorch#7841
Summary:
Leverage the flatbuffer builder apis to generate a .ptd on device. This will be used by training for checkpointing.
No other use cases really exist for generating a .ptd on device right now, so I didnt worry about making this more easily extensible by coming up with a cpp equivalent of a cord or by trying to think ahead of how this might integrate with delegates.
Later if we add support for delegates owning the weights under ET training we can revisit this.
Differential Revision: D67992901