cusignal icon indicating copy to clipboard operation
cusignal copied to clipboard

Add differentiable polyphase resampler

Open mbolding3 opened this issue 2 years ago • 8 comments

closes #491

Adds a differentiable polyphase resampler in a new diff submodule. Includes some basic unit tests and a demonstration of how to incorporate the new layer in a Pytorch sequential model.

mbolding3 avatar Jun 28 '22 18:06 mbolding3

Can one of the admins verify this patch?

GPUtester avatar Jun 28 '22 18:06 GPUtester

ok to test

awthomp avatar Jun 28 '22 18:06 awthomp

@mbolding3 and @jfsantos -- working through the review now, but one immediate concern is how we handle a PyTorch dependency on cuSignal with this new functionality.

I want to try to keep cuSignal light, so I'm doing a simple try/except on cusignal import to throw a warning if PyTorch isn't installed.

I don't see any major issues with this PR, but I want to make sure that it behaves as @jfsantos would expect prior to merge :).

awthomp avatar Jun 29 '22 17:06 awthomp

@awthomp By default the diff submodule is not imported by cusignal's top-level __init__.py. Users would have to intentionally import cusignal.diff to trigger the pytorch import, which would raise for users without pytorch installed. The unit test file uses a try-except (like you said) to skip the tests if pytorch can't be imported.

Edit: Just noticed your commit. Doing it that way works, too.

mbolding3 avatar Jun 29 '22 18:06 mbolding3

@awthomp By default the diff submodule is not imported by cusignal's top-level __init__.py. Users would have to intentionally import cusignal.diff to trigger the pytorch import, which would raise for users without pytorch installed. The unit test file uses a try-except (like you said) to skip the tests if pytorch can't be imported.

D'oh, I totally missed that. My bad. That said, I think we should put the try/except in the python/diff/__init__.py file, so the user gets a warning if he/she imports cusignal.diff. Right now, with my latest commit, you get it on import of cusignal, which is probably annoying for the average user.

awthomp avatar Jun 29 '22 18:06 awthomp

@awthomp By default the diff submodule is not imported by cusignal's top-level __init__.py. Users would have to intentionally import cusignal.diff to trigger the pytorch import, which would raise for users without pytorch installed. The unit test file uses a try-except (like you said) to skip the tests if pytorch can't be imported.

D'oh, I totally missed that. My bad. That said, I think we should put the try/except in the python/diff/__init__.py file, so the user gets a warning if he/she imports cusignal.diff. Right now, with my latest commit, you get it on import of cusignal, which is probably annoying for the average user.

Makes perfect sense to me. Thanks!

mbolding3 avatar Jun 29 '22 18:06 mbolding3

Also I am not a regular Pytorch user so it would be very helpful to have someone try out the module and make sure it supports the features they need and generally works as expected. All I did was make sure it conformed to the handful of torch's own examples I based the interface off of. (I assume this is what @jfsantos is going to do)

mbolding3 avatar Jun 29 '22 18:06 mbolding3

This PR has been labeled inactive-30d due to no recent activity in the past 30 days. Please close this PR if it is no longer required. Otherwise, please respond with a comment indicating any updates. This PR will be labeled inactive-90d if there is no activity in the next 60 days.

github-actions[bot] avatar Jul 29 '22 20:07 github-actions[bot]