Skip to content

Commit

Permalink
Merge pull request #21 from IntelPython/add-workflow
Browse files Browse the repository at this point in the history
Remove .travis, add workflow
  • Loading branch information
oleksandr-pavlyk authored Sep 14, 2023
2 parents 393798d + dfcf8dd commit cc2e177
Show file tree
Hide file tree
Showing 7 changed files with 92 additions and 48 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 0 additions & 7 deletions .travis.yml

This file was deleted.

13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
[![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*

## 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
28 changes: 0 additions & 28 deletions create_python_envs.py

This file was deleted.

15 changes: 15 additions & 0 deletions environments/intel.yaml
Original file line number Diff line number Diff line change
@@ -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
17 changes: 17 additions & 0 deletions environments/stock.yaml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 0 additions & 7 deletions run_tests.py

This file was deleted.

0 comments on commit cc2e177

Please sign in to comment.