-
Notifications
You must be signed in to change notification settings - Fork 87
Python simple cuda #685
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
base: master
Are you sure you want to change the base?
Python simple cuda #685
Conversation
This looks great. I would ask @janden to review. My suggestion it to extend https://github.com/flatironinstitute/finufft/blob/master/python/cufinufft/tests/test_simple.py with type3 |
…e3 with CPU version gen_coef_ind
Hi @MaximEremenko, I noticed the tests failing do you need help with it? |
…789 * n_target_pts),) keep in mind n_tr
Hi @DiamonDinoia , ind = (int(0.1789 * n_target_pts),) and assert type3_rel_err < 100 * tol Original CPU code looks a little different. I made verify_type3 to ind = tuple(n-1 for n in n_tr + (int(0.1789 *n_pts),)) and it works but it looks like GPU version gives bigger error compare to CPU and general test case tuple(np.random.randint(0, n) for n in n_tr + (n_pts,)) does not work correctly. |
Really the python tests should not rely on the error of a single output
(ind),
since this can fluctuate too much.
In the C++ and matlab/octave tests I updated this (eg for the latter see
https://github.com/flatironinstitute/finufft/blob/master/matlab/test/fullmathtest.m
).
They use small tests where computing the answer directly is cheap, then
using relative l2-norm of difference.
…On Wed, May 28, 2025 at 11:01 AM Maxim Eremenko ***@***.***> wrote:
*MaximEremenko* left a comment (flatironinstitute/finufft#685)
<#685 (comment)>
Hi,
I have version that can pass tests. Problem is here:
in function: verify_type3
ind = (int(0.1789 * n_target_pts),) and assert type3_rel_err < 100 * tol
Original CPU code looks a little different.
I made verify_type3 to ind = tuple(n-1 for n in n_tr + (int(0.1789
*n_pts),)) and it works but it looks like GPU version gives bigger error
compere to CPU and general test case tuple(np.random.randint(0, n) for n in
n_tr + (n_pts,)) does not work correctly.
—
Reply to this email directly, view it on GitHub
<#685 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACNZRSSOZFHEX2Y4PVGOAS33AXFTXAVCNFSM6AAAAAB5ZTXJB6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDSMJWGY3TENZXGM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
*-------------------------------------------------------------------~^`^~._.~'
|\ Alex Barnett Center for Computational Mathematics, Flatiron Institute
| \ http://users.flatironinstitute.org/~ahb 646-876-5942
|
Hi @MaximEremenko, Yes, let's leave something sensible that passes here. |
This pull request introduces a simplified Python interface for Type 3 NUFFTs (nonuniform-to-nonuniform) in 1D, 2D, and 3D within the cufinufft library. The new functions—nufft1d3, nufft2d3, and nufft3d3—allow users to perform Type 3 transforms with minimal setup, similar to the existing Type 1 and Type 2 interfaces.
Changes
With this update, all NUFFT types (1, 2, and 3) now offer a consistent and simplified Python interface.