[python] Add Paimon LeRobot map-style dataset - #9498
Conversation
JingsongLi
left a comment
There was a problem hiding this comment.
Two remaining issues after re-checking the updated head.
| "Paimon table is missing LeRobot fields: %s" | ||
| % sorted(missing)) | ||
|
|
||
| self._dataset, splits, read_table, snapshot_id = _lazy_torch_dataset( |
There was a problem hiding this comment.
[P2] Please reject unsupported lazy-reader fallbacks before loading payload columns. to_torch() silently calls _materialize() when the row-ID path is unavailable; a reachable example is query authorization masking _ROW_ID. In that case constructing this wrapper reads and retains the full projected table even though the documented contract says payload columns remain lazy, and enabling deltas materializes a second projection as well. This can turn dataset construction into O(table size) payload I/O and memory use on training-scale tables. Please preflight the lazy eligibility and fail with an actionable error, or provide a lazy routing path for these cases.
| def _resolve_metadata(metadata): | ||
| if isinstance(metadata, (str, Path)): | ||
| root = Path(metadata) | ||
| if root.name == "meta": |
There was a problem hiding this comment.
[P2] Please disambiguate the dataset root and meta/ directory structurally instead of using the basename. A valid dataset rooted at /datasets/meta stores its metadata at /datasets/meta/meta/info.json, but this branch rewrites the root to /datasets and then rejects it. Check <input>/meta/info.json first as the dataset-root form; only if that is absent should <input>/info.json be treated as the metadata-directory form and resolved to its parent.
|
I think the imported dataset should be self-contained in Paimon, but separate typed tables would be clearer than either duplicating metadata in every frame or storing all metadata in a generic A possible logical dataset bundle is:
All component tables should use the same With this contract, The current PR leaves the source of truth split between Paimon frames and an external metadata directory. I suggest defining and implementing the self-contained multi-table import contract first, then keeping |
|
To clarify the business meaning of the three proposed metadata tables, they represent three different levels of the dataset rather than merely splitting one metadata blob by file type. 1.
|
Purpose
Add a map-style
PaimonLeRobotDatasetfor training from LeRobot v3 image datasets that were imported into a multimodal Paimon table.Changes
LeRobotDatasetMetadataor a local v3 dataset/metapath and expose it asdataset.meta.__getitems__and multi-workerDataLoaderreads, without materializing the full table.Scope
This first version reuses external LeRobot v3 metadata; the imported table does not persist the complete
meta/directory and is not presented as a self-contained round-trip format. It supports image-backed datasets. Video-backed reads are an independent follow-up to #9494, and this PR does not depend on that PR.PaimonLeRobotDatasetis a minimal PyTorch Dataset-compatible wrapper rather than a subclass of the officialLeRobotDataset.Tests
53 passedinpypaimon/tests/torch_read_test.py, includingDataLoader(batch_size=2, num_workers=2).15 passed, 4 skippedinpypaimon/tests/multimodal_lerobot_test.pylocally; LeRobot-dependent cases run in the optional-dependency CI lane.py_compile, andgit diff --checkpass.