-
Notifications
You must be signed in to change notification settings - Fork 712
Implement load_into for SharedPtrDataLoader and add test (#11562) #11707
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/11707
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 2c3eee1 with merge base db8ef6b ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
Hi @Tanish2101! Thank you for your pull request and welcome to our community. Action RequiredIn order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
|
@pytorchbot label "release notes: none" |
|
Hi @JacobSzwejbka, I created a PR for this issue. This is the first time I am contributing to executorch. Please Let me know if there are any changes required. |
|
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks! |
|
Hi @Tanish2101 Thank you for the contribution. Looks like @keyprocedure has started the PR for the same task (#11654) |
|
I have implemented the load_into() function for shared_ptr data loader so the implementation done by @keyprocedure for mmap data loader is sufficient? means there is no need for seperate implementation for shared_ptr ? |
|
So now what should I do? means should I close the pull request which I have created for this issue? Let me know @mergennachin |
| return size_; | ||
| } | ||
|
|
||
| ET_NODISCARD executorch::runtime::Error SharedPtrDataLoader::load_into( |
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.
Can you merge the declaration and implementation?
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.
I have merged the 'load_into' function declaration and implemention as suggested by you, please review it.
I have merge the declaration and implementation of 'load_into' function.
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.
Letting CI run, but looks good. Thanks for contributing!
|
All of the failures looked like infra issues so rerunning the jobs |
- Replaced non-existent with in implementation. - Updated the corresponding unit test to match the corrected error. - Ensures correctness and prevents enum resolution error during compilation.
|
Fixed: Changed invalid error code Error::OutOfBounds to Error::InvalidArgument in both implementation and test. OutOfBounds is not part of the executorch::runtime::Error enum |
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
|
Looks like this PR hasn't been updated in a while so we're going to go ahead and mark this as |
|
Hi @Tanish2101 , are you still working on this? See that it's approved, do you want to rebase and merge? |
Summary:
Implemented the load_into method for SharedPtrDataLoader to support copying preallocated buffer data into a target buffer. This enables use cases where mutable model state has a meaningful initial value (e.g., on-device training or serialized read-before-write data).
Fixes
Fixes #11562
Test plan:
Added a unit test in shared_ptr_data_loader_test.cpp to verify that load_into():