feat(array): map_over maps over a tuple of dims, with mapper= choosing jax.vmap, a loop or any vmap-like callable
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 75/100
Direzione di ricerca
Start with pipekit_array/named/_map.py:map_over and inspect its current dimension mapping and loop fallback. Add tuple-of-dim support and the mapper option described in the issue, then compare results with nested map_over for DimArray and CField, including the NumPy loop case. Done means those checks pass and lint and type checks are green.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem / Request
Let pa.map_over(x, fn, dims, mapper=jax.vmap) take a tuple of dims and a mapper: jax.vmap (default on JAX data, as today), "loop", or any vmap-like callable such as a sharded map.
Motivation
Mapping over members and times today is two nested map_over calls. coordax's cmap takes the vmap as an argument (CP-D4). The prototype on a (member, time, y, x) = (4, 5, 32, 32) ensemble: one call over ("member", "time") equalled nesting to 0.0 with jax.vmap, and a loop equalled it to 2.2e-8; eagerly the vmap took 3.0 ms and the loop 10.3 ms, so the choice belongs to the caller.
Proposed API
# Shapes: (member, time, y, x) = (4, 5, 32, 32)
# today (pipekit-array)
# (member, time, y, x) → (member, time)
eta_bar = pa.map_over(eta, lambda m: pa.map_over(m, spatial_mean, "time"), "member")
# proposed (CP-D4)
# (member, time, y, x) → (member, time), mapped dims first in the order given
eta_bar = pa.map_over(eta, spatial_mean, ("member", "time"), mapper=jax.vmap)
A single dim as a string keeps working. Today's fallback to a loop for a fn that cannot be traced stays when mapper is not given.
Reuse
pipekit_array/named/_map.py:map_over.
References & Existing Code
- Design:
docs/design/coordax_carriers.mdin jejjohnson/geostack (merged in jejjohnson/geostack#368), "Mapping over named dims" and pattern 3. - Prototype:
q3_q7_rest.py, section Q3.
Implementation Steps
- Accept
dims: str | tuple[str, ...]andmapper; nest one level per dim. - Docstring with the nested equivalent.
Definition of Done
- Equal to nested
map_overwithjax.vmap, to the bit, onDimArrayandCField. - Equal to round-off with
mapper="loop"; NumPy data with"loop"stays NumPy. - Lint, type check and tests green.
Relationships
- Parent: jejjohnson/geostack#369
- Lingua principale
- Python
- Stelle
- 0
- Fork
- 0
- Merge medio
- 3h 50m
- PR unite (30g)
- 143
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di jejjohnson/pipekit
-
area:code layer:0-primitives priority:p2 type:feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
jejjohnson/pipekit#296 ·
I maintainer di solito rispondono entro 1 giorno
-
area:code type:feature
Difficoltà 3/5 1-2 giorni Idoneità per principianti 57/100
jejjohnson/pipekit#411 ·
I maintainer di solito rispondono entro 1 giorno
-
area:code type:feature
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
jejjohnson/pipekit#410 ·
I maintainer di solito rispondono entro 1 giorno
-
area:code type:feature
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
jejjohnson/pipekit#409 ·
I maintainer di solito rispondono entro 1 giorno
-
area:code type:feature
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
jejjohnson/pipekit#407 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di jejjohnson/pipekit
Issue simili
-
A JSON chat answer blocks the backend event loop for the whole RAG runForse già presa @NopeCharon l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
The-OpenROAD-Project/ORAssistant#656 ·
I maintainer di solito rispondono entro 1 giorno
-
bug(operator): VolterraOperator built inside jax.jit with a concrete decay raises TracerBoolConversionErrorForse già presa @jejjohnson l’ha presa oggi. Apertatype:bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
jejjohnson/integrix#144 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
finos/ai-governance-framework#459 ·
-
slurm: a case outcome nested too deep crashes status/collect instead of reading as no outcomeAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
autowarefoundation/autoware_carla_scenario#2963 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno