Commit 15719817 authored by Ashwin Vishnu's avatar Ashwin Vishnu
Browse files

Rename perf -> pyperf

It got a rename and a new home: https://github.com/psf/pyperf
I executed:

  rg '\-m perf' -l | xargs sed -i 's/\-m\ perf/\-m\ pyperf/g'
parent 8ab326dcd766
Pipeline #12637 passed with stage
in 5 minutes and 30 seconds
......@@ -9,30 +9,30 @@ perf: perfpython perfcython perfpythran perfsimd perfomp
perfpython:
# python
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import grad_py as g, f_fft, KX, KY' 'g(f_fft, KX, KY)'
perfcython:
# cython with @cython.boundscheck(False) @cython.wraparound(False)
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import grad_cy_nocheck as g, f_fft, KX, KY' 'g(f_fft, KX, KY)'
perfcythoncheck:
# cython without @cython.boundscheck(False) @cython.wraparound(False)
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import grad_cy_check as g, f_fft, KX, KY' 'g(f_fft, KX, KY)'
perfpythran:
# pythran
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import grad_pythran as g, f_fft, KX, KY' 'g(f_fft, KX, KY)'
perfsimd:
# SIMD
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import grad_simd as g, f_fft, KX, KY' 'g(f_fft, KX, KY)'
perfomp:
# OpenMP
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import grad_omp as g, f_fft, KX, KY' 'g(f_fft, KX, KY)'
......@@ -37,27 +37,27 @@ Launch benchmarking::
which gives:
# python
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import grad_py as g, f_fft, KX, KY' 'g(f_fft, KX, KY)'
.....................
Mean +- std dev: 15.0 ms +- 0.3 ms
# cython with @cython.boundscheck(False) @cython.wraparound(False)
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import grad_cy_nocheck as g, f_fft, KX, KY' 'g(f_fft, KX, KY)'
.....................
Mean +- std dev: 8.76 ms +- 0.32 ms
# pythran
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import grad_pythran as g, f_fft, KX, KY' 'g(f_fft, KX, KY)'
.....................
Mean +- std dev: 8.69 ms +- 0.20 ms
# SIMD
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import grad_simd as g, f_fft, KX, KY' 'g(f_fft, KX, KY)'
.....................
Mean +- std dev: 8.91 ms +- 0.53 ms
# OpenMP
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import grad_omp as g, f_fft, KX, KY' 'g(f_fft, KX, KY)'
.....................
Mean +- std dev: 9.12 ms +- 0.33 ms
......@@ -76,12 +76,13 @@ from grad_omp import gradfft_from_fft as grad_omp
from grad_cy import (
gradfft_from_fft_nocheck as grad_cy_nocheck,
gradfft_from_fft_check as grad_cy_check)
gradfft_from_fft_check as grad_cy_check,
)
d = run_path('grad_pythran.py')
grad_py = d['gradfft_from_fft']
d = run_path("grad_pythran.py")
grad_py = d["gradfft_from_fft"]
assert hasattr(mod_pythran, '__pythran__')
assert hasattr(mod_pythran, "__pythran__")
n = 1000
shape = n, n
......@@ -91,7 +92,7 @@ f_fft = np.ones(shape, dtype=np.complex128)
KX = np.ones(shape, dtype=np.float64)
KY = np.ones(shape, dtype=np.float64)
if __name__ == '__main__':
if __name__ == "__main__":
grad_py(f_fft, KX, KY)
grad_cy_nocheck(f_fft, KX, KY)
......
TIMEIT:=python -m pyperf timeit --fast -s
# TIMEIT:=python -m perf timeit -q -s
# TIMEIT:=python -m pyperf timeit -q -s
NPROC:=2
FFT:='from bench import fft as transform;'
......
......@@ -39,14 +39,14 @@ openmp/$(name)_openmp$(extbin): $(name).py
# perf:
# ## numpy
# python -m perf timeit -s '$(setup) from $(name) import myfunc' 'myfunc(a)'
# python -m pyperf timeit -s '$(setup) from $(name) import myfunc' 'myfunc(a)'
# ## default
# python -m perf timeit -s '$(setup) from $(name)_default import myfunc' 'myfunc(a)'
# python -m pyperf timeit -s '$(setup) from $(name)_default import myfunc' 'myfunc(a)'
# ## native
# python -m perf timeit -s '$(setup) from $(name)_native import myfunc' 'myfunc(a)'
# python -m pyperf timeit -s '$(setup) from $(name)_native import myfunc' 'myfunc(a)'
# ## native_openmp
# python -m perf timeit -s '$(setup) from $(name)_native_openmp import myfunc' 'myfunc(a)'
# python -m pyperf timeit -s '$(setup) from $(name)_native_openmp import myfunc' 'myfunc(a)'
# ## openmp
# python -m perf timeit -s '$(setup) from $(name)_openmp import myfunc' 'myfunc(a)'
# python -m pyperf timeit -s '$(setup) from $(name)_openmp import myfunc' 'myfunc(a)'
# ## simd
# python -m perf timeit -s '$(setup) from $(name)_simd import myfunc' 'myfunc(a)'
# python -m pyperf timeit -s '$(setup) from $(name)_simd import myfunc' 'myfunc(a)'
......@@ -28,34 +28,34 @@ end=as func, c0, c1, c2, a0, a1, a2, a3
perf: perfpython perfnative
perfnative:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import proj_native $(end)' $(code)
perfdefault:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import proj_default $(end)' $(code)
perfdefault1:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import proj1_default $(end)' $(code)
perfdefault2:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import proj2_default $(end)' $(code)
perffft:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import proj_fft $(end)' $(code)
perfomp:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import proj_omp $(end)' $(code)
OMP_NUM_THREADS=1 python -m perf timeit -s \
OMP_NUM_THREADS=1 python -m pyperf timeit -s \
'from bench import proj_omp $(end)' $(code) \
--inherit-environ=OMP_NUM_THREADS
perfpython:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import proj_py $(end)' $(code)
perffortran: bench_proj_fortran.out
......
......@@ -5,21 +5,21 @@
See the files proj.py, proj1.py and proj2.py
pierre@pierre-KTH:~/Dev/fluidfft/bench/compare_projperpk3d$ make perfdefault
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import proj_default as func, arr_c, arr' 'func(arr_c, arr_c, arr_c, arr, arr, arr, arr)'
.....................
Mean +- std dev: 23.8 ms +- 1.3 ms
pierre@pierre-KTH:~/Dev/fluidfft/bench/compare_projperpk3d$ make perfdefault1
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import proj1_default as func, arr_c, arr' 'func(arr_c, arr_c, arr_c, arr, arr, arr, arr)'
.....................
Mean +- std dev: 26.6 ms +- 1.1 ms
pierre@pierre-KTH:~/Dev/fluidfft/bench/compare_projperpk3d$ make perfdefault2
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import proj2_default as func, arr_c, arr' 'func(arr_c, arr_c, arr_c, arr, arr, arr, arr)'
.....................
Mean +- std dev: 23.9 ms +- 1.5 ms
......@@ -30,7 +30,7 @@ Mean +- std dev: 23.9 ms +- 1.5 ms
Small difference but it is reproducible...
pierre@pierre-KTH:~/Dev/fluidfft/bench/compare_projperpk3d$ make perfnative
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import proj_native as func, arr_c, arr' 'func(arr_c, arr_c, arr_c, arr, arr, arr, arr)'
.....................
Mean +- std dev: 24.8 ms +- 1.3 ms
......
......@@ -26,43 +26,43 @@ code='func(arr)'
perfpython2d: all
## numpy 2d (no loop)
@python -m perf timeit -s \
@python -m pyperf timeit -s \
'from bench import myfunc_py as func, f2d as arr' $(code)
perfdefault2d: all
## default 2d (no loop)
@python -m perf timeit -s \
@python -m pyperf timeit -s \
'from bench import myfunc_default as func, f2d as arr' $(code)
# default 2d (explicit loops)
@python -m perf timeit -s \
@python -m pyperf timeit -s \
'from bench import myfunc_loops2d_default as func, f2d as arr' $(code)
perfsimd2d: $(name)_simd.so
# simd 2d (no loop)
@python -m perf timeit -s \
@python -m pyperf timeit -s \
'from bench import myfunc_simd as func, f2d as arr' $(code)
# simd 2d (explicit loops)
@python -m perf timeit -s \
@python -m pyperf timeit -s \
'from bench import myfunc_loops2d_simd as func, f2d as arr' $(code)
perfpython3d: all
## numpy 3d (no loop)
@python -m perf timeit -s \
@python -m pyperf timeit -s \
'from bench import myfunc_py as func, f3d as arr' $(code)
perfdefault3d: all
# default 3d (no loop)
@python -m perf timeit -s \
@python -m pyperf timeit -s \
'from bench import myfunc_default as func, f3d as arr' $(code)
# default 3d (explicit loops)
@python -m perf timeit -s \
@python -m pyperf timeit -s \
'from bench import myfunc_loops3d_default as func, f3d as arr' $(code)
perfsimd3d: all
# simd 3d (no loop)
@python -m perf timeit -s \
@python -m pyperf timeit -s \
'from bench import myfunc_simd as func, f3d as arr' $(code)
# simd 3d (explicit loops)
@python -m perf timeit -s \
@python -m pyperf timeit -s \
'from bench import myfunc_loops3d_simd as func, f3d as arr' $(code)
......@@ -3,32 +3,32 @@
# Result on Pierre's machine at LEGI (Intel(R) Xeon(R) CPU E5-1603 v3 @ 2.80GHz, 4 cores).
## numpy
python -m perf timeit -s 'import numpy as np; a = np.ones([1000, 1000]); from mymod import myfunc' 'myfunc(a)'
python -m pyperf timeit -s 'import numpy as np; a = np.ones([1000, 1000]); from mymod import myfunc' 'myfunc(a)'
.....................
Mean +- std dev: 47.6 ms +- 0.2 ms
## default
python -m perf timeit -s 'import numpy as np; a = np.ones([1000, 1000]); from mymod_default import myfunc' 'myfunc(a)'
python -m pyperf timeit -s 'import numpy as np; a = np.ones([1000, 1000]); from mymod_default import myfunc' 'myfunc(a)'
.....................
Mean +- std dev: 5.15 ms +- 0.01 ms
## native
python -m perf timeit -s 'import numpy as np; a = np.ones([1000, 1000]); from mymod_native import myfunc' 'myfunc(a)'
python -m pyperf timeit -s 'import numpy as np; a = np.ones([1000, 1000]); from mymod_native import myfunc' 'myfunc(a)'
.....................
Mean +- std dev: 5.15 ms +- 0.01 ms
## native_openmp
python -m perf timeit -s 'import numpy as np; a = np.ones([1000, 1000]); from mymod_native_openmp import myfunc' 'myfunc(a)'
python -m pyperf timeit -s 'import numpy as np; a = np.ones([1000, 1000]); from mymod_native_openmp import myfunc' 'myfunc(a)'
.....................
Mean +- std dev: 1.41 ms +- 0.11 ms
## openmp
python -m perf timeit -s 'import numpy as np; a = np.ones([1000, 1000]); from mymod_openmp import myfunc' 'myfunc(a)'
python -m pyperf timeit -s 'import numpy as np; a = np.ones([1000, 1000]); from mymod_openmp import myfunc' 'myfunc(a)'
.....................
Mean +- std dev: 1.40 ms +- 0.06 ms
## simd
python -m perf timeit -s 'import numpy as np; a = np.ones([1000, 1000]); from mymod_simd import myfunc' 'myfunc(a)'
python -m pyperf timeit -s 'import numpy as np; a = np.ones([1000, 1000]); from mymod_simd import myfunc' 'myfunc(a)'
.....................
Mean +- std dev: 5.16 ms +- 0.01 ms
......@@ -38,7 +38,7 @@ see no effect of the flags -march=native or -DUSE_BOOST_SIMD. Why?
# Update (2018-10-01)
The following are the results, in Ashwin's laptop after a `sudo python -m perf system tune`.
The following are the results, in Ashwin's laptop after a `sudo python -m pyperf system tune`.
(Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz, 2 cores).
### branch master (6f2a8f6)
......@@ -86,7 +86,7 @@ Mean +- std dev: 6.07 ms +- 0.07 ms
# default 2d (explicit loops)
Mean +- std dev: 4.45 ms +- 0.14 ms
# simd 2d (no loop)
python -m perf timeit -s \
python -m pyperf timeit -s \
Mean +- std dev: 5.49 ms +- 0.14 ms
# simd 2d (explicit loops)
Mean +- std dev: 4.40 ms +- 0.15 ms
......
......@@ -13,22 +13,22 @@ and CXX and CC env variables.
$ make perf3d
# default 3d (no loop)
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import myfunc_default as func, f3d as arr' 'func(arr)'
Mean +- std dev: 25.1 ms +- 1.0 ms
# default 3d (explicit loops)
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import myfunc_loops3d_default as func, f3d as arr' 'func(arr)'
Mean +- std dev: 18.2 ms +- 1.1 ms
# simd 3d (no loop)
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import myfunc_simd as func, f3d as arr' 'func(arr)'
Mean +- std dev: 20.5 ms +- 1.1 ms
# simd 3d (explicit loops)
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import myfunc_loops3d_simd as func, f3d as arr' 'func(arr)'
Mean +- std dev: 23.0 ms +- 1.2 ms
......@@ -37,21 +37,21 @@ Mean +- std dev: 23.0 ms +- 1.2 ms
$ make perf3d
# default 3d (no loop)
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import myfunc_default as func, f3d as arr' 'func(arr)'
Mean +- std dev: 32.6 ms +- 2.1 ms
# default 3d (explicit loops)
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import myfunc_loops3d_default as func, f3d as arr' 'func(arr)'
Mean +- std dev: 17.7 ms +- 0.6 ms
# simd 3d (no loop)
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import myfunc_simd as func, f3d as arr' 'func(arr)'
Mean +- std dev: 31.7 ms +- 0.4 ms
# simd 3d (explicit loops)
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import myfunc_loops3d_simd as func, f3d as arr' 'func(arr)'
Mean +- std dev: 17.7 ms +- 0.8 ms
......@@ -2,8 +2,8 @@
name=mymod
nameso=$(name)_thran.so
# TIMEIT=python -m perf timeit --fast -q -s
TIMEIT=python -m perf timeit -q -s
# TIMEIT=python -m pyperf timeit --fast -q -s
TIMEIT=python -m pyperf timeit -q -s
# PYTHRAN=pythran -march=native -DUSE_BOOST_SIMD
PYTHRAN=pythran
......
......@@ -29,102 +29,102 @@ arrays=a0, a1, a2, a3, a4, a5
perf: perfpython perfdefault perfdefault1 perfsimd
perfnative:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)_native as func, $(arrays)' $(code)
perfdefault:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)_default as func, $(arrays)' $(code)
perffft:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)_fft as func, $(arrays)' $(code)
perfomp:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)_omp as func, $(arrays)' $(code)
OMP_NUM_THREADS=1 python -m perf timeit -s \
OMP_NUM_THREADS=1 python -m pyperf timeit -s \
'from bench import $(name)_omp as func, $(arrays)' $(code) \
--inherit-environ=OMP_NUM_THREADS
perfpython:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)_py as func, $(arrays)' $(code)
perfsimd:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)_simd as func, $(arrays)' $(code)
perfsimd1:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)1_simd as func, $(arrays)' $(code)
perfsimd2:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)2_simd as func, $(arrays)' $(code)
perfsimd3:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)3_simd as func, $(arrays)' $(code)
perfnative1:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)1_native as func, $(arrays)' $(code)
perfdefault1:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)1_default as func, $(arrays)' $(code)
perfomp1:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)1_omp as func, $(arrays)' $(code)
OMP_NUM_THREADS=1 python -m perf timeit -s \
OMP_NUM_THREADS=1 python -m pyperf timeit -s \
'from bench import $(name)1_omp as func, $(arrays)' $(code) \
--inherit-environ=OMP_NUM_THREADS
perfpython1:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)1_py as func, $(arrays)' $(code)
perfnative2:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)2_native as func, $(arrays)' $(code)
perfdefault2:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)2_default as func, $(arrays)' $(code)
perfomp2:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)2_omp as func, $(arrays)' $(code)
OMP_NUM_THREADS=1 python -m perf timeit -s \
OMP_NUM_THREADS=1 python -m pyperf timeit -s \
'from bench import $(name)2_omp as func, $(arrays)' $(code) \
--inherit-environ=OMP_NUM_THREADS
perfpython2:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)2_py as func, $(arrays)' $(code)
perfnative3:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)3_native as func, $(arrays)' $(code)
perfdefault3:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)3_default as func, $(arrays)' $(code)
perfomp3:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)3_omp as func, $(arrays)' $(code)
OMP_NUM_THREADS=1 python -m perf timeit -s \
OMP_NUM_THREADS=1 python -m pyperf timeit -s \
'from bench import $(name)3_omp as func, $(arrays)' $(code) \
--inherit-environ=OMP_NUM_THREADS
perfpython3:
python -m perf timeit -s \
python -m pyperf timeit -s \
'from bench import $(name)2_py as func, $(arrays)' $(code)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment