Implement load_into for Mmap Data Loader#11654
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/11654
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New FailureAs of commit 5589d40 with merge base 7bd15b9 ( NEW FAILURE - The following job has failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
@pytorchbot label "release notes: none" |
|
|
||
| ET_NODISCARD executorch::runtime::Result<size_t> size() const override; | ||
|
|
||
| ET_NODISCARD executorch::runtime::Error validate_input( |
There was a problem hiding this comment.
nit: Can you make this private
There was a problem hiding this comment.
Done, moved to private section
|
just letting ci run again and then will merge |
|
CI failure looks unrelated: |
|
Thanks for contributing! |
|
I'm happy to help! Thanks for the review. |
This reverts commit 18e4240.
### Summary - Adds `load_into()` to support memory mapped loading directly into the caller's buffer. - Enables copying a specific byte range from the file without creating an internal buffer. - Resuses input validation from `load()`. Fixes pytorch#11561 ### Test plan - Added unit tests to `MmapDataLoaderTest` for `load_into()` to validate copying for both aligned and offset data. - All Mmap Data Loader tests pass via: ``` ./build-ninja/extension/data_loader/test/extension_data_loader_test --gtest_filter='MmapDataLoaderTest.*' ``` - Full set of Data Loader tests pass via: ``` ./build-ninja/extension/data_loader/test/extension_data_loader_test ```
### Summary - Adds `load_into()` to support memory mapped loading directly into the caller's buffer. - Enables copying a specific byte range from the file without creating an internal buffer. - Resuses input validation from `load()`. Fixes pytorch#11561 ### Test plan - Added unit tests to `MmapDataLoaderTest` for `load_into()` to validate copying for both aligned and offset data. - All Mmap Data Loader tests pass via: ``` ./build-ninja/extension/data_loader/test/extension_data_loader_test --gtest_filter='MmapDataLoaderTest.*' ``` - Full set of Data Loader tests pass via: ``` ./build-ninja/extension/data_loader/test/extension_data_loader_test ```
|
FYI I temporarily reverted this due to a meta-internal build issue. Sorry about that. I'm going to re-merge it shortly, preserving commit authorship. We'll also fix the CI so that it builds with -Wshadow. |
|
Got it. Let me know if you'd like me to change anything. |
### Summary - Adds `load_into()` to support memory mapped loading directly into the caller's buffer. - Enables copying a specific byte range from the file without creating an internal buffer. - Resuses input validation from `load()`. Fixes #11561 ### Test plan - Added unit tests to `MmapDataLoaderTest` for `load_into()` to validate copying for both aligned and offset data. - All Mmap Data Loader tests pass via: ``` ./build-ninja/extension/data_loader/test/extension_data_loader_test --gtest_filter='MmapDataLoaderTest.*' ``` - Full set of Data Loader tests pass via: ``` ./build-ninja/extension/data_loader/test/extension_data_loader_test ```
### Summary - Adds `load_into()` to support memory mapped loading directly into the caller's buffer. - Enables copying a specific byte range from the file without creating an internal buffer. - Resuses input validation from `load()`. Fixes pytorch#11561 ### Test plan - Added unit tests to `MmapDataLoaderTest` for `load_into()` to validate copying for both aligned and offset data. - All Mmap Data Loader tests pass via: ``` ./build-ninja/extension/data_loader/test/extension_data_loader_test --gtest_filter='MmapDataLoaderTest.*' ``` - Full set of Data Loader tests pass via: ``` ./build-ninja/extension/data_loader/test/extension_data_loader_test ```
### Summary Revert pytorch#11654 and pytorch#11858 due to Meta-internal build breakage. I will re-land these (preserving attribution).
### Summary - Adds `load_into()` to support memory mapped loading directly into the caller's buffer. - Enables copying a specific byte range from the file without creating an internal buffer. - Resuses input validation from `load()`. Fixes pytorch#11561 ### Test plan - Added unit tests to `MmapDataLoaderTest` for `load_into()` to validate copying for both aligned and offset data. - All Mmap Data Loader tests pass via: ``` ./build-ninja/extension/data_loader/test/extension_data_loader_test --gtest_filter='MmapDataLoaderTest.*' ``` - Full set of Data Loader tests pass via: ``` ./build-ninja/extension/data_loader/test/extension_data_loader_test ```
Summary
load_into()to support memory mapped loading directly into the caller's buffer.load().Fixes #11561
Test plan
MmapDataLoaderTestforload_into()to validate copying for both aligned and offset data.