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

Using the FMM plans #251

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Using the FMM plans #251

wants to merge 2 commits into from

Conversation

MikaelSlevinsky
Copy link
Member

This starts using the new binaries that incorporate MikaelSlevinsky/FastTransforms#83. Unfortunately, the code is structured somewhat differently, so it may take some thought to determine the best way forward. However, it seems to be significantly faster, which is great! CC @ioannisPApapadopoulos, @dlfivefifty

julia> using FastTransforms

julia> x = randn(10_000);

julia> @time p = plan_leg2cheb(x);
  0.584059 seconds (1 allocation: 48 bytes)

julia> @time p*x;
  0.008889 seconds (2 allocations: 78.172 KiB)

julia> @time pfmm = FastTransforms.plan_fmm_leg2cheb(x);
N 10000
Num levels 6
Num submatrices 360
Num blocks 120
Given max s 64 
Computed s 40 
Computed N 10240
Lagrange 0
Using exact binomial matrix
Initialization 1.4929e-03 s
  0.001504 seconds (1 allocation: 48 bytes)

julia> @time pfmm*x;
  0.000425 seconds (4 allocations: 156.344 KiB)

@mikaem
Copy link
Collaborator

mikaem commented Sep 4, 2024

Very nice to see this in Julia, thanks @MikaelSlevinsky!
Looking at the computation I was thinking perhaps the verbosity should be turned down to 0 by default? The planning is now printing a lot of different numbers that are perhaps only important for someone really interested in the method and not the actual transform?

@MikaelSlevinsky
Copy link
Member Author

Yep, I was just curious about your diagnostic info (and checking that the ccall was correct!). That will most definitely be elided before a merge.

@ioannisPApapadopoulos
Copy link
Member

Hi @MikaelSlevinsky, what work remains in this PR? Does ldiv work with FastTransforms.plan_fmm_leg2cheb or does FastTransforms.plan_fmm_cheb2leg also need to be implemented?

@MikaelSlevinsky
Copy link
Member Author

While it could be merged, I have held off so far because it would be best if the API were the same as the existing schemes so that this code would be a drop-in replacement. This means allowing 2-normalized Chebyshev and Legendre polynomials. and also, since the connection coefficients are upper triangular, it would make sense for the C library to have the execute routines work in-place on a vector of coefficients instead of having input and output arrays. Both of these (relatively minor) issues would be best resolved in the C library itself.

@ioannisPApapadopoulos
Copy link
Member

ok, understood! Thanks @MikaelSlevinsky

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.

3 participants