Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

DeadlineExceeded failures in test_eye/test_linspace

Open
#214 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
testing

Research direction

Run the listed pytest command and inspect array_api_tests/test_creation_functions.py, focusing on test_eye and test_linspace. Trace the generated dimension sizes and apply the issue's proposed restriction on the maximum size. Done means both tests complete without Hypothesis DeadlineExceeded failures.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Python
Stars
74
Forks
54
Avg merge
4h 35m
Merged PRs (30d)
4

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from data-apis/array-api-tests

All issues in data-apis/array-api-tests

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.