From: Toon Moene <toon@moene.org>
To: Andrew Pinski <pinskia@gmail.com>
Cc: fortran@gcc.gnu.org, gcc mailing list <gcc@gcc.gnu.org>
Subject: Re: Tests of gcc development beyond its testsuite (in this case, for gfortran)
Date: Wed, 8 May 2024 14:43:53 +0200 [thread overview]
Message-ID: <a0c228c6-c66f-462c-87da-b26bc54c63f6@moene.org> (raw)
In-Reply-To: <b4393fc7-84dc-44ce-bee6-0e063f45a56c@moene.org>
On 5/7/24 20:44, Toon Moene wrote:
> On 5/7/24 20:35, Andrew Pinski wrote:
>
>> On Tue, May 7, 2024 at 11:31 AM Toon Moene <toon@moene.org> wrote:
>>>
>>> On 5/7/24 00:02, Toon Moene wrote:
>>>
>>>> OK, perhaps on the aarch64 I need the following option to make the
>>>> comparison fair:
>>>>
>>>> ‘rdma’
>>>>
>>>> Enable Round Double Multiply Accumulate instructions. This is
>>>> on by
>>>> default for -march=armv8.1-a.
>>>>
>>>> I.e., -mno-rdma
>>>>
>>>> (I hope that's correct - I'll will try that when the Sun rises again
>>>> and
>>>> I have some power to run the AArch64 machine ...).
>>>
>>> Well, I did two independent runs with gfortran-13.2 and the following
>>> options:
>>>
>>> -O3 -march=armv8.1-a+rdma
>>>
>>> and
>>>
>>> -O3 -march=armv8.1-a+nordma
>>>
>>> No difference in the number of error runs exceeding the prescribed
>>> thresholds.
>>>
>>> So, unless I made a mistake in the option specification (or the compiler
>>> silently ignored them because they were not applicable to my machine -
>>> ugh), the cause of the problem lies elsewhere.
>>
>>
>> AARCH64 armv8-a has FMA as part of its base ISA.
>> So you want to try with `-ffp-contract=off` instead.
>> RDMA turns on/off instructions which are not used by the
>> auto-vectorizer (yet) and used by intrinsics for them (If I read the
>> code correctly).
>
> Ah, thanks - I'll try that tomorrow.
Yep, that did it:
--> LAPACK TESTING SUMMARY <--
Processing LAPACK Testing output found in the TESTING directory
SUMMARY nb test run numerical error other error
================ =========== ================= ================
REAL 1327023 0 (0.000%) 0 (0.000%)
DOUBLE PRECISION 1327845 0 (0.000%) 0 (0.000%)
COMPLEX 786775 0 (0.000%) 0 (0.000%)
COMPLEX16 787842 0 (0.000%) 0 (0.000%)
--> ALL PRECISIONS 4229485 0 (0.000%) 0 (0.000%)
So, obviously, the threshold values for these tests were derived on a
machine without fused-multiply-add, or without using them if present.
This is perhaps not surprising, as the default build-and-test setup
(make.inc.example) of the LAPACK package as distributed from netlib.org
lists as the compiler choice:
FC = gfortran
FFLAGS = -O2 -frecursive
FFLAGS_DRV = $(FFLAGS)
FFLAGS_NOOPT = -O0 -frecursive
which means that the choice of architecture on x86-64 would be "generic"
and wouldn't include FMA instructions. If the authors had used that
setup in deriving the thresholds, it is not surprising that you need
-ffp-contract=off on architectures that include FMA instructions by default.
Thanks for helping me out with this !
--
Toon Moene - e-mail: toon@moene.org - phone: +31 346 214290
Saturnushof 14, 3738 XG Maartensdijk, The Netherlands
prev parent reply other threads:[~2024-05-08 12:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-06 21:27 Toon Moene
2024-05-06 21:32 ` Andrew Pinski
2024-05-06 21:35 ` Toon Moene
2024-05-06 22:02 ` Toon Moene
2024-05-07 18:30 ` Toon Moene
2024-05-07 18:35 ` Andrew Pinski
2024-05-07 18:44 ` Toon Moene
2024-05-08 12:43 ` Toon Moene [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=a0c228c6-c66f-462c-87da-b26bc54c63f6@moene.org \
--to=toon@moene.org \
--cc=fortran@gcc.gnu.org \
--cc=gcc@gcc.gnu.org \
--cc=pinskia@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).