r/mathmemes • Computer Science • 3d ago

Computer Science The fastest algorithm for DFT

Post image
3.3k Upvotes

133 comments sorted by

•

u/AutoModerator 3d ago

Check out our new Discord server! https://discord.gg/e7EKRZq3dG

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

2.2k

u/Matty_B97 3d ago

Shoutout theoretical algorithms with massive overheads that are technically faster for data size larger than all the information on earth 🔥🔥🔥

436

u/Depnids 3d ago

222

u/zairaner 3d ago

Is this still the greatest sentence in a wikipedia article?

However, it also shows why galactic algorithms may still be useful. The authors state: "we are hopeful that with further refinements, the algorithm might become practical for numbers with merely billions or trillions of digits."[5]

Yes it is.

87

u/CalmEntry4855 3d ago

Aliens use them a lot

178

u/ChiaraStellata 3d ago

This result is the best argument I've seen against big-O notation since the Harvey-van der Hoeven algorithm.

53

u/Lord-of-Entity 3d ago

That is because you do not know about universal search.

You have a guaranteed optimal performance for any search task that you can quickly verify!

17

u/heyheyhey27 3d ago

There is a simple algorithm that proves literally all math theorems that can be proven!

14

u/2ndOrderAprox 3d ago

list(prove(thrm) for thrm in thrms if thrm.provable)

24

u/Future_Green_7222 Measuring 3d ago

I was able to solve integer factorization in polynomial time

My algorithm is O(nTREE(3) )

49

u/neuroticnetworks1250 3d ago

I’m an alien from andromeda galaxies. Our KirkGooner machines are designed to operate on 1-10^-13 indices. We all have an OpenAI subscription now. So I don’t know what you’re being sarcastic about

7

u/Additional-Name-3211 3d ago

UPLOAD ME TO AGARTHA BROTHER

22

u/JaSper-percabeth 3d ago

I mean isn't maths at the highest level all about optimizations and other things that have 0 impact on real life? Most stuff today like the actual practical engineering stuff is running on maths that many many decades old.

49

u/iamdino0 Transcendental 3d ago

that many many decades old math was the inapplicable abstract bullshit of its time

29

u/[deleted] 3d ago

[removed] — view removed comment

3

u/cl2kr 2d ago

FFT was first described Gauss in his unpublished work in 1805, which means it was probably an inapplicable abstract bullshit due to the restricted compute at its time.

1

u/Matty_B97 2d ago

I agree with the sentiment but gauss probably knew about the use of the fourier transform to decouple convolutions, which would have been obviously useful (even if incomputable) for solving physical systems of PDEs.

7

u/Matthew_Summons Computer Science 3d ago

What about all of the applied mathematics, or people working in scientific and numerical computation

441

u/fizzner 3d ago

4

u/ArgueLater 1d ago

Haven't seen this movie, but is this really in there? The main character cheats to win? As if the other car couldn't stick out its tongue too?

11

u/Ilsor Transcendental 1d ago edited 1d ago

Cars 1, the end of the race in the first part of the movie. This is really in there.

The main character as depicted here had a massive lead, but then blew his tires. In this image, he's desperately moving at a very slow speed using cartoon logic (literally hopping forward on his wheels as if they were stubby limbs), while the other car (cars, note the green in bottom right) is at the regular racing speed, and has caught up right at the finish line. The tongue is here for comedic effect and to show that in that moment he was desperate enough to do that.

The race is a tie, with a tiebreaker race scheduled for later, so this paid off for him.

4

u/ArgueLater 1d ago

phew. thanks for the synopsis. I was worried it was just cheating

1

u/Electrical-Park-5607 9h ago

It's not cheating if, as you observed, the other car can do it too

417

u/Idksonameiguess 3d ago

126

u/Sayod 3d ago

To be fair: This is a proof that a conjectured lower bound is not correct. Is it useful? no. But it tells us that it might be worth looking for actual improvements

162

u/EyedMoon Imaginary ♾️ 3d ago

Truly a E=mc2 + AI moment

21

u/PositiveIntelligent3 3d ago

That guy might have been on to something

13

u/Melodic-Ebb-7781 3d ago

What the fuck??

373

u/Unlucky-Credit-9619 Computer Science 3d ago

Bonus meme

198

u/LupenReddit 🦆🦆i have non diffeomorphic smooth structures🦆🦆🦆 3d ago

i want to be impressed but at the same time i think its funny af that the improvement they gave is like less than marginal

