Skip to content
This repository was archived by the owner on Sep 25, 2023. It is now read-only.

[REVIEW] cusignal.lfilter implementation - #78

Merged
awthomp merged 6 commits into
rapidsai:branch-0.14from
mnicely:lfilter_cupy
May 6, 2020
Merged

awthomp merged 6 commits into
rapidsai:branch-0.14from
mnicely:lfilter_cupy

Conversation

@mnicely

@mnicely mnicely commented May 5, 2020

Copy link
Copy Markdown
Contributor

This PR ports @luigifreitas lfilter implementation to a CuPy raw kernel

Pre-CuPy

---------------------------------------------------------------------------------------------------- benchmark 'Lfilter': 2 tests ----------------------------------------------------------------------------------------------------
Name (time in us)                       Min                       Max                      Mean                 StdDev                    Median                     IQR            Outliers         OPS            Rounds  Iterations
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
bench_lfilter_cpu[65536]           248.5420 (1.0)          6,068.0390 (1.0)            265.2118 (1.0)         190.6781 (1.0)            248.9720 (1.0)            1.0130 (1.0)        22;763  3,770.5708 (1.0)        4016           1
bench_lfilter_gpu[65536]     3,148,112.2440 (>1000.0)  3,390,779.5800 (558.79)   3,260,895.4035 (>1000.0)  68,649.6840 (360.03)   3,273,964.9520 (>1000.0)  105,369.7988 (>1000.0)      10;0      0.3067 (0.00)         25           1
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Post-CuPy

----------------------------------------------------------------------------------------- benchmark 'Lfilter': 2 tests -----------------------------------------------------------------------------------------
Name (time in us)                    Min                    Max                   Mean             StdDev                 Median               IQR            Outliers         OPS            Rounds  Iterations
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
bench_lfilter_cpu[65536]        248.9730 (1.0)         288.7730 (1.0)         249.8220 (1.0)       2.3228 (1.0)         249.3310 (1.0)      0.2702 (1.0)       188;485  4,002.8505 (1.0)        4009           1
bench_lfilter_gpu[65536]     29,370.4790 (117.97)   29,456.6140 (102.01)   29,384.6633 (117.62)   19.3389 (8.33)     29,377.8030 (117.83)   8.2640 (30.58)         3;3     34.0314 (0.01)         34           1
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

It is still much slower than the sciPy.signal CPU version but this was all the code can stay on the GPU.

@mnicely
mnicely requested a review from a team May 5, 2020 20:34
@GPUtester

Copy link
Copy Markdown
Contributor

Please update the changelog in order to start CI tests.

View the gpuCI docs here.

@mnicely

mnicely commented May 5, 2020

Copy link
Copy Markdown
Contributor Author

Note: This implementation only work on 1D

Comment thread python/cusignal/filtering/filtering.py Resolved
Comment thread python/cusignal/filtering/filtering.py Resolved

@awthomp awthomp left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very minor changes requested and one clarification request.

@mnicely

mnicely commented May 6, 2020

Copy link
Copy Markdown
Contributor Author

Also added documentation to filtering.py

@mnicely mnicely changed the title [PR-WIP] cusignal.lfilter implementation [REVIEW] cusignal.lfilter implementation May 6, 2020
@awthomp
awthomp merged commit 613449d into rapidsai:branch-0.14 May 6, 2020
@mnicely

mnicely commented May 6, 2020

Copy link
Copy Markdown
Contributor Author

signal.lfilter vs cusignal.lfilter vs pytorch.torchaudio.gpu

------------------------------------------------------------------------------------------ benchmark 'Lfilter': 2 tests ------------------------------------------------------------------------------------------
Name (time in us)                            Min                       Max                   Mean                   StdDev                  Median                  IQR            Outliers         OPS            Rounds  Iterations
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
bench_lfilter_cpu[65536]                249.0070 (1.0)            278.1310 (1.0)            249.7074 (1.0)           1.2815 (1.0)            249.3590 (1.0)            0.2750 (1.0)         370;458  4,004.6875 (1.0)        4009           1
bench_lfilter_gpu[65536]             29,375.2840 (117.97)      31,349.0550 (112.71)      29,477.1940 (118.05)      337.7333 (263.54)      29,388.3325 (117.86)        91.4300 (332.49)        1;2       33.9245 (0.01)         34           1
bench_lfiltertorch_gpu[65536]     2,448,753.6310 (>1000.0)  2,658,229.9870 (517.68)   2,561,780.4254 (>1000.0)  57,878.5578 (375.83)   2,555,457.8750 (>1000.0)  100,555.4607 (>1000.0)      10;0        0.3904 (0.00)         25           1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants