Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

DeadlineExceeded failures in test_eye/test_linspace

Abierto
#214 3 comentarios 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Estancado
Stack tecnológico
python
Área
testing

Línea de trabajo

Ejecuta el comando de pytest indicado e inspecciona array_api_tests/test_creation_functions.py, centrándote en test_eye y test_linspace. Traza los tamaños de dimensión generados y aplica la restricción sobre el tamaño máximo propuesta en el issue. Se considera completado cuando ambas pruebas terminan sin fallos Hypothesis DeadlineExceeded.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

bug performance

Running array-api-tests suite on dpctl.tensor (https://github.com/IntelPython/dpctl):

ONEAPI_DEVICE_SELECTOR=*:cpu ARRAY_API_TESTS_MODULE=dpctl.tensor python -m pytest array_api_tests/test_creation_functions.py

two test new failures consistently occur (after updating from f82c7bc8627cc2c3a44fa3e425f53a253a609aa8 to recent tip of main, i.e. 9d7777bc60d45a35124b0de084ff8edbd284c06b), e.g.:

FAILED array_api_tests/test_creation_functions.py::test_eye - hypothesis.errors.DeadlineExceeded: Test took 1470.80ms, which exceeds the deadline of 800.00ms
FAILED array_api_tests/test_creation_functions.py::test_linspace - hypothesis.errors.DeadlineExceeded: Test took 864.40ms, which exceeds the deadline of 800.00ms

Here is my understanding of what happens.

Hypothesis would generate a sufficiently large array, i.e. eye(47, 100) but testing of the output correctness is is done one element at the time (suboptimal usage for offloading libraries as it triggers 4700 submissions of small kernels) and this testing would take much longer than the creation of the array itself:

In [7]: import dpctl, dpctl.tensor as dpt

In [8]: %time eye_m = dpt.eye(47,100)
CPU times: user 3.23 ms, sys: 0 ns, total: 3.23 ms
Wall time: 2.76 ms

In [9]: %time all(eye_m[i, j] == (1 if i == j else 0) for i in range(eye_m.shape[0]) for j in range(eye_m.shape[1]))
CPU times: user 6.68 s, sys: 1.98 s, total: 8.67 s
Wall time: 2.09 s
Out[9]: True

The remedy would be to restrict the maximal dimension size.

Lenguaje dominante
Python
Estrellas
74
Forks
54
Merge medio
4 h 35 min
PR fusionados (30 d)
4

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de data-apis/array-api-tests

Todos los issues de data-apis/array-api-tests

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.