The scan from Zarr to rows costs as much as a whole dense data loader
Les mainteneurs répondent en général sous 3 jours
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 5/5
- Temps estimé
- Plus d'une semaine
- Accessibilité débutants
- 35/100
- Type d'issue
- Fonctionnalité
- Clarté
- Plutôt claire
- Activité
- Active
- Domaine
- data-engineering, performance
Piste de recherche
Start by comparing the Zarr-to-Arrow scan with the Dask and direct Zarr baselines described in the issue, then read related issues #173 and #276 for context. The proposed work spans scan indexing, mask pushdown, and preserving row order, so first identify which optimization has a defined entry point. Done means a measured improvement against the stated baselines while preserving the reported batch correctness.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
🔥 Claude (torch-sql):
torch-sql is a prototype that runs PyTorch models as SQL on XQL. Its first step into production is to replace Samudra's training data loader with a query through xarray-sql: read a rollout window, normalize it with a join to per-channel statistics, mask land, and hand dense tensors to PyTorch.
A spike measured that on a synthetic store shaped like Samudra's OM4 data: 40 channels, 180 × 360, chunks of one time step, NaN on land, 24 time steps. One rollout window is 5 time steps × 40 channels, 52 MB of float32. The batches are correct (equal to Samudra's own normalization and masking within 1e-5), but they're slow:
| Path | Seconds per window (warm) |
|---|---|
Dask, as Samudra's cpu loader reads it |
0.17–0.25 |
| Zarr directly, no Dask | 0.16–0.24 |
| xarray-sql on DataFusion | 0.40–0.48 |
| the same, dropping land rows | 0.36–0.43 |
| xarray-sql on DuckDB | 0.49–0.54 |
These are xarray-sql 0.6.0 and DataFusion 54 on a 12-core x86 machine that other jobs shared, so expect about 30% noise between runs. The time filter prunes partitions well, so the cost is proportional to the window, not the store.
Where the time goes:
- The scan from Zarr to Arrow rows takes about 240 ms, as long as the baselines' whole pipeline. Each cell becomes a row with three int64 index columns, so the scan writes more index bytes than value bytes.
- The mask and normalization joins add about 90 ms.
- Turning rows back into a dense tensor adds about 40 ms, and it needs a scatter because the rows arrive out of order.
Three things would help, roughly in order:
- A cheaper scan. Narrower index types, or index columns generated from each chunk's offsets rather than materialized per cell.
- A mask as a scan filter. Today, dropping land rows is a join, so land chunks are still read and decoded. Pushing a mask table into the scan would skip chunks that are all land.
- A per-partition order fact. Rows that come out ordered by their indices within a partition could be reshaped without a copy (9 µs on 10.5 million rows), instead of scattered (182 ms). Related: #173 and #276.
- Langage dominant
- Python
- Étoiles
- 142
- Forks
- 19
- Merge moyen
- 3 j 47 min
- PR mergées (30 j)
- 8
Préparer son environnement
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de xqlsystems/xarray-sql
-
dependencies github_actions
Difficulté 2/5 1-3 heures Accessibilité débutants 70/100
xqlsystems/xarray-sql#295 ·
Les mainteneurs répondent en général sous 3 jours
-
A big-endian data variable registers, then every query fails: Byte-swapped arrays not supportedOuvertebug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
xqlsystems/xarray-sql#288 ·
Les mainteneurs répondent en général sous 3 jours
-
documentation ml
Difficulté 1/5 1-3 heures Accessibilité débutants 85/100
xqlsystems/xarray-sql#268 ·
Les mainteneurs répondent en général sous 3 jours
-
enhancement ml
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
xqlsystems/xarray-sql#267 · 4 commentaires ·
Les mainteneurs répondent en général sous 3 jours
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 74/100
xqlsystems/xarray-sql#243 ·
Les mainteneurs répondent en général sous 3 jours
Toutes les issues de xqlsystems/xarray-sql
Issues similaires
-
documentation good first issue
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 84/100
MarketSquare/robotframework-browser#5479 ·
Les mainteneurs répondent en général sous 1 jour
-
Visual COBOL: missing 11.0 and 12.0, and 9.0 date differs from Rocket Software's lifecycle pageOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
endoflife-date/endoflife.date#11561 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 76/100
OCA/l10n-brazil#5602 ·
Les mainteneurs répondent en général sous 1 jour
-
documentation review-2.0.0
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
dkuenzel/meshcore-home-gateway#106 ·
Les mainteneurs répondent en général sous 1 jour