Support the combination of multiple datasets with the dataloader#99
Conversation
|
@claude please review this PR (I'll review afterwards) |
|
Claude finished @forklady42's task in 1m 58s —— View job PR Review: Support the combination of multiple datasets with the dataloader
Overall this is a well-structured approach to multi-dataset support. The Bug:
|
forklady42
left a comment
There was a problem hiding this comment.
Minor comment about clarifying the config interface. Also worth reviewing Claude's comments.
| datasets: | ||
| - root: /scratch/gpfs/ROSENGROUP/common/globus_share_OA/mp/chg_datasets/dataset_2/mp_filelist.txt | ||
| split_file: /scratch/gpfs/ROSENGROUP/common/globus_share_OA/mp/chg_datasets/dataset_2/split.json | ||
| val_frac: 0.005 |
There was a problem hiding this comment.
val_frac isn't used when split_file is provided. this is at least worth a comment so no one is misled
- Fix collate_fn fallback to work with dict batches and return consistent dict - Gate train/val part building in setup() by stage - Remove dead `if s.root is None` guard - Add comment in lightning.py about Dataset_ID for future multi-head use - Add val_frac comment in configs clarifying it is ignored when split_file is set - Add tests for AddDatasetID, collate_fn fallback, DatasetSpec, RhoRead init and setup Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
45dcaf5 to
071e1d8
Compare
|
@claude review this PR. |
|
Claude finished @hanaol's task in 1m 43s —— View job PR Review: Support the combination of multiple datasets with the dataloader
This revision addresses the main issues from the prior review. Here's the current state: What was fixed
Remaining issuesBug:
|
- Handle list batch in test_step for mismatched-shape multi-dataset inference - Skip split_data for test stage when no split_file is defined (no test set possible) - Shallow-copy dict in AddDatasetID.__getitem__ to avoid mutating base dataset output Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@claude review this PR |
|
Claude finished @hanaol's task in 1m 23s —— View job PR Review: Support the combination of multiple datasets with the dataloader
This revision addresses all of the major issues from prior rounds. Here's the current state: What was fixed since the last review
Remaining issuesLatent bug:
|
- Fix y.detach().cpu() crash in test_step when y is a list (fallback collate path) - Gate split_data call by stage to avoid computing unused train/val splits on test - Warn when a dataset is skipped in test stage due to missing split_file - Fix test.py: use cfg.precision instead of cfg.model_precision - Fix test.py: use devices=auto and infer num_nodes from env for multi-GPU testing Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@claude review this PR as a final round |
|
Claude finished @hanaol's task in 1m 56s —— View job PR Review (Final Round)
All three issues flagged in round 3 have been fixed. This PR is ready to merge. What was fixed since the last review
One minor observation
Overall: the multi-dataset design is clean and idiomatic ( |
In the fallback path, per-key collation is now attempted with default_collate so scalar/uniform fields (e.g. Dataset_ID) become tensors matching the normal path, while only genuinely mismatched tensors remain as lists. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
@forklady42 @ryan-williams there is an e2e error, can I modify the |
|
yes! fine to edit |
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Problem
The current dataloader only supports a single dataset. As a result, it is not possible to combine data coming from different paths.
Solution
This PR extends the dataloader to support multiple datasets. The
root,split_file, andval_fracparameters retain the same meaning as before. In addition, this introduces a new parameter,dataset_id, which serves as an identifier for each dataset and will be useful for future development of multi-head models.Example