Poor performance of SIMD implementation in Nightly

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Poor performance of SIMD implementation in Nightly

soeren
I have been toying around with the SIMD support in Nightly and was wondering if someone familiar with the state of development could share some additional insights?

For one, the current SIMD implementation seems to only incompletely cover the polyfill, which supposedly represents the targeted API (?): https://github.com/johnmccutchan/ecmascript_simd. For example, Firefox' int32x4 object lacks the "lessThan" function (and others) - their counterparts are present in float32x4, though. Any chance of these being added?

I also wondered if SIMD operation for other base types (notably uint8, int8, etc.) will eventually be supported as well, e.g., by introducing an uint8x16 object, ...

As I plan to use the SIMD API from within asm.js code, generated by Emscripten, I would assume the asm.js spec and AOT compiler need to be extended to allow for SIMD operations in asm.js code. Are there any plans to do so?

Most of all, however, I was wondering if the current SIMD implementation does, in fact, use the corresponding CPU instruction sets (SSE and friends). My test cases have actually shown a very bad performance. For example, the "Mandelbrot" test case published by Intel (see here: https://github.com/crosswalk-project/crosswalk-samples/tree/master/simd-mandelbrot) shows that performance suffers dramatically, when SIMD support is switched on.

I understand that the Firefox' SIMD support is tentative and incomplete. Any suggestion re when it may become available in the mainline production version would be very much appreciated.

Thanks,
Soeren
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine
Reply | Threaded
Open this post in threaded view
|

Re: Poor performance of SIMD implementation in Nightly

Till Schneidereit-2
Hi Soeren,

On Sat, Apr 12, 2014 at 3:36 PM, <[hidden email]> wrote:

> I have been toying around with the SIMD support in Nightly and was
> wondering if someone familiar with the state of development could share
> some additional insights?
>

While I'm not directly involved, I roughly know what the state is, so I
hope the below answers help. I CC'd Niko Matsakis, who's both responsible
for our implementation and the champion for the standardization effort, and
Benjamin Bouvier, who recently started on the asm.js implementation.


> For one, the current SIMD implementation seems to only incompletely cover
> the polyfill, which supposedly represents the targeted API (?):
> https://github.com/johnmccutchan/ecmascript_simd. For example, Firefox'
> int32x4 object lacks the "lessThan" function (and others) - their
> counterparts are present in float32x4, though. Any chance of these being
> added?
>

The polyfill is still the closest thing to a "spec" for SIMD support, but
it hasn't been updated in a long time, and some changes have been made to
the API. I can't comment on what those changes are, sorry.


> I also wondered if SIMD operation for other base types (notably uint8,
> int8, etc.) will eventually be supported as well, e.g., by introducing an
> uint8x16 object, ...
>
> As I plan to use the SIMD API from within asm.js code, generated by
> Emscripten, I would assume the asm.js spec and AOT compiler need to be
> extended to allow for SIMD operations in asm.js code. Are there any plans
> to do so?
>

Yes, that's planned and, as mentioned above, actively worked on.


>
> Most of all, however, I was wondering if the current SIMD implementation
> does, in fact, use the corresponding CPU instruction sets (SSE and
> friends). My test cases have actually shown a very bad performance. For
> example, the "Mandelbrot" test case published by Intel (see here:
> https://github.com/crosswalk-project/crosswalk-samples/tree/master/simd-mandelbrot)
> shows that performance suffers dramatically, when SIMD support is switched
> on.
>

While the implementation does use the corresponding instruction sets, it is
incomplete in a crucial way: it lacks JIT support. That means that
functions using it have to take a slow path for all SIMD computations,
negating any performance benefits in the usual case. (I might not be fully
up to date here and our JIT support might have improved. Certainly, though,
bad performance is due to incompleteness of this integration.)


>
> I understand that the Firefox' SIMD support is tentative and incomplete.
> Any suggestion re when it may become available in the mainline production
> version would be very much appreciated.
>

Right now, the SIMD implementation is only available in Nightly (and
Aurora, I think) for exactly the reason you state. It will only be turned
on for the release channel after the spec has been written, reviewed and
accepted by the committee. Everything else would mean that we'd make an
un-reviewed, probably non-ideal API the de-facto standard that can't be
changed because of compatibility concerns.

I don't know what the timeline on the standardization is, though.


>
> Thanks,
> Soeren
>


cheers,
till
_______________________________________________
dev-tech-js-engine mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-tech-js-engine