diff --git a/.github/workflows/run_tests.yaml b/.github/workflows/run_tests.yaml new file mode 100644 index 0000000..b58c18a --- /dev/null +++ b/.github/workflows/run_tests.yaml @@ -0,0 +1,53 @@ +name: Run benchmark tests +on: + pull_request: + push: + branches: [master] + +jobs: + run_test: + name: Run optimization bench on intel_dev + runs-on: ubuntu-latest + + strategy: + matrix: + python: ['3.10'] + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.11.0 + with: + access_token: ${{ github.token }} + + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Set pkgs_dirs + run: | + echo "pkgs_dirs: [~/.conda/pkgs]" >> ~/.condarc + + - name: Add conda to system path + run: echo $CONDA/bin >> $GITHUB_PATH + + - name: Create Intel test environment + run: conda env create -f environments/intel.yaml + + - name: Create stock test environment + run: conda env create -f environments/stock.yaml + + - name: Run tests in Intel environment + run: | + . $CONDA/etc/profile.d/conda.sh + conda activate intel_env || exit 1 + # This is toy run for GH action, + # The arguments are really bad for real perf testing, use default arguments instead + python numpy/umath/umath_mem_bench.py -v --size 10 --goal-time 0.01 --repeats 1 || exit 1 + + - name: Run tests in stock environment + run: | + . $CONDA/etc/profile.d/conda.sh + conda activate stock_env || exit 1 + # This is toy run for GH action, + # The arguments are really bad for real perf testing, use default arguments instead + python numpy/umath/umath_mem_bench.py -v --size 10 --goal-time 0.01 --repeats 1 || exit 1 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 995d193..0000000 --- a/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: python -python: - - "3.6" -install: - - "python create_python_envs.py" -script: - - "python run_tests.py" diff --git a/README.md b/README.md index f61f501..5290a37 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -[![Build Status](https://travis-ci.org/IntelPython/optimizations_bench.svg?branch=master)](https://travis-ci.org/IntelPython/optimizations_bench) +[![Run benchmark tests](https://github.com/IntelPython/optimizations_bench/actions/workflows/run_tests.yaml/badge.svg)](https://github.com/IntelPython/optimizations_bench/actions/workflows/run_tests.yaml) # Optimization Benchmarks Collection of performance benchmarks used to present optimizations implemented for Intel(R) Distribution for Python* @@ -6,19 +6,20 @@ Collection of performance benchmarks used to present optimizations implemented f ## Environment Setup To install Python environments from Intel channel along with pip-installed packages -- `python3 create_python_envs.py` - +- `conda env create -f environments/intel.yaml` +- `conda activate intel_env` + ## Run tests -- `python3 run_tests.py` +- `python numpy/umath/umath_mem_bench.py -v --size 10 --goal-time 0.01 --repeats 1` ## Run benchmarks ### umath - To run python benchmarks: `python numpy/umath/umath_mem_bench.py` -- To compile and run native benchmarks (requires icc): `make -C numpy/umath` +- To compile and run native benchmarks (requires `icx`): `make -C numpy/umath` ### Random number generation - To run python benchmarks: `python numpy/random/rng.py` -- To compile and run native benchmarks (requires icc): `make -C numpy/random` +- To compile and run native benchmarks (requires `icx`): `make -C numpy/random` ## See also "[Accelerating Scientific Python with Intel Optimizations](http://conference.scipy.org/proceedings/scipy2017/pdfs/oleksandr_pavlyk.pdf)" by Oleksandr Pavlyk, Denis Nagorny, Andres Guzman-Ballen, Anton Malakhov, Hai Liu, Ehsan Totoni, Todd A. Anderson, Sergey Maidanov. Proceedings of the 16th Python in Science Conference (SciPy 2017), July 10 - July 16, Austin, Texas diff --git a/create_python_envs.py b/create_python_envs.py deleted file mode 100644 index 0517f68..0000000 --- a/create_python_envs.py +++ /dev/null @@ -1,28 +0,0 @@ -# Copyright (C) 2017-2018 Intel Corporation -# -# SPDX-License-Identifier: MIT - -import os -import urllib.request -from os.path import join as jp - -dir = 'miniconda3' -conda = jp(dir,'bin','conda') -miniconda = 'Miniconda3-latest-Linux-x86_64.sh' -miniconda_url = 'https://repo.continuum.io/miniconda/' + miniconda - -if not os.path.exists(conda): - if not os.path.exists(dir): - os.makedirs(dir) - if not os.path.exists(miniconda): - urllib.request.urlretrieve(miniconda_url, miniconda) - os.system('chmod +x %s; ./%s -b -p %s -f' % (miniconda,miniconda,dir)) - -if not os.path.exists(jp(dir,'envs','intel3')): - os.system('%s create -q -y -n intel3 -c intel python=3 numpy numexpr numexpr numba scikit-learn tbb cython' % conda) - -pip_env = jp(dir,'envs','pip3') -if not os.path.exists(pip_env): - os.system('%s create -q -y -n pip3 -c intel python=3 pip llvmlite cython' % conda) - os.system('%s/bin/pip -q install numpy scikit-learn toolz numexpr rdtsc' % pip_env) - os.system('%s/bin/pip -q install dask numba' % pip_env) diff --git a/environments/intel.yaml b/environments/intel.yaml new file mode 100644 index 0000000..e2fb042 --- /dev/null +++ b/environments/intel.yaml @@ -0,0 +1,15 @@ +name: intel_env +channels: + - intel + - conda-forge + - nodefaults +dependencies: + - numpy + - conda-forge::numexpr=*=mkl* + - numba + - scikit-learn + - cython + - pip + - pip: + - dask +# - rdtsc diff --git a/environments/stock.yaml b/environments/stock.yaml new file mode 100644 index 0000000..a20257b --- /dev/null +++ b/environments/stock.yaml @@ -0,0 +1,17 @@ +name: stock_env +channels: + - intel + - conda-forge + - nodefaults +dependencies: + - llvmlite + - cython + - pip + - pip: + - numpy + - scikit-learn + - toolz + - numexpr +# - rdtsc + - numba + - dask diff --git a/run_tests.py b/run_tests.py deleted file mode 100644 index 84f3c66..0000000 --- a/run_tests.py +++ /dev/null @@ -1,7 +0,0 @@ -# Copyright (C) 2017 Intel Corporation -# -# SPDX-License-Identifier: MIT - -import os -# warning: this is sanity test for Travis CI. The arguments are really bad for real perf testing, use default arguments instead -os.system('miniconda3/envs/intel3/bin/python numpy/umath/umath_mem_bench.py -v --size 10 --goal-time 0.01 --repeats 1')