* RH5.1 axp floating point performance
@ 1998-08-13 17:12 Cooperberg, David
1998-08-14 1:26 ` Michal Jaegermann
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Cooperberg, David @ 1998-08-13 17:12 UTC (permalink / raw)
To: 'axp-list@redhat.com'
I have noticed a considerable decline in floating-point performance in
upgrading from Redhat4.2 (for alpha) to Redhat 5.1 (same alpha). As an
example, the spec.c code below
executes in 27. seconds (time output) when run on my 433MHz RH5.1 alpha
when compiled as "gcc spec.c -o spec -lm" while it runs in 4.3 seconds
on
the same machine if I link to the old (from RH4.2) math library,
-lm-1.99,
(though the compile gives me warnings). I have tried a variety of
compiler
flags when linking with the new math library but have not improved
performance. I gather RH5.1 has a new glibc package and was wondering
if I
have to live with this huge performance hit. Is there a patch or flag I
am
missing? Has anyone else had problems?
#include <math.h>
int main()
{
int i, j;
double ftemp;
ftemp=1.;
for(i=1;i<10000;i++) {
for(j=1;j<1000;j++) {
ftemp+= 2.*sqrt(ftemp);
ftemp*=0.5;
}
}
printf("%g\n",ftemp);
}
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: RH5.1 axp floating point performance
1998-08-13 17:12 RH5.1 axp floating point performance Cooperberg, David
@ 1998-08-14 1:26 ` Michal Jaegermann
1998-08-14 2:06 ` Wes Bauske
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: Michal Jaegermann @ 1998-08-14 1:26 UTC (permalink / raw)
To: axp-list
Cooperberg, David wrote:
>
> I have noticed a considerable decline in floating-point performance in
> upgrading from Redhat4.2 (for alpha) to Redhat 5.1 (same alpha).
.....
> ftemp+= 2.*sqrt(ftemp);
^^^
As it was said already few times on this list 'sqrt()' function in
a basic compiler library was replaced by significantly slower one
but one which happens to be correct. The old one had bugs. Until
a faster replacement will show up in a compiler libraries your best
bet is to link with new floating point libraries mentioned a few
postings ago. Such action will also significantly speed up other
elementary functions.
Michal
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: RH5.1 axp floating point performance
1998-08-13 17:12 RH5.1 axp floating point performance Cooperberg, David
1998-08-14 1:26 ` Michal Jaegermann
@ 1998-08-14 2:06 ` Wes Bauske
1998-08-14 12:45 ` Harvey J. Stein
1998-08-14 3:01 ` Alvin Starr
1998-08-14 8:46 ` Stefan Schroepfer
3 siblings, 1 reply; 11+ messages in thread
From: Wes Bauske @ 1998-08-14 2:06 UTC (permalink / raw)
To: axp-list
Cooperberg, David wrote:
>
> I have noticed a considerable decline in floating-point performance in
> upgrading from Redhat4.2 (for alpha) to Redhat 5.1 (same alpha). As an
> example, the spec.c code below
> executes in 27. seconds (time output) when run on my 433MHz RH5.1 alpha
> when compiled as "gcc spec.c -o spec -lm" while it runs in 4.3 seconds
> on
> the same machine if I link to the old (from RH4.2) math library,
> -lm-1.99,
> (though the compile gives me warnings). I have tried a variety of
> compiler
> flags when linking with the new math library but have not improved
> performance. I gather RH5.1 has a new glibc package and was wondering
> if I
> have to live with this huge performance hit. Is there a patch or flag I
> am
> missing? Has anyone else had problems?
>
> #include <math.h>
>
> int main()
> {
> int i, j;
> double ftemp;
>
> ftemp=1.;
> for(i=1;i<10000;i++) {
> for(j=1;j<1000;j++) {
> ftemp+= 2.*sqrt(ftemp);
> ftemp*=0.5;
> }
> }
> printf("%g\n",ftemp);
> }
>
The problem is they de-activated the ASM version of sqrt()
because it had edge case problems. (Richard?)
So, maybe you should try the libffm.a code that was just
mentioned a few replies back...
Wes
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: RH5.1 axp floating point performance
1998-08-13 17:12 RH5.1 axp floating point performance Cooperberg, David
1998-08-14 1:26 ` Michal Jaegermann
1998-08-14 2:06 ` Wes Bauske
@ 1998-08-14 3:01 ` Alvin Starr
1998-08-14 12:36 ` Ken Hansen
1998-08-14 8:46 ` Stefan Schroepfer
3 siblings, 1 reply; 11+ messages in thread
From: Alvin Starr @ 1998-08-14 3:01 UTC (permalink / raw)
To: Cooperberg, David; +Cc: 'axp-list@redhat.com'
On Thu, 13 Aug 1998, Cooperberg, David wrote:
>
> I have noticed a considerable decline in floating-point performance in
> upgrading from Redhat4.2 (for alpha) to Redhat 5.1 (same alpha). As an
> example, the spec.c code below
> executes in 27. seconds (time output) when run on my 433MHz RH5.1 alpha
> when compiled as "gcc spec.c -o spec -lm" while it runs in 4.3 seconds
> on
> the same machine if I link to the old (from RH4.2) math library,
> -lm-1.99,
> (though the compile gives me warnings). I have tried a variety of
> compiler
> flags when linking with the new math library but have not improved
> performance. I gather RH5.1 has a new glibc package and was wondering
> if I
> have to live with this huge performance hit. Is there a patch or flag I
> am
> missing? Has anyone else had problems?
>
> #include <math.h>
>
> int main()
> {
> int i, j;
> double ftemp;
>
> ftemp=1.;
> for(i=1;i<10000;i++) {
> for(j=1;j<1000;j++) {
> ftemp+= 2.*sqrt(ftemp);
> ftemp*=0.5;
> }
> }
> printf("%g\n",ftemp);
> }
If I remember correctly this issue came up before and was explained as a
problem with the sqrt function. The 4.2 was faster but had a bug that
could cause some inaccuracy.
Alvin Starr || voice: (416)585-9971
Interlink Connectivity || fax: (416)585-9974
alvin@iplink.net ||
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: RH5.1 axp floating point performance
1998-08-13 17:12 RH5.1 axp floating point performance Cooperberg, David
` (2 preceding siblings ...)
1998-08-14 3:01 ` Alvin Starr
@ 1998-08-14 8:46 ` Stefan Schroepfer
3 siblings, 0 replies; 11+ messages in thread
From: Stefan Schroepfer @ 1998-08-14 8:46 UTC (permalink / raw)
To: axp-list
Similar experiences here (I did not try linking against the
old libraries under RH 5.1 so far).
But it's not only a problem with the libs, trying egcs-1.0.3a
and egcs-snapshot-1998-08-03 gave me gradually decreasing
performance with my code.
scr@iis.fhg.de
Cooperberg, David wrote:
>
> I have noticed a considerable decline in floating-point performance in
> upgrading from Redhat4.2 (for alpha) to Redhat 5.1 (same alpha). As an
> example, the spec.c code below
> executes in 27. seconds (time output) when run on my 433MHz RH5.1 alpha
> when compiled as "gcc spec.c -o spec -lm" while it runs in 4.3 seconds
> on
> the same machine if I link to the old (from RH4.2) math library,
> -lm-1.99,
> (though the compile gives me warnings). I have tried a variety of
> [...]
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: RH5.1 axp floating point performance
1998-08-14 3:01 ` Alvin Starr
@ 1998-08-14 12:36 ` Ken Hansen
[not found] ` <35D43B4E.59E2B600@iis.fhg.de>
0 siblings, 1 reply; 11+ messages in thread
From: Ken Hansen @ 1998-08-14 12:36 UTC (permalink / raw)
To: axp-list
Alvin Starr wrote:
>
> On Thu, 13 Aug 1998, Cooperberg, David wrote:
>
> >
> > I have noticed a considerable decline in floating-point performance in
> > upgrading from Redhat4.2 (for alpha) to Redhat 5.1 (same alpha). As an
> > example, the spec.c code below
<snip>
> If I remember correctly this issue came up before and was explained as a
> problem with the sqrt function. The 4.2 was faster but had a bug that
> could cause some inaccuracy.
So, you can get a fast answer or a correct answer, it's your choice!
Good luck,
Ken
khansen@njcc.com
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: RH5.1 axp floating point performance
1998-08-14 2:06 ` Wes Bauske
@ 1998-08-14 12:45 ` Harvey J. Stein
1998-08-14 19:52 ` Wes Bauske
0 siblings, 1 reply; 11+ messages in thread
From: Harvey J. Stein @ 1998-08-14 12:45 UTC (permalink / raw)
To: axp-list; +Cc: hjstein
"Wes Bauske" <wsb@paralleldata.com> writes:
> Cooperberg, David wrote:
> >
> > I have noticed a considerable decline in floating-point performance in
> > upgrading from Redhat4.2 (for alpha) to Redhat 5.1 (same alpha). As an
> > example, the spec.c code below
> > executes in 27. seconds (time output) when run on my 433MHz RH5.1 alpha
> > when compiled as "gcc spec.c -o spec -lm" while it runs in 4.3 seconds
>
> The problem is they de-activated the ASM version of sqrt()
> because it had edge case problems. (Richard?)
>
> So, maybe you should try the libffm.a code that was just
> mentioned a few replies back...
If that's the case, can't they test for & fix the edges, using the
fast asm code on the domain for which it's accurate?
--
Harvey J. Stein
BFM Financial Research
hjstein@bfr.co.il
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: RH5.1 axp floating point performance
1998-08-14 12:45 ` Harvey J. Stein
@ 1998-08-14 19:52 ` Wes Bauske
0 siblings, 0 replies; 11+ messages in thread
From: Wes Bauske @ 1998-08-14 19:52 UTC (permalink / raw)
To: axp-list
Harvey J. Stein wrote:
>
> "Wes Bauske" <wsb@paralleldata.com> writes:
>
> > Cooperberg, David wrote:
> > >
> > > I have noticed a considerable decline in floating-point performance in
> > > upgrading from Redhat4.2 (for alpha) to Redhat 5.1 (same alpha). As an
> > > example, the spec.c code below
> > > executes in 27. seconds (time output) when run on my 433MHz RH5.1 alpha
> > > when compiled as "gcc spec.c -o spec -lm" while it runs in 4.3 seconds
> >
> > The problem is they de-activated the ASM version of sqrt()
> > because it had edge case problems. (Richard?)
> >
> > So, maybe you should try the libffm.a code that was just
> > mentioned a few replies back...
>
> If that's the case, can't they test for & fix the edges, using the
> fast asm code on the domain for which it's accurate?
>
I'd guess that the libffm.a stuff does that but I haven't looked
at the source code for it.
Wes
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: RH5.1 axp floating point performance
[not found] ` <35D48F2C.F3C@njcc.com>
@ 1998-08-16 16:38 ` Stefan Schroepfer
1998-08-16 18:44 ` Richard Henderson
0 siblings, 1 reply; 11+ messages in thread
From: Stefan Schroepfer @ 1998-08-16 16:38 UTC (permalink / raw)
To: axp-list
Ken Hansen wrote:
>
> I apologize, my humor escaped at least one reader of this list - I was
> simply indicating that the person who noticed the problem has two
> choices:
> Run RH 4.2 libraries and get an answer fast, and run the risk that
> it MAY be incorrect., or
>
> run RH 5.1 libraries, and get an answer that is always accurate,
> but takes longer to get at.
Thanks for the additional clearification, but that's exactly that
what I understood from your earlier reply (maybe I have to apologize
for my bad english).
> There is no switch/alternate flag to choose good/bad functions on
> request
> from one library...
But a library designer could call the fast code where it is proven
to produce correct results and call the slow code where the fast
code is known to fail. In addition to that, the library designer
could provide a way to call the fast code directly for those who
know what they are doing (surely via an additional function name,
not via obscure flags).
> Would you really want a compiler that produced code that was *usually*
> correct or *always* correct? I choose the latter, but that is me...
O.k., an ANSI sqrt () always has to be correct (as far as data
representation allows), but in general the precision needed for
intermediary results depends on what they are used for.
> Ken
> khansen@njcc.com
>
> Stefan Schroepfer wrote:
> >
> > Ken Hansen wrote:
> > >
> > >
> > > So, you can get a fast answer or a correct answer, it's your choice!
> >
> > Assuming that "could cause some inaccuracy" means: it depends on
> > the value of the argument (on what else?), couldn't be a fallback
> > implemented that calls the faster code if appropriate?
> >
> > Is the option "fast answer" built into the newer libs (let's say
> > by calling __fast_sqrt () or something similar)?
> >
> > scr@iis.fhg.de
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: RH5.1 axp floating point performance
1998-08-16 16:38 ` Stefan Schroepfer
@ 1998-08-16 18:44 ` Richard Henderson
1998-08-17 9:43 ` Stefan Schroepfer
0 siblings, 1 reply; 11+ messages in thread
From: Richard Henderson @ 1998-08-16 18:44 UTC (permalink / raw)
To: axp-list
On Sun, Aug 16, 1998 at 06:38:11PM +0200, Stefan Schroepfer wrote:
> > There is no switch/alternate flag to choose good/bad functions on
> > request
> > from one library...
>
> But a library designer could call the fast code where it is proven
> to produce correct results and call the slow code where the fast
> code is known to fail.
Yes, there are lots of things that _could_ be done. What is
needed is for someone to do them. Consider this a call for
volunteers.
> In addition to that, the library designer could provide a way to call
> the fast code directly for those who know what they are doing (surely
> via an additional function name, not via obscure flags).
Ah, obscure function names rather than obscure flags.
r~
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: RH5.1 axp floating point performance
1998-08-16 18:44 ` Richard Henderson
@ 1998-08-17 9:43 ` Stefan Schroepfer
0 siblings, 0 replies; 11+ messages in thread
From: Stefan Schroepfer @ 1998-08-17 9:43 UTC (permalink / raw)
To: axp-list
Richard Henderson wrote:
>
> On Sun, Aug 16, 1998 at 06:38:11PM +0200, Stefan Schroepfer wrote:
> >
> > In addition to that, the library designer could provide a way to call
> > the fast code directly for those who know what they are doing (surely
> > via an additional function name, not via obscure flags).
>
> Ah, obscure function names rather than obscure flags.
... because an additional function name would give the user finest
(per call) granularity where to use which implementation.
scr@iis.fhg.de
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~1998-08-17 9:40 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-08-13 17:12 RH5.1 axp floating point performance Cooperberg, David
1998-08-14 1:26 ` Michal Jaegermann
1998-08-14 2:06 ` Wes Bauske
1998-08-14 12:45 ` Harvey J. Stein
1998-08-14 19:52 ` Wes Bauske
1998-08-14 3:01 ` Alvin Starr
1998-08-14 12:36 ` Ken Hansen
[not found] ` <35D43B4E.59E2B600@iis.fhg.de>
[not found] ` <35D48F2C.F3C@njcc.com>
1998-08-16 16:38 ` Stefan Schroepfer
1998-08-16 18:44 ` Richard Henderson
1998-08-17 9:43 ` Stefan Schroepfer
1998-08-14 8:46 ` Stefan Schroepfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox