Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on missing dependencies #79

Merged
merged 3 commits into from
Oct 12, 2023
Merged

Error on missing dependencies #79

merged 3 commits into from
Oct 12, 2023

Conversation

WardBrian
Copy link
Collaborator

If you pass a CPU array and finufft is unavailable, or if you pass a cuda array and cufinufft is unavailable, we should raise an error

@WardBrian WardBrian requested a review from eickenberg October 11, 2023 20:57
pytorch_finufft/functional.py Show resolved Hide resolved

# dependencies
def test_cuda_finufft_not_installed():
pytest.importorskip("finufft")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this == "if we can import finufft, import it, otherwise skip this test"?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, which I think means it’s actually the flip of what I wanted it to be, which is a mistake (which I think also lead to the confusion in your second comment, and the test to fail on Jenkins)

I’ll fix it up tomorrow if I can, otherwise this will just be untested which I think is fine

points = torch.rand(10, dtype=torch.float64).to('cpu')
values = torch.randn(10, dtype=torch.complex128).to('cpu')

with pytest.raises(RuntimeError, match="cufinufft failed to import"):
Copy link
Collaborator

Choose a reason for hiding this comment

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

By which mechanism do we know that this test is running in the non-cufinufft environment? I don't see where we ensure that cufinufft is not installed

@WardBrian WardBrian force-pushed the error-on-missing-dep branch from 75f7c6a to bf66ad6 Compare October 12, 2023 13:23
@WardBrian WardBrian merged commit 2b94275 into main Oct 12, 2023
0 of 4 checks passed
@WardBrian WardBrian deleted the error-on-missing-dep branch October 12, 2023 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants