feat(array): a bare vmap gives its new axis a positional dim, pa.tag names it, and "batch" stops being special
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 38/100
Direzione di ricerca
Start with pipekit_array/named/_carrier.py, focusing on vmapped_dims, core_dims, and _batch_names; then inspect the dim functions and to_xarray named in the implementation steps. Run the referenced q4b_batch_clash.py prototype and relevant tests. Done means vmap preserves item dims, leaves its added axis positional until pa.tag, and lint, type checks, and tests pass; the issue also calls for checking listed downstream consumers.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem / Request
After a bare jax.vmap, give the new axis a positional dim (None) instead of "batch". Dim functions refuse a positional dim with an error naming pa.tag. Add pa.tag(x, *names) and pa.untag(x, *dims). vmapped_dims and core_dims stop treating names starting with "batch" as added axes.
Motivation
The prototype built a ("batch", "x") carrier of shape (3, 4) for each of 2 items under vmap. The result's sizes were {batch: 2, batch_1: 3, x: 4}: the item's own dim was renamed batch_1 and its name went to the mapped axis, with no error. With ("member", "x") the result was {batch: 2, member: 3, x: 4}. coordax leaves such axes positional until tag names them (CP-D5).
Proposed API
# Shapes: (patch, y, x) = (2, 3, 4)
# today (pipekit-array)
# ("batch", x) per item → (batch, batch_1, x)
out = jax.vmap(build)(patches)
# proposed (CP-D5)
# ("batch", x) per item → (None, batch, x)
out = jax.vmap(build)(patches)
# proposed (CP-D5)
# (None, batch, x) → (patch, batch, x)
out = pa.tag(out, "patch")
Reuse
pipekit_array/named/_carrier.py:vmapped_dims,core_dims,_batch_names.
References & Existing Code
- Design:
docs/design/coordax_carriers.mdin jejjohnson/geostack (merged in jejjohnson/geostack#368), pattern 4 and question CP-O2. - Prototype:
q4b_batch_clash.py.
Implementation Steps
-
vmapped_dimsprependsNone;core_dimsdrops leadingNones only. - Every dim function and
to_xarrayrefuses aNonedim, namingpa.tag. -
pa.tag,pa.untag. - Grep every consumer (geotoolz, gridax, sesmax, plumax, radtrax, diagnostix, vardax) for code that relies on a dim called
"batch"appearing aftervmap, and list them in the PR.
Definition of Done
- Q4b: a
("batch", "x")item undervmapkeeps its name; the mapped axis isNone. -
pa.tagaftervmapgives the same carrier as building it with the name. - Lint, type check and tests green.
Relationships
- Parent: jejjohnson/geostack#369
- Blocked by: jejjohnson/gridax#627, jejjohnson/geotoolz#849, #407
- Blocks: jejjohnson/geotoolz#851, jejjohnson/gridax#629
- 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à 3/5 1-2 giorni Idoneità per principianti 75/100
jejjohnson/pipekit#408 ·
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
-
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
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
freelawproject/litigant-portal#1307 ·
I maintainer di solito rispondono entro 2 giorni
-
type/bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
h2oai/h2o-llmstudio#1163 ·
I maintainer di solito rispondono entro 1 giorno