Adopt the array API standard for the multi-backend numeric core
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
- 35/100
- Tipo di issue
- Refactoring
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Ambito
- backend, machine-learning
Direzione di ricerca
Start by reading the existing ArrayBackend abstraction and the CRPS family entry points, then inspect how array-api-compat infers a namespace from input arrays. Phase 1 is complete when CRPS uses the shared inferred namespace and special-function layer, native arrays are tested across the listed frameworks, and unsupported torch special functions raise NotImplementedError; the remaining phases span all score families and backend removal.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Background
scoringrules runs every score across numpy, numba, jax, and torch through a hand-written ArrayBackend abstraction — an ABC with one concrete subclass per framework (~1400 lines). It works, but it's a maintenance burden: every new numeric primitive has to be added to the ABC and re-implemented in each backend, and users must explicitly select or register a backend.
The Python array API standard (via array-api-compat) now provides a portable, framework-agnostic surface that covers most of what we hand-rolled. Adopting it lets us infer the framework directly from the input arrays, drop most of the custom backend code, and return results in the caller's own framework with no configuration.
Goals
- Infer the array framework from input arrays instead of a global/registry selection.
- Replace the
ArrayBackendABC witharray-api-compatplus a thin extension layer for special functions the standard doesn't cover (erf, gamma, betainc, …). - Keep numba's compiled gufuncs as an explicit, opt-in fast path (
backend="numba"). - Deprecate registry-based backend selection; long-term, remove the
backend=argument entirely.
Approach
This touches all ten score families, so we're doing it in phases — family by family — with the shared infrastructure landing alongside the first pilot family.
- Phase 1 — Foundation + CRPS pilot. Add the
array-api-compatdependency; build the inference and augmented-namespace layer plus the native-first special-function extension layer; migrate the entire CRPS family end-to-end as the pilot. Deprecatebackend="numpy"/"jax"/"torch"andregister_backend/set_activefor array-API frameworks; mixed-framework inputs now raise. Tests exercise native arrays per framework and assert the inferred backend so a misrouted score can't silently fall back to numpy. - Phase 2 — Migrate the remaining families. Port the other nine families (energy, logs, brier, kernels, variogram, dss, interval, quantile, error_spread) and their weighted variants onto the same infrastructure, folding the parallel
_xphelper modules back into the shared core as each family moves over. - Phase 3 — Remove the old abstraction. Once every family is migrated, delete the
ArrayBackendABC, the per-framework subclasses, and the backend registry. - Phase 4 (long-term) — Remove
backend=entirely. Explore transparent auto-numba so the compiled fast path is selected automatically for numpy inputs, removing the need for the backend argument at all.
Behavior changes from Phase 1
- The default no longer routes through numba.
interval_scoreandcrps_quantilepreviously defaulted to gufuncs and now requirebackend="numba"to opt in. - torch has no native betainc / hyp2f1 / expi; scores needing those raise
NotImplementedErrorfor torch inputs (pass numpy or jax instead).
- Lingua principale
- Python
- Stelle
- 108
- Fork
- 15
- Merge medio
- 1h 42m
- PR unite (30g)
- 9
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un 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 frazane/scoringrules
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
frazane/scoringrules#164 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
frazane/scoringrules#163 ·
I maintainer di solito rispondono entro 1 giorno
-
backend:torch bug documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
frazane/scoringrules#146 ·
I maintainer di solito rispondono entro 1 giorno
-
Bugs in the legacy TorchBackendForse già presa @frazane l’ha presa oggi. Apertabackend:torch bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 25/100
frazane/scoringrules#147 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 3/5 1-2 giorni Idoneità per principianti 58/100
frazane/scoringrules#145 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di frazane/scoringrules
Issue simili
-
ChatBedrockConverse changes the keys of JSON tool results to camelCase (`order_id` becomes `orderId`)Forse già presa @geyazheng l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
langchain-ai/langchain-aws#1469 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
b4b usability
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
fix(schedule): align list_tasks since cursor filter boundary from strict > to >=Forse già presa @bfs2021 l’ha presa oggi. Apertaagent-ready bug p2 schedule
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
allenporter/supernote#540 ·
I maintainer di solito rispondono entro 1 giorno
-
The docs build fails: ecc's live inventory dropped the ecc.ecc names btclib's pinned ecc usesForse già presa @fametrano l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
btclib-org/btclib#2968 ·
I maintainer di solito rispondono entro 1 giorno