Author Topic: Intel SPMD Program Compiler  (Read 779 times)

TimoVJL

  • Member
  • ***
  • Posts: 438
Intel SPMD Program Compiler
« on: October 09, 2019, 01:58:45 AM »
May the source be with you

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 6662
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Intel SPMD Program Compiler
« Reply #1 on: October 09, 2019, 03:19:04 PM »
Great link Timo, looks like good stuff.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :skrewy:

LiaoMi

  • Member
  • ****
  • Posts: 574
Re: Intel SPMD Program Compiler
« Reply #2 on: October 09, 2019, 10:57:03 PM »
Two years ago, I tried unsuccessfully to compile this project, contacted the author, he could not help. According to the description on the github, people periodically have problems with compilation. I could not start the binary file that can be downloaded on the site, the program closed with an exception. Here is the author - https://github.com/dbabokin/ This code is similar to Proof of Concept, step left step right and nothing works.

HSE

  • Member
  • *****
  • Posts: 1107
  • <AMD>< 7-32>
Re: Intel SPMD Program Compiler
« Reply #3 on: October 10, 2019, 06:52:40 AM »
Hi Liaomi!

Binary (v1.12.0-windows) apparently is working in x86. I can build mandelbrot example as an object, and then to generate masm code with objconv (because ispc emit intel or ATT asm).

Raistlin

  • Member
  • ****
  • Posts: 501
Re: Intel SPMD Program Compiler
« Reply #4 on: October 10, 2019, 04:09:26 PM »
Why are you guys posting all the COOL stuff in the Romper Room ?  :undecided:
Makes it hard for mere mortals like me to find it - or - is this the new secret lair slash bat-cave ....
Are you pondering what I'm pondering? It's time to take over the world ! - let's use ASSEMBLY...

TimoVJL

  • Member
  • ***
  • Posts: 438
Re: Intel SPMD Program Compiler
« Reply #5 on: October 10, 2019, 05:55:01 PM »
Code: [Select]
x86
[mandelbrot ispc]:              [141.179] million cycles
Wrote image file mandelbrot-ispc.ppm
[mandelbrot serial]:            [965.913] million cycles
Wrote image file mandelbrot-serial.ppm
                                (6.84x speedup from ISPC)
x64
[mandelbrot ispc]:              [134.526] million cycles
Wrote image file mandelbrot-ispc.ppm
[mandelbrot serial]:            [373.930] million cycles
Wrote image file mandelbrot-serial.ppm
                                (2.78x speedup from ISPC)
« Last Edit: October 10, 2019, 07:26:40 PM by TimoVJL »
May the source be with you

AW

  • Member
  • *****
  • Posts: 2322
  • Let's Make ASM Great Again!
Re: Intel SPMD Program Compiler
« Reply #6 on: October 10, 2019, 11:16:18 PM »
Intel compiler, including in attachment .exes and modified files.
Code: [Select]
x86 C++ compiler: Intel, Version 1900 Build Date: 20190417
@time of ISPC run:                      [41.831] million cycles
@time of ISPC run:                      [39.380] million cycles
@time of ISPC run:                      [40.292] million cycles
[mandelbrot ispc]:              [39.380] million cycles
Wrote image file mandelbrot-ispc.ppm
@time of serial run:                    [276.504] million cycles
@time of serial run:                    [283.851] million cycles
@time of serial run:                    [309.351] million cycles
[mandelbrot serial]:            [276.504] million cycles
Wrote image file mandelbrot-serial.ppm
                                (7.02x speedup from ISPC)

x64 C++ compiler: Intel, Version 1900 Build Date: 20190417
@time of ISPC run:                      [41.312] million cycles
@time of ISPC run:                      [41.491] million cycles
@time of ISPC run:                      [40.101] million cycles
[mandelbrot ispc]:              [40.101] million cycles
Wrote image file mandelbrot-ispc.ppm
@time of serial run:                    [285.268] million cycles
@time of serial run:                    [299.299] million cycles
@time of serial run:                    [324.834] million cycles
[mandelbrot serial]:            [285.268] million cycles
Wrote image file mandelbrot-serial.ppm
                                (7.11x speedup from ISPC)

TimoVJL

  • Member
  • ***
  • Posts: 438
Re: Intel SPMD Program Compiler
« Reply #7 on: October 10, 2019, 11:41:30 PM »
Those examples need an AVX support ?
Could we have an examples using SSE2 ?

