arrayfire / arrayfire/arrayfire-python

Slow SVD

Offen
#134 3 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
422
Forks
63
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I found AF's SVD implementation is quite slow comparing to DGEMM with Radeon HD 7950/FGLRX driver on Debian Jessie:

```
In [47]: from pylab import randn, svd

In [48]: x_0 = randn(1000, 1000)

In [49]: %time y_0 = svd(x_0)
CPU times: user 1.24 s, sys: 1.01 s, total: 2.24 s
Wall time: 287 ms

In [50]: x_1 = af.Array(x_0.ctypes.data, x_0.shape, 'd')

In [51]: %time y_1 = af.svd(x_1)
CPU times: user 3.64 s, sys: 3.97 s, total: 7.62 s
Wall time: 3.25 s
```
AF's SVD takes more than 9 times of Numpy's SVD to solve the same matrix, However, the in DGEMM, AF is faster (but not much) than Numpy:

```
In [75]: from pylab import dot

In [76]: %time z_0 = dot(x_0.transpose(), x_0)
CPU times: user 52 ms, sys: 20 ms, total: 72 ms
Wall time: 10.6 ms

In [77]: %time z_1 = af.matmul(x_1.T, x_1)
CPU times: user 0 ns, sys: 0 ns, total: 0 ns
Wall time: 8.38 ms
```

I am wondering if there are anything I should tune/adjust before proceeding.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start by reproducing the reported 1000x1000 benchmark using af.svd and compare it with NumPy's svd on the Radeon HD 7950/FGLRX and Debian Jessie setup described in the issue. Check the existing SVD implementation and its backend path; done means identifying and addressing the cause of the timing gap, with the benchmark showing improved results.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
performance
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
30/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.