Mathematica on iPad

By: Maynard Handley (, October 20, 2017 1:41 pm
Room: Moderated Discussions
dmcq ( on October 20, 2017 7:26 am wrote:
> Maynard Handley ( on October 20, 2017 1:34 am wrote:
> > I mentioned some weeks ago that Wolfram was going to ship a Mathematica Player for iPad,
> > and that it would be an interesting performance comparison against x86 of a "serious"
> > app. Well the Player has been released and I've spent a few hours playing with it.
> >

> Thanks very much, that's interesting. As far as cooperation is concerned that is what Linaro
> is all about. I see thay have recently added a high performance computing group
> Linaro: High Performance Computing (HPC)
> This I guess would be where most of what you see as missing would be done in the
> future I guess. But until now I think it has been up to ARM to do all the basics
> Welcome to the Arm HPC Ecosystem
> I'm not sure when they started to get serious about all this but their purchase of Allinea
> and the post K business with Fujitsu certainly indicates they are serious about it. (Hm
> - I wonder if Apple are looking at that Scalable Vector Extension facility)

I'm still working on this, and will generate a full report, but I have some more interesting data points.
Definitely multi-precision in either FP or integer is a disaster area.
Memory size is not an issue (in that all the performance tests I ran would not [I don't think] generate compressed page activity on the iPod, with a maximum memory utilization of around half a gig.

Packed arrays definitely are implemented (so we get the memory benefit) but beyond that it's a strange mixed bag.

Explicitly parallel operations (like ParallelDo[]) are DEFINITELY not supported, and generate an error.

On x86 a substantial number of the most demanding numerical "loops" are both vectorized and parallelized. (So if you do things like multiply two matrices or invert a matrix, and the matrices are "easy", so all machine precision floating point, no symbolic for example, the internal algorithm will transparently use vectors and all cores.
Not all, but some part of the speedup of Mathematica over the years since version 5 or so has been capturing more and more special cases [special matrix forms or shapes, adding in support for all-integer matrices, etc] to route to a specialized optimized routine.

Definitely MOST of these specialized routines are not present. Neither floating point matrix arithmetic nor Fourier transforms are parallelized (you can see that by examining CPU utilization while the code runs for its 3 seconds or so), so that gives a 4x gap and I'm guessing, based on the remaining gap between the Intel and iPad results, that it's not vectorized either.
But not EVERYTHING. Strangely some integer matrix manipulation (multiplications, inversion) ARE parallelized --- again you see that all three CPUs spike to 100% usage, and the performance gap is much less, now apparently just a vectorization performance gap. I expect that if I pushed this hard enough it would again fall off a cliff because at some point the intermediate values would start to exceed 64-bits, we'd be in the world of multi-precision, and we already know what that's like.
So it looks like someone wanted to experiment with porting some of the parallel routines and, for whatever reason, integer matrices were considered to be a good place to start.

Also (unsurprisingly, but still reassuring) symbolic work IS as performant on the iPad as you'd expect (so basically at par with the MacBook Pro). I had the system create large arrays of reasonably complicated expressions then symbolically integrate them, to get something that would last for 3 or 4 seconds, and the results were as I said.
I've also done some (very brief so far) experiments with things like Simplify[] (which are again just huge amounts of searching in symbol space) and again results seem to be at par. (I have to do more work on this to clean up exactly what I'm seeing, because you want to be sure, when you create these huge expressions for the machine to chug on, that you're not generating big nums, and I think I may be to some extent.)

But the summary seems to be (much like I said before, but more definite this time)
- "raw" scalar single-threaded performance is comparable
- parallelization is present, but barely, in routines you'd very rarely use (and not explicitly available to the developer)
- vectorization seems non-existent
- big-num support is abysmal
< Previous Post in ThreadNext Post in Thread >
TopicPosted ByDate
Mathematica on iPadMaynard Handley2017/10/20 01:34 AM
  Mathematica on iPaddmcq2017/10/20 07:26 AM
    Mathematica on iPadMaynard Handley2017/10/20 01:41 PM
      Mathematica on iPadMaynard Handley2017/10/20 08:16 PM
        Does this give better formatting?Maynard Handley2017/10/20 08:20 PM
          Does this give better formatting?anon2017/10/20 09:37 PM
            Does this give better formatting?Maynard Handley2017/10/20 10:29 PM
              Does this give better formatting?anon2017/10/21 12:52 AM
                Does this give better formatting?Maynard Handley2017/10/21 09:48 AM
                  Does this give better formatting?anon2017/10/21 10:01 AM
        Mathematica on iPadAdrian2017/10/21 01:49 AM
          Sorry for the typoAdrian2017/10/21 01:51 AM
          Mathematica on iPaddmcq2017/10/21 07:03 AM
            Mathematica on iPadMaynard Handley2017/10/21 09:58 AM
          Mathematica on iPadWilco2017/10/21 07:16 AM
            Mathematica on iPadDoug S2017/10/21 09:02 AM
              Mathematica on iPadMegol2017/10/22 05:24 AM
            clang __builtin_addcllMichael S2017/10/21 11:05 AM
          Mathematica on iPadMaynard Handley2017/10/21 09:55 AM
  Mathematica on iPadAnon2017/10/21 04:20 PM
    Mathematica on iPadMaynard Handley2017/10/21 05:51 PM
      Mathematica on iPadAnon2017/10/21 09:56 PM
        Mathematica on iPadMaynard Handley2017/10/22 12:23 AM
      A quick search shows that Mathematica is using Intel MKLGabriele Svelto2017/10/21 11:38 PM
        A quick search shows that Mathematica is using Intel MKLAnon2017/10/22 05:12 PM
          A quick search shows that Mathematica is using Intel MKLMaynard Handley2017/10/22 06:08 PM
            A quick search shows that Mathematica is using Intel MKLDoug S2017/10/22 10:40 PM
            A quick search shows that Mathematica is using Intel MKLMichael S2017/10/23 05:32 AM
  Mathematica on iPadnone2017/10/22 06:06 AM
    Mathematica on iPaddmcq2017/10/23 03:43 AM
Reply to this Topic
Body: No Text
How do you spell avocado?