Discussion:
Opportunities for numerical work on FreeBSD?
(too old to reply)
Robert Clausecker
2024-06-18 17:31:01 UTC
Permalink
Greetings,

I have here a talented maths student looking for a place to
complete her mandatory (unpaid) industry internship.

She has a knack for numerical analysis, differential equations,
and writing floating point code. I suggested that there might
be need for some improvement to the math code currently shipped
with FreeBSD as the old msun code, while very precise, is not
writted to take advantage of modern SIMD FPUs with FMA support
and could be improved considerably.

Is there an interest for such or other numerical work on the
FreeBSD code base? Would anybody be interested in supervising
such work? If yes, I would try to connect the two of you.

Yours,
Robert Clausecker
--
() ascii ribbon campaign - for an encoding-agnostic world
/\ - against html email - against proprietary attachments
Steve Kargl
2024-06-18 18:49:12 UTC
Permalink
Robert,

There is an old numerics wiki page (https://wiki.freebsd.org/Numerics)
that lists a few missing C99/C11 math.h/complex.h functions. Some have
been implemented and committed, but I recall that something like 6 are
still missing. I thought I had opened a PR, but cannot seem to
find it (someday, I'll get around to pecking at these). Search for
N1256.pdf and N1570.pdf if one does not have the C standard handy.
Appendice F and G are relevant.

There is also C23 (N3088.pdf), which introduced several new functions.
Some of these may be compiler builtin functions such as inverse square
root (rsqrt(x)), but having fall back implementations may be desirable.

At the moment, I lack the time to mentor someone, but I am more than
willing to offer opinions and test code if asked. I also know zip
about SIMD programming, and relied heavily on Bruce Evans to
whack me with a clue stick with regards to low-level numerical
programming.
--
steve
Post by Robert Clausecker
Greetings,
I have here a talented maths student looking for a place to
complete her mandatory (unpaid) industry internship.
She has a knack for numerical analysis, differential equations,
and writing floating point code. I suggested that there might
be need for some improvement to the math code currently shipped
with FreeBSD as the old msun code, while very precise, is not
writted to take advantage of modern SIMD FPUs with FMA support
and could be improved considerably.
Is there an interest for such or other numerical work on the
FreeBSD code base? Would anybody be interested in supervising
such work? If yes, I would try to connect the two of you.
Yours,
Robert Clausecker
--
() ascii ribbon campaign - for an encoding-agnostic world
/\ - against html email - against proprietary attachments
--
Steve


--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Jason Bacon
2024-06-18 21:27:00 UTC
Permalink
Post by Robert Clausecker
Greetings,
I have here a talented maths student looking for a place to
complete her mandatory (unpaid) industry internship.
She has a knack for numerical analysis, differential equations,
and writing floating point code. I suggested that there might
be need for some improvement to the math code currently shipped
with FreeBSD as the old msun code, while very precise, is not
writted to take advantage of modern SIMD FPUs with FMA support
and could be improved considerably.
Is there an interest for such or other numerical work on the
FreeBSD code base? Would anybody be interested in supervising
such work? If yes, I would try to connect the two of you.
Yours,
Robert Clausecker
Coincidentally, I just came across a recent benchmark that might provide
some hints about where to focus the efforts:

https://www.phoronix.com/review/bsd-linux-threadripper-7980x
--
Life is a game. Play hard. Play fair. Have fun.



--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Warner Losh
2024-06-18 21:31:12 UTC
Permalink
Post by Jason Bacon
Post by Robert Clausecker
Greetings,
I have here a talented maths student looking for a place to
complete her mandatory (unpaid) industry internship.
She has a knack for numerical analysis, differential equations,
and writing floating point code. I suggested that there might
be need for some improvement to the math code currently shipped
with FreeBSD as the old msun code, while very precise, is not
writted to take advantage of modern SIMD FPUs with FMA support
and could be improved considerably.
Is there an interest for such or other numerical work on the
FreeBSD code base? Would anybody be interested in supervising
such work? If yes, I would try to connect the two of you.
Yours,
Robert Clausecker
Coincidentally, I just came across a recent benchmark that might provide
https://www.phoronix.com/review/bsd-linux-threadripper-7980x
But stress-ng isn't a benchmark. It says so in it's docs. Also there are
several ifdef linux in the source to make it faster on linux.

I wouldn't waste my time on that garbage.

Warner
Post by Jason Bacon
--
Life is a game. Play hard. Play fair. Have fun.
Paul Zimmermann
2024-06-19 06:31:11 UTC
Permalink
Hi Robert,

she might be interested to contribute to CORE-MATH
(https://core-math.gitlabpages.inria.fr/). This is
not part of FreeBSD, but FreeBSD might incorporate
routines from CORE-MATH (which are under MIT license).

Best regards,
Paul Zimmermann
Date: Tue, 18 Jun 2024 19:31:01 +0200
[1:text/plain Hide]
Greetings,
I have here a talented maths student looking for a place to
complete her mandatory (unpaid) industry internship.
She has a knack for numerical analysis, differential equations,
and writing floating point code. I suggested that there might
be need for some improvement to the math code currently shipped
with FreeBSD as the old msun code, while very precise, is not
writted to take advantage of modern SIMD FPUs with FMA support
and could be improved considerably.
Is there an interest for such or other numerical work on the
FreeBSD code base? Would anybody be interested in supervising
such work? If yes, I would try to connect the two of you.
Yours,
Robert Clausecker
--
() ascii ribbon campaign - for an encoding-agnostic world
/\ - against html email - against proprietary attachments
[2:application/pgp-signature Show Save:signature.asc (963B)]
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Lexi Winter
2024-06-19 06:36:32 UTC
Permalink
Post by Jason Bacon
Coincidentally, I just came across a recent benchmark that might provide
https://www.phoronix.com/review/bsd-linux-threadripper-7980x
please don't pay any attention to Phoronix "benchmarks". it's fairly
clear from looking at some of what they've published in the past that
they have no editorial standards at all and the results they produce are
meaningless; for example the "benchmark" where they claimed zstd
compression on FreeBSD was about ~10x slower than on Linux, yet they did
not think this was worth investigating or even mentioning in their
write-up even though it makes no sense at all and is clearly some kind
of measurment error.

i would hate for someone to put any amount of effort into attempting to
"fix" any "problems" raised by Phoronix benchmarks only to find out the
source data is nonsense.
Jason Bacon
2024-06-19 12:18:44 UTC
Permalink
Post by Jason Bacon
Coincidentally, I just came across a recent benchmark that might provide
https://www.phoronix.com/review/bsd-linux-threadripper-7980x
<https://www.phoronix.com/review/bsd-linux-threadripper-7980x>
But stress-ng isn't a benchmark. It says so in it's docs. Also there are
several ifdef linux in the source to make it faster on linux.
I wouldn't waste my time on that garbage.
Well, I wouldn't take the results of stress-ng, or even a proper
benchmark tool (if there is such a thing) at face value. I'd always run
multiple tests and try to understand *why* they're producing the results
that they are.

I was only suggesting that these results might provide a data point to
help narrow down the areas where FreeBSD could be improved. Maybe some
of the apparent "weaknesses" in FreeBSD are due to

#ifdef Linux
// Optimized code
#else
// Generic code
#endif

as was suggested. But they might also indicate something real. We'll
never know if we dismiss them without a closer look. We could at least
see if any of these results are corroborated by other tools. That much
is easy.
--
Life is a game. Play hard. Play fair. Have fun.



--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...