Conversation
6736b0b to
ffac83a
Compare
17a4673 to
10bb945
Compare
|
Oh, one other thing about this: it's probably worth refreshing the torch docs in repo after this lands to reflect the (new, much smaller) resource requirements and resulting torch flexibility in general (e.g. preemptible compute is much more available with smaller requests) |
2703fcf to
f99a0b4
Compare
b3d363e to
4399ced
Compare
## Summary - rebase the canonical-reader refactor needed by #800 onto the LLC support landed in #670 - replace the overlapping `DatasetSpec` / `CanonicalDataset` / `OceanData` abstractions with `DataLayout`, `CanonicalSource`, `BatchPreprocessor`, `HostBatch`, and `ModelBatch` - make the storage-independent reader accept explicit time indices and canonical channel names - push prognostic-versus-boundary selection into read requests instead of maintaining sliced source objects - move OM4-specific canonicalization into `Om4DataSourceConfig.canonicalize_datasets` - make OM4 and LLC canonicalizers derive their channel selections from variable keys and return the resulting `DataLayout` - keep raw source conventions such as LLC staggered masks and OM4 mask names out of `DataLayout` - preserve the grid-geometry, analysis-ready writer output, and training-progress changes currently on `main` This intentionally does not add an LLC Rust loader. It establishes the narrower `CanonicalReader` seam that the Rust loader can implement later without exposing xarray or source-specific naming to the training pipeline. ## Impact Callers now request ordered canonical channels directly. Canonicalization owns source-specific naming, dimension, mask, and variable-selection rules, while `DataLayout` describes only the canonical/model-facing result. This removes repeated variable filtering and normalization wrappers from the hot data-loading path. ## Validation - `uvx pre-commit run --all-files` - `CUDA_VISIBLE_DEVICES='' uv run pytest -q -m 'not manual and not cuda'` - 323 passed, 2 skipped, 10 xfailed --------- Co-authored-by: OA jder bot <jesse+bot@openathena.ai> Co-authored-by: Alexander Merose <alex@openathena.ai>
10bb945 to
f22b414
Compare
|
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Isolate sampler and DataLoader worker RNGs so loader backends share epoch schedules without consuming process-global randomness.
f22b414 to
5d519f5
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9cd36b1bdc
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| derived = [ | ||
| name | ||
| for name in source.data_layout.boundary_var_names | ||
| if name.endswith("_anomalies") | ||
| ] | ||
| if derived: |
There was a problem hiding this comment.
Reject derived channels before canonicalization
When loading.type='rust' is used with a derived boundary configuration—including the shipped configs/data/om4.yaml—this check runs in prepare() only after BaseDataSourceConfig._build_source() calls canonicalize_datasets(). If the store does not already contain hfds_anomalies, canonicalization computes the anomaly over the full hfds time series before this block discards the result and raises; for quarter-degree data, a simple unsupported-configuration error therefore triggers a multi-gigabyte read and calculation. Validate the configured layout before opening or canonicalizing the datasets.
AGENTS.md reference: AGENTS.md:L303-L307
Useful? React with 👍 / 👎.
Summary
data.loading.type: rustpath for flat and compact OM4 Zarr stores behind the newCanonicalDataset/TrainingShardboundaries.Why
The current CPU loader can spend minutes in xarray/Python data-loading cold paths and shows large periodic data-wait stalls during realistic quarter-degree training. The Rust path keeps local Zarr readers open, loads each unique time/channel plane once, reuses pinned host buffers, and overlaps host reads plus CUDA batch preparation with model execution without changing sampler or
dataset_idsemantics.Scope
This is opt-in and local-filesystem only. It supports training and validation for flat OM4 and OM4-compact. S3, LLC-specific canonicalization, inference, derived seasonal-climatology/anomaly channels, and changing heterogeneous batch semantics remain out of scope.
Quarter-degree two-GPU speed check
gr101, batch size 1, gradient accumulation 4, rollout steps[4], boundary varstauuo,tauvo,hfds.14115987; the attempted two-epoch CPU/Rust job was stopped because CPU validation and epoch-2 cold loading would not leave time for the Rust half in the one-hour allocation.14117615, submitted immediately afterward on the same node with the same container andNCCL_P2P_DISABLE=1.This is a 5.4x train-epoch improvement and 139x validation improvement for this one-epoch qdeg run. The non-stall training number is 1.3x faster, so the main win is removing CPU-loader cold loads and periodic stalls rather than changing steady GPU compute.
Validation
libcudart.so.12environment issue.Notes for review
dataset_idsemantics.TorchTrainDatasetcompatibility adapter solely to delete it in the next commit.