An old AMD
Code: [Select]
C++ compiler: Intel, Version 1900 Build Date: 20190417
@time of ISPC run:                      [178.016] million cycles
@time of ISPC run:                      [153.057] million cycles
@time of ISPC run:                      [194.262] million cycles
[mandelbrot ispc]:              [153.057] million cycles
Wrote image file mandelbrot-ispc.ppm
@time of serial run:                    [310.135] million cycles
@time of serial run:                    [317.251] million cycles
@time of serial run:                    [303.225] million cycles
[mandelbrot serial]:            [303.225] million cycles
Wrote image file mandelbrot-serial.ppm
                                (1.98x speedup from ISPC)

C++ compiler: Intel, Version 1900 Build Date: 20190417
@time of ISPC run:                      [158.360] million cycles
@time of ISPC run:                      [148.705] million cycles
@time of ISPC run:                      [150.118] million cycles
[mandelbrot ispc]:              [148.705] million cycles
Wrote image file mandelbrot-ispc.ppm
@time of serial run:                    [358.490] million cycles
@time of serial run:                    [349.711] million cycles
@time of serial run:                    [343.810] million cycles
[mandelbrot serial]:            [343.810] million cycles
Wrote image file mandelbrot-serial.ppm
                                (2.31x speedup from ISPC)
May the source be with you

AW

  • Member
  • *****
  • Posts: 2322
  • Let's Make ASM Great Again!
Re: Intel SPMD Program Compiler
« Reply #8 on: October 10, 2019, 11:57:55 PM »
Those examples need an AVX support ?
Could we have an examples using SSE2 ?
I have done this way

x64
ispc -O2 "%(Filename).ispc" -o "$(IntDir)%(Filename).obj" -h "$(ProjectDir)%(Filename)_ispc.h"  --target=sse4,avx2 --opt=fast-math

x86
ispc -O2 --arch=x86 "%(Filename).ispc" -o "$(IntDir)%(Filename).obj" -h "$(ProjectDir)%(Filename)_ispc.h" --target=sse4,avx2 --opt=fast-math



For x64, with:
ispc -O2 "%(Filename).ispc" -o "$(IntDir)%(Filename).obj" -h "$(ProjectDir)%(Filename)_ispc.h"  --target=sse2 --opt=fast-math

C++ compiler: Intel, Version 1900 Build Date: 20190417
@time of ISPC run:                      [91.228] million cycles
@time of ISPC run:                      [87.654] million cycles
@time of ISPC run:                      [87.918] million cycles
[mandelbrot ispc]:              [87.654] million cycles
Wrote image file mandelbrot-ispc.ppm
@time of serial run:                    [294.670] million cycles
@time of serial run:                    [286.823] million cycles
@time of serial run:                    [286.338] million cycles
[mandelbrot serial]:            [286.338] million cycles
Wrote image file mandelbrot-serial.ppm
                                (3.27x speedup from ISPC)

For x86, same performance.

AW

  • Member
  • *****
  • Posts: 2322
  • Let's Make ASM Great Again!
Re: Intel SPMD Program Compiler
« Reply #9 on: October 11, 2019, 01:22:08 AM »
VS 2017 .exe are much smaller than for Intel, spmd performance roughly the same.

x64
C++ compiler: Microsoft Visual C/C++ Version: 1916 Toolset: 191627031
@time of ISPC run:                      [41.134] million cycles
@time of ISPC run:                      [40.187] million cycles
@time of ISPC run:                      [40.242] million cycles
[mandelbrot ispc]:              [40.187] million cycles
Wrote image file mandelbrot-ispc.ppm
@time of serial run:                    [296.413] million cycles
@time of serial run:                    [333.210] million cycles
@time of serial run:                    [308.974] million cycles
[mandelbrot serial]:            [296.413] million cycles
Wrote image file mandelbrot-serial.ppm
                                (7.38x speedup from ISPC)

x86
C++ compiler: Microsoft Visual C/C++ Version: 1916 Toolset: 191627031
@time of ISPC run:                      [44.781] million cycles
@time of ISPC run:                      [39.926] million cycles
@time of ISPC run:                      [39.294] million cycles
[mandelbrot ispc]:              [39.294] million cycles
Wrote image file mandelbrot-ispc.ppm
@time of serial run:                    [298.390] million cycles
@time of serial run:                    [302.402] million cycles
@time of serial run:                    [311.517] million cycles
[mandelbrot serial]:            [298.390] million cycles
Wrote image file mandelbrot-serial.ppm
                                (7.59x speedup from ISPC)


