diff --git a/README.md b/README.md index 56ae28b2..edd0cfdc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Benchmarks -Several tests are available for the user to benchmark Pyccel against other common accelerators, notably [pythran](https://pythran.readthedocs.io/en/latest/) and [numba](https://numba.pydata.org/). +Several tests are available for the user to benchmark Pyccel against other common accelerators, notably [pythran](https://pythran.readthedocs.io/en/latest/), [numba](https://numba.pydata.org/) and [jax](https://docs.jax.dev/en/latest/index.html). The same code is used for all tests, only the decorators change. The dependencies can be installed using the command `python3 -m pip install .` @@ -94,230 +94,230 @@ Runs a molecular dynamics simulation. The code is adapted from examples written Evaluates a non-uniform spline saved as a class instance at a large number of test points. The code uses Algorithm A2.2 from the NURBS book (Piegl, Les, and Wayne Tiller. The NURBS book. Springer Science & Business Media, 2012.). ## Development branch results -### Performance Comparison (as of Thu Dec 11 12:51:44 UTC 2025) +### Performance Comparison (as of Mon Jan 19 10:43:50 UTC 2026) ## Compilation time -Algorithm | python | pythran_gnu | pythran_intel | numba | pyccel_gnu_c | pyccel_gnu_fortran | pyccel_intel_c | pyccel_intel_fortran -------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- -Ackermann | - | - | - | 0.26 | 1.24 | 1.27 | 1.27 | 1.33 -Bellman Ford | - | - | - | 0.89 | 24.77 | 1.44 | 26.65 | 1.49 -Dijkstra | - | - | - | 0.96 | 24.78 | 1.54 | 26.85 | 1.63 -Euler | - | - | - | 3.06 | 24.56 | 1.42 | 26.78 | 1.48 -Midpoint Explicit | - | - | - | 3.39 | 24.79 | 1.61 | 26.80 | 1.65 -Midpoint Fixed | - | - | - | 3.55 | 24.75 | 1.66 | 26.77 | 1.71 -RK4 | - | - | - | 3.53 | 25.31 | 2.01 | 27.21 | 2.06 -FD - L Convection | - | - | - | 2.33 | 24.43 | 1.36 | 26.50 | 1.42 -FD - NL Convection | - | - | - | 2.45 | 24.50 | 1.35 | 26.79 | 1.42 -FD - Poisson | - | - | - | 4.02 | 24.74 | 1.65 | 26.76 | 1.81 -FD - Laplace | - | - | - | 5.32 | 25.16 | 1.80 | 27.06 | 1.85 -M-D | - | - | - | 5.95 | 25.13 | 2.32 | 27.19 | 2.41 -Splines | - | - | - | 0.59 | 24.66 | 1.63 | 26.65 | 1.72 +Algorithm | python | pythran_gnu | pythran_intel | numba | jax | pyccel_gnu_c | pyccel_gnu_fortran | pyccel_intel_c | pyccel_intel_fortran +------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- +Ackermann | - | 2.12 | 2.24 | 0.31 | 0.31 | 1.46 | 1.47 | 1.47 | 1.56 +Bellman Ford | - | 3.32 | 3.69 | 1.05 | 1.05 | 26.27 | 1.62 | 30.80 | 1.70 +Dijkstra | - | 2.34 | 2.63 | 1.11 | 1.10 | 26.38 | 1.66 | 30.05 | 1.81 +Euler | - | 2.57 | 3.03 | 3.38 | 3.39 | 26.15 | 1.54 | 30.03 | 1.67 +Midpoint Explicit | - | 2.96 | 3.44 | 3.73 | 3.73 | 26.30 | 1.78 | 30.16 | 1.88 +Midpoint Fixed | - | 3.29 | 3.78 | 3.91 | 3.92 | 27.38 | 1.90 | 30.66 | 1.95 +RK4 | - | 3.42 | 4.02 | 3.90 | 3.87 | 26.74 | 2.22 | 31.32 | 2.39 +FD - L Convection | - | 2.27 | 2.62 | 2.53 | 2.49 | 25.99 | 1.50 | 29.94 | 1.62 +FD - NL Convection | - | 3.23 | 3.62 | 2.69 | 2.76 | 26.83 | 1.53 | 30.18 | 1.61 +FD - Poisson | - | 3.53 | 3.80 | 4.31 | 4.26 | 26.36 | 1.85 | 30.69 | 2.09 +FD - Laplace | - | 7.26 | 8.19 | 5.52 | 5.57 | 27.33 | 2.03 | 30.91 | 2.15 +M-D | - | 6.13 | 6.60 | 6.63 | 6.59 | 26.85 | 2.59 | 31.31 | 2.77 +Splines | - | - | - | 0.69 | 0.68 | 26.40 | 1.80 | 30.44 | 1.95 ## Execution time -Algorithm | python | pythran_gnu | pythran_intel | numba | pyccel_gnu_c | pyccel_gnu_fortran | pyccel_intel_c | pyccel_intel_fortran -------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- -Ackermann (ms) | 308.00 | - | - | 19.20 | 2.22 | 2.27 | 11.70 | 15.60 -Bellman Ford (ms) | 1750.00 | - | - | 4.61 | 4.20 | 3.22 | 5.86 | 3.52 -Dijkstra (ms) | 4540.00 | - | - | 29.10 | 45.00 | 26.30 | 56.00 | 32.80 -Euler (ms) | 3100.00 | - | - | 85.80 | 20.30 | 10.10 | 22.40 | 11.00 -Midpoint Explicit (ms) | 6370.00 | - | - | 171.00 | 38.30 | 18.90 | 40.30 | 14.50 -Midpoint Fixed (ms) | 31600.00 | - | - | 593.00 | 171.00 | 67.60 | 179.00 | 43.20 -RK4 (ms) | 16000.00 | - | - | 311.00 | 79.10 | 25.50 | 82.40 | 29.70 -FD - L Convection (ms) | 1970.00 | - | - | 1.98 | 6.57 | 1.51 | 8.46 | 1.40 -FD - NL Convection (ms) | 2530.00 | - | - | 2.45 | 6.10 | 1.43 | 8.54 | 1.41 -FD - Poisson (ms) | 5790.00 | - | - | 6.86 | 8.51 | 2.78 | 13.30 | 2.75 -FD - Laplace (ms) | 563.00 | - | - | 211.00 | 202.00 | 54.00 | 397.00 | 60.60 -M-D (ms) | 14000.00 | - | - | 52.90 | 89.00 | 55.40 | 56.30 | 54.80 -Splines (ms) | 1730.00 | - | - | 18.40 | 12.00 | 16.90 | 13.20 | 26.60 +Algorithm | python | pythran_gnu | pythran_intel | numba | jax | pyccel_gnu_c | pyccel_gnu_fortran | pyccel_intel_c | pyccel_intel_fortran +------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- +Ackermann (ms) | 419.00 | 2.92 | 3.67 | 8.63 | 8.50 | 1.23 | 1.36 | 4.06 | 8.05 +Bellman Ford (ms) | 1720.00 | 4.51 | 3.65 | 4.03 | 4.06 | 3.32 | 3.27 | 5.37 | 3.81 +Dijkstra (ms) | 4830.00 | 20.70 | 16.70 | 20.00 | 20.80 | 36.50 | 19.50 | 43.30 | 21.20 +Euler (ms) | 3330.00 | 25.20 | 25.90 | 36.10 | 35.10 | 24.10 | 10.80 | 23.40 | 16.10 +Midpoint Explicit (ms) | 6700.00 | 51.60 | 50.50 | 66.60 | 68.30 | 41.20 | 19.60 | 43.80 | 16.90 +Midpoint Fixed (ms) | 34000.00 | 268.00 | 95.30 | 304.00 | 308.00 | 178.00 | 72.90 | 201.00 | 55.00 +RK4 (ms) | 17000.00 | 155.00 | 36.00 | 122.00 | 123.00 | 85.70 | 31.90 | 89.60 | 28.30 +FD - L Convection (ms) | 2140.00 | 1.52 | 1.49 | 2.83 | 2.93 | 4.27 | 1.52 | 3.83 | 1.31 +FD - NL Convection (ms) | 2630.00 | 1.98 | 1.78 | 2.86 | 2.89 | 4.69 | 1.62 | 4.06 | 1.51 +FD - Poisson (ms) | 5800.00 | 2.99 | 5.50 | 6.39 | 6.45 | 3.75 | 2.71 | 6.31 | 2.59 +FD - Laplace (ms) | 634.00 | 67.70 | 104.00 | 190.00 | 189.00 | 151.00 | 61.40 | 193.00 | 60.50 +M-D (ms) | 14100.00 | 45.10 | 51.10 | 56.80 | 56.80 | 106.00 | 62.10 | 88.20 | 90.20 +Splines (ms) | 1650.00 | - | - | 18.30 | 18.40 | 13.40 | 18.50 | 15.10 | 27.60 ![Development compilation results](./version_specific_results/devel_performance_311_compilation.svg) ![Development execution results](./version_specific_results/devel_performance_311_execution.svg) ## Python 3.9 results -### Performance Comparison (as of 2.1.0) +### Performance Comparison (as of 2.0.1) ## Compilation time Algorithm | python | pythran_gnu | pythran_intel | numba | pyccel_gnu_c | pyccel_gnu_fortran | pyccel_intel_c | pyccel_intel_fortran ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- -Ackermann | - | - | - | 0.32 | 1.40 | 1.46 | 1.44 | 1.48 -Bellman Ford | - | - | - | 1.08 | 1.70 | 1.58 | 1.66 | 1.66 -Dijkstra | - | - | - | 1.59 | 1.79 | 1.68 | 1.75 | 1.78 -Euler | - | - | - | 2.05 | 1.66 | 1.56 | 1.64 | 1.64 -Midpoint Explicit | - | - | - | 3.06 | 1.88 | 1.78 | 1.86 | 1.85 -Midpoint Fixed | - | - | - | 3.27 | 1.97 | 1.83 | 1.91 | 1.91 -RK4 | - | - | - | 3.84 | 2.35 | 2.26 | 2.27 | 2.31 -FD - L Convection | - | - | - | 0.87 | 1.62 | 1.53 | 1.59 | 1.60 -FD - NL Convection | - | - | - | 0.87 | 1.62 | 1.53 | 1.60 | 1.60 -FD - Poisson | - | - | - | 1.32 | 1.76 | 1.80 | 1.74 | 2.00 -FD - Laplace | - | - | - | 3.04 | 1.99 | 1.94 | 1.91 | 2.05 -M-D | - | - | - | 4.11 | 2.47 | 2.62 | 2.40 | 2.75 -Splines | - | - | - | 0.60 | 1.85 | 1.81 | 1.80 | 1.92 +Ackermann | - | 1.93 | 1.85 | 0.33 | 1.40 | 1.44 | 1.39 | 1.44 +Bellman Ford | - | 3.28 | 3.53 | 1.08 | 1.70 | 1.58 | 1.62 | 1.61 +Dijkstra | - | 2.28 | 2.56 | 1.58 | 1.78 | 1.67 | 1.71 | 1.73 +Euler | - | 2.52 | 2.89 | 2.02 | 1.65 | 1.55 | 1.60 | 1.59 +Midpoint Explicit | - | 2.87 | 3.25 | 3.00 | 1.89 | 1.77 | 1.82 | 1.80 +Midpoint Fixed | - | 3.27 | 3.64 | 3.21 | 1.96 | 1.83 | 1.86 | 1.87 +RK4 | - | 3.38 | 3.81 | 3.75 | 2.36 | 2.27 | 2.26 | 2.29 +FD - L Convection | - | 2.20 | 2.50 | 0.86 | 1.61 | 1.51 | 1.55 | 1.55 +FD - NL Convection | - | 3.12 | 3.43 | 0.87 | 1.60 | 1.52 | 1.56 | 1.55 +FD - Poisson | - | 3.34 | 3.60 | 1.33 | 1.75 | 1.78 | 1.68 | 1.93 +FD - Laplace | - | 6.69 | 7.34 | 3.02 | 2.00 | 1.94 | 1.87 | 2.02 +M-D | - | 6.12 | 6.07 | 4.04 | 2.46 | 2.60 | 2.35 | 2.71 +Splines | - | - | - | 0.61 | 1.83 | 1.79 | 1.75 | 1.86 ## Execution time Algorithm | python | pythran_gnu | pythran_intel | numba | pyccel_gnu_c | pyccel_gnu_fortran | pyccel_intel_c | pyccel_intel_fortran ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- -Ackermann (ms) | 312.00 $\pm$ 3.00 | - | - | 13.50 $\pm$ 0.00 | 1.39 $\pm$ 0.01 | 1.50 $\pm$ 0.00 | 4.46 $\pm$ 0.02 | 8.36 $\pm$ 0.24 -Bellman Ford (ms) | 1870.00 $\pm$ 20.00 | - | - | 3.91 $\pm$ 0.04 | 4.16 $\pm$ 0.02 | 3.20 $\pm$ 0.02 | 6.04 $\pm$ 0.32 | 4.29 $\pm$ 0.01 -Dijkstra (ms) | 4850.00 $\pm$ 70.00 | - | - | 18.60 $\pm$ 0.40 | 69.80 $\pm$ 1.00 | 18.10 $\pm$ 0.00 | 67.30 $\pm$ 0.30 | 19.80 $\pm$ 0.10 -Euler (ms) | 3710.00 $\pm$ 30.00 | - | - | 37.80 $\pm$ 0.30 | 29.10 $\pm$ 0.40 | 11.80 $\pm$ 0.40 | 30.40 $\pm$ 0.40 | 13.40 $\pm$ 3.00 -Midpoint Explicit (ms) | 7520.00 $\pm$ 60.00 | - | - | 72.00 $\pm$ 0.50 | 50.20 $\pm$ 0.40 | 19.90 $\pm$ 0.40 | 51.80 $\pm$ 0.30 | 14.80 $\pm$ 0.20 -Midpoint Fixed (ms) | 38800.00 $\pm$ 500.00 | - | - | 370.00 $\pm$ 3.00 | 211.00 $\pm$ 0.00 | 80.10 $\pm$ 1.50 | 228.00 $\pm$ 1.00 | 47.30 $\pm$ 0.20 -RK4 (ms) | 19200.00 $\pm$ 100.00 | - | - | 141.00 $\pm$ 20.00 | 94.60 $\pm$ 0.80 | 29.50 $\pm$ 0.40 | 91.20 $\pm$ 0.70 | 25.30 $\pm$ 0.10 -FD - L Convection (ms) | 2390.00 $\pm$ 40.00 | - | - | 3.05 $\pm$ 0.04 | 7.26 $\pm$ 0.20 | 1.66 $\pm$ 0.08 | 8.84 $\pm$ 0.12 | 1.50 $\pm$ 0.05 -FD - NL Convection (ms) | 3000.00 $\pm$ 30.00 | - | - | 3.18 $\pm$ 0.07 | 7.66 $\pm$ 0.27 | 1.53 $\pm$ 0.07 | 8.90 $\pm$ 0.19 | 1.67 $\pm$ 0.02 -FD - Poisson (ms) | 6370.00 $\pm$ 50.00 | - | - | 6.86 $\pm$ 0.06 | 14.00 $\pm$ 0.00 | 2.82 $\pm$ 0.03 | 21.60 $\pm$ 0.30 | 2.76 $\pm$ 0.02 -FD - Laplace (ms) | 617.00 $\pm$ 2.00 | - | - | 273.00 $\pm$ 1.00 | 509.00 $\pm$ 1.00 | 57.00 $\pm$ 0.70 | 672.00 $\pm$ 1.00 | 54.30 $\pm$ 0.60 -M-D (ms) | 14900.00 $\pm$ 200.00 | - | - | 61.30 $\pm$ 0.60 | 101.00 $\pm$ 0.00 | 61.80 $\pm$ 0.20 | 63.30 $\pm$ 0.30 | 63.90 $\pm$ 2.20 -Splines (ms) | 2070.00 $\pm$ 30.00 | - | - | 18.10 $\pm$ 0.30 | 15.10 $\pm$ 0.00 | 19.30 $\pm$ 0.50 | 17.10 $\pm$ 1.00 | 29.60 $\pm$ 0.10 +Ackermann (ms) | 303.00 $\pm$ 2.00 | 2.83 $\pm$ 0.01 | 3.08 $\pm$ 0.11 | 10.90 $\pm$ 0.10 | 1.23 $\pm$ 0.00 | 1.32 $\pm$ 0.00 | 4.36 $\pm$ 0.01 | 10.30 $\pm$ 0.40 +Bellman Ford (ms) | 1850.00 $\pm$ 20.00 | 4.58 $\pm$ 0.01 | 3.53 $\pm$ 0.13 | 3.84 $\pm$ 0.05 | 3.73 $\pm$ 0.03 | 3.23 $\pm$ 0.01 | 5.85 $\pm$ 0.03 | 4.20 $\pm$ 0.02 +Dijkstra (ms) | 4980.00 $\pm$ 70.00 | 18.20 $\pm$ 0.10 | 16.50 $\pm$ 0.10 | 19.10 $\pm$ 0.50 | 67.00 $\pm$ 0.40 | 17.80 $\pm$ 0.00 | 66.30 $\pm$ 0.10 | 20.70 $\pm$ 0.00 +Euler (ms) | 3890.00 $\pm$ 30.00 | 25.20 $\pm$ 0.40 | 25.50 $\pm$ 0.60 | 39.40 $\pm$ 8.10 | 26.80 $\pm$ 0.40 | 11.00 $\pm$ 0.30 | 26.80 $\pm$ 0.30 | 15.60 $\pm$ 0.40 +Midpoint Explicit (ms) | 7940.00 $\pm$ 70.00 | 51.70 $\pm$ 0.40 | 50.10 $\pm$ 0.20 | 69.80 $\pm$ 1.50 | 44.80 $\pm$ 0.40 | 19.70 $\pm$ 2.20 | 45.80 $\pm$ 0.40 | 16.60 $\pm$ 1.40 +Midpoint Fixed (ms) | 39800.00 $\pm$ 300.00 | 267.00 $\pm$ 2.00 | 92.30 $\pm$ 0.50 | 357.00 $\pm$ 6.00 | 188.00 $\pm$ 1.00 | 72.80 $\pm$ 1.30 | 199.00 $\pm$ 3.00 | 51.00 $\pm$ 0.50 +RK4 (ms) | 20000.00 $\pm$ 200.00 | 154.00 $\pm$ 2.00 | 35.60 $\pm$ 0.90 | 138.00 $\pm$ 23.00 | 95.60 $\pm$ 0.80 | 31.50 $\pm$ 0.30 | 91.80 $\pm$ 1.50 | 27.70 $\pm$ 0.30 +FD - L Convection (ms) | 2370.00 $\pm$ 20.00 | 1.52 $\pm$ 0.05 | 1.49 $\pm$ 0.03 | 2.69 $\pm$ 0.01 | 7.44 $\pm$ 0.07 | 1.54 $\pm$ 0.08 | 7.72 $\pm$ 0.08 | 1.53 $\pm$ 0.05 +FD - NL Convection (ms) | 2920.00 $\pm$ 10.00 | 1.81 $\pm$ 0.06 | 1.58 $\pm$ 0.07 | 2.84 $\pm$ 0.07 | 6.71 $\pm$ 0.04 | 1.50 $\pm$ 0.06 | 8.13 $\pm$ 0.16 | 1.51 $\pm$ 0.01 +FD - Poisson (ms) | 6500.00 $\pm$ 60.00 | 2.83 $\pm$ 0.03 | 5.38 $\pm$ 0.10 | 7.21 $\pm$ 0.03 | 16.00 $\pm$ 0.00 | 2.70 $\pm$ 0.03 | 24.10 $\pm$ 0.00 | 2.67 $\pm$ 0.04 +FD - Laplace (ms) | 586.00 $\pm$ 6.00 | 67.10 $\pm$ 0.40 | 127.00 $\pm$ 1.00 | 252.00 $\pm$ 1.00 | 491.00 $\pm$ 1.00 | 60.70 $\pm$ 0.50 | 662.00 $\pm$ 1.00 | 59.40 $\pm$ 0.50 +M-D (ms) | 15900.00 $\pm$ 200.00 | 35.00 $\pm$ 2.20 | 52.80 $\pm$ 0.40 | 58.70 $\pm$ 0.40 | 113.00 $\pm$ 0.00 | 62.00 $\pm$ 0.20 | 61.40 $\pm$ 0.70 | 89.50 $\pm$ 0.20 +Splines (ms) | 2050.00 $\pm$ 30.00 | - | - | 17.00 $\pm$ 0.00 | 14.40 $\pm$ 0.00 | 17.90 $\pm$ 0.60 | 15.30 $\pm$ 0.20 | 27.70 $\pm$ 0.10 ![Python 3.9 compilation results](./version_specific_results/pypi_performance_39_compilation.svg) ![Python 3.9 execution results](./version_specific_results/pypi_performance_39_execution.svg) ## Python 3.10 results -### Performance Comparison (as of 2.1.0) +### Performance Comparison (as of 2.0.1) ## Compilation time Algorithm | python | pythran_gnu | pythran_intel | numba | pyccel_gnu_c | pyccel_gnu_fortran | pyccel_intel_c | pyccel_intel_fortran ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- -Ackermann | - | - | - | 0.35 | 1.46 | 1.48 | 1.54 | 1.61 -Bellman Ford | - | - | - | 1.02 | 26.42 | 1.58 | 29.92 | 1.69 -Dijkstra | - | - | - | 1.17 | 26.12 | 1.66 | 29.83 | 1.81 -Euler | - | - | - | 3.34 | 25.90 | 1.54 | 29.77 | 1.64 -Midpoint Explicit | - | - | - | 3.89 | 26.31 | 1.79 | 30.27 | 1.91 -Midpoint Fixed | - | - | - | 3.90 | 26.15 | 1.83 | 30.00 | 1.95 -RK4 | - | - | - | 3.98 | 26.57 | 2.27 | 30.23 | 2.33 -FD - L Convection | - | - | - | 2.59 | 26.20 | 1.50 | 29.87 | 1.61 -FD - NL Convection | - | - | - | 2.80 | 26.60 | 1.56 | 30.39 | 1.66 -FD - Poisson | - | - | - | 4.39 | 26.03 | 1.77 | 29.67 | 1.99 -FD - Laplace | - | - | - | 5.67 | 27.09 | 1.93 | 30.10 | 2.07 -M-D | - | - | - | 6.54 | 26.69 | 2.61 | 30.56 | 2.77 -Splines | - | - | - | 0.66 | 26.10 | 1.79 | 29.85 | 1.93 +Ackermann | - | 2.38 | 2.10 | 0.32 | 1.35 | 1.38 | 1.34 | 1.39 +Bellman Ford | - | 3.46 | 3.77 | 0.95 | 1.66 | 1.53 | 1.58 | 1.57 +Dijkstra | - | 2.42 | 2.73 | 1.26 | 1.74 | 1.63 | 1.69 | 1.71 +Euler | - | 2.72 | 3.05 | 3.35 | 1.61 | 1.50 | 1.57 | 1.57 +Midpoint Explicit | - | 3.04 | 3.44 | 3.69 | 1.84 | 1.73 | 1.78 | 1.77 +Midpoint Fixed | - | 3.45 | 3.83 | 3.84 | 1.91 | 1.80 | 1.85 | 1.83 +RK4 | - | 3.53 | 4.02 | 3.84 | 2.31 | 2.22 | 2.20 | 2.24 +FD - L Convection | - | 2.35 | 2.63 | 2.54 | 1.50 | 1.47 | 1.51 | 1.51 +FD - NL Convection | - | 3.28 | 3.62 | 2.59 | 1.57 | 1.49 | 1.52 | 1.51 +FD - Poisson | - | 3.54 | 3.81 | 5.89 | 1.70 | 1.74 | 1.65 | 1.89 +FD - Laplace | - | 6.91 | 7.63 | 7.35 | 1.94 | 1.89 | 1.85 | 1.97 +M-D | - | 6.32 | 6.34 | 8.60 | 2.45 | 2.62 | 2.32 | 2.66 +Splines | - | - | - | 0.57 | 1.78 | 1.74 | 1.72 | 1.82 ## Execution time Algorithm | python | pythran_gnu | pythran_intel | numba | pyccel_gnu_c | pyccel_gnu_fortran | pyccel_intel_c | pyccel_intel_fortran ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- -Ackermann (ms) | 312.00 $\pm$ 3.00 | - | - | 9.02 $\pm$ 0.47 | 1.23 $\pm$ 0.01 | 1.32 $\pm$ 0.01 | 4.06 $\pm$ 0.02 | 8.76 $\pm$ 0.27 -Bellman Ford (ms) | 1830.00 $\pm$ 30.00 | - | - | 4.05 $\pm$ 0.02 | 4.06 $\pm$ 0.02 | 3.25 $\pm$ 0.02 | 5.19 $\pm$ 0.01 | 3.83 $\pm$ 0.01 -Dijkstra (ms) | 4980.00 $\pm$ 60.00 | - | - | 20.70 $\pm$ 0.70 | 38.00 $\pm$ 0.60 | 19.90 $\pm$ 0.20 | 47.80 $\pm$ 0.30 | 22.10 $\pm$ 0.30 -Euler (ms) | 3420.00 $\pm$ 10.00 | - | - | 35.30 $\pm$ 0.60 | 22.20 $\pm$ 0.30 | 10.90 $\pm$ 0.30 | 24.20 $\pm$ 0.50 | 15.50 $\pm$ 0.40 -Midpoint Explicit (ms) | 7000.00 $\pm$ 40.00 | - | - | 69.20 $\pm$ 4.90 | 39.90 $\pm$ 0.30 | 19.40 $\pm$ 0.50 | 43.90 $\pm$ 0.50 | 16.50 $\pm$ 1.10 -Midpoint Fixed (ms) | 35400.00 $\pm$ 200.00 | - | - | 308.00 $\pm$ 3.00 | 183.00 $\pm$ 1.00 | 73.60 $\pm$ 2.90 | 195.00 $\pm$ 0.00 | 55.00 $\pm$ 0.40 -RK4 (ms) | 17300.00 $\pm$ 100.00 | - | - | 123.00 $\pm$ 2.00 | 90.40 $\pm$ 0.60 | 31.90 $\pm$ 0.40 | 94.30 $\pm$ 1.10 | 27.90 $\pm$ 0.30 -FD - L Convection (ms) | 2300.00 $\pm$ 20.00 | - | - | 2.84 $\pm$ 0.02 | 5.80 $\pm$ 0.03 | 1.58 $\pm$ 0.11 | 8.25 $\pm$ 0.30 | 1.33 $\pm$ 0.04 -FD - NL Convection (ms) | 2900.00 $\pm$ 30.00 | - | - | 2.89 $\pm$ 0.04 | 5.09 $\pm$ 0.01 | 1.62 $\pm$ 0.01 | 8.15 $\pm$ 0.13 | 1.40 $\pm$ 0.03 -FD - Poisson (ms) | 6200.00 $\pm$ 40.00 | - | - | 6.58 $\pm$ 0.07 | 10.20 $\pm$ 0.00 | 2.59 $\pm$ 0.03 | 18.20 $\pm$ 0.10 | 2.54 $\pm$ 0.02 -FD - Laplace (ms) | 580.00 $\pm$ 8.00 | - | - | 190.00 $\pm$ 2.00 | 204.00 $\pm$ 1.00 | 56.60 $\pm$ 0.40 | 355.00 $\pm$ 1.00 | 55.00 $\pm$ 0.30 -M-D (ms) | 15100.00 $\pm$ 100.00 | - | - | 56.90 $\pm$ 0.10 | 105.00 $\pm$ 0.00 | 62.80 $\pm$ 1.20 | 91.90 $\pm$ 0.50 | 90.40 $\pm$ 0.50 -Splines (ms) | 1950.00 $\pm$ 40.00 | - | - | 17.60 $\pm$ 0.10 | 14.20 $\pm$ 0.00 | 17.60 $\pm$ 0.00 | 15.20 $\pm$ 0.10 | 27.80 $\pm$ 0.30 +Ackermann (ms) | 305.00 $\pm$ 3.00 | 2.94 $\pm$ 0.03 | 3.06 $\pm$ 0.02 | 10.80 $\pm$ 0.10 | 1.33 $\pm$ 0.01 | 1.33 $\pm$ 0.00 | 4.07 $\pm$ 0.08 | 9.44 $\pm$ 0.27 +Bellman Ford (ms) | 1820.00 $\pm$ 20.00 | 5.27 $\pm$ 0.02 | 3.54 $\pm$ 0.08 | 3.88 $\pm$ 0.07 | 3.75 $\pm$ 0.03 | 3.27 $\pm$ 0.02 | 5.87 $\pm$ 0.02 | 4.21 $\pm$ 0.03 +Dijkstra (ms) | 5100.00 $\pm$ 60.00 | 20.70 $\pm$ 0.20 | 17.10 $\pm$ 0.20 | 19.00 $\pm$ 0.20 | 66.90 $\pm$ 0.60 | 18.90 $\pm$ 0.80 | 68.70 $\pm$ 0.70 | 22.40 $\pm$ 0.40 +Euler (ms) | 3510.00 $\pm$ 40.00 | 25.80 $\pm$ 0.40 | 25.50 $\pm$ 0.30 | 36.20 $\pm$ 0.30 | 27.00 $\pm$ 0.40 | 11.00 $\pm$ 0.30 | 27.00 $\pm$ 0.40 | 15.30 $\pm$ 0.40 +Midpoint Explicit (ms) | 7120.00 $\pm$ 50.00 | 51.20 $\pm$ 0.30 | 50.70 $\pm$ 0.60 | 69.70 $\pm$ 0.70 | 44.70 $\pm$ 0.40 | 18.80 $\pm$ 0.20 | 46.10 $\pm$ 0.50 | 16.20 $\pm$ 0.40 +Midpoint Fixed (ms) | 35600.00 $\pm$ 200.00 | 268.00 $\pm$ 3.00 | 94.60 $\pm$ 4.20 | 322.00 $\pm$ 1.00 | 190.00 $\pm$ 1.00 | 72.50 $\pm$ 0.70 | 198.00 $\pm$ 1.00 | 55.40 $\pm$ 0.40 +RK4 (ms) | 17600.00 $\pm$ 100.00 | 154.00 $\pm$ 4.00 | 35.60 $\pm$ 0.70 | 126.00 $\pm$ 1.00 | 95.50 $\pm$ 0.70 | 31.70 $\pm$ 0.20 | 94.50 $\pm$ 7.30 | 29.40 $\pm$ 0.40 +FD - L Convection (ms) | 2290.00 $\pm$ 20.00 | 1.53 $\pm$ 0.05 | 1.64 $\pm$ 0.01 | 5.64 $\pm$ 0.01 | 6.68 $\pm$ 0.06 | 1.58 $\pm$ 0.07 | 7.75 $\pm$ 0.12 | 1.50 $\pm$ 0.01 +FD - NL Convection (ms) | 2770.00 $\pm$ 20.00 | 1.88 $\pm$ 0.05 | 1.78 $\pm$ 0.00 | 5.68 $\pm$ 0.03 | 6.72 $\pm$ 0.05 | 1.67 $\pm$ 0.07 | 8.35 $\pm$ 0.21 | 1.51 $\pm$ 0.02 +FD - Poisson (ms) | 6470.00 $\pm$ 160.00 | 2.94 $\pm$ 0.06 | 5.40 $\pm$ 0.16 | 6.90 $\pm$ 0.15 | 16.00 $\pm$ 0.00 | 2.63 $\pm$ 0.03 | 23.90 $\pm$ 0.10 | 2.57 $\pm$ 0.02 +FD - Laplace (ms) | 593.00 $\pm$ 17.00 | 63.60 $\pm$ 0.40 | 127.00 $\pm$ 1.00 | 280.00 $\pm$ 8.00 | 492.00 $\pm$ 1.00 | 61.40 $\pm$ 0.60 | 657.00 $\pm$ 2.00 | 55.10 $\pm$ 0.30 +M-D (ms) | 15300.00 $\pm$ 100.00 | 35.30 $\pm$ 0.30 | 52.60 $\pm$ 0.30 | 60.30 $\pm$ 0.30 | 117.00 $\pm$ 1.00 | 62.20 $\pm$ 0.20 | 61.20 $\pm$ 0.10 | 89.50 $\pm$ 0.20 +Splines (ms) | 1870.00 $\pm$ 10.00 | - | - | 18.40 $\pm$ 0.10 | 14.20 $\pm$ 0.00 | 17.60 $\pm$ 0.00 | 15.20 $\pm$ 0.00 | 27.80 $\pm$ 0.30 ![Python 3.10 compilation results](./version_specific_results/pypi_performance_310_compilation.svg) ![Python 3.10 execution results](./version_specific_results/pypi_performance_310_execution.svg) ## Python 3.11 results -### Performance Comparison (as of 2.1.0) +### Performance Comparison (as of 2.0.1) ## Compilation time Algorithm | python | pythran_gnu | pythran_intel | numba | pyccel_gnu_c | pyccel_gnu_fortran | pyccel_intel_c | pyccel_intel_fortran ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- -Ackermann | - | - | - | 0.30 | 1.39 | 1.42 | 1.46 | 1.55 -Bellman Ford | - | - | - | 1.01 | 26.15 | 1.59 | 30.04 | 1.71 -Dijkstra | - | - | - | 1.10 | 26.21 | 1.67 | 30.02 | 1.81 -Euler | - | - | - | 3.30 | 26.06 | 1.53 | 29.67 | 1.66 -Midpoint Explicit | - | - | - | 3.70 | 26.35 | 1.76 | 30.16 | 1.86 -Midpoint Fixed | - | - | - | 3.87 | 26.29 | 1.80 | 29.99 | 1.93 -RK4 | - | - | - | 3.91 | 26.98 | 2.23 | 30.83 | 2.34 -FD - L Convection | - | - | - | 2.48 | 26.06 | 1.48 | 29.86 | 1.65 -FD - NL Convection | - | - | - | 2.62 | 26.32 | 1.51 | 30.27 | 1.62 -FD - Poisson | - | - | - | 4.14 | 26.30 | 1.86 | 30.92 | 2.05 -FD - Laplace | - | - | - | 5.44 | 26.57 | 1.95 | 30.31 | 2.09 -M-D | - | - | - | 6.41 | 26.90 | 2.53 | 30.66 | 2.71 -Splines | - | - | - | 0.66 | 26.20 | 1.80 | 30.01 | 1.95 +Ackermann | - | 2.34 | 2.13 | 0.29 | 1.39 | 1.40 | 1.36 | 1.44 +Bellman Ford | - | 3.44 | 3.64 | 0.97 | 1.65 | 1.52 | 1.58 | 1.58 +Dijkstra | - | 2.37 | 2.67 | 1.23 | 1.77 | 1.63 | 1.66 | 1.72 +Euler | - | 2.68 | 3.02 | 3.43 | 1.61 | 1.51 | 1.57 | 1.54 +Midpoint Explicit | - | 3.00 | 3.40 | 3.69 | 1.83 | 1.75 | 1.78 | 1.78 +Midpoint Fixed | - | 3.34 | 3.74 | 3.75 | 1.98 | 1.83 | 1.82 | 1.83 +RK4 | - | 3.50 | 3.96 | 3.85 | 2.26 | 2.18 | 2.18 | 2.19 +FD - L Convection | - | 2.34 | 2.60 | 2.53 | 1.57 | 1.45 | 1.51 | 1.52 +FD - NL Convection | - | 3.30 | 3.59 | 2.58 | 1.55 | 1.49 | 1.50 | 1.50 +FD - Poisson | - | 3.38 | 3.70 | 5.65 | 1.68 | 1.73 | 1.65 | 1.88 +FD - Laplace | - | 6.99 | 7.55 | 7.27 | 1.96 | 1.88 | 1.83 | 1.94 +M-D | - | 6.35 | 6.25 | 8.66 | 2.41 | 2.50 | 2.30 | 2.59 +Splines | - | - | - | 0.60 | 1.81 | 1.74 | 1.71 | 1.85 ## Execution time Algorithm | python | pythran_gnu | pythran_intel | numba | pyccel_gnu_c | pyccel_gnu_fortran | pyccel_intel_c | pyccel_intel_fortran ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- -Ackermann (ms) | 448.00 $\pm$ 22.00 | - | - | 9.53 $\pm$ 0.40 | 1.30 $\pm$ 0.02 | 1.37 $\pm$ 0.02 | 4.07 $\pm$ 0.04 | 7.43 $\pm$ 0.04 -Bellman Ford (ms) | 1710.00 $\pm$ 10.00 | - | - | 4.06 $\pm$ 0.03 | 4.20 $\pm$ 0.10 | 3.24 $\pm$ 0.02 | 5.29 $\pm$ 0.11 | 4.19 $\pm$ 0.02 -Dijkstra (ms) | 4920.00 $\pm$ 30.00 | - | - | 22.70 $\pm$ 1.40 | 40.50 $\pm$ 0.80 | 20.50 $\pm$ 0.50 | 49.20 $\pm$ 0.60 | 22.50 $\pm$ 0.70 -Euler (ms) | 3320.00 $\pm$ 30.00 | - | - | 35.30 $\pm$ 0.40 | 22.30 $\pm$ 0.40 | 10.90 $\pm$ 0.30 | 24.40 $\pm$ 0.50 | 15.40 $\pm$ 0.40 -Midpoint Explicit (ms) | 6770.00 $\pm$ 60.00 | - | - | 70.30 $\pm$ 11.50 | 41.30 $\pm$ 4.50 | 19.00 $\pm$ 0.40 | 43.90 $\pm$ 0.50 | 16.40 $\pm$ 0.70 -Midpoint Fixed (ms) | 34400.00 $\pm$ 600.00 | - | - | 308.00 $\pm$ 3.00 | 183.00 $\pm$ 1.00 | 73.00 $\pm$ 1.40 | 195.00 $\pm$ 1.00 | 55.10 $\pm$ 0.50 -RK4 (ms) | 16700.00 $\pm$ 100.00 | - | - | 123.00 $\pm$ 1.00 | 91.40 $\pm$ 1.20 | 32.10 $\pm$ 0.40 | 97.00 $\pm$ 1.80 | 27.90 $\pm$ 0.60 -FD - L Convection (ms) | 2130.00 $\pm$ 20.00 | - | - | 2.85 $\pm$ 0.02 | 6.00 $\pm$ 0.11 | 1.64 $\pm$ 0.01 | 8.27 $\pm$ 0.19 | 1.52 $\pm$ 0.03 -FD - NL Convection (ms) | 2670.00 $\pm$ 30.00 | - | - | 2.94 $\pm$ 0.05 | 5.27 $\pm$ 0.09 | 1.58 $\pm$ 0.06 | 8.37 $\pm$ 0.23 | 1.52 $\pm$ 0.01 -FD - Poisson (ms) | 5910.00 $\pm$ 110.00 | - | - | 6.62 $\pm$ 0.05 | 10.30 $\pm$ 0.10 | 2.62 $\pm$ 0.04 | 18.80 $\pm$ 0.10 | 2.55 $\pm$ 0.02 -FD - Laplace (ms) | 628.00 $\pm$ 9.00 | - | - | 190.00 $\pm$ 1.00 | 205.00 $\pm$ 1.00 | 61.80 $\pm$ 0.70 | 374.00 $\pm$ 5.00 | 59.80 $\pm$ 0.50 -M-D (ms) | 14500.00 $\pm$ 100.00 | - | - | 56.90 $\pm$ 0.20 | 105.00 $\pm$ 0.00 | 62.40 $\pm$ 0.30 | 91.20 $\pm$ 0.10 | 90.40 $\pm$ 0.40 -Splines (ms) | 1690.00 $\pm$ 30.00 | - | - | 18.10 $\pm$ 0.10 | 14.30 $\pm$ 0.50 | 17.70 $\pm$ 0.00 | 15.20 $\pm$ 0.10 | 27.90 $\pm$ 0.20 +Ackermann (ms) | 436.00 $\pm$ 9.00 | 2.93 $\pm$ 0.03 | 3.07 $\pm$ 0.03 | 10.70 $\pm$ 0.30 | 1.24 $\pm$ 0.01 | 1.32 $\pm$ 0.00 | 4.09 $\pm$ 0.12 | 9.07 $\pm$ 0.22 +Bellman Ford (ms) | 1700.00 $\pm$ 10.00 | 5.29 $\pm$ 0.08 | 3.52 $\pm$ 0.05 | 3.86 $\pm$ 0.06 | 3.84 $\pm$ 0.01 | 3.25 $\pm$ 0.03 | 5.85 $\pm$ 0.02 | 4.45 $\pm$ 0.02 +Dijkstra (ms) | 4840.00 $\pm$ 40.00 | 21.30 $\pm$ 0.30 | 17.70 $\pm$ 0.40 | 20.40 $\pm$ 0.60 | 64.70 $\pm$ 0.30 | 19.50 $\pm$ 0.20 | 66.30 $\pm$ 0.60 | 22.90 $\pm$ 0.70 +Euler (ms) | 3360.00 $\pm$ 20.00 | 25.60 $\pm$ 0.30 | 25.80 $\pm$ 0.40 | 36.60 $\pm$ 0.30 | 27.30 $\pm$ 0.40 | 11.10 $\pm$ 0.50 | 27.40 $\pm$ 0.40 | 15.40 $\pm$ 0.40 +Midpoint Explicit (ms) | 6920.00 $\pm$ 80.00 | 52.50 $\pm$ 3.80 | 51.20 $\pm$ 1.70 | 70.20 $\pm$ 0.90 | 45.10 $\pm$ 0.30 | 19.50 $\pm$ 0.50 | 47.00 $\pm$ 0.60 | 16.80 $\pm$ 0.40 +Midpoint Fixed (ms) | 34700.00 $\pm$ 200.00 | 267.00 $\pm$ 2.00 | 92.70 $\pm$ 0.50 | 322.00 $\pm$ 2.00 | 191.00 $\pm$ 1.00 | 73.00 $\pm$ 1.20 | 199.00 $\pm$ 1.00 | 52.10 $\pm$ 2.40 +RK4 (ms) | 17100.00 $\pm$ 100.00 | 154.00 $\pm$ 3.00 | 35.90 $\pm$ 0.60 | 132.00 $\pm$ 15.00 | 96.10 $\pm$ 1.60 | 32.10 $\pm$ 0.20 | 98.00 $\pm$ 7.40 | 28.10 $\pm$ 0.40 +FD - L Convection (ms) | 2130.00 $\pm$ 20.00 | 1.52 $\pm$ 0.03 | 1.63 $\pm$ 0.04 | 5.65 $\pm$ 0.03 | 7.42 $\pm$ 0.04 | 1.61 $\pm$ 0.14 | 7.72 $\pm$ 0.08 | 1.36 $\pm$ 0.05 +FD - NL Convection (ms) | 2650.00 $\pm$ 40.00 | 2.00 $\pm$ 0.02 | 1.80 $\pm$ 0.03 | 5.67 $\pm$ 0.02 | 6.72 $\pm$ 0.05 | 1.56 $\pm$ 0.07 | 8.11 $\pm$ 0.16 | 1.40 $\pm$ 0.03 +FD - Poisson (ms) | 5910.00 $\pm$ 100.00 | 2.95 $\pm$ 0.11 | 5.42 $\pm$ 0.05 | 6.85 $\pm$ 0.10 | 16.10 $\pm$ 0.00 | 2.61 $\pm$ 0.03 | 24.00 $\pm$ 0.10 | 2.55 $\pm$ 0.03 +FD - Laplace (ms) | 634.00 $\pm$ 4.00 | 67.80 $\pm$ 0.90 | 128.00 $\pm$ 1.00 | 282.00 $\pm$ 8.00 | 479.00 $\pm$ 1.00 | 61.80 $\pm$ 0.60 | 663.00 $\pm$ 1.00 | 60.70 $\pm$ 0.60 +M-D (ms) | 14500.00 $\pm$ 100.00 | 35.80 $\pm$ 0.20 | 52.50 $\pm$ 0.40 | 60.50 $\pm$ 1.20 | 117.00 $\pm$ 0.00 | 62.30 $\pm$ 0.30 | 61.90 $\pm$ 0.10 | 89.40 $\pm$ 0.10 +Splines (ms) | 1690.00 $\pm$ 20.00 | - | - | 18.40 $\pm$ 0.10 | 14.50 $\pm$ 0.10 | 17.70 $\pm$ 0.10 | 15.30 $\pm$ 0.10 | 27.80 $\pm$ 0.30 ![Python 3.11 compilation results](./version_specific_results/pypi_performance_311_compilation.svg) ![Python 3.11 execution results](./version_specific_results/pypi_performance_311_execution.svg) ## Python 3.12 results -### Performance Comparison (as of 2.1.0) +### Performance Comparison (as of 2.0.1) ## Compilation time Algorithm | python | pythran_gnu | pythran_intel | numba | pyccel_gnu_c | pyccel_gnu_fortran | pyccel_intel_c | pyccel_intel_fortran ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- -Ackermann | - | - | - | 0.32 | 1.47 | 1.50 | 1.49 | 1.56 -Bellman Ford | - | - | - | 1.09 | 26.28 | 1.60 | 29.98 | 1.71 -Dijkstra | - | - | - | 1.15 | 26.46 | 1.71 | 29.96 | 1.84 -Euler | - | - | - | 3.29 | 26.24 | 1.57 | 29.90 | 1.69 -Midpoint Explicit | - | - | - | 3.71 | 26.51 | 1.83 | 30.05 | 1.93 -Midpoint Fixed | - | - | - | 3.74 | 26.59 | 1.92 | 30.25 | 2.01 -RK4 | - | - | - | 3.78 | 26.99 | 2.31 | 30.64 | 2.40 -FD - L Convection | - | - | - | 2.53 | 26.40 | 1.54 | 29.73 | 1.64 -FD - NL Convection | - | - | - | 2.63 | 26.18 | 1.55 | 29.77 | 1.65 -FD - Poisson | - | - | - | 4.18 | 26.40 | 1.81 | 29.90 | 2.06 -FD - Laplace | - | - | - | 5.45 | 26.67 | 2.01 | 30.08 | 2.11 -M-D | - | - | - | 6.48 | 27.30 | 2.73 | 31.27 | 2.80 -Splines | - | - | - | 0.72 | 26.55 | 1.84 | 30.05 | 1.98 +Ackermann | - | 2.03 | 2.05 | 0.29 | 1.42 | 1.48 | 1.39 | 1.46 +Bellman Ford | - | 3.39 | 3.62 | 0.99 | 1.70 | 1.59 | 1.62 | 1.61 +Dijkstra | - | 2.29 | 2.61 | 1.25 | 1.76 | 1.66 | 1.68 | 1.72 +Euler | - | 2.58 | 2.96 | 3.21 | 1.65 | 1.54 | 1.62 | 1.60 +Midpoint Explicit | - | 2.92 | 3.34 | 3.52 | 1.89 | 1.76 | 1.80 | 1.81 +Midpoint Fixed | - | 3.29 | 3.84 | 3.71 | 2.00 | 1.85 | 1.92 | 1.88 +RK4 | - | 3.45 | 3.94 | 3.66 | 2.35 | 2.28 | 2.25 | 2.32 +FD - L Convection | - | 2.26 | 2.62 | 2.52 | 1.61 | 1.51 | 1.55 | 1.56 +FD - NL Convection | - | 3.23 | 3.57 | 2.48 | 1.60 | 1.54 | 1.57 | 1.56 +FD - Poisson | - | 3.49 | 3.72 | 5.66 | 1.76 | 1.79 | 1.71 | 1.94 +FD - Laplace | - | 6.91 | 7.61 | 7.07 | 2.04 | 2.10 | 1.90 | 2.00 +M-D | - | 6.52 | 6.38 | 8.65 | 2.50 | 2.64 | 2.38 | 2.72 +Splines | - | - | - | 0.67 | 1.88 | 1.84 | 1.79 | 1.91 ## Execution time Algorithm | python | pythran_gnu | pythran_intel | numba | pyccel_gnu_c | pyccel_gnu_fortran | pyccel_intel_c | pyccel_intel_fortran ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- -Ackermann (ms) | 444.00 $\pm$ 10.00 | - | - | 9.22 $\pm$ 0.44 | 1.34 $\pm$ 0.02 | 1.28 $\pm$ 0.02 | 3.71 $\pm$ 0.02 | 9.78 $\pm$ 0.46 -Bellman Ford (ms) | 2130.00 $\pm$ 20.00 | - | - | 4.10 $\pm$ 0.18 | 4.67 $\pm$ 0.02 | 3.24 $\pm$ 0.02 | 5.15 $\pm$ 0.02 | 3.83 $\pm$ 0.02 -Dijkstra (ms) | 5870.00 $\pm$ 70.00 | - | - | 20.60 $\pm$ 1.00 | 37.80 $\pm$ 0.60 | 18.20 $\pm$ 0.20 | 47.10 $\pm$ 0.40 | 21.50 $\pm$ 0.40 -Euler (ms) | 3880.00 $\pm$ 40.00 | - | - | 35.90 $\pm$ 0.20 | 22.50 $\pm$ 0.40 | 11.20 $\pm$ 0.60 | 24.20 $\pm$ 0.40 | 14.80 $\pm$ 0.20 -Midpoint Explicit (ms) | 7870.00 $\pm$ 60.00 | - | - | 68.50 $\pm$ 0.60 | 39.80 $\pm$ 0.40 | 19.30 $\pm$ 0.30 | 44.20 $\pm$ 0.50 | 16.10 $\pm$ 0.40 -Midpoint Fixed (ms) | 38900.00 $\pm$ 300.00 | - | - | 311.00 $\pm$ 2.00 | 183.00 $\pm$ 0.00 | 73.20 $\pm$ 1.20 | 203.00 $\pm$ 26.00 | 51.00 $\pm$ 0.30 -RK4 (ms) | 19800.00 $\pm$ 400.00 | - | - | 124.00 $\pm$ 2.00 | 89.60 $\pm$ 0.90 | 32.40 $\pm$ 0.30 | 96.00 $\pm$ 5.00 | 27.90 $\pm$ 0.60 -FD - L Convection (ms) | 2390.00 $\pm$ 60.00 | - | - | 2.86 $\pm$ 0.06 | 5.83 $\pm$ 0.10 | 1.65 $\pm$ 0.06 | 8.09 $\pm$ 0.11 | 1.33 $\pm$ 0.06 -FD - NL Convection (ms) | 2980.00 $\pm$ 20.00 | - | - | 2.96 $\pm$ 0.16 | 5.10 $\pm$ 0.01 | 1.70 $\pm$ 0.11 | 8.21 $\pm$ 0.17 | 1.43 $\pm$ 0.06 -FD - Poisson (ms) | 6630.00 $\pm$ 320.00 | - | - | 6.66 $\pm$ 0.06 | 10.60 $\pm$ 0.30 | 2.60 $\pm$ 0.03 | 18.70 $\pm$ 0.10 | 2.56 $\pm$ 0.04 -FD - Laplace (ms) | 655.00 $\pm$ 15.00 | - | - | 191.00 $\pm$ 1.00 | 205.00 $\pm$ 1.00 | 61.20 $\pm$ 0.70 | 348.00 $\pm$ 1.00 | 60.40 $\pm$ 0.80 -M-D (ms) | 16500.00 $\pm$ 200.00 | - | - | 57.10 $\pm$ 0.30 | 106.00 $\pm$ 0.00 | 62.00 $\pm$ 0.10 | 91.60 $\pm$ 1.20 | 90.20 $\pm$ 0.20 -Splines (ms) | 1970.00 $\pm$ 40.00 | - | - | 17.80 $\pm$ 0.10 | 14.20 $\pm$ 0.10 | 17.70 $\pm$ 0.00 | 15.50 $\pm$ 0.60 | 27.70 $\pm$ 0.20 +Ackermann (ms) | 450.00 $\pm$ 10.00 | 2.74 $\pm$ 0.01 | 3.97 $\pm$ 0.02 | 10.80 $\pm$ 0.30 | 1.30 $\pm$ 0.02 | 1.37 $\pm$ 0.04 | 3.73 $\pm$ 0.04 | 9.08 $\pm$ 0.47 +Bellman Ford (ms) | 2310.00 $\pm$ 60.00 | 4.55 $\pm$ 0.05 | 3.51 $\pm$ 0.06 | 3.91 $\pm$ 0.07 | 3.85 $\pm$ 0.02 | 3.25 $\pm$ 0.03 | 5.93 $\pm$ 0.07 | 4.41 $\pm$ 0.02 +Dijkstra (ms) | 5980.00 $\pm$ 50.00 | 22.00 $\pm$ 0.60 | 18.70 $\pm$ 0.50 | 20.80 $\pm$ 0.60 | 68.80 $\pm$ 1.20 | 20.90 $\pm$ 0.40 | 70.10 $\pm$ 1.30 | 24.00 $\pm$ 0.70 +Euler (ms) | 3910.00 $\pm$ 30.00 | 25.60 $\pm$ 0.50 | 26.20 $\pm$ 0.80 | 36.70 $\pm$ 0.40 | 27.00 $\pm$ 0.50 | 11.00 $\pm$ 0.30 | 27.20 $\pm$ 1.20 | 15.00 $\pm$ 0.40 +Midpoint Explicit (ms) | 7930.00 $\pm$ 60.00 | 53.30 $\pm$ 5.10 | 51.40 $\pm$ 2.00 | 70.70 $\pm$ 3.10 | 44.70 $\pm$ 0.50 | 18.80 $\pm$ 0.20 | 45.90 $\pm$ 0.40 | 16.10 $\pm$ 0.40 +Midpoint Fixed (ms) | 39400.00 $\pm$ 1100.00 | 268.00 $\pm$ 3.00 | 94.10 $\pm$ 1.50 | 327.00 $\pm$ 2.00 | 190.00 $\pm$ 3.00 | 73.00 $\pm$ 0.30 | 198.00 $\pm$ 0.00 | 51.40 $\pm$ 0.30 +RK4 (ms) | 19800.00 $\pm$ 100.00 | 155.00 $\pm$ 3.00 | 35.80 $\pm$ 0.50 | 134.00 $\pm$ 14.00 | 95.90 $\pm$ 1.10 | 32.40 $\pm$ 0.80 | 91.20 $\pm$ 0.70 | 27.90 $\pm$ 0.40 +FD - L Convection (ms) | 2530.00 $\pm$ 20.00 | 1.48 $\pm$ 0.08 | 1.65 $\pm$ 0.05 | 5.65 $\pm$ 0.02 | 6.84 $\pm$ 0.13 | 1.54 $\pm$ 0.04 | 7.55 $\pm$ 0.10 | 1.33 $\pm$ 0.03 +FD - NL Convection (ms) | 3160.00 $\pm$ 30.00 | 1.91 $\pm$ 0.05 | 1.69 $\pm$ 0.02 | 5.87 $\pm$ 0.16 | 6.87 $\pm$ 0.16 | 1.59 $\pm$ 0.10 | 8.19 $\pm$ 0.16 | 1.54 $\pm$ 0.06 +FD - Poisson (ms) | 6850.00 $\pm$ 130.00 | 2.94 $\pm$ 0.14 | 5.53 $\pm$ 0.18 | 6.94 $\pm$ 0.15 | 16.10 $\pm$ 0.00 | 2.60 $\pm$ 0.03 | 24.10 $\pm$ 0.40 | 2.56 $\pm$ 0.04 +FD - Laplace (ms) | 656.00 $\pm$ 23.00 | 67.60 $\pm$ 0.60 | 105.00 $\pm$ 1.00 | 282.00 $\pm$ 8.00 | 494.00 $\pm$ 6.00 | 62.00 $\pm$ 0.60 | 670.00 $\pm$ 6.00 | 59.70 $\pm$ 0.60 +M-D (ms) | 16800.00 $\pm$ 200.00 | 34.30 $\pm$ 0.20 | 50.00 $\pm$ 0.10 | 60.50 $\pm$ 0.90 | 119.00 $\pm$ 13.00 | 62.40 $\pm$ 0.20 | 61.30 $\pm$ 0.20 | 89.00 $\pm$ 0.20 +Splines (ms) | 2000.00 $\pm$ 30.00 | - | - | 18.40 $\pm$ 0.10 | 14.30 $\pm$ 0.00 | 17.70 $\pm$ 0.00 | 15.40 $\pm$ 0.30 | 27.90 $\pm$ 0.10 ![Python 3.12 compilation results](./version_specific_results/pypi_performance_312_compilation.svg) ![Python 3.12 execution results](./version_specific_results/pypi_performance_312_execution.svg) ## Python 3.13 results -### Performance Comparison (as of 2.1.0) +### Performance Comparison (as of 2.0.1) ## Compilation time Algorithm | python | pythran_gnu | pythran_intel | numba | pyccel_gnu_c | pyccel_gnu_fortran | pyccel_intel_c | pyccel_intel_fortran ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- -Ackermann | - | - | - | 0.29 | 1.39 | 1.41 | 1.45 | 1.50 -Bellman Ford | - | - | - | 1.03 | 25.86 | 1.55 | 29.43 | 1.66 -Dijkstra | - | - | - | 1.09 | 26.00 | 1.66 | 29.58 | 1.79 -Euler | - | - | - | 3.07 | 25.82 | 1.54 | 29.38 | 1.65 -Midpoint Explicit | - | - | - | 3.42 | 26.05 | 1.75 | 29.60 | 1.84 -Midpoint Fixed | - | - | - | 3.57 | 26.16 | 1.82 | 29.72 | 1.94 -RK4 | - | - | - | 3.57 | 26.47 | 2.22 | 30.04 | 2.30 -FD - L Convection | - | - | - | 2.43 | 25.76 | 1.50 | 29.44 | 1.61 -FD - NL Convection | - | - | - | 2.52 | 25.78 | 1.50 | 29.37 | 1.60 -FD - Poisson | - | - | - | 3.94 | 25.94 | 1.77 | 29.54 | 2.00 -FD - Laplace | - | - | - | 5.10 | 26.17 | 1.91 | 29.69 | 2.03 -M-D | - | - | - | 5.99 | 26.59 | 2.51 | 30.21 | 2.69 -Splines | - | - | - | 0.70 | 26.01 | 1.78 | 29.61 | 1.93 +Ackermann | - | 1.97 | 1.99 | 0.27 | 1.36 | 1.41 | 1.37 | 1.42 +Bellman Ford | - | 3.23 | 3.51 | 0.95 | 1.65 | 1.53 | 1.58 | 1.57 +Dijkstra | - | 2.21 | 2.51 | 1.21 | 1.73 | 1.61 | 1.66 | 1.69 +Euler | - | 2.48 | 2.86 | 3.12 | 1.61 | 1.50 | 1.56 | 1.55 +Midpoint Explicit | - | 2.82 | 3.23 | 3.37 | 1.81 | 1.71 | 1.76 | 1.74 +Midpoint Fixed | - | 3.17 | 3.56 | 3.50 | 1.90 | 1.78 | 1.82 | 1.83 +RK4 | - | 3.30 | 3.78 | 3.51 | 2.26 | 2.18 | 2.17 | 2.19 +FD - L Convection | - | 2.19 | 2.54 | 2.40 | 1.57 | 1.47 | 1.51 | 1.52 +FD - NL Convection | - | 3.11 | 3.43 | 2.42 | 1.57 | 1.47 | 1.52 | 1.51 +FD - Poisson | - | 3.28 | 3.56 | 5.50 | 1.71 | 1.75 | 1.65 | 1.90 +FD - Laplace | - | 6.63 | 7.41 | 6.87 | 1.94 | 1.89 | 1.83 | 1.96 +M-D | - | 5.97 | 5.99 | 8.12 | 2.36 | 2.51 | 2.24 | 2.56 +Splines | - | - | - | 0.66 | 1.78 | 1.74 | 1.72 | 1.84 ## Execution time Algorithm | python | pythran_gnu | pythran_intel | numba | pyccel_gnu_c | pyccel_gnu_fortran | pyccel_intel_c | pyccel_intel_fortran ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- -Ackermann (ms) | 446.00 $\pm$ 6.00 | - | - | 9.19 $\pm$ 0.53 | 1.33 $\pm$ 0.00 | 1.32 $\pm$ 0.01 | 3.70 $\pm$ 0.01 | 9.50 $\pm$ 0.28 -Bellman Ford (ms) | 2120.00 $\pm$ 40.00 | - | - | 4.05 $\pm$ 0.02 | 4.69 $\pm$ 0.03 | 3.26 $\pm$ 0.03 | 5.19 $\pm$ 0.01 | 4.17 $\pm$ 0.01 -Dijkstra (ms) | 5320.00 $\pm$ 30.00 | - | - | 19.90 $\pm$ 0.40 | 36.60 $\pm$ 0.50 | 17.60 $\pm$ 0.30 | 46.20 $\pm$ 0.30 | 20.20 $\pm$ 0.10 -Euler (ms) | 3860.00 $\pm$ 80.00 | - | - | 35.90 $\pm$ 0.30 | 22.20 $\pm$ 0.30 | 10.90 $\pm$ 0.40 | 24.00 $\pm$ 0.50 | 14.80 $\pm$ 0.40 -Midpoint Explicit (ms) | 7840.00 $\pm$ 80.00 | - | - | 67.70 $\pm$ 0.40 | 39.60 $\pm$ 0.40 | 18.80 $\pm$ 0.30 | 43.80 $\pm$ 0.50 | 15.80 $\pm$ 0.40 -Midpoint Fixed (ms) | 39000.00 $\pm$ 300.00 | - | - | 315.00 $\pm$ 15.00 | 183.00 $\pm$ 0.00 | 72.50 $\pm$ 1.20 | 195.00 $\pm$ 1.00 | 50.60 $\pm$ 0.60 -RK4 (ms) | 19500.00 $\pm$ 100.00 | - | - | 125.00 $\pm$ 1.00 | 88.70 $\pm$ 0.60 | 31.80 $\pm$ 0.40 | 93.20 $\pm$ 0.40 | 28.60 $\pm$ 1.40 -FD - L Convection (ms) | 2690.00 $\pm$ 20.00 | - | - | 2.85 $\pm$ 0.06 | 5.79 $\pm$ 0.01 | 1.56 $\pm$ 0.06 | 8.17 $\pm$ 0.15 | 1.35 $\pm$ 0.05 -FD - NL Convection (ms) | 3380.00 $\pm$ 70.00 | - | - | 2.92 $\pm$ 0.10 | 5.09 $\pm$ 0.02 | 1.67 $\pm$ 0.06 | 8.18 $\pm$ 0.16 | 1.37 $\pm$ 0.02 -FD - Poisson (ms) | 6730.00 $\pm$ 100.00 | - | - | 6.59 $\pm$ 0.03 | 10.60 $\pm$ 0.00 | 2.59 $\pm$ 0.04 | 23.50 $\pm$ 0.50 | 2.50 $\pm$ 0.02 -FD - Laplace (ms) | 639.00 $\pm$ 7.00 | - | - | 189.00 $\pm$ 1.00 | 205.00 $\pm$ 1.00 | 56.30 $\pm$ 0.40 | 350.00 $\pm$ 1.00 | 54.90 $\pm$ 0.20 -M-D (ms) | 16000.00 $\pm$ 100.00 | - | - | 59.20 $\pm$ 7.00 | 106.00 $\pm$ 0.00 | 62.20 $\pm$ 0.20 | 94.50 $\pm$ 9.40 | 90.50 $\pm$ 0.10 -Splines (ms) | 2030.00 $\pm$ 30.00 | - | - | 18.10 $\pm$ 0.20 | 14.10 $\pm$ 0.10 | 17.70 $\pm$ 0.00 | 15.30 $\pm$ 0.10 | 27.70 $\pm$ 0.10 +Ackermann (ms) | 444.00 $\pm$ 8.00 | 2.70 $\pm$ 0.02 | 3.96 $\pm$ 0.01 | 10.70 $\pm$ 0.30 | 1.28 $\pm$ 0.01 | 1.23 $\pm$ 0.00 | 4.36 $\pm$ 0.00 | 10.40 $\pm$ 0.30 +Bellman Ford (ms) | 2120.00 $\pm$ 50.00 | 4.52 $\pm$ 0.02 | 3.53 $\pm$ 0.12 | 3.88 $\pm$ 0.05 | 3.72 $\pm$ 0.03 | 3.25 $\pm$ 0.02 | 5.89 $\pm$ 0.02 | 4.20 $\pm$ 0.02 +Dijkstra (ms) | 5330.00 $\pm$ 40.00 | 20.40 $\pm$ 0.10 | 17.20 $\pm$ 0.20 | 19.40 $\pm$ 0.50 | 66.60 $\pm$ 0.10 | 19.30 $\pm$ 0.10 | 67.30 $\pm$ 0.20 | 21.70 $\pm$ 0.20 +Euler (ms) | 3910.00 $\pm$ 30.00 | 25.40 $\pm$ 0.50 | 25.40 $\pm$ 0.30 | 36.40 $\pm$ 0.20 | 26.80 $\pm$ 0.40 | 10.80 $\pm$ 0.30 | 26.70 $\pm$ 0.30 | 15.30 $\pm$ 0.40 +Midpoint Explicit (ms) | 8040.00 $\pm$ 90.00 | 51.30 $\pm$ 0.60 | 51.60 $\pm$ 2.00 | 69.40 $\pm$ 0.50 | 44.60 $\pm$ 0.40 | 18.90 $\pm$ 0.40 | 45.90 $\pm$ 0.40 | 15.90 $\pm$ 0.20 +Midpoint Fixed (ms) | 39800.00 $\pm$ 500.00 | 274.00 $\pm$ 23.00 | 92.70 $\pm$ 0.70 | 331.00 $\pm$ 12.00 | 190.00 $\pm$ 1.00 | 72.70 $\pm$ 1.40 | 198.00 $\pm$ 1.00 | 53.10 $\pm$ 0.70 +RK4 (ms) | 20000.00 $\pm$ 200.00 | 157.00 $\pm$ 4.00 | 35.50 $\pm$ 0.40 | 126.00 $\pm$ 1.00 | 95.10 $\pm$ 1.00 | 31.60 $\pm$ 0.40 | 90.60 $\pm$ 0.50 | 27.70 $\pm$ 0.20 +FD - L Convection (ms) | 2780.00 $\pm$ 40.00 | 1.45 $\pm$ 0.05 | 1.64 $\pm$ 0.03 | 5.64 $\pm$ 0.00 | 6.69 $\pm$ 0.05 | 1.53 $\pm$ 0.06 | 7.43 $\pm$ 0.05 | 1.54 $\pm$ 0.03 +FD - NL Convection (ms) | 3480.00 $\pm$ 40.00 | 1.88 $\pm$ 0.06 | 1.69 $\pm$ 0.03 | 5.67 $\pm$ 0.02 | 6.72 $\pm$ 0.05 | 1.68 $\pm$ 0.07 | 8.14 $\pm$ 0.21 | 1.38 $\pm$ 0.04 +FD - Poisson (ms) | 6840.00 $\pm$ 220.00 | 3.03 $\pm$ 0.24 | 5.43 $\pm$ 0.03 | 6.88 $\pm$ 0.11 | 16.10 $\pm$ 0.20 | 2.59 $\pm$ 0.03 | 23.90 $\pm$ 0.10 | 2.52 $\pm$ 0.02 +FD - Laplace (ms) | 640.00 $\pm$ 3.00 | 62.90 $\pm$ 0.30 | 103.00 $\pm$ 1.00 | 279.00 $\pm$ 9.00 | 477.00 $\pm$ 1.00 | 56.60 $\pm$ 0.70 | 663.00 $\pm$ 1.00 | 55.20 $\pm$ 0.40 +M-D (ms) | 16500.00 $\pm$ 100.00 | 35.60 $\pm$ 2.30 | 50.00 $\pm$ 0.30 | 60.20 $\pm$ 0.10 | 114.00 $\pm$ 0.00 | 62.00 $\pm$ 0.20 | 61.50 $\pm$ 0.50 | 89.30 $\pm$ 0.10 +Splines (ms) | 2020.00 $\pm$ 30.00 | - | - | 18.40 $\pm$ 0.20 | 14.30 $\pm$ 0.00 | 17.80 $\pm$ 0.10 | 15.50 $\pm$ 0.60 | 27.50 $\pm$ 0.00 ![Python 3.13 compilation results](./version_specific_results/pypi_performance_313_compilation.svg) ![Python 3.13 execution results](./version_specific_results/pypi_performance_313_execution.svg) diff --git a/benchmarks/run_benchmarks.py b/benchmarks/run_benchmarks.py index ad8bf555..00b42ee3 100644 --- a/benchmarks/run_benchmarks.py +++ b/benchmarks/run_benchmarks.py @@ -32,6 +32,7 @@ help="Don't time the execution step") parser.add_argument('--pypy', action='store_true', help='Run test cases with pypy') parser.add_argument('--no_numba', action='store_true', help="Don't run numba tests") +parser.add_argument('--no_jax', action='store_true', help="Don't run jax tests") parser.add_argument('--pythran-config-files', type=str, nargs='*', help='Provide configuration files for pythran', default = []) parser.add_argument('--pyccel-config-files', type=str, nargs='*', help='Provide configuration files for pyccel', default = []) parser.add_argument('--output', choices=('latex', 'markdown'), \ @@ -61,6 +62,9 @@ if not args.no_numba: test_cases.append('numba') test_case_names.append('numba') +if not args.no_jax: + test_cases.append('jax') + test_case_names.append('jax') n_configs = 0 for i,f in enumerate(pyccel_configs): name = os.path.splitext(os.path.basename(f))[0] @@ -205,11 +209,16 @@ def run_process(cmd: "List[str]", time_compilation: "bool"=False, env = None): numba_testname = 'numba_'+testname numba_test_file = os.path.join(os.path.dirname(test_file), numba_basename) + jax_basename = 'jax_'+basename + jax_testname = 'jax_'+testname + jax_test_file = os.path.join(os.path.dirname(test_file), jax_basename) + new_folder = os.path.join('tmp',t.imports[0]) os.makedirs(new_folder, exist_ok=True) shutil.copyfile(test_file, os.path.join(new_folder, basename)) shutil.copyfile(numba_test_file, os.path.join(new_folder, numba_basename)) + shutil.copyfile(jax_test_file, os.path.join(new_folder, jax_basename)) os.chdir(new_folder) import_funcs = ', '.join(t.imports) @@ -221,9 +230,13 @@ def run_process(cmd: "List[str]", time_compilation: "bool"=False, env = None): run_units = [] for case in test_cases: - setup_cmd = 'from {testname} import {funcs};'.format( - testname = numba_testname if case == 'numba' else testname, - funcs = import_funcs) + if case == 'numba': + chosen_testname = numba_testname + elif case == 'jax': + chosen_testname = jax_testname + else: + chosen_testname = testname + setup_cmd = f'from {chosen_testname} import {import_funcs};' setup_cmd += t.setup.replace('\n','') print("-------------------", file=log_file, flush=True) print(" ",case, file=log_file, flush=True) @@ -264,8 +277,8 @@ def run_process(cmd: "List[str]", time_compilation: "bool"=False, env = None): print("Compilation CPU time : ", cpu_time, file=log_file) comp_times.append('{:.2f}'.format(float(cpu_time))) - elif time_compilation and case == "numba": - cmd = ['pypy'] if case=='pypy' else ['python3'] + elif time_compilation and case in ("numba", "jax"): + cmd = ['pypy'] if case=='pypy' else [sys.executable] run_str = "{setup}import resource; t0 = resource.getrusage(resource.RUSAGE_SELF); {run}; t1 = resource.getrusage(resource.RUSAGE_SELF); {run}; t2 = resource.getrusage(resource.RUSAGE_SELF); print(2*t1.ru_utime-t0.ru_utime-t2.ru_utime + 2*t1.ru_stime-t0.ru_stime-t2.ru_stime)".format( setup=setup_cmd, run=exec_cmd) @@ -291,7 +304,7 @@ def run_process(cmd: "List[str]", time_compilation: "bool"=False, env = None): comp_times.append('-') if time_execution: - cmd = ['pypy'] if case=='pypy' else ['python3'] + cmd = ['pypy'] if case=='pypy' else [sys.executable] cmd += ['-m'] + timeit_cmd + ['-s', setup_cmd, exec_cmd] if verbose: @@ -315,9 +328,7 @@ def run_process(cmd: "List[str]", time_compilation: "bool"=False, env = None): stddev = float(r.group(3)) units = r.group(2) - bench_str = '{mean:.2f} $\pm$ {stddev:.2f}'.format( - mean=mean, - stddev=stddev) + bench_str = rf'{mean:.2f} $\pm$ {stddev:.2f}' run_times.append((mean,stddev)) else: regexp = re.compile(r'([0-9]+) loops?, best of ([0-9]+): ([0-9.]+) (\w*)') @@ -354,9 +365,7 @@ def run_process(cmd: "List[str]", time_compilation: "bool"=False, env = None): row.append('-') else: mean,stddev = time - row.append('{mean:.2f} $\pm$ {stddev:.2f}'.format( - mean=mean*f, - stddev=stddev*f)) + row.append(rf'{mean*f:.2f} $\pm$ {stddev*f:.2f}') else: for time,f in zip(run_times,mult_fact): if time is None: diff --git a/benchmarks/tests/jax_ackermann_mod.py b/benchmarks/tests/jax_ackermann_mod.py new file mode 100644 index 00000000..552ab1fa --- /dev/null +++ b/benchmarks/tests/jax_ackermann_mod.py @@ -0,0 +1,20 @@ +# coding: utf-8 +#------------------------------------------------------------------------------------------# +# This file is part of Pyccel which is released under MIT License. See the LICENSE file or # +# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. # +#------------------------------------------------------------------------------------------# +""" Module containing functions for testing the ackerman algorithm using numba +""" + + + +def ackermann(m : int, n : int) -> int: + """ Total computable function that is not primitive recursive. + This function is useful for testing recursion + """ + if m == 0: + return n + 1 + elif n == 0: + return ackermann(m - 1, 1) + else: + return ackermann(m - 1, ackermann(m, n - 1)) diff --git a/benchmarks/tests/jax_bellman_ford_mod.py b/benchmarks/tests/jax_bellman_ford_mod.py new file mode 100644 index 00000000..48dbfb09 --- /dev/null +++ b/benchmarks/tests/jax_bellman_ford_mod.py @@ -0,0 +1,81 @@ +# coding: utf-8 +#------------------------------------------------------------------------------------------# +# This file is part of Pyccel which is released under MIT License. See the LICENSE file or # +# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. # +#------------------------------------------------------------------------------------------# +""" Module containing functions for testing the Bellman-Ford algorithm using numba +""" + + +import jax.numpy as np + + + +def bellman_ford ( v_num: int, e_num: int, source: int, e: 'int[:,:]', e_weight: 'float[:]', + v_weight: 'float[:]', predecessor: 'int[:]' ): + """ Calculate the shortest paths from a source vertex to all other + vertices in the weighted digraph + """ + + r8_big = 1.0E+14 + + # Step 1: initialize the graph. + for i in range ( 0, v_num ): + v_weight[i] = r8_big + v_weight[source] = 0.0 + + predecessor[:v_num] = -1 + + # Step 2: Relax edges repeatedly. + for i in range ( 1, v_num ): + for j in range ( e_num ): + u = e[1, j] + v = e[0, j] + t = v_weight[u] + e_weight[j] + if ( t < v_weight[v] ): + v_weight[v] = t + predecessor[v] = u + + # Step 3: check for negative-weight cycles + for j in range ( e_num ): + u = e[1, j] + v = e[0, j] + if ( v_weight[u] + e_weight[j] < v_weight[v] ): + print ( '' ) + print ( 'BELLMAN_FORD - Fatal error!' ) + print ( ' Graph contains a cycle with negative weight.' ) + return 1 + + return 0 + + + + +def bellman_ford_test(): + """ Test bellman ford's algorithm + """ + + e_num = 19900 + v_num = 200 + + e = np.zeros((2, e_num), dtype = 'int') + e_weight = np.zeros(e_num, dtype = 'float') + idx = 0 + + for i in range(v_num): + for j in range(v_num): + if i > j: + e[0, idx] = i + e[1, idx] = j + idx += 1 + + for i in range(e_num): + e_weight[i] = np.cos(i) * i + + source = 0 + v_weight = np.zeros(v_num, dtype = 'float') + predecessor = np.zeros(v_num, dtype = 'int') + + bellman_ford(v_num, e_num, source, e, e_weight, v_weight, predecessor) + + return v_weight diff --git a/benchmarks/tests/jax_dijkstra.py b/benchmarks/tests/jax_dijkstra.py new file mode 100644 index 00000000..8781a725 --- /dev/null +++ b/benchmarks/tests/jax_dijkstra.py @@ -0,0 +1,109 @@ +# coding: utf-8 +#------------------------------------------------------------------------------------------# +# This file is part of Pyccel which is released under MIT License. See the LICENSE file or # +# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. # +#------------------------------------------------------------------------------------------# +""" Module containing functions for testing the Dijkstra algorithm using numba +""" + +import jax.numpy as np + +# ================================================================ + +def find_nearest ( nv: int, mind: 'int[:]', connected: 'bool[:]' ): + """ Find the nearest node + """ + + i4_huge = 2147483647 + + d = i4_huge + v = -1 + for i in range ( 0, nv ): + if ( not connected[i] and mind[i] <= d ): + d = mind[i] + v = i + + return d, v + +# ================================================================ + +def update_mind ( nv: int, mv: int, connected: 'bool[:]', ohd: 'int[:,:]', mind: 'int[:]' ): + """ Update the minimum distance + """ + + i4_huge = 2147483647 + + for i in range ( 0, nv ): + if ( not connected[i] ): + if ( ohd[mv,i] < i4_huge ): + mind[i] = min ( mind[i], mind[mv] + ohd[mv,i] ) + +# ================================================================ + +def dijkstra_distance ( nv: int, ohd: 'int[:,:]', mind: 'int[:]' ): + """ Find the shortest paths between nodes in a graph + """ + + # Start out with only node 1 connected to the tree. + connected = np.zeros (nv, dtype = 'bool' ) + + connected[0] = True + for i in range ( 1, nv ): + connected[i] = False + + # Initialize the minimum distance to the one-step distance. + for i in range ( 1, nv ): + mind[i] = ohd[0,i] + + # Attach one more node on each iteration. + + for _ in range ( 1, nv ): + # Find the nearest unconnected node. + _, mv = find_nearest ( nv, mind, connected ) + + if ( mv == - 1 ): + print ( 'DIJKSTRA_DISTANCE - Fatal error!' ) + print ( ' Search terminated early.' ) + print ( ' Graph might not be connected.' ) + # TODO exit + #exit ( 'DIJKSTRA_DISTANCE - Fatal error!' ) + + # Mark this node as connected. + connected[mv] = True + + # Having determined the minimum distance to node MV, see if + # that reduces the minimum distance to other nodes. + update_mind ( nv, mv, connected, ohd, mind ) + +# ================================================================ + +def init ( nv: int, ohd: 'int[:,:]' ): + """ Create a graph + """ + + i4_huge = 1 << 20 + + for i in range ( 0, nv ): + for j in range ( 0, nv ): + ohd[i,j] = i4_huge + + ohd[i,i] = 0 + + ohd[0,333] = 33 + +# ================================================================ + +def dijkstra_distance_test ( ): + """ Test Dijkstra's algorithm + """ + + # Initialize the problem data. + nv = 3000 + ohd = np.zeros ( ( nv, nv ), dtype = 'int' ) + init ( nv, ohd ) + + # Carry out the algorithm. + min_distance = np.zeros ( nv, dtype = 'int' ) + dijkstra_distance ( nv, ohd, min_distance ) + + return min_distance diff --git a/benchmarks/tests/jax_euler_mod.py b/benchmarks/tests/jax_euler_mod.py new file mode 100644 index 00000000..42a99b3a --- /dev/null +++ b/benchmarks/tests/jax_euler_mod.py @@ -0,0 +1,109 @@ +# coding: utf-8 +#------------------------------------------------------------------------------------------# +# This file is part of Pyccel which is released under MIT License. See the LICENSE file or # +# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. # +#------------------------------------------------------------------------------------------# +""" +Functions for solving an ordinary differential equation using Euler's method. The code is adapted from examples written by [J. Burkardt](https://people.sc.fsu.edu/~jburkardt/py_src/py_src.html) +To be accelerated with numba +""" + +import jax.numpy as np + +# ================================================================ + +def euler(dydt: '()(float, const float[:], float[:])', + tspan: 'float[:]', y0: 'float[:]', n: int, + t: 'float[:]', y: 'float[:,:]'): + """ + Function implementing Euler's method + """ + + t0 = tspan[0] + t1 = tspan[1] + dt = (t1 - t0) / float(n) + y[0] = y0[:] + + for i in range(n): + dydt(t[i], y[i,:], y[i+1,:]) + y[i+1,:] = y[i,:] + dt * y[i+1,:] + +# ================================================================ + +def humps_fun(x: float): + """ + Humps function + """ + + y = 1.0 / ( ( x - 0.3 )**2 + 0.01 ) \ + + 1.0 / ( ( x - 0.9 )**2 + 0.04 ) \ + - 6.0 + + return y + +# ================================================================ + +def humps_deriv(x: 'float', y: 'float[:]', out: 'float[:]'): + """ + Derivative of the humps function + """ + + out[0] = - 2.0 * ( x - 0.3 ) / ( ( x - 0.3 )**2 + 0.01 )**2 - 2.0 * ( x - 0.9 ) / ( ( x - 0.9 )**2 + 0.04 )**2 + +# ================================================================ + +def euler_humps_test(t0: float, t1: float, n: int): + """ + Compute an approximate solution y_h(t) ~= y(t) of the initial + value problem + + dy/dt = f(t) + y(t0) = y0 + + over the interval [t0, t1]. + + For test purposes we use the method of manufactured solutions, + i.e. we choose the humps function y(t) as the exact solution + and we compute f(t) := dy/dt, which is then passed to the ODE + integrator. Finally the numerical solution y_h(t) is compared to + the exact solution y(t) at the final time t1. + + Numerical integration is performed with n uniform steps of the + explicit Euler method. + + Parameters + ---------- + t0 : float + Initial time. + + t1 : float + Final time. + + n : int + Number of uniform time steps. + + Returns + ------- + err : float + Difference between numerical and exact solution at the + final time t=t1. + + """ + + # Time interval and initial conditions + tspan = np.array([t0, t1]) + y0 = np.array([humps_fun(t0)]) + + # Uniform time array where solution should be computed + t = np.linspace(t0, t1, n + 1) + + # Empty array which will contain numerical solution + yh = np.zeros((n + 1, 1)) + + # Time integration + euler(humps_deriv, tspan, y0, n, t, yh) + + # Error at final time + err = yh[-1, 0] - humps_fun(t1) + + return err diff --git a/benchmarks/tests/jax_laplace_2d_mod.py b/benchmarks/tests/jax_laplace_2d_mod.py new file mode 100644 index 00000000..33a3ba63 --- /dev/null +++ b/benchmarks/tests/jax_laplace_2d_mod.py @@ -0,0 +1,101 @@ +# coding: utf-8 +#------------------------------------------------------------------------------------------# +# This file is part of Pyccel which is released under MIT License. See the LICENSE file or # +# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. # +#------------------------------------------------------------------------------------------# +""" +Functions for solving a Laplace equation. The code is adapted from examples written by +[J. Burkardt](https://people.sc.fsu.edu/~jburkardt/py_src/py_src.html). +To be accelerated with numba +""" + +import jax.numpy as np + + +def laplace_2d(nx: int, ny: int, rtol: float, maxiter: int): + """ + Solve the 2D Laplace equation for phi(x, y) on the rectangular + domain [0, 2] * [0, 1] with boundary conditions + + phi = 0 at x = xmin, + phi = y at x = xmax, + dphi/dy = 0 at y = ymin, + dphi/dy = 0 at y = ymax. + + The numerical solution is computed on a uniform grid using 2nd + order finite differences and the Jacobi method with a prescribed + relative tolerance. + + Parameters + ---------- + nx : int + Number of grid points along x axis. + + ny : int + Number of grid points along y axis. + + rtol : float + Stopping condition for the Jacobi method: the relative L1 norm + of the difference between successive solutions should be lower + than the value provided. + + maxiter : int + Maximum number of Jacobi iterations allowed. + + Returns + ------- + x : jax.numpy.ndarray[nx] + Computational grid along x axis. + + y : jax.numpy.ndarray[ny] + Computational grid along y axis. + + phi : jax.numpy.ndarray[ny, nx] + Numerical solution on the computational grid. + + niter : int + Number of Jacobi iterations performed. + """ + + # Domain size + xmin, xmax = 0., 2. + ymin, ymax = 0., 1. + + # Computational grid + dx = (xmax - xmin) / (nx - 1) + dy = (ymax - ymin) / (ny - 1) + x = np.linspace(xmin, xmax, nx) + y = np.linspace(ymin, ymax, ny) + + # Initial values + phi = np.ones((ny, nx)) + l1norm = 2 * rtol + niter = 0 + + # Temporary arrays + pn = np.empty((ny, nx)) + diff = np.empty((ny, nx)) + a = np.empty((ny, nx)) + err = np.empty((ny, nx)) + + # Jacobi iteration + while l1norm > rtol and niter < maxiter: + pn[:, :] = phi[:, :] + + phi[1:-1, 1:-1] = ((dy**2 * (pn[1:-1, 2:] + pn[1:-1, 0:-2]) + + dx**2 * (pn[2:, 1:-1] + pn[0:-2, 1:-1])) / + (2 * (dx**2 + dy**2))) + + phi[ :, 0] = 0 # phi = 0 @ x = 0 + phi[ :,-1] = y # phi = y @ x = 2 + phi[ 0, :] = phi[ 1, :] # dphi/dy = 0 @ y = 0 + phi[-1, :] = phi[-2, :] # dphi/dy = 0 @ y = 1 + + diff[:] = phi[:] - pn[:] + err[:] = np.abs(diff[:]) + a[:] = np.abs(pn[:]) + l1norm = np.sum(err) / np.sum(a) + niter += 1 + + # Return axes' grid, solution, and number of iterations + return x, y, phi, niter diff --git a/benchmarks/tests/jax_linearconv_1d_mod.py b/benchmarks/tests/jax_linearconv_1d_mod.py new file mode 100644 index 00000000..6fd4d761 --- /dev/null +++ b/benchmarks/tests/jax_linearconv_1d_mod.py @@ -0,0 +1,66 @@ +# coding: utf-8 +#------------------------------------------------------------------------------------------# +# This file is part of Pyccel which is released under MIT License. See the LICENSE file or # +# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. # +#------------------------------------------------------------------------------------------# +""" +Functions for solving a linear convection equation. The code is adapted from examples written by [J. Burkardt](https://people.sc.fsu.edu/~jburkardt/py_src/py_src.html) +To be accelerated with numba +""" + + +import jax.numpy as np + + +def linearconv_1d(nx: int, dt: float, nt: int): + """ + Compute an approximation of the solution u(t, x) to the 1D + linear advection equation + + du/dt + du/dx = 0 + + on the domain [0, 2], with discontinuous initial conditions + + u(t=0, x) = 2 for 0.5 < x < 1, + u(t=0, x) = 1 otherwise. + + The numerical solution is computed on a uniform grid using + the 1st-order Godunov method, i.e. explicit Euler time stepping + combined with upwind fluxes. + + Parameters + ---------- + nx : int + Number of grid points in the domain. + + dt : float + Time step size. + + nt : int + Number of time steps to be taken. + + Returns + ------- + x : jax.numpy.ndarray of nx floats + Spatial grid where solution is computed. + + u : jax.numpy.ndarray of nx floats + Numerical solution u at final time. + + """ + + c = 1.0 + dx = 2 / (nx-1) + x = np.linspace(0, 2, nx) + u = np.ones(nx) + u[int(.5 / dx):int(1 / dx + 1)] = 2 + + cp = c * dt / dx + un = np.zeros(nx) + + for _ in range(nt): + un[:] = u[:] + for i in range(1, nx): + u[i] = un[i] - cp * (un[i] - un[i-1]) + + return x, u diff --git a/benchmarks/tests/jax_md_mod.py b/benchmarks/tests/jax_md_mod.py new file mode 100644 index 00000000..2ec8aea0 --- /dev/null +++ b/benchmarks/tests/jax_md_mod.py @@ -0,0 +1,188 @@ +# coding: utf-8 +#------------------------------------------------------------------------------------------# +# This file is part of Pyccel which is released under MIT License. See the LICENSE file or # +# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. # +#------------------------------------------------------------------------------------------# +""" +Functions for running a small molecular dynamics simulation. The code is adapted from examples written by [J. Burkardt](https://people.sc.fsu.edu/~jburkardt/py_src/py_src.html) +To be accelerated with numba +""" + +from jax.numpy import zeros +from jax.numpy import sqrt +from jax.numpy import pi +from jax.numpy import sin + +# ================================================================ + +def compute_kinetic_energy(vel: 'double[:,:]', mass: float): + """ Compute the kinetic energy associated with the current configuration. + """ + d_num, p_num = vel.shape + + kinetic = 0.0 + for k in range(d_num): + for j in range(p_num): + kinetic = kinetic + vel[k, j] ** 2 + + return 0.5 * mass * kinetic + +# ================================================================ + +def compute(mass: float, pos: 'double[:,:]', vel: 'double[:,:]', + force: 'double[:,:]'): + """ + Calculate the potential energy and forces associated with the + current configuration. + + """ + + (d_num, p_num) = pos.shape + rij = zeros(d_num) + + potential = 0.0 + force[:, :] = 0.0 + + for i in range(p_num): + # + # Compute the potential energy and forces. + # + for j in range(p_num): + if i != j: + # Compute RIJ, the displacement vector. + for k in range(d_num): + rij[k] = pos[k, i] - pos[k, j] + + # Compute D and D2, a distance and a truncated distance. + d = 0.0 + for k in range(d_num): + d = d + rij[k] ** 2 + + d = sqrt(d) + d2 = min(d, pi / 2.0) + + # Attribute half of the total potential energy to particle J. + potential = potential + 0.5 * sin(d2) * sin(d2) + + # Add particle J's contribution to the force on particle I. + for k in range(d_num): + force[k, i] = force[k, i] - rij[k] * sin(2.0 * d2) / d + + return potential + +# ================================================================ + +def update(dt: float, mass: float, force: 'double[:,:]', + pos: 'double[:,:]', vel: 'double[:,:]', acc: 'double[:,:]'): + + """ Update the position, velocity and acceleration of the particles + """ + + rmass = 1.0 / mass + # + # Update positions. + # + pos += vel * dt + 0.5 * acc * dt * dt + # + # Update velocities. + # + vel += 0.5 * dt * ( force * rmass + acc ) + # + # Update accelerations. + # + acc[:] = force * rmass + +# ================================================================ + +def r8mat_uniform_ab(r: 'double[:, :]', a: float, b: float, seed: int): + """ Fill r with random numbers with a uniform distribution + """ + + (m, n) = r.shape + i4_huge = 2147483647 + + if seed <= 0: + seed += i4_huge + + elif seed > 0: + + for j in range(n): + for i in range(m): + + k = seed // 127773 + seed = 16807 * (seed - k * 127773) - k * 2836 + seed = seed % i4_huge + + if seed <= 0: + seed += i4_huge + + r[i, j] = a + (b - a) * seed * 4.656612875E-10 + + return seed + +# ================================================================ + +def initialize(pos: 'double[:,:]'): + """ Initialise the positions of the particles + """ + # Positions. + seed = 123456789 + seed = r8mat_uniform_ab(pos, 0.0, 10.0, seed) + +# ================================================================ + +def md(d_num: int, p_num: int, step_num: int, dt: float): + """ + Run a molecular dynamics simulation. This consists of an N-body + problem in 3D, where N identical particles of unit mass + interact through a given potential and accelerate according + to Newton's 2nd law of motion. + + Parameters + ---------- + d_num : int + Number of dimensions, i.e. number of components of + position and velocity vectors. + + p_num : int + Number of particles. + + dt : float + Time step size. + + step_num : int + Number of time steps to be taken. + + Returns + ------- + potential : float + Total potential energy of the system. + + kinetic : float + Total kinetic energy of the system. + + """ + + # Set particles' mass + mass = 1.0 + + # Allocate work arrays + pos = zeros((d_num, p_num)) # positions + vel = zeros((d_num, p_num)) # velocities + acc = zeros((d_num, p_num)) # accelerations + force = zeros((d_num, p_num)) # forces + + # Initialization + initialize(pos) + potential = compute(mass, pos, vel, force) + + # Time stepping + for _ in range(step_num): + update(dt, mass, force, pos, vel, acc) + potential = compute(mass, pos, vel, force) + + # Compute total kinetic energy at final time + kinetic = compute_kinetic_energy(vel, mass) + + # Return total potential and kinetic energies + return potential, kinetic diff --git a/benchmarks/tests/jax_midpoint_explicit_mod.py b/benchmarks/tests/jax_midpoint_explicit_mod.py new file mode 100644 index 00000000..866fa8bc --- /dev/null +++ b/benchmarks/tests/jax_midpoint_explicit_mod.py @@ -0,0 +1,118 @@ +# coding: utf-8 +#------------------------------------------------------------------------------------------# +# This file is part of Pyccel which is released under MIT License. See the LICENSE file or # +# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. # +#------------------------------------------------------------------------------------------# +""" +Functions for solving an ordinary differential equation using the explicit midpoint method. The code is adapted from examples written by [J. Burkardt](https://people.sc.fsu.edu/~jburkardt/py_src/py_src.html) +To be accelerated with numba +""" + +import jax.numpy as np + +# ================================================================ + +def midpoint_explicit(dydt: '()(float, float[:], float[:])', + tspan: 'float[:]', y0: 'float[:]', n: int, + t: 'float[:]', y: 'float[:,:]'): + """ + Function implementing the explicit midpoint method + """ + + m = len(y0) + ym = np.zeros(m) + + dt = (tspan[1] - tspan[0]) / float(n) + + t[0] = tspan[0] + y[0,:] = y0[:] + + for i in range(n): + + dydt(t[i], y[i,:], ym[:]) + tm = t[i] + 0.5 * dt + ym[:] = y[i,:] + 0.5 * dt * ym[:] + + dydt(tm, ym[:], y[i+1,:]) + t[i+1] = t[i] + dt + y[i+1,:] = y[i,:] + dt * y[i+1,:] + +# ================================================================ + +def humps_fun(x: float): + """ + Humps function + """ + + y = 1.0 / ( ( x - 0.3 )**2 + 0.01 ) \ + + 1.0 / ( ( x - 0.9 )**2 + 0.04 ) \ + - 6.0 + + return y + +# ================================================================ + +def humps_deriv(x: 'float', y: 'float[:]', out: 'float[:]'): + """ + Derivative of the humps function + """ + + out[0] = - 2.0 * ( x - 0.3 ) / ( ( x - 0.3 )**2 + 0.01 )**2 - 2.0 * ( x - 0.9 ) / ( ( x - 0.9 )**2 + 0.04 )**2 + +# ================================================================ + +def midpoint_explicit_humps_test(t0: float, t1: float, n: int): + """ + Compute an approximate solution y_h(t) ~= y(t) of the initial + value problem + + dy/dt = f(t) + y(t0) = y0 + + over the interval [t0, t1]. + + For test purposes we use the method of manufactured solutions, + i.e. we choose the humps function y(t) as the exact solution + and we compute f(t) := dy/dt, which is then passed to the ODE + integrator. Finally the numerical solution y_h(t) is compared to + the exact solution y(t) at the final time t1. + + Numerical integration is performed with n uniform steps of the + explicit midpoint method. + + Parameters + ---------- + t0 : float + Initial time. + + t1 : float + Final time. + + n : int + Number of uniform time steps. + + Returns + ------- + err : float + Difference between numerical and exact solution at the + final time t=t1. + + """ + + # Time interval and initial conditions + tspan = np.array([t0, t1]) + y0 = np.array([humps_fun(t0)]) + + # Uniform time array where solution should be computed + t = np.linspace(t0, t1, n + 1) + + # Empty array which will contain numerical solution + yh = np.zeros((n + 1, 1)) + + # Time integration + midpoint_explicit(humps_deriv, tspan, y0, n, t, yh) + + # Error at final time + err = yh[-1, 0] - humps_fun(t1) + + return err diff --git a/benchmarks/tests/jax_midpoint_fixed_mod.py b/benchmarks/tests/jax_midpoint_fixed_mod.py new file mode 100644 index 00000000..7c894eb9 --- /dev/null +++ b/benchmarks/tests/jax_midpoint_fixed_mod.py @@ -0,0 +1,125 @@ +# coding: utf-8 +#------------------------------------------------------------------------------------------# +# This file is part of Pyccel which is released under MIT License. See the LICENSE file or # +# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. # +#------------------------------------------------------------------------------------------# +""" +Functions for solving an ordinary differential equation using the implicit midpoint method for a fixed number of iterations. The code is adapted from examples written by [J. Burkardt](https://people.sc.fsu.edu/~jburkardt/py_src/py_src.html) +To be accelerated with numba +""" + +import jax.numpy as np + +# ================================================================ + +def midpoint_fixed(dydt: '()(float, float[:], float[:])', + tspan: 'float[:]', y0: 'float[:]', n: int, + t: 'float[:]', y: 'float[:,:]'): + """ + Function implementing the implicit midpoint method for 10 iterations + """ + + m = len(y0) + y1m = np.zeros(m) + y2m = np.zeros(m) + + dt = (tspan[1] - tspan[0]) / float(n) + + it_max = 10 + theta = 0.5 + + t[0] = tspan[0] + y[0,:] = y0 + + for i in range(n): + + xm = t[i] + theta * dt + + y1m[:] = y[i,:] + for _ in range(it_max): + dydt(xm, y1m[:], y2m[:]) + y1m[:] = y[i,:] + theta * dt * y2m[:] + + t[i+1] = t[i] + dt + y[i+1,:] = ( 1.0 / theta) * y1m[:] \ + + (1.0 - 1.0 / theta) * y[i,:] + +# ================================================================ + +def humps_fun(x: float): + """ + Humps function + """ + + y = 1.0 / ( ( x - 0.3 )**2 + 0.01 ) \ + + 1.0 / ( ( x - 0.9 )**2 + 0.04 ) \ + - 6.0 + + return y + +# ================================================================ + +def humps_deriv(x: 'float', y: 'float[:]', out: 'float[:]'): + """ + Derivative of the humps function + """ + + out[0] = - 2.0 * ( x - 0.3 ) / ( ( x - 0.3 )**2 + 0.01 )**2 - 2.0 * ( x - 0.9 ) / ( ( x - 0.9 )**2 + 0.04 )**2 + +# ================================================================ + +def midpoint_fixed_humps_test(t0: float, t1: float, n: int): + """ + Compute an approximate solution y_h(t) ~= y(t) of the initial + value problem + + dy/dt = f(t) + y(t0) = y0 + + over the interval [t0, t1]. + + For test purposes we use the method of manufactured solutions, + i.e. we choose the humps function y(t) as the exact solution + and we compute f(t) := dy/dt, which is then passed to the ODE + integrator. Finally the numerical solution y_h(t) is compared to + the exact solution y(t) at the final time t1. + + Numerical integration is performed with n uniform steps of the + implicit midpoint method. + + Parameters + ---------- + t0 : float + Initial time. + + t1 : float + Final time. + + n : int + Number of uniform time steps. + + Returns + ------- + err : float + Difference between numerical and exact solution at the + final time t=t1. + + """ + + # Time interval and initial conditions + tspan = np.array([t0, t1]) + y0 = np.array([humps_fun(t0)]) + + # Uniform time array where solution should be computed + t = np.linspace(t0, t1, n + 1) + + # Empty array which will contain numerical solution + yh = np.zeros((n + 1, 1)) + + # Time integration + midpoint_fixed(humps_deriv, tspan, y0, n, t, yh) + + # Error at final time + err = yh[-1, 0] - humps_fun(t1) + + return err diff --git a/benchmarks/tests/jax_nonlinearconv_1d_mod.py b/benchmarks/tests/jax_nonlinearconv_1d_mod.py new file mode 100644 index 00000000..ae02b1a8 --- /dev/null +++ b/benchmarks/tests/jax_nonlinearconv_1d_mod.py @@ -0,0 +1,65 @@ +# coding: utf-8 +#------------------------------------------------------------------------------------------# +# This file is part of Pyccel which is released under MIT License. See the LICENSE file or # +# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. # +#------------------------------------------------------------------------------------------# +""" +Functions for solving a non-linear convection equation. The code is adapted from examples written by [J. Burkardt](https://people.sc.fsu.edu/~jburkardt/py_src/py_src.html) +To be accelerated with numba +""" + + +import jax.numpy as np + + + +def nonlinearconv_1d(nx: int, dt: float, nt: int): + """ + Compute an approximation of the solution u(t, x) to the 1D + Burgers' equation + + du/dt + u du/dx = 0 + + on the domain [0, 2], with initial conditions consisting of + a Gaussian perturbation over a uniform background: + + u(t=0, x) = 1 + 0.5 exp( -((x-0.5)^2 / 0.15^2) ). + + The numerical solution is computed on a uniform grid using + one-sided upwind finite-differences combined with explicit + Euler time stepping. + + Parameters + ---------- + nx : int + Number of grid points in the domain. + + dt : float + Time step size. + + nt : int + Number of time steps to be taken. + + Returns + ------- + x : jax.numpy.ndarray of nx floats + Spatial grid where solution is computed. + + u : jax.numpy.ndarray of nx floats + Numerical solution u at final time. + + """ + + dx = 2 / (nx-1) + x = np.linspace(0, 2, nx) + u = 1.0 + 0.5 * np.exp(-((x - 0.5)/0.15)**2) + + dt_dx = dt / dx + un = np.zeros(nx) + + for _ in range(nt): + un[:] = u[:] + for i in range(1, nx): + u[i] = un[i] - un[i] * dt_dx * (un[i] - un[i-1]) + + return x, u diff --git a/benchmarks/tests/jax_poisson_2d_mod.py b/benchmarks/tests/jax_poisson_2d_mod.py new file mode 100644 index 00000000..a5ebe1cd --- /dev/null +++ b/benchmarks/tests/jax_poisson_2d_mod.py @@ -0,0 +1,98 @@ +# coding: utf-8 +#------------------------------------------------------------------------------------------# +# This file is part of Pyccel which is released under MIT License. See the LICENSE file or # +# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. # +#------------------------------------------------------------------------------------------# +""" +Functions for solving a Poisson equation. The code is adapted from examples written by [J. Burkardt](https://people.sc.fsu.edu/~jburkardt/py_src/py_src.html) +To be accelerated with numba +""" + + +import jax.numpy as np + + + +def poisson_2d(nx: int, ny: int, nt: int): + """ + Solve the 2D poisson equation for phi(x, y) on the rectangular + domain [0, 2] * [0, 1] with 2 point sources (Dirac deltas) of + charge +1 and -1 respectively, at the positions + + (x, y) = (0.5, 0.25) and + (x, y) = (1.5, 0.75), + + and subject to the boundary conditions + + phi = 0 at x = xmin, + phi = y at x = xmax, + dphi/dy = 0 at y = ymin, + dphi/dy = 0 at y = ymax. + + The numerical solution is computed on a uniform grid using 2nd + order finite differences and the Jacobi method with a fixed + number of iterations. + + Parameters + ---------- + nx : int + Number of grid points along x axis. + + ny : int + Number of grid points along y axis. + + nt : int + Number of Jacobi iterations. + + Returns + ------- + x : jax.numpy.ndarray[nx] + Computational grid along x axis. + + y : jax.numpy.ndarray[ny] + Computational grid along y axis. + + phi : jax.numpy.ndarray[ny, nx] + Numerical solution on the computational grid. + + """ + + # Domain size + xmin, xmax = 0., 2. + ymin, ymax = 0., 1. + + # Computational grid + dx = (xmax - xmin) / (nx - 1) + dy = (ymax - ymin) / (ny - 1) + x = np.linspace(xmin, xmax, nx) + y = np.linspace(ymin, ymax, ny) + + # Charge density with point sources + b = np.zeros((ny, nx)) + b[ ny // 4, nx // 4] = 1. / (dx * dy) + b[3 * ny // 4, 3 * nx // 4] = -1. / (dx * dy) + + # First guess + phi = np.zeros((ny, nx)) + + # Temporary array + pn = np.empty((ny, nx)) + + # Jacobi iteration + for _ in range(nt): + pn[:, :] = phi[:, :] + + for j in range(1, ny-1): + for i in range(1, nx-1): + phi[j, i] = (((pn[j, i+1] + pn[j, i-1]) * dy**2 + + (pn[j+1, i] + pn[j-1, i]) * dx**2 - + b[j, i] * dx**2 * dy**2) / + (2 * (dx**2 + dy**2))) + + phi[ :, 0] = 0 # phi = 0 @ x = xmin + phi[ :,-1] = y # phi = y @ x = xmax + phi[ 0, :] = phi[ 1, :] # dphi/dy = 0 @ y = ymin + phi[-1, :] = phi[-2, :] # dphi/dy = 0 @ y = ymax + + # Return axes' grid and solution + return x, y, phi diff --git a/benchmarks/tests/jax_rk4_mod.py b/benchmarks/tests/jax_rk4_mod.py new file mode 100644 index 00000000..1e771897 --- /dev/null +++ b/benchmarks/tests/jax_rk4_mod.py @@ -0,0 +1,123 @@ +# coding: utf-8 +#------------------------------------------------------------------------------------------# +# This file is part of Pyccel which is released under MIT License. See the LICENSE file or # +# go to https://github.com/pyccel/pyccel/blob/master/LICENSE for full license details. # +#------------------------------------------------------------------------------------------# +""" +Functions for solving an ordinary differential equation using the fourth order Runge-Kutta method. The code is adapted from examples written by [J. Burkardt](https://people.sc.fsu.edu/~jburkardt/py_src/py_src.html) +To be accelerated with numba +""" + +import jax.numpy as np + +# ================================================================ + +def rk4(dydt: '()(float, float[:], float[:])', + tspan: 'float[:]', y0: 'float[:]', n: int, + t: 'float[:]', y: 'float[:,:]'): + """ + Function implementing a fourth order Runge-Kutta method + """ + + m = len(y0) + f1 = np.zeros(m) + f2 = np.zeros(m) + f3 = np.zeros(m) + f4 = np.zeros(m) + + tfirst = tspan[0] + tlast = tspan[1] + dt = (tlast - tfirst) / n + + t[0] = tspan[0] + y[0,:] = y0[:] + + for i in range(n): + + dydt(t[i], y[i,:], f1[:]) + dydt(t[i] + dt / 2.0, y[i,:] + dt * f1[:] / 2.0, f2[:]) + dydt(t[i] + dt / 2.0, y[i,:] + dt * f2[:] / 2.0, f3[:]) + dydt(t[i] + dt, y[i,:] + dt * f3[:], f4[:]) + + t[i+1] = t[i] + dt + y[i+1,:] = y[i,:] + dt * (f1[:] + 2.0 * f2[:] + 2.0 * f3[:] + f4[:]) / 6.0 + +# ================================================================ + +def humps_fun(x: float): + """ + Humps function + """ + + y = 1.0 / ( ( x - 0.3 )**2 + 0.01 ) \ + + 1.0 / ( ( x - 0.9 )**2 + 0.04 ) \ + - 6.0 + + return y + +# ================================================================ + +def humps_deriv(x: 'float', y: 'float[:]', out: 'float[:]'): + """ + Derivative of the humps function + """ + + out[0] = - 2.0 * ( x - 0.3 ) / ( ( x - 0.3 )**2 + 0.01 )**2 - 2.0 * ( x - 0.9 ) / ( ( x - 0.9 )**2 + 0.04 )**2 + +# ================================================================ + +def rk4_humps_test(t0: float, t1: float, n: int): + """ + Compute an approximate solution y_h(t) ~= y(t) of the initial + value problem + + dy/dt = f(t) + y(t0) = y0 + + over the interval [t0, t1]. + + For test purposes we use the method of manufactured solutions, + i.e. we choose the humps function y(t) as the exact solution + and we compute f(t) := dy/dt, which is then passed to the ODE + integrator. Finally the numerical solution y_h(t) is compared to + the exact solution y(t) at the final time t1. + + Numerical integration is performed with n uniform steps of the + classical 4th-order Runga Kutta method. + + Parameters + ---------- + t0 : float + Initial time. + + t1 : float + Final time. + + n : int + Number of uniform time steps. + + Returns + ------- + err : float + Difference between numerical and exact solution at the + final time t=t1. + + """ + + # Time interval and initial conditions + tspan = np.array([t0, t1]) + y0 = np.array([humps_fun(t0)]) + + # Uniform time array where solution should be computed + t = np.linspace(t0, t1, n + 1) + + # Empty array which will contain numerical solution + yh = np.zeros((n + 1, 1)) + + # Time integration + rk4(humps_deriv, tspan, y0, n, t, yh) + + # Error at final time + err = yh[-1, 0] - humps_fun(t1) + + return err diff --git a/benchmarks/tests/jax_splines.py b/benchmarks/tests/jax_splines.py new file mode 100644 index 00000000..a1c356c6 --- /dev/null +++ b/benchmarks/tests/jax_splines.py @@ -0,0 +1,79 @@ +import jax.numpy as np +from numba import int64, float64 # import the types +from numba.experimental import jitclass + +spec = [ + ('_degree', int64), + ('_knots', float64[:]), + ('_coeffs', float64[:]), +] + +@jitclass(spec) +class Spline: + def __init__(self, degree : int, knots : 'float[:]', coeffs : 'float[:]'): + self._degree = degree + self._knots = knots + self._coeffs = coeffs + + @property + def degree(self): + return self._degree + + def _basis_funcs(self, x: 'float', span: 'int', values: 'float[:]'): + """ Compute non-zero basis functions at x following Algorithm A2.2 + from the NURBS book [1]. """ + left = np.empty(self.degree) + right = np.empty(self.degree) + + values[0] = 1.0 + + for j in range(0, self.degree): + left[j] = x - self._knots[span-j] + right[j] = self._knots[span+1+j] - x + saved = 0.0 + + for r in range(0, j+1): + temp = values[r] / (right[r] + left[j-r]) + values[r] = saved + right[r] * temp + saved = left[j-r] * temp + + values[j+1] = saved + + def eval(self, x : 'const float[:]', y : 'float[:]'): + """ Evaluate spline at non-zero basis elements: sum_i N_i(x) * c_i. + """ + basis = np.empty(self.degree+1) + for i, xi in enumerate(x): + span = self._find_span(xi) + self._basis_funcs(xi, span, basis) + + # Evaluate the spline at xi + y[i] = 0.0 + for j in range(self.degree+1): + y[i] += self._coeffs[span-self.degree+j]*basis[j] + + def _find_span(self, x: float) -> int: + # Knot index at left/right boundary + low = self.degree + high = len(self._knots)-1-self.degree + + # Check if point is exactly on left/right boundary, or outside domain + if x <= self._knots[low]: + returnVal = low + elif x >= self._knots[high]: + returnVal = high-1 + else: + # Perform binary search + span = (low+high)//2 + + while x < self._knots[span] or x >= self._knots[span+1]: + if x < self._knots[span]: + high = span + else: + low = span + span = (low+high)//2 + + returnVal = span + + return returnVal + diff --git a/pyproject.toml b/pyproject.toml index de4a5c4b..c19cf5b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,23 @@ [build-system] -requires = [ - "setuptools", +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[project] +name="pyccel-benchmarks" +authors = [ + { name = "Pyccel development team" }, +] +version="0.0.0" +dependencies = [ "pyccel", "pythran", + "jax", "numba", "pyperf", "numpy", "matplotlib", ] -build-backend = "setuptools.build_meta" +requires-python = ">= 3.10" + +[tool.setuptools] +py-modules = [] diff --git a/readme/intro.md b/readme/intro.md index 65fd1a0a..485707a5 100644 --- a/readme/intro.md +++ b/readme/intro.md @@ -1,6 +1,6 @@ # Benchmarks -Several tests are available for the user to benchmark Pyccel against other common accelerators, notably [pythran](https://pythran.readthedocs.io/en/latest/) and [numba](https://numba.pydata.org/). +Several tests are available for the user to benchmark Pyccel against other common accelerators, notably [pythran](https://pythran.readthedocs.io/en/latest/), [numba](https://numba.pydata.org/) and [jax](https://docs.jax.dev/en/latest/index.html). The same code is used for all tests, only the decorators change. The dependencies can be installed using the command `python3 -m pip install .` diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index cab01bff..00000000 --- a/setup.cfg +++ /dev/null @@ -1,20 +0,0 @@ -[metadata] -name = pyccel-benchmarks -author = Pyccel development team -version = 0.0.0 -email = pyccel@googlegroups.com -url = https://github.com/pyccel/pyccel-benchmarks -descr = Benchmark for pyccel, a python extension language using accelerators. -long_description = file: README.md -long_description_content_type = text/markdown - -[options] -packages = -install_requires = - pyccel - pythran - numba - pyperf - numpy - matplotlib -python_requires = >= 3.8 diff --git a/setup.py b/setup.py deleted file mode 100644 index 606d4d2d..00000000 --- a/setup.py +++ /dev/null @@ -1,17 +0,0 @@ -# -*- coding: UTF-8 -*- -#!/usr/bin/env python -from setuptools import setup - -if __name__ == '__main__': - setup( - name='pyccel-benchmarks', - version='0.0.0', - install_requires=[ - 'pyccel', - 'pythran', - 'numba', - 'pyperf', - 'numpy', - 'matplotlib', - ], - ) diff --git a/version_specific_results/devel_performance_311.md b/version_specific_results/devel_performance_311.md index 42625a44..9d5cf0b3 100644 --- a/version_specific_results/devel_performance_311.md +++ b/version_specific_results/devel_performance_311.md @@ -1,34 +1,34 @@ -### Performance Comparison (as of Thu Dec 11 12:51:44 UTC 2025) +### Performance Comparison (as of Mon Jan 19 10:43:50 UTC 2026) ## Compilation time -Algorithm | python | pythran_gnu | pythran_intel | numba | pyccel_gnu_c | pyccel_gnu_fortran | pyccel_intel_c | pyccel_intel_fortran -------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- -Ackermann | - | - | - | 0.26 | 1.24 | 1.27 | 1.27 | 1.33 -Bellman Ford | - | - | - | 0.89 | 24.77 | 1.44 | 26.65 | 1.49 -Dijkstra | - | - | - | 0.96 | 24.78 | 1.54 | 26.85 | 1.63 -Euler | - | - | - | 3.06 | 24.56 | 1.42 | 26.78 | 1.48 -Midpoint Explicit | - | - | - | 3.39 | 24.79 | 1.61 | 26.80 | 1.65 -Midpoint Fixed | - | - | - | 3.55 | 24.75 | 1.66 | 26.77 | 1.71 -RK4 | - | - | - | 3.53 | 25.31 | 2.01 | 27.21 | 2.06 -FD - L Convection | - | - | - | 2.33 | 24.43 | 1.36 | 26.50 | 1.42 -FD - NL Convection | - | - | - | 2.45 | 24.50 | 1.35 | 26.79 | 1.42 -FD - Poisson | - | - | - | 4.02 | 24.74 | 1.65 | 26.76 | 1.81 -FD - Laplace | - | - | - | 5.32 | 25.16 | 1.80 | 27.06 | 1.85 -M-D | - | - | - | 5.95 | 25.13 | 2.32 | 27.19 | 2.41 -Splines | - | - | - | 0.59 | 24.66 | 1.63 | 26.65 | 1.72 +Algorithm | python | pythran_gnu | pythran_intel | numba | jax | pyccel_gnu_c | pyccel_gnu_fortran | pyccel_intel_c | pyccel_intel_fortran +------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- +Ackermann | - | 2.12 | 2.24 | 0.31 | 0.31 | 1.46 | 1.47 | 1.47 | 1.56 +Bellman Ford | - | 3.32 | 3.69 | 1.05 | 1.05 | 26.27 | 1.62 | 30.80 | 1.70 +Dijkstra | - | 2.34 | 2.63 | 1.11 | 1.10 | 26.38 | 1.66 | 30.05 | 1.81 +Euler | - | 2.57 | 3.03 | 3.38 | 3.39 | 26.15 | 1.54 | 30.03 | 1.67 +Midpoint Explicit | - | 2.96 | 3.44 | 3.73 | 3.73 | 26.30 | 1.78 | 30.16 | 1.88 +Midpoint Fixed | - | 3.29 | 3.78 | 3.91 | 3.92 | 27.38 | 1.90 | 30.66 | 1.95 +RK4 | - | 3.42 | 4.02 | 3.90 | 3.87 | 26.74 | 2.22 | 31.32 | 2.39 +FD - L Convection | - | 2.27 | 2.62 | 2.53 | 2.49 | 25.99 | 1.50 | 29.94 | 1.62 +FD - NL Convection | - | 3.23 | 3.62 | 2.69 | 2.76 | 26.83 | 1.53 | 30.18 | 1.61 +FD - Poisson | - | 3.53 | 3.80 | 4.31 | 4.26 | 26.36 | 1.85 | 30.69 | 2.09 +FD - Laplace | - | 7.26 | 8.19 | 5.52 | 5.57 | 27.33 | 2.03 | 30.91 | 2.15 +M-D | - | 6.13 | 6.60 | 6.63 | 6.59 | 26.85 | 2.59 | 31.31 | 2.77 +Splines | - | - | - | 0.69 | 0.68 | 26.40 | 1.80 | 30.44 | 1.95 ## Execution time -Algorithm | python | pythran_gnu | pythran_intel | numba | pyccel_gnu_c | pyccel_gnu_fortran | pyccel_intel_c | pyccel_intel_fortran -------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- -Ackermann (ms) | 308.00 | - | - | 19.20 | 2.22 | 2.27 | 11.70 | 15.60 -Bellman Ford (ms) | 1750.00 | - | - | 4.61 | 4.20 | 3.22 | 5.86 | 3.52 -Dijkstra (ms) | 4540.00 | - | - | 29.10 | 45.00 | 26.30 | 56.00 | 32.80 -Euler (ms) | 3100.00 | - | - | 85.80 | 20.30 | 10.10 | 22.40 | 11.00 -Midpoint Explicit (ms) | 6370.00 | - | - | 171.00 | 38.30 | 18.90 | 40.30 | 14.50 -Midpoint Fixed (ms) | 31600.00 | - | - | 593.00 | 171.00 | 67.60 | 179.00 | 43.20 -RK4 (ms) | 16000.00 | - | - | 311.00 | 79.10 | 25.50 | 82.40 | 29.70 -FD - L Convection (ms) | 1970.00 | - | - | 1.98 | 6.57 | 1.51 | 8.46 | 1.40 -FD - NL Convection (ms) | 2530.00 | - | - | 2.45 | 6.10 | 1.43 | 8.54 | 1.41 -FD - Poisson (ms) | 5790.00 | - | - | 6.86 | 8.51 | 2.78 | 13.30 | 2.75 -FD - Laplace (ms) | 563.00 | - | - | 211.00 | 202.00 | 54.00 | 397.00 | 60.60 -M-D (ms) | 14000.00 | - | - | 52.90 | 89.00 | 55.40 | 56.30 | 54.80 -Splines (ms) | 1730.00 | - | - | 18.40 | 12.00 | 16.90 | 13.20 | 26.60 +Algorithm | python | pythran_gnu | pythran_intel | numba | jax | pyccel_gnu_c | pyccel_gnu_fortran | pyccel_intel_c | pyccel_intel_fortran +------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- | ------------------------- +Ackermann (ms) | 419.00 | 2.92 | 3.67 | 8.63 | 8.50 | 1.23 | 1.36 | 4.06 | 8.05 +Bellman Ford (ms) | 1720.00 | 4.51 | 3.65 | 4.03 | 4.06 | 3.32 | 3.27 | 5.37 | 3.81 +Dijkstra (ms) | 4830.00 | 20.70 | 16.70 | 20.00 | 20.80 | 36.50 | 19.50 | 43.30 | 21.20 +Euler (ms) | 3330.00 | 25.20 | 25.90 | 36.10 | 35.10 | 24.10 | 10.80 | 23.40 | 16.10 +Midpoint Explicit (ms) | 6700.00 | 51.60 | 50.50 | 66.60 | 68.30 | 41.20 | 19.60 | 43.80 | 16.90 +Midpoint Fixed (ms) | 34000.00 | 268.00 | 95.30 | 304.00 | 308.00 | 178.00 | 72.90 | 201.00 | 55.00 +RK4 (ms) | 17000.00 | 155.00 | 36.00 | 122.00 | 123.00 | 85.70 | 31.90 | 89.60 | 28.30 +FD - L Convection (ms) | 2140.00 | 1.52 | 1.49 | 2.83 | 2.93 | 4.27 | 1.52 | 3.83 | 1.31 +FD - NL Convection (ms) | 2630.00 | 1.98 | 1.78 | 2.86 | 2.89 | 4.69 | 1.62 | 4.06 | 1.51 +FD - Poisson (ms) | 5800.00 | 2.99 | 5.50 | 6.39 | 6.45 | 3.75 | 2.71 | 6.31 | 2.59 +FD - Laplace (ms) | 634.00 | 67.70 | 104.00 | 190.00 | 189.00 | 151.00 | 61.40 | 193.00 | 60.50 +M-D (ms) | 14100.00 | 45.10 | 51.10 | 56.80 | 56.80 | 106.00 | 62.10 | 88.20 | 90.20 +Splines (ms) | 1650.00 | - | - | 18.30 | 18.40 | 13.40 | 18.50 | 15.10 | 27.60 diff --git a/version_specific_results/devel_performance_311_compilation.svg b/version_specific_results/devel_performance_311_compilation.svg index b645d6cd..e9bb77be 100644 --- a/version_specific_results/devel_performance_311_compilation.svg +++ b/version_specific_results/devel_performance_311_compilation.svg @@ -6,7 +6,7 @@ - 2025-12-11T12:51:44.827956 + 2026-01-19T10:43:51.220077 image/svg+xml @@ -41,17 +41,17 @@ z - - + - + - + - + - + - + - + - + - + - + - + - + @@ -665,12 +665,12 @@ z - + - + - + - + - + - + - + - + - + - + @@ -937,12 +937,12 @@ z - + - + @@ -952,12 +952,12 @@ z - + - + +" clip-path="url(#p545a82adc8)" style="fill: none; stroke: #b0b0b0; stroke-opacity: 0.5; stroke-width: 0.5; stroke-linecap: square"/> - - + @@ -1051,18 +1051,18 @@ z - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + @@ -1180,700 +1233,876 @@ z - +" clip-path="url(#p545a82adc8)" style="fill: #ff7f0e"/> - +" clip-path="url(#p545a82adc8)" style="fill: #ff7f0e"/> - +" clip-path="url(#p545a82adc8)" style="fill: #ff7f0e"/> - +" clip-path="url(#p545a82adc8)" style="fill: #ff7f0e"/> - +" clip-path="url(#p545a82adc8)" style="fill: #ff7f0e"/> - +" clip-path="url(#p545a82adc8)" style="fill: #ff7f0e"/> - +" clip-path="url(#p545a82adc8)" style="fill: #ff7f0e"/> - +" clip-path="url(#p545a82adc8)" style="fill: #ff7f0e"/> - +" clip-path="url(#p545a82adc8)" style="fill: #ff7f0e"/> - +" clip-path="url(#p545a82adc8)" style="fill: #ff7f0e"/> - +" clip-path="url(#p545a82adc8)" style="fill: #ff7f0e"/> - +" clip-path="url(#p545a82adc8)" style="fill: #ff7f0e"/> +" clip-path="url(#p545a82adc8)" style="fill: #ff7f0e"/> - +" clip-path="url(#p545a82adc8)" style="fill: #2ca02c"/> - +" clip-path="url(#p545a82adc8)" style="fill: #2ca02c"/> - +" clip-path="url(#p545a82adc8)" style="fill: #2ca02c"/> - +" clip-path="url(#p545a82adc8)" style="fill: #2ca02c"/> - +" clip-path="url(#p545a82adc8)" style="fill: #2ca02c"/> - +" clip-path="url(#p545a82adc8)" style="fill: #2ca02c"/> - +" clip-path="url(#p545a82adc8)" style="fill: #2ca02c"/> - +" clip-path="url(#p545a82adc8)" style="fill: #2ca02c"/> - +" clip-path="url(#p545a82adc8)" style="fill: #2ca02c"/> - +" clip-path="url(#p545a82adc8)" style="fill: #2ca02c"/> - +" clip-path="url(#p545a82adc8)" style="fill: #2ca02c"/> - +" clip-path="url(#p545a82adc8)" style="fill: #2ca02c"/> +" clip-path="url(#p545a82adc8)" style="fill: #2ca02c"/> - +" clip-path="url(#p545a82adc8)" style="fill: #d62728"/> - +" clip-path="url(#p545a82adc8)" style="fill: #d62728"/> - +" clip-path="url(#p545a82adc8)" style="fill: #d62728"/> - +" clip-path="url(#p545a82adc8)" style="fill: #d62728"/> - +" clip-path="url(#p545a82adc8)" style="fill: #d62728"/> - +" clip-path="url(#p545a82adc8)" style="fill: #d62728"/> - +" clip-path="url(#p545a82adc8)" style="fill: #d62728"/> - +" clip-path="url(#p545a82adc8)" style="fill: #d62728"/> - +" clip-path="url(#p545a82adc8)" style="fill: #d62728"/> - +" clip-path="url(#p545a82adc8)" style="fill: #d62728"/> - +" clip-path="url(#p545a82adc8)" style="fill: #d62728"/> - +" clip-path="url(#p545a82adc8)" style="fill: #d62728"/> - +" clip-path="url(#p545a82adc8)" style="fill: #d62728"/> - +" clip-path="url(#p545a82adc8)" style="fill: #9467bd"/> - +" clip-path="url(#p545a82adc8)" style="fill: #9467bd"/> - +" clip-path="url(#p545a82adc8)" style="fill: #9467bd"/> - +" clip-path="url(#p545a82adc8)" style="fill: #9467bd"/> - +" clip-path="url(#p545a82adc8)" style="fill: #9467bd"/> - +" clip-path="url(#p545a82adc8)" style="fill: #9467bd"/> - +" clip-path="url(#p545a82adc8)" style="fill: #9467bd"/> - +" clip-path="url(#p545a82adc8)" style="fill: #9467bd"/> - +" clip-path="url(#p545a82adc8)" style="fill: #9467bd"/> - +" clip-path="url(#p545a82adc8)" style="fill: #9467bd"/> - +" clip-path="url(#p545a82adc8)" style="fill: #9467bd"/> - +" clip-path="url(#p545a82adc8)" style="fill: #9467bd"/> - +" clip-path="url(#p545a82adc8)" style="fill: #9467bd"/> - +" clip-path="url(#p545a82adc8)" style="fill: #8c564b"/> - +" clip-path="url(#p545a82adc8)" style="fill: #8c564b"/> - +" clip-path="url(#p545a82adc8)" style="fill: #8c564b"/> - +" clip-path="url(#p545a82adc8)" style="fill: #8c564b"/> - +" clip-path="url(#p545a82adc8)" style="fill: #8c564b"/> - +" clip-path="url(#p545a82adc8)" style="fill: #8c564b"/> - +" clip-path="url(#p545a82adc8)" style="fill: #8c564b"/> - +" clip-path="url(#p545a82adc8)" style="fill: #8c564b"/> - +" clip-path="url(#p545a82adc8)" style="fill: #8c564b"/> - +" clip-path="url(#p545a82adc8)" style="fill: #8c564b"/> - +" clip-path="url(#p545a82adc8)" style="fill: #8c564b"/> - +" clip-path="url(#p545a82adc8)" style="fill: #8c564b"/> - +" clip-path="url(#p545a82adc8)" style="fill: #8c564b"/> - +" clip-path="url(#p545a82adc8)" style="fill: #e377c2"/> - +" clip-path="url(#p545a82adc8)" style="fill: #e377c2"/> - +" clip-path="url(#p545a82adc8)" style="fill: #e377c2"/> - +" clip-path="url(#p545a82adc8)" style="fill: #e377c2"/> - +" clip-path="url(#p545a82adc8)" style="fill: #e377c2"/> - +" clip-path="url(#p545a82adc8)" style="fill: #e377c2"/> - +" clip-path="url(#p545a82adc8)" style="fill: #e377c2"/> - +" clip-path="url(#p545a82adc8)" style="fill: #e377c2"/> - +" clip-path="url(#p545a82adc8)" style="fill: #e377c2"/> - +" clip-path="url(#p545a82adc8)" style="fill: #e377c2"/> - +" clip-path="url(#p545a82adc8)" style="fill: #e377c2"/> - +" clip-path="url(#p545a82adc8)" style="fill: #e377c2"/> - +" clip-path="url(#p545a82adc8)" style="fill: #e377c2"/> - +" clip-path="url(#p545a82adc8)" style="fill: #7f7f7f"/> - +" clip-path="url(#p545a82adc8)" style="fill: #7f7f7f"/> - +" clip-path="url(#p545a82adc8)" style="fill: #7f7f7f"/> - +" clip-path="url(#p545a82adc8)" style="fill: #7f7f7f"/> - +" clip-path="url(#p545a82adc8)" style="fill: #7f7f7f"/> - +" clip-path="url(#p545a82adc8)" style="fill: #7f7f7f"/> - +" clip-path="url(#p545a82adc8)" style="fill: #7f7f7f"/> - +" clip-path="url(#p545a82adc8)" style="fill: #7f7f7f"/> - +" clip-path="url(#p545a82adc8)" style="fill: #7f7f7f"/> - +" clip-path="url(#p545a82adc8)" style="fill: #7f7f7f"/> - +" clip-path="url(#p545a82adc8)" style="fill: #7f7f7f"/> - +" clip-path="url(#p545a82adc8)" style="fill: #7f7f7f"/> - +" clip-path="url(#p545a82adc8)" style="fill: #7f7f7f"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - - + - - + - + - + - - + - + - + @@ -2028,17 +2257,17 @@ z - - + - + - + - - + - + + + + + + + + + + + + - + - - + +" style="fill: #e377c2"/> - + - + - - + +" style="fill: #7f7f7f"/> - + - + @@ -2189,17 +2434,17 @@ z - - + +" style="fill: #bcbd22"/> - + - + @@ -2226,7 +2471,7 @@ z - + diff --git a/version_specific_results/devel_performance_311_execution.svg b/version_specific_results/devel_performance_311_execution.svg index 2aaad941..badb3660 100644 --- a/version_specific_results/devel_performance_311_execution.svg +++ b/version_specific_results/devel_performance_311_execution.svg @@ -6,7 +6,7 @@ - 2025-12-11T12:51:45.102131 + 2026-01-19T10:43:51.561816 image/svg+xml @@ -41,17 +41,17 @@ z - - + - + - + - + - + - + - + - + - + - + - + - + @@ -665,12 +665,12 @@ z - + - + - + - + - + - + - + - + - + - + @@ -937,12 +937,12 @@ z - + - + @@ -952,12 +952,12 @@ z - + - + - + - - + - + - + - + - + @@ -1087,18 +1087,18 @@ L 383.27 72.310066 - + - + - + - + - + - + - + - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1516,648 +1516,872 @@ L 383.27 8.763291 - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - +" clip-path="url(#pfbec9784cf)" style="fill: #d62728"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #d62728"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #d62728"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #d62728"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #d62728"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #d62728"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #d62728"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #d62728"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #d62728"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #d62728"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #d62728"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #d62728"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #d62728"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #9467bd"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #9467bd"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #9467bd"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #9467bd"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #9467bd"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #9467bd"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #9467bd"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #9467bd"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #9467bd"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #9467bd"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #9467bd"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #9467bd"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #9467bd"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #8c564b"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #8c564b"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #8c564b"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #8c564b"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #8c564b"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #8c564b"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #8c564b"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #8c564b"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #8c564b"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #8c564b"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #8c564b"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #8c564b"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #8c564b"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #e377c2"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #e377c2"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #e377c2"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #e377c2"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #e377c2"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #e377c2"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #e377c2"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #e377c2"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #e377c2"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #e377c2"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #e377c2"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #e377c2"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #e377c2"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #7f7f7f"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #7f7f7f"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #7f7f7f"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #7f7f7f"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #7f7f7f"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #7f7f7f"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #7f7f7f"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #7f7f7f"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #7f7f7f"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #7f7f7f"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #7f7f7f"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #7f7f7f"/> - +" clip-path="url(#pfbec9784cf)" style="fill: #7f7f7f"/> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - - + - - + - + - - + - + @@ -2312,17 +2536,17 @@ z - - + - + - - + + + + + + + + + + + + - + - - + +" style="fill: #e377c2"/> - + - + - - + +" style="fill: #7f7f7f"/> - + - + @@ -2473,17 +2713,17 @@ z - - + +" style="fill: #bcbd22"/> - + - + @@ -2510,7 +2750,7 @@ z - + diff --git a/version_specific_results/devel_performance_311_requirements.txt b/version_specific_results/devel_performance_311_requirements.txt index 5ffc68f2..cb5954e0 100644 --- a/version_specific_results/devel_performance_311_requirements.txt +++ b/version_specific_results/devel_performance_311_requirements.txt @@ -2,29 +2,34 @@ Arpeggio==2.0.3 beniget==0.4.2.post1 contourpy==1.3.3 cycler==0.12.1 -filelock==3.20.0 -fonttools==4.61.0 +filelock==3.20.3 +fonttools==4.61.1 gast==0.6.0 immutabledict==4.2.2 +jax==0.8.2 +jaxlib==0.8.2 kiwisolver==1.4.9 llvmlite==0.46.0 matplotlib==3.10.8 -meson==1.10.0 +meson==1.10.1 +ml_dtypes==0.5.4 mpmath==1.3.0 ninja==1.13.0 numba==0.63.1 numpy==2.3.5 +opt_einsum==3.4.0 packaging==25.0 -pillow==12.0.0 +pillow==12.1.0 ply==3.11 -psutil==7.1.3 -pyccel @ git+https://github.com/pyccel/pyccel@32262c86922362687a2b87a600d9b1e28acc40c4 +psutil==7.2.1 +pyccel @ git+https://github.com/pyccel/pyccel@371a14872c662a508d799c2dcca22be5b9668b11 pyccel-benchmarks @ file:///home/runner/work/pyccel-benchmarks/pyccel-benchmarks -pyparsing==3.2.5 +pyparsing==3.3.1 pyperf==2.9.0 python-dateutil==2.9.0.post0 pythran==0.18.1 +scipy==1.17.0 six==1.17.0 sympy==1.14.0 -termcolor==3.2.0 +termcolor==3.3.0 textX==4.3.0