Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
simonbyrne
searching Neon…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
1.
▲
by
simonbyrne
5y ago
If that's seriously what you're looking for, you should really consider Fortran. There is a reason it is still very widely used in scientific domains.
2.
▲
by
simonbyrne
5y ago
You can just wrap the literal in a conversion function, eg Float32(0x1p52), which should get constant propagated at compile time.
3.
▲
by
simonbyrne
5y ago
That's fascinating thread, thanks: https://github.com/WebAssembly/design/issues/148
4.
▲
by
simonbyrne
5y ago
Do you know what happens when you have ops with different flags? e.g. if you have (a + b) + c, where one + allows reassoc but one doesn't?
5.
▲
by
simonbyrne
5y ago
From personal experience, yes: I've seen multiple cases of scientists finding the ultimate cause of their bugs was some fast-math-related optimization. The problem isn't necessarily the code they wrote themselves: it is often that
6.
▲
by
simonbyrne
5y ago
I tried to lay out a reasonable path: incrementally test accuracy and performance, and only enable the necessary optimizations to get the desired performance. Good tests will catch the obvious catastrophic cases, but some will inevitably be
7.
▲
by
simonbyrne
5y ago
I'm not exactly sure what you're asking here, but the point is that "to machine precision" is relative: if f(x) and g(x) are O(1e200), then the absolute error of each is still O(1e185). However f(x)/g(x) will still
8.
▲
by
simonbyrne
5y ago
The key thing about floating point is that it maintains relative accuracy: in your case, if you have say f(x) and g(x) are both O(1e200), and are correct to some small relative tolerance, say 1e-10 (that is, the absolute error is 1e190). Th
9.
▲
by
simonbyrne
5y ago
Herbie is a great tool, especially for teaching.
10.
▲
by
simonbyrne
5y ago
In theory, every function should do that to check things like rounding mode etc. But that would be pretty slow, especially for low-latency operations (modifying mxcsr will disrupt pipelining for example).
11.
▲
by
simonbyrne
5y ago
-ffp-contract=fast will enable FMA contraction, i.e. replacing a * b + c with fma(a,b,c). This is generally okay, but there are a few cases where it can cause problems: the canonical example is computing an expression of the form: a * d -
12.
▲
by
simonbyrne
5y ago
My point isn't that fast-math isn't useful: it very much is. The problem is that it is a whole grab bag of things that can do very dangerous things. Rather than using a sledgehammer, you should try to be selective and enable only
13.
▲
by
simonbyrne
5y ago
Not necessarily: if your cospi(x) function is always returning 1.0 ( https://github.com/JuliaLang/julia/issues/30073#issuecomment... ), but you wrote your code assuming the result was in a different interval, t
14.
▲
Beware of fast-math
(simonbyrne.github.io)
189 points
by
simonbyrne
5y ago
|
107 comments
15.
▲
by
simonbyrne
5y ago
> But then people latched on to the idea that it was caused by some kind of sonic device or hitherto unknown weapon targeting embassies. Possibly prompted by historical precedent: https://en.wikipedia.org/wiki/Moscow
16.
▲
by
simonbyrne
6y ago
One of the interesting things about the 80-bit format was that allowed the use of 64-bit integers on a 16 or 32-bit machine. This was what Thomas Nicely was using them for when he found the Pentium FDIV bug: https://faculty.lynch
17.
▲
by
simonbyrne
7y ago
> or wait for optimizations to be done, e.g have pandas, numpy etc handle multi-core processors etc ? All those exist already. Indeed, other than DataFrames.jl (the pandas equivalent) they are part of the language itself.
18.
▲
by
simonbyrne
7y ago
I disagree about practical and accessible: - its exposition is complicated (trying to prove everything in a general base makes it difficult to understand) - it's woefully out of date (lack of guard digits haven't been an issue for
19.
▲
by
simonbyrne
7y ago
Deep learning is the obvious answer: 10 years ago it was largely confined to a small number of research groups and niche conferences.
20.
▲
by
simonbyrne
7y ago
Thank you! The Goldberg article is a terrible way to learn about floating point, and the frequency with which it is referred to on StackOverflow is really disheartening.
21.
▲
by
simonbyrne
7y ago
I seem to recall that part of the DoE's selection criteria is to ensure a competitive market for future contracts (since they will always be buying more supercomputers). Given the recent dominance of Nvidia in the market (see https:&#
22.
▲
by
simonbyrne
7y ago
Additionally the language and penalties for fare evasion often don't match that of say parking tickets, which I would put as roughly similar in terms of moral violations (i.e. taking advantage of a common good, but not endangering the
23.
▲
by
simonbyrne
7y ago
Not to mention a Cray 1 used 115kW: the new raspberry pi uses 7W peak.
24.
▲
by
simonbyrne
7y ago
It's difficult to examine his comments without historical context: I haven't dealt with any code from that era, but there is still plenty of Fortran 77 code from ~20 years later where the use of gotos makes it difficult to underst
25.
▲
by
simonbyrne
7y ago
Am I missing something? Other than the doc generator (which is in Python), none of the repos have been touched for a year or so.
26.
▲
by
simonbyrne
7y ago
Also, reminded me of the old CB1 cafe, which labelled itself "UK's oldest internet cafe", which amusingly hadn't updated their website since 2005: http://www.cb1.com/
27.
▲
by
simonbyrne
7y ago
I used to live around the corner: I always wondered about that. I do miss Norfolk Street Bakery though (which I hope is still going).
28.
▲
ReviewNB: Code Reviews for Jupyter Notebooks
(reviewnb.com)
2 points
by
simonbyrne
7y ago
|
0 comments
29.
▲
by
simonbyrne
8y ago
Interesting: I've heard anecdotes about similar experiences in southern California, where the "good" school districts often don't allow apartments or smaller subdivided buildings (duplexes/triplexes) to be built.
30.
▲
by
simonbyrne
8y ago
Obviously that question depends on your motivation, but one good reason is that it is a great way to learn how software actually works. R makes it very easy to see the underlying R code (you just type the function name), until you get to a
More ›