Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continous Benchmarking Action #1137

Merged
merged 24 commits into from
Apr 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
637c259
ci: continous benchmarking action
JuanPedroGHM Mar 31, 2023
24b8d77
fix pytorch install command
JuanPedroGHM Mar 31, 2023
0ed8278
fixed action python version
JuanPedroGHM Mar 31, 2023
29d8f35
added github token to benchmark action
JuanPedroGHM Mar 31, 2023
a2c7d2a
test message worst performance
JuanPedroGHM Mar 31, 2023
11ca920
ci: test gh-pages results from cb action
JuanPedroGHM Apr 4, 2023
3815d5a
ci: this should pass
JuanPedroGHM Apr 4, 2023
b1cfb43
fix: typo
JuanPedroGHM Apr 4, 2023
48c5d7b
remove cache action in favor of gh-pages
JuanPedroGHM Apr 4, 2023
c6fc775
extra /
JuanPedroGHM Apr 4, 2023
ddf7321
ci: action config should work now
JuanPedroGHM Apr 4, 2023
8f75137
extra benchmarks from linalg module
JuanPedroGHM Apr 4, 2023
fea17f2
quicker linalg benchmarks
JuanPedroGHM Apr 4, 2023
d6bf98d
cluster benchmarks, removed some code duplication
JuanPedroGHM Apr 5, 2023
8f72606
corrected cb workflow command
JuanPedroGHM Apr 5, 2023
dee3a77
ci: split cb workflow into a main and pr. pr workflow triggers with a…
JuanPedroGHM Apr 18, 2023
4c06c12
ci: bench pr runs after a review is requested
JuanPedroGHM Apr 18, 2023
a40c40b
ci: bench now only triggers on pull requests with 'PR talk' tag
JuanPedroGHM Apr 18, 2023
a7baabd
ci: reshape benchmark, removed cronjob from pytorch workflows, rename…
JuanPedroGHM Apr 24, 2023
2888cfc
mend
JuanPedroGHM Apr 24, 2023
be9cd0a
fix: missing import in cb main
JuanPedroGHM Apr 24, 2023
1eda895
Merge branch 'main' into features/continuous-benchmarking
ClaudiaComito Apr 26, 2023
2259e9b
ci: changed benchmark python version to 3.10, added shield in readme …
JuanPedroGHM Apr 26, 2023
7fe7a21
fix: incorrect python version param
JuanPedroGHM Apr 26, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 65 additions & 11 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,94 @@ categories:
- title: '🐛 Bug Fixes'
labels:
- 'bug :bug:'
- title: 'Google Summer of Code 2022'
label: 'GSoC22'
- title: '💯 Benchmarking'
label: 'benchmarking'
- title: '📜 Documentation'
label: 'documentation :book:'
- title: '🧹 Maintenance'
label: 'chore'
- title: '🧪 Testing'
label: 'testing'
- title: 'Arithmetic'
label: 'arithmetic'
- title: 'Array API'
label: 'array API'
- title: 'Classification'
label: 'classification'
- title: 'Cluster'
label: 'cluster'
- title: 'Communication'
labels:
- 'io'
- 'I/O'
- 'communication'
- title: 'Complex Math'
label: 'complex math'
- title: 'Constants'
label: 'constants'
- title: 'Datasets'
label: 'datasets'
- title: 'Devices'
label: 'devices'
- title: 'DNDarray'
label: 'dndarray'
- title: 'Exponential'
label: 'exponential'
- title: 'Factories'
label: 'factories'
- title: 'Graph'
label: 'graph'
- title: 'Indexing'
label: 'indexing'
- title: 'Linear Algebra'
label: 'linalg'
- title: 'Logical'
label: 'logical'
- title: 'Manipulations'
label: 'manipulation'
- title: 'Memory'
label: 'memory'
- title: 'Naive Bayes'
label: 'naive Bayes'
- title: 'Neural Networks'
labels:
- 'nn'
- 'neural net'
- title: 'Optimization'
label: 'optim'
- title: 'Printing'
label: 'printing'
- title: 'Random'
label: 'random'
- title: 'Regression'
label: 'regression'
- title: 'Relational'
label: 'relational'
- title: 'Rounding'
label: 'rounding'
- title: 'Sanitation'
label: 'sanitation'
- title: 'Signal'
label: 'signal'
- title: 'Sparse'
label: 'sparse'
- title: 'Google Summer of Code 2022'
label: 'GSoC22'
- title: '💯 Benchmarking'
label: 'benchmarking'
- title: '📜 Documentation'
label: 'documentation :book:'
- title: '🧹 Maintenance'
label: 'chore'
- title: '🧪 Testing'
label: 'testing'
- title: 'Spatial'
label: 'spatial'
- title: 'Statistics'
label: 'statistics'
- title: 'Stride Tricks'
label: 'stride tricks'
- title: 'Tiling'
label: 'tiling'
- title: 'Trigonometrics'
label: 'trigonometrics'
- title: 'Types'
label: 'types'