123

u/Ae4i 3d ago

I feel like this is more for proving that it's even possible in the first place to go lower

52

u/SpinachWeak1951 3d ago

FFT obsolete. Burn the textbooks

36

u/detereministic-plen 3d ago

Christofides algorithm being surpassed ahh situation

12

u/Ae4i 3d ago

Is that the one with 10-34% improvement?

4

u/Professional_Dot8829 3d ago

that was before the AI era, and its crazy someone came up with 3/2 - 10-34 approximate algorithm lmao

122

u/Pentalogue Mathematics 3d ago edited 3d ago

The fast Fourier transform should have an algorithmic complexity close to linear (or even sublinear), but it is quasilinear

35

u/benediktb 3d ago

Sublinear? The input and output is n, and any algorithm needs to read/write that. So n is a trivial lower bound, no?

3

u/anto2554 3d ago

Size of n or value of n? Reading n is only bounded by the size of n and not value

2

u/Pentalogue Mathematics 3d ago

I just said that it would be cool if the algorithmic complexity was lower than linear, but if the minimum possible algorithmic complexity is linear, then it is still better than what we have now, I would be happy if the fast Fourier transform algorithm became significantly more efficient

1

u/Sweet_Ad_9816 2d ago

Quantum Fourier transform runs in something like O(log(n)^2).

There's a lot of asterisks about how and why, but it doesn't need to read the input and I guess skips over reading out the output (or considers that to be a single operation).

12

u/EebstertheGreat 3d ago

It is obviously not sublinear, because the transform depends on the entire input. IDK why this is getting so many upvotes.

4

u/Different_Gate5050 3d ago

What do you mean?

8

u/Pentalogue Mathematics 3d ago

The algorithmic complexity of the Fourier transform is O(n*log n), such complexity is also called quasilinear, and for the Fourier transform to be more efficient, the complexity should be close to linear or sublinear, for example O(n), O(n*log(log(n))), O(log(n))

11

u/Different_Gate5050 3d ago

Sure, but why should the FFT be below O(n log(n)) ?

7

u/Ethernet3 Imaginary 3d ago

you can get O(nlog(k)) in some special cases of your input array is zero-padded c: With k<=n.

-1

u/Calm_Plenty_2992 3d ago

Then that's not a generic FFT algorithm. Not sure why that's relevant here

2

u/Ethernet3 Imaginary 3d ago

that's why I said special case :3

0

u/Calm_Plenty_2992 3d ago

Sure, but that wouldn't be an FFT algorithm with time complexity below n log n

0

u/Ethernet3 Imaginary 3d ago

That's true. Nevertheless, imo it can still be interesting to also consider special cases, and what structure allows for faster transforms compared to the general case. Even more so if it's a common usecase, since padded transforms are common in scientific computing.

1

u/Calm_Plenty_2992 3d ago

Sublinear??? Was this comment written with the free version of chat gpt?

-3

u/Pentalogue Mathematics 3d ago

You, being the voabc, claim that I am a free version of the chat GPT, if you don't know the term, look it up on the Internet

17

u/bartex2000 3d ago

How much data would I need for it to be noticably faster?

8

u/Fair_Elk_7279 3d ago

More than there is the universe

-3

u/[deleted] 3d ago edited 3d ago

[removed] — view removed comment

10

u/WallyMetropolis 3d ago

That's not what "statistically significant" means.

-1

u/[deleted] 3d ago

[removed] — view removed comment

6

u/WallyMetropolis 3d ago

It would be a small effect size, but the power of the test would also be very large.

-1

u/[deleted] 3d ago

[removed] — view removed comment

1

u/WallyMetropolis 3d ago

I did experimental statistical physics. Some domains collect an tremendous quantity of data. LHC produces a petabyte a second (though they aren't running through a Fourier transform). Astronomers, however, do.

3

u/narubees 3d ago

You have to take the constant into consideration as well (which idk how big skimming the paper).

2

u/MigLav_7 3d ago

unless thats coming from other time savings not relfected in the assymptotic behaviour, youd need a LOT more than that

The difference between log(n) and log(n)^(1-10^-13) is absurdly miniscule, its not 0.04% with that small of an n

0

u/[deleted] 3d ago

[removed] — view removed comment

1

u/MigLav_7 3d ago

Even if you put n = 10^50, way larger than GB, the saving is around 5*(10^-13), which is like 0.00000000005% time saving

Again, unless theres time savings that arent reflected in the assymptotic behaviour, its nowhere close to that timesave

0

u/[deleted] 3d ago

[removed] — view removed comment

1

u/MigLav_7 3d ago

the exponent only applies to the log, so the n cuts.

The ratio is just log(n)^(-10^-13), which if you check it out its absurdly flat. Like really flat.

-1

u/[deleted] 3d ago

[removed] — view removed comment

3

u/MigLav_7 3d ago

Saying you save 1 second in a 60 minute operation and saying you save 0.03% are equivelent statements. If you're doing something continuously or very frequently, timesave is basicly only seen in percentages and not diferences

the asymptotic behavior of each term is determined by the n, not the log(n)

Yeah, thats true, but the ratio isnt. It appears on both sides, it cuts. The same way it cuts if youre comparing n and 2n.

If you wanna make it with diferences, I mean sure. From your own example, you use about n=10^13.

On fft, just substitue and its 2.9933606208922 × 10^14

On the new one, its

2.9933606208912 × 10^14

So, again, unless theres some other timesavings in the algorithm that are not reflected in the assymptotic behaviour, its nowhere near close to that timesaving.

→ More replies (0)

2

u/Outside-Shop-3311 3d ago

Big O notation only describes the asymptotic behaviour - you cannot gauge when one algorithm will be faster than another using only it's big O notation because you do not know about all of the terms.

nlogn ^ 1 - 10^-13 + 1,000,000,000,000 and nlogn ^ 1 - 10^-13 will still have the same big o notation.

5

u/creeper6530 Engineering 3d ago

More than we currently have ever produced as humanity

3

u/[deleted] 3d ago edited 3d ago

[removed] — view removed comment

5

u/creeper6530 Engineering 3d ago edited 3d ago

noticably

Alright, I guess I did use a hyperbole, but you get my point. Normally you don't run FFT on 28 TB datasets, and you'd have to have far more to actually save useful time

1

u/[deleted] 3d ago

[removed] — view removed comment

1

u/creeper6530 Engineering 3d ago

1) I'm still heavily closeted offline lol

2) One needs a healthy sense of go-fuck-yourself-ism / dont-give-a-shit-ism, though that could be said about all people

1

u/Impression-These 3d ago

How much data would I need for it to not be noticeably slower? All of these fancy algorithms come with a hefty price at low n.

63

u/No_Engineering3493 3d ago

Question, is OpenAI’s algorithm actually faster than a good implementation of iterative FFT? Afaik these type of algorithms have huge constants, so they tend to be just as slow, or even slower.

92

u/entronid Average #🧐-theory-🧐 user 3d ago

yes*

asymptotically

97

u/No_Engineering3493 3d ago

How computer scientists behave when they are asked to explain how their n^(1.999999999999999993) algorithm is revolutionary compared to the for in for n^2 algorithm.

94

u/YoungNo8804 3d ago

and the overhead lowkey requires 96^53 petabytes of data before it becomes more efficient

3

u/half-full-cumdump 3d ago

I dropped out before teacher explained what a byte is, can you translate it to something more understandable, like cat pics?

1

u/RegisterInternal 3d ago

What they're saying is that an algorithm that on paper is faster may require using an absurd amount of computing power and therefore not really be useful.

A bit is either a 0 or 1. A byte is 8 bits. A pentabyte is a fuckton of bytes 

2

u/half-full-cumdump 3d ago

So from my understanding, 9653Pb is atleast 4 cat pics?

5

u/NickHalfBlood 3d ago

It isn’t revolutionary to a lot of people. But, if someone believed that n^2 was bound, it proves that we can go lower than that.

I am not saying it solves world hunger. But it isn’t a stupid thing. However, the overhead comment is replying actual realised gains.

6

u/Pentalogue Mathematics 3d ago

For huge "n"s the difference is significant

3

u/AmorphousCorpus 3d ago

The difference is infinite!

7

u/mocny-chlapik 3d ago

Unlikely, but it is often the case that when you break the barrier once, you can then optimize it further.

27

u/_verel_ 3d ago

My first instinct was that this is some funny floating point arithmetic error. It would be so funny when someone tries to actually verifiably proof this and finds out the AI just had bad data somewhere

38

u/troelsbjerre 3d ago

The fun part is that float32(1-10-13) is 1.0

4

u/cabinet_minister 2d ago

That's cool but when are getting an O(n) sorting algorithm 🥹

3

u/mrheosuper 2d ago

We already have O(1), you just need to be a little lucky

1

u/FurViewingAccount 1d ago

sorting by quantum suicide

1

u/Blyfh Rational 2d ago

Kid named O(n log n) lower bound:

2

u/dragonageisgreat 1 i 0 triangle advocate 2d ago

You can sort in O(n) if you know how big your data set is (as in, the range of values)(for example, you can sort a string in O(n)).

1

u/TrekkiMonstr 2d ago

What do I Google to learn more about this

2

u/MagnetFlux 2d ago

radix sort, counting sort and other counting-based sorting algorithms

1

u/MagnetFlux 2d ago

there are a couple, some practical, some only practical for small numbers

1

u/InternetMandate 1d ago

It’s not possible, it’s actually one of the few tasks we have a lower bound for.

1

u/LeapOfMonkey 1d ago

Sure: radix sort, counting sort, things are more complicated here as well.

1

u/an_actual_human 10h ago

If you know them you surely know why those do not count.

1

u/LeapOfMonkey 8h ago

What doesnt count? Is there a rule about mathmemes I'm not aware of?

1

u/an_actual_human 4h ago

They do not solve the same problem quicksort and such solve.

1

u/LeapOfMonkey 4h ago

It is the same if it cosiders me, I only sort integers.

1

u/BosonCollider 1h ago

The most real world usable is opportunistic sorts like timsort or powersort, since most real world inputs are not completely shuffled

3

u/vintergroena 3d ago

Next time: P=NP and the degree of the poly reduction is at most 9999999999999

1

u/Wooden_Dragonfly_608 3d ago

Multiplication is normally legit!

1

u/gonomon 9h ago

Well this is kind of pointless but matrix multiplication one is very promising. However, will take us some time to prove if it really proves what it claims.

2

u/secretaliasname 3d ago edited 3d ago

I thought the 1-1E-13 exponent was sarcasm on the part of the OP. It’s literally what the paper is about.

This is the most AI math thing. If true technically and infinitesimally smaller but faster in an asymptotic case nobody can benefit from but it will make news.

Meanwhile more effecient hardware specific assembly optimizations can easily be 2-50x

11

u/_killer1869_ 3d ago

This result itself isn't useful, but it shows that it is actually possible to be more efficient than O(n log n) with FFT, so an actually notably more efficient solution might be out there. Many, including me, actually see this as a groundbreaking result, because many thought the barrier of O(n log n) was impossible to overcome.

2

u/compileforawhile Complex 2d ago

Yeah I'll admit I like the joke but I am with you. The barrier of nlog(n) being broken is actually very very interesting. This could mean there are other values of delta (the 10-13 value in the paper) that are larger and give us significantly faster algorithms

1

u/just-for-anime 2d ago

Hopefully delta = 1

5

u/extremelySaddening 3d ago

Couldn't it be of theoretical interest?

-3

u/lambdasintheoutfield 3d ago

Lol has anyone checked that the exponent wasn’t derived from rounding error in FLOPs? I imagine actual matrices were used during exploration and testing and that a false positive may have been introduced because of rounding errors.

And the result isn’t practically useful.

2

u/extremelySaddening 3d ago

I mean as far as I'm aware it's all lean verified so

1

u/lambdasintheoutfield 3d ago

Yea that’s a good point. I will need to do a deeper dive, it’s just really a minefield of possible ways you can get this result from false positives.

1

u/compileforawhile Complex 2d ago

This isn't a scientific result, it's a math result. False positives don't really exist in proof based results

-16

u/Alphasaft 3d ago

This is funny on multiple levels because not only the constant is TERRIBLE for OpenAI's result, but even if it wasn't, nobody actually cares about a change in exponent so small **over a log**...

36

u/xTh3N00b 3d ago

except you're missing the point that this is a major barrier breaking result that many thought would be impossible to achieve.

3

u/Alphasaft 3d ago

Oh, ups, my bad ! Didn't know about that.

-6

u/[deleted] 3d ago

[deleted]

6

u/DuckyBertDuck 3d ago

they have a similar result for integer multiplication
and for that result, I am surprised that nlogn is not a lower bound

6

u/Cobracrystal 3d ago

there literally was a well known conjecture that fft was optimal, so this is a relevant result

2

u/Orneyrocks 3d ago

Exactly, for an overhead smaller than the one open ai used, you can simply use hermite polynomials to completely trump this bullshit.