public inbox for fortran@gcc.gnu.org
 help / color / mirror / Atom feed
From: Iain Sandoe <idsandoe@googlemail.com>
To: James Secan <james.secan@gmail.com>
Cc: Rosemary Mardling <rosemary.mardling@monash.edu>,
	Fortran List <fortran@gcc.gnu.org>,
	Thomas Koenig <tkoenig@netcologne.de>
Subject: Re: apple silicon fortran
Date: Tue, 12 Jan 2021 22:13:26 +0000	[thread overview]
Message-ID: <3FFC9C05-CB2C-4DB6-874D-B263EDE04533@googlemail.com> (raw)
In-Reply-To: <B48BB153-D142-405C-8640-1FBBC2E55256@googlemail.com>

Hi Folks,

Iain Sandoe via Fortran <fortran@gcc.gnu.org> wrote:
> James Secan <james.secan@gmail.com> wrote:
>>> On Jan 9, 2021, at 11:07 AM, Iain Sandoe via Fortran  
>>> <fortran@gcc.gnu.org> wrote:
>
>>> I am testing out the Rosetta 2 alternative (which is, AFAIU, a  
>>> binary-conversion done at install-time native on macOS).

OK so I haven’t yet found a way to trigger the install-time translation,  
perhaps it only works on a fully packaged and signed app.

- however, the “on demand” conversion clearly works.

>> I am interested to hear the results of your testing with Rosetta 2.
>
> I bootstrapped x86_64-apple-darwin20 on aarch64-darwin20.3, and currently  
> running the Fortran testsuite - it’s not clear to me if some of the  
> issues (PIE and no-executable stack) will be sidestepped or not.  We  
> shall see.

Summary : some pretty good parts, but not enough to be a drop-in replacement.

[ disclaimer : the testsuite is somewhat ‘noisy’ at the moment, we have  
some tidying to do before release…]

here’s the native (x86_64-darwin20, on an Intel skylake processor):

https://gcc.gnu.org/pipermail/gcc-testresults/2021-January/644184.html

here’s the same branch bootstrapped for aarch64 and x86_64 using Rosetta 2  
on an A12Z processor (I don’t have access to an actual M1 yet).

https://github.com/iains/gcc-darwin-arm64/issues/30#issuecomment-758890255

— inferences and testing:

* It seems that Rosetta 2 + whatver sandboxing is in place is allowing  
diabling PIE (which means that PCH works again) but *NOT* allowing  
executable stack, which means that [GCC default implementation] nested  
functions are still broken (and gfortran uses nested functions ‘under the  
hood’ so to speak)

* informal testing on a couple of random Fortran benchmarks I have on that  
machine suggest that the binary translation gives pretty good performance  
for numerically intensive stuff (but again, disclaimer - that was [a] on an  
A12Z and [b] not carried out in any strictly controlled manner).  OTOH, I  
expect it’s not completely misleading.

Conclusion.

Rosetta 2 + Arm64 is not a drop-in replacement for x86_64 gfortran, we  
still need an ABI-compliant solution to the nested function issue - I do  
have an idea - but it isn’t a stage4 kind of thing.

If your machine breaks and you have to replace it, or your employer  
requires you to use an arm64 model, then I would suggest that the native  
branch is probably a better bet in the short-term - that has a workaround  
for the nested function issue (but that can give challenges in interworking  
with C, although those might not be insurmountable) ..

We’ll get there, I am sure - but not this week ;)

cheers
Iain


  reply	other threads:[~2021-01-12 22:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06  5:58 Rosemary Mardling
2021-01-06  8:53 ` Iain Sandoe
2021-01-06 17:11   ` James Secan
2021-01-06 17:28     ` Iain Sandoe
2021-01-06 19:38       ` James Secan
2021-01-08  2:32         ` Jerry DeLisle
2021-01-08  3:26           ` Rosemary Mardling
2021-01-08  9:56             ` Iain Sandoe
2021-01-08 10:05               ` Richard Biener
2021-01-08 19:28               ` James Secan
2021-01-08 19:57                 ` Iain Sandoe
2021-01-08 22:18             ` Thomas Koenig
2021-01-09 17:29               ` Jerry DeLisle
2021-01-09 17:37                 ` Jerry DeLisle
2021-01-09 19:07                   ` Iain Sandoe
2021-01-09 19:21                     ` James Secan
2021-01-09 19:30                       ` Iain Sandoe
2021-01-12 22:13                         ` Iain Sandoe [this message]
2021-01-15 20:36                           ` James Secan
2021-02-26 22:24                         ` Rosemary Mardling
2021-01-09 19:26                     ` Jerry DeLisle
2021-01-06 23:26   ` Rosemary Mardling

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=3FFC9C05-CB2C-4DB6-874D-B263EDE04533@googlemail.com \
    --to=idsandoe@googlemail.com \
    --cc=fortran@gcc.gnu.org \
    --cc=james.secan@gmail.com \
    --cc=rosemary.mardling@monash.edu \
    --cc=tkoenig@netcologne.de \
    /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).