• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

IntelPython / dpnp / 13168265799
81%

Build:
DEFAULT BRANCH: master
Ran 05 Feb 2025 11:35PM UTC
Jobs 1
Files 206
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

05 Feb 2025 11:08PM UTC coverage: 71.572% (-0.3%) from 71.848%
13168265799

push

github

web-flow
Improve performance of `dnp.nan_to_num` (#2228)

This PR adds a dedicated kernel for `dnp.nan_to_num` to improve its
performance. This reduces the number of kernel calls to at most one in
all cases.

A kernel for both strided and contiguous inputs have been added, to
avoid additional allocation of device memory for trivial strides when
input is fully C- or F-contiguous.

For example of performance gains, using Max GPU

master:
```python
In [1]: import dpnp as dnp

In [2]: import numpy as np

In [3]: x_np = np.random.randn(10**9)

In [4]: x_np[np.random.choice(x_np.size, 200, replace=False)] = np.nan

In [5]: x = dnp.asarray(x_np)

In [6]: q = x.sycl_queue

In [7]: %time r = dnp.nan_to_num(x); q.wait()
CPU times: user 394 ms, sys: 43.8 ms, total: 438 ms
Wall time: 304 ms

In [8]: %time r = dnp.nan_to_num(x); q.wait()
CPU times: user 333 ms, sys: 31.8 ms, total: 364 ms
Wall time: 134 ms
```

on branch:
```python
In [8]: %time r = dnp.nan_to_num(x); q.wait()
CPU times: user 49.6 ms, sys: 8.1 ms, total: 57.7 ms
Wall time: 60.9 ms

In [9]: %time r = dnp.nan_to_num(x); q.wait()
CPU times: user 22.9 ms, sys: 16 ms, total: 38.9 ms
Wall time: 19.7 ms
```

4628 of 9420 branches covered (49.13%)

Branch coverage included in aggregate %.

205 of 327 new or added lines in 4 files covered. (62.69%)

17276 of 21184 relevant lines covered (81.55%)

20204.92 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
35
75.47
dpnp/backend/extensions/ufunc/elementwise_functions/nan_to_num.cpp
87
30.4
dpnp/backend/kernels/elementwise_functions/nan_to_num.hpp
Jobs
ID Job ID Ran Files Coverage
1 13168265799.1 05 Feb 2025 11:35PM UTC 206
71.57
GitHub Action Run
Source Files on build 13168265799
  • Tree
  • List 206
  • Changed 14
  • Source Changed 0
  • Coverage Changed 3
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • 77702b3e on github
  • Prev Build on master (#13159902872)
  • Next Build on master (#13183276656)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc