Feature request: safety factor parameter
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
Direzione di ricerca
Inizia leggendo l’helper Ivy collegato in ivy_tests/test_ivy/helpers.py intorno alla riga 1793 e verifica come vengono generati i valori limite per il remainder case. Chiarisci con i maintainer l’API e l’ambito desiderati del safety factor; il completamento dovrebbe includere il comportamento documentato e una copertura che dimostri che i valori generati evitano i limiti rappresentabili oppure li includono intenzionalmente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
We (at Ivy) have observed that small variations in how different frameworks handle values very close to the borders of the representable limits of data types can lead to failing tests in the Array API test suite. These errors can be hard to handle, and can result from something as simple as a small rounding error which pushes things over the representable limits for one framework but not another one. For example, with remainder in PyTorch:
# Data generated in `test_remainder`:
x1 = tensor([[ 0.0000e+00, 2.1132e+270, 0.0000e+00, 0.0000e+00],
[ 0.0000e+00, 0.0000e+00, 0.0000e+00, 0.0000e+00]],
dtype=torch.float64)
x2 = ivy.array(1.1754944e-38, dtype=ivy.float32)
# Result for PyTorch:
tensor([[0., nan, 0., 0.],
[0., 0., 0., 0.]], dtype=torch.float64)
i.e. remainder(2.1132e+270, 1.1754944e-38) = nan when it should return 0. We think there has been some rounding of 1.1754944e-38 to 0 which results in the nan as this number is at the 'tiny' limit of float32:
finfo(resolution=1e-06, min=-3.40282e+38, max=3.40282e+38, eps=1.19209e-07, tiny=1.17549e-38, dtype=float32)
Therefore, it would be useful if there was a safety_factor parameter, or something similar, which prevents values from being generated which are right at the limits of the data type. For example, if values are only generated up to 95% of the maximum size (either on a linear or log scale), then this makes it possible the define the importance of such rigorous testing. Such an approach makes it possible Ivy tests to use hypothesis without needing to solve hundreds too many rare corner cases (example).
Let me know what you think 😊
- Lingua principale
- Python
- Stelle
- 74
- Fork
- 54
- Merge medio
- 4h 35m
- PR unite (30g)
- 4
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
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 data-apis/array-api-tests
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 87/100
data-apis/array-api-tests#465 · 1 commento ·
-
Test reflected operators?Aperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
data-apis/array-api-tests#460 · 1 commento ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
data-apis/array-api-tests#455 · 2 commenti ·
-
tracking
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
data-apis/array-api-tests#381 · 9 commenti ·
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
data-apis/array-api-tests#379 · 10 commenti ·
Tutte le issue di data-apis/array-api-tests
Issue simili
-
upstream update
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
conan-io/conan-center-index#31098 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
john-kurkowski/tldextract#382 ·
-
comp/tools duplicate P2 sweeper:risk-compatibility tool/mcp type/bug
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
NousResearch/hermes-agent#132042 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
deepset-ai/haystack#13092 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 85/100
feder-cr/invisible_playwright_mcp#1408 ·
I maintainer di solito rispondono entro 1 giorno