Conversation
…nk override Derived datasets that are filtered and/or resharded views of a catalog of original deliveries (e.g. data-<lang>: `resharded-delivery-X/...` vs the `delivery-X/...` shards that hold the audio on S3) cannot link their audio by shard name + offset: the derived shards hold a subset of the catalog rows, so an offset-based link silently returns another episode's audio (or NoSuchKey). - WSKeyedColumnShard: a `.wsds-link` loader that looks the sample's __key__ up in the linked dataset's index and serves any of `columns` from there. Answers `__key__` itself so cross-column key verification keeps working. - WSDataset._partition_link: a `<name>.wsds-link` inside a partition folder overrides the dataset-root link for that partition (`dataset_dir` relative to the partition folder), so each partition can point at its own catalog partition without a dataset-wide merged catalog index. - tests: filtered + reordered derived dataset, missing key, legacy single `column` spelling, partition override with colliding shard names. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
WSDataset('/mnt/weka/data-wsds/data-pl/indices/source')[i]['audio']→WSShardMissingError … NoSuchKey(same for data-cs, data-en, …).audio.wsds-link(WSS3Shard) maps partitionresharded-delivery-X/<batch>/sourceto the S3 keyresharded-delivery-X/…/audio/<shard>.wsds. That prefix only holds<shard>.keys.parquet; the audio is underdelivery-X/….__key__.Change
WSKeyedColumnShard– a.wsds-linkloader that looks the sample's__key__up in the linked dataset's index and serves any ofcolumnsfrom there:{"dataset_dir": "../catalog/source", "loader": ["wsds.ws_shard", "WSKeyedColumnShard"], "columns": ["audio", "audio_type"]}"column": "audio"is accepted as the single-column spelling.) It answers__key__itself so cross-column key verification keeps working. Missing key →WSShardMissingError.WSDataset._partition_link– a<name>.wsds-linkplaced inside a partition folder overrides the dataset-root link for that partition (dataset_dirrelative to the partition folder). Each partition of a merged index can then point at its own catalog partition, no dataset-wide catalog index needed.+69 lines of library code, no behaviour change for existing links.
Testing
KeyedColumnShardTest(tiny synthetic datasets, no S3): filtered + reordered + resharded derived dataset, unknown key, single-columnspelling, partition override with colliding shard names in two partitions.main+ this PR + WSS3Shard/WSModalShard: fix reading string columns (incl. __key__) #89 against a shadow ofdata-plwhose partitions link to a per-delivery catalog → correct 5 s segments for random episodes out of 3.3M; 38/40 random episodes decode to thedurationin their metadata (other 2 haveduration == -1).tests.pyare pre-existing onmain(need local datasets).Follow-ups (not in this PR)
Performance when a dataset links out to hundreds of catalog partitions: bounded LRU of linked datasets, process-wide open-shard cache, shared/lazy S3 client (overlaps #87), read-through block cache, seek index (#84). Cold fetch is ~4 s on
mainvs ~1.5 s with that stack.🤖 Generated with Claude Code