daydreamer

  • Member
  • ****
  • Posts: 907
  • watch Chebyshev on the backside of the Moon
Re: Intel SPMD Program Compiler
« Reply #10 on: October 11, 2019, 02:59:19 AM »
if you use vector library and use vectors instead of array on a standard compiler,there suppose to be a setting that unrolls loop using vectors to use SIMD,but havent tried it yet
but it would be nice to see if it also works speeding up  more than 3x ?
Quote from Flashdance
Nick  :  When you give up your dream, you die
*wears a flameproof asbestos suit*
Gone serverside programming p:  :D

caballero

  • Member
  • *****
  • Posts: 1189
    • abre ojos ensamblador
Re: Intel SPMD Program Compiler
« Reply #11 on: October 11, 2019, 03:14:26 AM »
Mandelbrot in 5kb, with tinyc and just gdi.
The logic of the error is hidden among the most unexpected lines of the program

caballero

  • Member
  • *****
  • Posts: 1189
    • abre ojos ensamblador
Re: Intel SPMD Program Compiler
« Reply #12 on: October 11, 2019, 04:11:33 AM »
mandelbrot with tinyc+gdi in 5.50kb, much faster and better than previous, but a bit bigger
The logic of the error is hidden among the most unexpected lines of the program

TimoVJL

  • Member
  • ***
  • Posts: 438
Re: Intel SPMD Program Compiler
« Reply #13 on: October 11, 2019, 05:18:39 AM »
Code: [Select]
[mandelbrot ispc]:              [141.766] million cycles SSE2
[mandelbrot serial]:            [1016.228] million cycles PellesC 8
[mandelbrot serial]:            [1372.807] million cycles tcc x86

tcc: 9.67x speedup from ISPC
but how to link with tcc ? objconv -felf32 -nu
Code: [Select]
@time of ISPC run:                      [143.013] million cycles
@time of ISPC run:                      [141.965] million cycles
@time of ISPC run:                      [141.684] million cycles
[mandelbrot ispc]:              [141.684] million cycles
Wrote image file mandelbrot-ispc.ppm
@time of serial run:                    [1292.054] million cycles
@time of serial run:                    [17592186041617.738] million cycles
@time of serial run:                    [1287.692] million cycles
[mandelbrot serial]:            [1287.692] million cycles
Wrote image file mandelbrot-serial.ppm
                                (9.09x speedup from ISPC)

EDIT:
Benchmarking-NET-Core-SIMD-performance-vs-Intel-IS
PellesC AVX2
Code: [Select]
@time of ISPC run:                      [147.803] million cycles
@time of ISPC run:                      [149.325] million cycles
@time of ISPC run:                      [137.857] million cycles
[mandelbrot ispc]:              [137.857] million cycles
Wrote image file mandelbrot-ispc.ppm
@time of serial run:                    [274.158] million cycles
@time of serial run:                    [283.609] million cycles
@time of serial run:                    [276.143] million cycles
[mandelbrot serial]:            [274.158] million cycles
Wrote image file mandelbrot-serial.ppm
                                (1.99x speedup from ISPC)
Can someone give an intel CPU or AMD Ryzen results ?
« Last Edit: October 12, 2019, 02:04:25 AM by TimoVJL »
May the source be with you

AW

  • Member
  • *****
  • Posts: 2322
  • Let's Make ASM Great Again!
Re: Intel SPMD Program Compiler
« Reply #14 on: October 11, 2019, 10:25:03 PM »
Quote
Can someone give an intel CPU or AMD Ryzen results ?

For mandelbrot_ispc_tcc:

@time of ISPC run:                      [17592186040405.824] million cycles
@time of ISPC run:                      [84.668] million cycles
@time of ISPC run:                      [84.757] million cycles
[mandelbrot ispc]:              [84.668] million cycles
Wrote image file mandelbrot-ispc.ppm
@time of serial run:                    [656.562] million cycles
@time of serial run:                    [656.442] million cycles
@time of serial run:                    [656.480] million cycles
[mandelbrot serial]:            [656.442] million cycles
Wrote image file mandelbrot-serial.ppm
                                (7.75x speedup from ISPC)

The mandelbrot64v9_AVX2 fails.