You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds public save_ptd and load_ptd Python helpers for saving and loading PTD tensor dictionaries without constructing DataPayload objects directly. The helpers validate supported CPU tensors, preserve contiguous and channels-last layouts, normalize other strided layouts while preserving shape and values, and reject malformed tensor entries.
Includes the review fixes from #21236: saved entries use the default FlatTensorConfig segment alignment for C++ mmap compatibility, optional torch dtypes are skipped when unavailable, and the API documentation explains layout normalization.
Replaces #21236 following the request to open a new PR. The original fork was deleted and recreated, so the original PR could not be reopened. This PR uses the updated Kilbex:python-ptd-tensor-dicts branch, including commit 788378f, so CI can run on the current changes.
lintrunner extension/flat_tensor/README.md extension/flat_tensor/serialize/BUCK extension/flat_tensor/serialize/__init__.py extension/flat_tensor/serialize/serialize.py extension/flat_tensor/test/test_serialize.py — no lint issues.
The earlier C++ smoke-test results cover FlatTensorDataMap with MmapDataLoader, 128-byte alignment, direct mapped-buffer aliases, mixed dtypes, and an empty tensor.
Implementation authored with Claude. Replacement PR prepared with Codex.
This comment was automatically generated by Dr. CI and updates every 15 minutes.
meta-claBot
added
the
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
label
Sep 18, 2026
If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.
To add a label, you can comment to pytorchbot, for example @pytorchbot label "release notes: none"
@nil-is-all The branch is updated with the latest main, and GitHub confirms there are no merge conflicts. The update is pushed and ready for review.
Validation: PYTHONPATH=.. python -m pytest extension/flat_tensor/test/test_serialize.py -q — 16 tests and 20 subtests passed. Lint passed for all five changed files. Remote checks have started on the updated commit.
Thanks!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CLA SignedThis label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.module: extensionIssues related to code under extension/
3 participants
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds public
save_ptdandload_ptdPython helpers for saving and loading PTD tensor dictionaries without constructingDataPayloadobjects directly. The helpers validate supported CPU tensors, preserve contiguous and channels-last layouts, normalize other strided layouts while preserving shape and values, and reject malformed tensor entries.Includes the review fixes from #21236: saved entries use the default
FlatTensorConfigsegment alignment for C++ mmap compatibility, optional torch dtypes are skipped when unavailable, and the API documentation explains layout normalization.Replaces #21236 following the request to open a new PR. The original fork was deleted and recreated, so the original PR could not be reopened. This PR uses the updated
Kilbex:python-ptd-tensor-dictsbranch, including commit 788378f, so CI can run on the current changes.Test plan
PYTHONPATH=.. python -m pytest extension/flat_tensor/test/test_serialize.py -q— 13 tests and 20 subtests passed.lintrunner extension/flat_tensor/README.md extension/flat_tensor/serialize/BUCK extension/flat_tensor/serialize/__init__.py extension/flat_tensor/serialize/serialize.py extension/flat_tensor/test/test_serialize.py— no lint issues.The earlier C++ smoke-test results cover
FlatTensorDataMapwithMmapDataLoader, 128-byte alignment, direct mapped-buffer aliases, mixed dtypes, and an empty tensor.Implementation authored with Claude. Replacement PR prepared with Codex.