Follow Slashdot blog updates by subscribing to our blog RSS feed

 



Forgot your password?
typodupeerror
×
Programming Open Source Apple

Why Apple Silicon Needs an Open Source Fortran Compiler (walkingrandomly.com) 113

"Earlier this week Apple announced their new, ARM-based 'Apple Silicon' machines to the world in a slick marketing event that had many of us reaching for our credit cards," writes Mike Croucher, technical evangelist at The Numerical Algorithms Group.

"Simultaneously, The Numerical Algorithms Group announced that they had ported their Fortran Compiler to the new platform. At the time of writing this is the only Fortran compiler publicly available for Apple Silicon although that will likely change soon as open source Fortran compilers get updated."

An anonymous Slashdot reader offers this analysis: Apple Silicon currently has no open source Fortran compiler and Apple themselves are one of the few silicon manufacturers who don't have their own Fortran compiler. You could be forgiven for thinking that this doesn't matter to most users... if it wasn't for the fact that sizeable percentages of foundational data science platforms such as R and SciPy are written in Fortran.
Croucher argues that "More modern systems, such as R, make direct use of a lot of this code because it is highly performant and, perhaps more importantly, has been battle tested in production for decades. Numerical computing is hard (even when all of your instincts suggest otherwise) and when someone demonstrably does it right, it makes good sense to reuse rather than reinvent..."

"The community needs and will demand open source (or at least free) Fortran compilers if data scientists are ever going to realise the full potential of Apple's new hardware and I have no doubt that these are on the way. Other major silicon providers (e.g. Intel, AMD, NEC and NVIDIA/PGI) have their own Fortran compiler that co-exist with the open ones. Perhaps Apple should join the club..."
This discussion has been archived. No new comments can be posted.

Why Apple Silicon Needs an Open Source Fortran Compiler