change-template: '- #$NUMBER $TITLE (by @$AUTHOR)'
categorie-template: '### $TITLE'
category-template: '### $TITLE'
exclude-labels:
- 'workflow'
template: |
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/benchmark_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Benchmark main and save
on:
push:
branches:
- main

jobs:
benchmark-main:
name: Benchmark main and save
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup MPI
uses: mpi4py/setup-mpi@v1
- name: Use Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.10.11 # Perun only supports 3.8 and ahead
architecture: x64
- name: Test
run: |
pip install torch==1.12.1+cpu torchvision==0.13.1+cpu torchaudio==0.12.1 -f https://download.pytorch.org/whl/torch_stable.html
pip install .[cb]
PERUN_RUN_ID=N4 mpirun -n 4 python benchmarks/cb/main.py
jq -s flatten bench_data/*.json > bench_data/all_benchmarks.json
- name: Save benchmark result and update gh-pages-chart
if: ${{github.ref == 'refs/heads/main'}}
uses: benchmark-action/github-action-benchmark@v1
with:
github-token: ${{secrets.GITHUB_TOKEN}}
# Benchmark action input and output
tool: 'customSmallerIsBetter'
output-file-path: bench_data/all_benchmarks.json
# external-data-json-path: ./cache/benchmark-data.json
# Alert configuration
fail-on-alert: false # Don't fail on main branch
comment-on-alert: true
# Save benchmarks from the main branch
save-data-file: true
# Pages configuration
auto-push: true
gh-pages-branch: gh-pages
benchmark-data-dir-path: dev/bench
# Upload the updated cache file for the next job by actions/cache
45 changes: 45 additions & 0 deletions .github/workflows/benchmark_pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Benchmark PR
on:
pull_request:
types: [opened, synchronize, reopened, labeled]
branches: [main]

jobs:
benchmark-pr:
name: Benchmark PR
if: contains(github.event.pull_request.labels.*.name, 'benchmark PR')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup MPI
uses: mpi4py/setup-mpi@v1
- name: Use Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.10.11 # Perun only supports 3.8 and ahead
architecture: x64
- name: Test
run: |
pip install torch==1.12.1+cpu torchvision==0.13.1+cpu torchaudio==0.12.1 -f https://download.pytorch.org/whl/torch_stable.html
pip install .[cb]
PERUN_RUN_ID=N4 mpirun -n 4 python benchmarks/cb/main.py
jq -s flatten bench_data/*.json > bench_data/all_benchmarks.json
- name: Compare benchmark result
if: ${{github.ref != 'refs/heads/main'}}
uses: benchmark-action/github-action-benchmark@v1
with:
github-token: ${{secrets.GITHUB_TOKEN}}
# Benchmark action input and output
tool: 'customSmallerIsBetter'
output-file-path: bench_data/all_benchmarks.json
# external-data-json-path: ./cache/benchmark-data.json
# Alert configuration
fail-on-alert: true
comment-on-alert: true
# Ignore results from non main branches.
save-data-file: false
# Pages configuration
auto-push: false
gh-pages-branch: gh-pages
benchmark-data-dir-path: dev/bench
2 changes: 0 additions & 2 deletions .github/workflows/pytorch-latest-main.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Get latest PyTorch version main branch
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * 1,4'
env:
working_branch: workflows/new-pytorch-main-branch
base_branch: main
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/pytorch-latest-release.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Get latest PyTorch version release branch
on:
workflow_dispatch:
schedule:
- cron: '0 3 * * 1,4'
env:
working_branch: workflows/new-pytorch-release-branch
base_branch: release/1.2.x
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -305,3 +305,5 @@ MANIFEST
travis_wait_*.log
testing.py
heat/datasets/MNISTDataset
perun_results/
bench_data/
8 changes: 8 additions & 0 deletions .perun.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[output]
format = bench
data_out = ./bench_data

[benchmarking]
bench_enable = True
bench_rounds = 10
bench_warmup_rounds = 1
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Heat is a distributed tensor framework for high performance data analytics.
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![license: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
[![Downloads](https://pepy.tech/badge/heat)](https://pepy.tech/project/heat)
[![Github-Pages - Benchmarks](https://img.shields.io/badge/Github--Pages-Benchmarks-2ea44f)](https://helmholtz-analytics.github.io/heat/dev/bench)

# New
- **NO GSoC WITH US THIS YEAR**. On Feb 21st we learned that our Organisation has not been selected this year. Congratulations to the [GSoC 2023 Mentoring Orgs](https://summerofcode.withgoogle.com/programs/2023/organizations)!
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
30 changes: 30 additions & 0 deletions benchmarks/cb/cluster.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import heat as ht
from perun.decorator import monitor


@monitor()
def kmeans_cpu(data):
kmeans = ht.cluster.KMeans(n_clusters=4, init="kmeans++")
kmeans.fit(data)


@monitor()
def kmedians_cpu(data):
kmeans = ht.cluster.KMedians(n_clusters=4, init="kmedians++")
kmeans.fit(data)


@monitor()
def kmedoids_cpu(data):
kmeans = ht.cluster.KMedoids(n_clusters=4, init="kmedoids++")
kmeans.fit(data)


n = 5000
seed = 1
data = ht.utils.data.spherical.create_spherical_dataset(
num_samples_cluster=n, radius=1.0, offset=4.0, dtype=ht.float32, random_state=seed
)
kmeans_cpu(data)
kmedians_cpu(data)
kmedoids_cpu(data)
38 changes: 38 additions & 0 deletions benchmarks/cb/linalg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# flake8: noqa
import heat as ht
from perun.decorator import monitor


@monitor()
def matmul_cpu_split_0(n: int = 3000):
a = ht.random.random((n, n), split=0, device="cpu")
b = ht.random.random((n, n), split=0, device="cpu")
a @ b


@monitor()
def matmul_cpu_split_1(n: int = 3000):
a = ht.random.random((n, n), split=1, device="cpu")
b = ht.random.random((n, n), split=1, device="cpu")
a @ b


@monitor()
def qr_cpu(n: int = 2000):
for t in range(1, 3):
for sp in range(2):
a = ht.random.random((n, n), split=sp)
qr = a.qr(tiles_per_proc=t)


@monitor()
def lanczos_cpu(n: int = 50):
A = ht.random.random((n, n), dtype=ht.float64, split=0)
B = A @ A.T
V, T = ht.lanczos(B, m=n)


matmul_cpu_split_0()
matmul_cpu_split_1()
qr_cpu()
lanczos_cpu()
4 changes: 4 additions & 0 deletions benchmarks/cb/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# flake8: noqa
import linalg
import cluster
import manipulations
14 changes: 14 additions & 0 deletions benchmarks/cb/manipulations.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# flake8: noqa
import heat as ht
from perun.decorator import monitor


@monitor()
def reshape_cpu():
sizes = [10000, 20000, 40000]
for size in sizes:
st = ht.zeros((1000, size), split=1)
a = ht.reshape(st, (10000000, -1), new_split=1)


reshape_cpu()
Loading