Comments Filter:
  • Bring back ALGOL!

  • Don't worry. (Score:1, Insightful)

    by drinkypoo ( 153816 )

    It doesn't matter because Apple hardware isn't for science, it's for art. If you buy a mac for scientific computing you're just throwing money away. All the software will run on a cheaper platform where you can get much more performance for your money.

    • by Entrope ( 68843 )

      I am as quick to jump on the anti-Apple bandwagon as anyone else, but it's not always good to keep additional devices around just because they're more efficient or more powerful for a subset of one's tasks. Sometimes a jack-of-all-trades (but master-of-none) device makes the most sense.

      • A CHEAP jack-of-all-trades (but master-of-none) device ALWAYS beats an OVERPRICED vanity device aimed at non-technical people who have more money than brains.

        • Performance per watt (Score:4, Interesting)

          by tepples ( 727027 ) <.tepples. .at. .gmail.com.> on Sunday November 15, 2020 @10:29AM (#60727044) Homepage Journal

          If Apple Silicon's performance per watt is as good as Apple claims it is, then someone accounting for the power and cooling bills might conclude that it's cheaper than AMD and Intel in the long run.

          • by drinkypoo ( 153816 ) <drink@hyperlogos.org> on Sunday November 15, 2020 @10:32AM (#60727056) Homepage Journal

            If Apple Silicon's performance per watt is as good as Apple claims it is, then someone accounting for the power and cooling bills might conclude that it's cheaper than AMD and Intel in the long run.

            The problem with that is that the big power consumption problem isn't in workstations, and Apple has ceded the server market completely. Nothing prevents them from returning to it, except that it will be hard to take them seriously when they abandoned the people who trusted them last time.

            • it will be hard to take them seriously when they abandoned the people who trusted them last time.

              That doesn't seem to impact Google or Microsoft.

              • it will be hard to take them seriously when they abandoned the people who trusted them last time.

                That doesn't seem to impact Google or Microsoft.

                Very different circumstances.

                I'm one to seldom pass up an opportunity to give Google crap for everything in the Google Graveyard, but the closest they have to things relevant to devs and sysadmins are GCC and G-Suite (or Workspace or whatever-they-hell they are calling their cloudy groupware service this week). Both of those things remain pretty steady as far as i'm aware, and I can't remember a "last time" they had a similar offering that is in the Graveyard. If you can point to it, let me know, but to my

                • by Bert64 ( 520050 )

                  Microsoft dropped "virtual server" - their initial vmware competitor, and there was a several year gap between virtual server being dropped and hyper-v becoming available. Microsoft tends to drop products which aren't as successful as they hope, and using such products is generally a monumental pain even while they are supported - for the common products people know how to work around the bugs, for the less common ones people don't.

                  Apple didn't so much drop their server option, as bake its features into the

                  • Microsoft dropped "virtual server" - their initial vmware competitor, and there was a several year gap between virtual server being dropped and hyper-v becoming available. Microsoft tends to drop products which aren't as successful as they hope, and using such products is generally a monumental pain even while they are supported

                    It's interesting to note that virtually all such packages were developed someplace else. Then Microsoft gets hold of them and strangles the life out of them, like they did with e.g. WolfPack, and then they suck and people don't want them. Virtual Server was developed by Connectix, from whence they also got Virtual PC — which they used for XP Mode on Windows 7. XP Mode was garbage, several programs I tried to run on it didn't work and none of them even used D3D. I presume that Virtual Server was also g

                • In the interim I have come up with a way for Apple to make money with Apple servers. They could build their own cloud that their OS provides a simple interface to so that processing tasks could be sped up by offloading to a cluster. This will only work well for people with high quality (and speed) internet access, but I would guess that most of the Apple users are among that group anyway.

          • by _xeno_ ( 155264 )

            Nobody is going to be using the current M1 for actual scientific computing for one simple reason: All the current M1 Macs cap out at 16GB of RAM.

            The "starting at" prices are all for 8GB of RAM, but for an extra $200 you can up it to 16GB. Yep, you read that right: $200 for 8GB of RAM. In 2020.

            And that only gets you to 16GB.

            The fact that even the "Pro" model caps out at 16GB suggests there's some underlying limitation of the M1 chip that means it can't handle large amounts of RAM.

            It's hard to say how much RA

            • by Ed_1024 ( 744566 )

              As the RAM is all in the SoC, I would expect the M1 *could* be outfitted with more than 16GB but it would need to be integrated into the package on manufacture. As the M1 was explicitly optimised for low power entry-level systems I would expect the M1X, M2 or whatever they call it to have 32, 64 or even more as an option...

            • by shmlco ( 594907 ) on Sunday November 15, 2020 @06:57PM (#60728318) Homepage

              So the problem is that you're comparing memory requirements across platforms.

              Just for one example: Android devices typically require twice as much memory as iOS devices to get comparable performance and utility. A good portion of that comes from the need to support JVM garbage collection schemes whose pool-to-pool copying mechanisms mean you NEED twice as much memory. (The from pool and the to pool.)

              Further, IIRC Apple claimed to have doubled the throughput from processor to SSD storage, which means that paging isn't as much of a hit as it might have been.

              I think they also mentioned that they can hand off a pointer to a graphics bitmap or texture directly to the GPU for processing/display, which means that again you don't need the same object taking up CPU space and GPU space.

              I don't think 16GB is enough for me either (currently i9 with 64GB) but I'm really interested to see what the next generation of this technology is going to bring.

            • It always amazes me how spoiled we get with advances in technology. 16GB would have been a dream machine 20 years ago and lots of scientific computing was done then.

              Scientific computing doesn't always required lots of memory. Maybe some things do, but I strongly doubt that all projects require lots of memory. Also realize that it may be that the development is often done on one machine with perhaps a small subset of what needs to be done and then the actual "real run" can be done on a larger machine (that c

          • Unless your electricity price is something like 100x more expensive than average, this is likely not true for typical home/office use where the CPU is idle most of the time.

          • I'm sure the difference in cost between a MacBook and a box under my desk to crunch numbers would buy a lot of electricity.

        • Re: Don't worry. (Score:2, Informative)

          I hate Apple and don't own one. However, my niece has a 11 year old MAC which still works. It supports R, Python, Excel, and ported Unix tools for her University research tools developed long ago orginally for SunOS for her Neurology degree.

          Windows at the time didn't have R and Python for Windows was more of a special port with the real stuff on Unix back in 2010. No she doesn't have time to learn Linux or deal with all the upgrade problems due to a lack of a driver ABI and Xorg being a piece of shit for ea

        • A CHEAP jack-of-all-trades (but master-of-none) device ALWAYS beats an OVERPRICED vanity device aimed at non-technical people who have more money than brains.

          Right, hater.

          That's why Apple's examples in their Apple Silicon Macs Event were almost all showing Software Development and high-end Content Creation, like 8k video in DaVinci Resolve.

          In fact, the entire presentation was fairly focused on technical details and capabilities (for something intended for general audiences).

          https://www.apple.com/apple-ev... [apple.com]

      • I am as quick to jump on the anti-Apple bandwagon as anyone else,

        Doesn't look like it.

        but it's not always good to keep additional devices around just because they're more efficient or more powerful for a subset of one's tasks.

        What does that have to do with anything?

        Sometimes a jack-of-all-trades (but master-of-none) device makes the most sense.

        I still don't see what you think you're saying here. Macs, Windows PCs, and Linux machines all are "a jack-of-all-trades (but master-of-none) device".

        • by Entrope ( 68843 )

          Doesn't look like it.

          I invite you to look at my recent comments, particularly in the context of the M1 benchmark results, and decide whether I'm pro- or anti-Apple.

          What does that have to do with anything?

          You noted that Apple competitors provide better performance-per-dollar than Apple does. That is certainly true, but it is not the only relevant metric. For example, I have a desktop running Linux with Windows in a VM. I don't keep another desktop for playing games, even though that would give much better

    • The CPU is great for scientific calculation. The os is just a thing that manages running your programs, it isn't a religion.

      • Re: Don't worry. (Score:5, Informative)

        by drinkypoo ( 153816 ) <drink@hyperlogos.org> on Sunday November 15, 2020 @10:13AM (#60726976) Homepage Journal

        The CPU is great for scientific calculation.

        No Apple platform has ever had the fastest shipping Intel CPU. The only time a Mac has been faster than PCs has been when the G4 came out, which was briefly faster than available Intel offerings. The G5 was faster at some tasks, slower at others.

        These days the real horsepower is in GPUs, and Apple's ecosystem doesn't allow you to have the latest and greatest GPUs, so they're not faster at that type of calculation either.

        The os is just a thing that manages running your programs, it isn't a religion.

        That's bullshit through and through. First, the OS is a religion to the average Apple user. They'll tell you it's better than anything else, but they can't tell you why, they're just taking it on faith. When you point out real and concrete examples of how it is inferior, they come back with irrelevant responses. Second, the OS does a lot more than "manage running your programs". It includes a lot of other functionality. If you really think all it does is that, you are utterly unqualified to comment. If you don't, then why did you say so? Apple Religion?

        • I don't think they even know what the OS is. If the UI stayed the same but the underlying OS switched out, how many of the Apple faithful would notice, care, or understand? And anyway, with a walled garden like they have, isn't most/all of the OS access through Apple's APIs/frameworks?

        • by shmlco ( 594907 )

          "When you point out real and concrete examples of how it is inferior, they come back with irrelevant responses."

          So... it's a Unix-based OS with a Mach kernel. I guess I'd like some real and concrete examples.

          • It's not the underpinnings, it's the UI and the stuff on top like the outdated libraries.

            • by shmlco ( 594907 )

              I guess I'm not seeing all of the "outdated" libraries.

              And the UI is pretty consistent, unlike that, say, of Windows where all too often you're likely to drop in a Windows XP-style settings dialog that comes straight from the 90's. Or even, for matter, Linux, where you're lucky to see the same UI on two different machines, as it all depends on personal preferences and whatever the flavor-of-the-week UI/UX library the owner wanted to install. (Deepin, KDE, Pantheon, Budgie, Cinnamon, LXDE... I could go on, b

        • You are just foolish. Scientific computing does not require the fastest CPU or largest computer. And in addition to computing stuff many like to use visualization tools to analyze them. The mac is convenient for both applications. I generally use a Ryzen CPU with nvidia graphics but lots of people use mac for the same functions. Using the exact same programs I use on Linux.

          And the function of an os is indeed to manage running programs and organize files.

          • And the function of an os is indeed to manage running programs and organize files.

            I guess it's not to enable applications' access to hardware, huh? Like, the primary function of an operating system?

        • by Gimric ( 110667 )

          The CPU is great for scientific calculation.

          No Apple platform has ever had the fastest shipping Intel CPU. The only time a Mac has been faster than PCs has been when the G4 came out, which was briefly faster than available Intel offerings. The G5 was faster at some tasks, slower at others.

          These days the real horsepower is in GPUs, and Apple's ecosystem doesn't allow you to have the latest and greatest GPUs, so they're not faster at that type of calculation either.

          The os is just a thing that manages running your programs, it isn't a religion.

          That's bullshit through and through. First, the OS is a religion to the average Apple user. They'll tell you it's better than anything else, but they can't tell you why, they're just taking it on faith. When you point out real and concrete examples of how it is inferior, they come back with irrelevant responses. Second, the OS does a lot more than "manage running your programs". It includes a lot of other functionality. If you really think all it does is that, you are utterly unqualified to comment. If you don't, then why did you say so? Apple Religion?

          One reason I like OSX is that it is designed around Fitts Law. It's also nice having a Unixey environment with a nice UI.

          • Apple's UI is garbage, though. It is nigh-impossible to reconfigure, it has inadequate contrast, last I checked Apple apps alone used three different widget sets, and the dock moves around as apps are opened and closed so it defeats the use of muscle memory.

      • it isn't a religion.

        You must be new here!

    • Precisely. This is a lame attempt by pathetic people to try and justify buying computers for their shininess by running calculations on them.

      Stop wasting your research dollars on VANITY, you w%$nkers.

    • Re:Don't worry. (Score:4, Insightful)

      by Mendenhall ( 32321 ) on Sunday November 15, 2020 @10:33AM (#60727060)

      You're doing the math wrong. A computer costs roughly 1% of my salary. If I can be 1% more efficient in a year, due to personal preferences as to how I use a computer, the _entire_ cost of the computer is recovered in 1 year. It's a great investment. So, no matter differences in cost, it's just worth it to use a computer that you like. I am a very heavy scientific computer user (experimental control, data analysis, everything else). I have written a few 100,000 lines of c++ code in my life, along with maybe a comparable amount of python. I am sure I could get a nice little Linux box and do OK with it. However, I like Apple Mail, and Keynote for presentations. They work well.

      • Good points. The thing techies often forget is that”does the job in the real world” is more important than “is really cool tech” or “is cheaper (and often isn’t but that’s another post).”
      • You can get a nice high end threadripper box for about 10K that will smoke anything apple has. You can put really good GPUs in it and push it up to 20K. It would be amazing for scientific computing. It would also be more than 1% of your salary unless you are making 2M/year. It would still likely be a good investment.

        Macs are nice pieces of jewelry but if you need serious number crunching there are FAR better options.

        • You can get a nice high end threadripper box for about 10K that will smoke anything apple has.

          Who cares? No sane person buys a laptop to use as a compute server.

          I use my laptop for prototyping, editing, compiling, testing.

          But when I am done, the code will be deployed to the cloud.

          The important criteria for a laptop are a nice keyboard, screen resolution, the UX, and having a brand that impresses the cute barista at Starbucks.

    • Re: (Score:3, Informative)

      by sabian2008 ( 6338768 )
      Actual scientist here working in HPC topics regarding fluid dynamics (not as that AC moron). I'm a very Linux guy but in my experience most people at HPC centers (them being scientists with little programming idea --i.e. Python people --, with low level programming knowledge or computer scientists), they all tend to use Macs in my experience. BTW the stupid claim that consumer ARM (not to be confused with the machine by Fujitsu) is better than server HPC processors by Intel and AMD is plainly stupid and ca
    • by quenda ( 644621 )

      It doesn't matter because Apple hardware isn't for science, it's for art.

      So what you are saying is, Apple silicon needs a COBOL compiler?

      • So what you are saying is, Apple silicon needs a COBOL compiler?

        There are Cobol compilers available for MacOS and they run on the M1.

        For instance, there is GnuCobol [wikipedia.org].

    • My niece finishing her PHD in Neuroscience disagrees. She uses Python, Excel, and Java software for her data modelling.

    • by keltor ( 99721 ) *
      I work with a lot of scientists; they are mostly Mac users for their desktop/laptop machines. Whether they do science on their MacOS machine is a lot more complicated: 1. If it's a shorter script, they will 100% run it locally. There are some scientists that run nothing locally. 2. If the tool is a GUI tool, they use it in MacOS. 3. For big long scripts/processes/ML/blah/blah/blah, these are run on either a beefy linux VM, a linux VM cluster or a similar physical machine.
  • That's odd. (Score:4, Interesting)

    by rlwinm ( 6158720 ) on Sunday November 15, 2020 @09:58AM (#60726932)
    That's odd. I know gcc can target ARM and it certainly has a Fortran compiler. And gcc is quite good at autovectorizing and optimizing Fortran.
    • Re:That's odd. (Score:4, Interesting)

      by donour ( 445617 ) <donour@cs.uchicago . e du> on Sunday November 15, 2020 @10:14AM (#60726980) Homepage
      I think the real point here is that Apple micro architecture is different enough that a generic ARM target is not going to be very good. I haven't looked in a while, but I suspect that the combination of Intel compiler and numerical libraries still beat gcc on mobile targets.
      • Re:That's odd. (Score:5, Interesting)

        by rlwinm ( 6158720 ) on Sunday November 15, 2020 @10:25AM (#60727030)
        x86/x64 is much harder to optimize for than ARM. My guess is that the generic ARM scheduler in gcc will do quite well on the Apple silicon. To be fair I won't give a single penny to Apple so I won't exactly be running benchmarks. But certainly gcc means that the claim there is no open Fortran compiler for the M1 is silly.

        It may not generate the most optimal code for Apple silicon in every case but gcc does damn well in most cases. And the gcc Fortran compiler is as battle tested as BLAS is. Certainly a person wanting to do scientific computing on Apple's hardware can't use the lack of a Fortran compiler as an excuse.
      • Not a problem. Just use Apples optimized version of LLVM and stick Gnu F77 in front of it via drqagon eg. problem solved

      • by AReilly ( 9339 )

        The 600+ instruction scoreboard/scheduler in the M1 (much larger than the 250-ish instruction window in latest AMD and Intel cores, and those seem fairly adequate anyway) means that compiler microarchitecture cost functions aren't as important as they were in the old days, or on in-order processors like the Cortex-A53 "little" cores, or embedded processors. The processor is effectively dynamically recompiling and instruction-scheduling your code as it runs, anyway.

        So: as long as the compiler does a decent

      • I think the real point here is that Apple micro architecture is different enough that a generic ARM target is not going to be very good

        There have been benchmarks out showing that an M1, automatically translating Intel to ARM code, beats all the Intel CPUs with up to four cores. So I suggest there can't be that much difference.

        Only thing that Apple tells you: 1. Tell every thread what performance it needs (so you can have threads running automatically on the low power cores, or in the background). 2. Use the graphics formats that are fastest. 3. If you use CoreML, don't tell it to use CPU or Graphics card only, but everything (or it will

    • Comment removed based on user account deletion
    • Apple wants what Apple has always wanted, Open Source without strings that can be closed down. Like they took OpenBSD (2.2?) for MacOSX. The GPL version _ANY_ is toxic for them because they would have to deliver source on request to anyone who receives binaries.

      As per side-thread there are perfectly good Open-Source Fortran compilers (g77, flang) but these are all under GPL hence undesireable for Apple.

  • flang and gfortran (Score:5, Interesting)

    by nickovs ( 115935 ) on Sunday November 15, 2020 @10:16AM (#60726986)
    Apple's own tool chain is mostly built on clang and LLVM, and LLVM has flang [github.com]. The GCC suite also supports ARM64 CPUs and includes gfortran [gnu.org]. Of you can use DragonEgg [llvm.org] to use the GCC frontend and the LLVM backend. It may be that Apple don't bundle a Fortran compiler in Xcode but compiling Fortran for the new Apple machines shouldn't really be a problem.
    • Flang (the current flag, upstreamed this year by NVidia) still has a long way to go. Last time I check it didn't even have OpenMP support (which is the most common way to accelerate multithreaded code in general purpose consumer hardware).
  • Not sure I understand, vendors have to make their own compilers for new architectures. Aren't existing ARM compilers fine for Apple Silicon? Are there any new extensions specific to Apple that I have not heard about?

    • by Misagon ( 1135 )

      For the most part it shouldn't matter but compilers can sometimes do specific optimisations for specific processors.
      Fortran is these days used mostly for numerical programs where performance matters, which is what makes this an issue.

      Two processors with the same ISA can have different issue-widths and be able to run different instructions in parallel. The same instruction can have different latency. Processors can also have different memory subsystems which together with everything else could have an effect

  • Just checked the llvm site, and the open source flang compiler should be available llvm 11.0.

    And if you havenâ(TM)t noticed, the new Macs are all _low end_ machines. They are bloody fast for low end, somewhere between 2017 Intel 8 core chips and 2020 intel 8 core chips, but they are low end. So if scientists canâ(TM)t use low end computers...
    • So if scientists can't use low end computers...

      They often can. The legacy software may originally have been running on quite dated systems. What once needed a Sun or SGI workstation can now run comfortably on a laptop. Some Fortran code I ported from a mainframe ran fine on regular PC desktops that the scientists happened to have for writing documentation. They were quite happy with a GUI front end pasted on top of the legacy fortran code running on these PCs.

  • LLVM (which is what Apple uses on OSX and iOS and which will almost certainly run great on the new ARM Macs) has a Fortran frontend called flang. Just get that running and you have your Fortran compiler.

  • I know that gcc does not currently support arm-darwin, but ... I would expect it to support the arm macs either before they're released (if the developers can get access to them) or shortly afterwards (if they can't).

    I mean, the hardware itself isn't due to be reased until late 2020 (right?) so there's still lots of time.

    • by Bert64 ( 520050 )

      Support may not currently exist because the hardware is very new and not yet widely available, but it is being worked on.
      Support for darwin-x86_64/ppc64 exists, as does support for arm64-linux/freebsd/etc so the os and cpu are already supported separately with the only thing missing being the specific combination of darwin and arm64.

  • Seriously, we're talking 5 guys in the whole world that want Fortran for a Mac?
    Am I wrong?

    I'd have to wonder what in the world they are doing that would still need Fortran. Just update it to a new language already.

Do molecular biologists wear designer genes?

Working...