Skip to content

Update benchmarks and CI #9

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

Open
wants to merge 35 commits into
base: hpy
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
41b22ef
Benchmark with HPy 0.0.3 and PyPy3 7.3.6
paugier Oct 12, 2021
ba809f3
CI: use HPy 0.0.3
paugier Oct 12, 2021
9e5aae7
CI: pypy-3.7-nightly
paugier Oct 12, 2021
d3025c5
xfail 2 tests for PyPy
paugier Oct 12, 2021
0b809bc
rm piconumpy/_piconumpy_hpy.py
paugier Oct 12, 2021
f788f1a
Skip too long benchmarks
paugier Oct 12, 2021
6f1d511
rerun bench_hpy
paugier Oct 12, 2021
aa6f146
Small improvements
paugier Oct 12, 2021
968cc43
microbench loop_sum
paugier Oct 13, 2021
20fbba3
microbench_loop_sum: add numpy
paugier Oct 13, 2021
47ebd2e
Update bench + PyPy traces
paugier Nov 12, 2021
431abef
Add more simple low level benchmarks
paugier Dec 8, 2021
b014314
New dir microbench_low_level
paugier Dec 8, 2021
01effe9
Improve output benchmarks
paugier Dec 8, 2021
b653dfd
Clean up Makefile + result files
paugier Dec 9, 2021
655e492
Update results with GraalPython
paugier Dec 9, 2021
2a8cbf2
Cleanup after rebase
paugier Dec 9, 2021
3e379ac
Cosmetic changes output microbench
paugier Dec 10, 2021
9d7f176
Add "board" benchmark
paugier Dec 10, 2021
34ad4c1
Converting floats to floats is expensive and useless
paugier Dec 13, 2021
d172daa
Log and stability microbench
paugier Dec 13, 2021
8472fbd
Add microbench instantiate
paugier Dec 15, 2021
c381f1f
Merge hpy in microbench_loop_sum
paugier May 8, 2025
593fa75
Modernize pyproject.toml and Makefile
paugier May 9, 2025
f0d956f
IS_CPY instead of IS_PYPY (for GraalPy)
paugier May 11, 2025
3523611
microbench: element_wise
paugier May 13, 2025
ad9dfc1
Various compatibility improvements
paugier May 13, 2025
442fdb7
makefile: compat PyPy and GraalPy
paugier May 13, 2025
89ff214
Add .mdformat.toml
paugier May 13, 2025
adfc2f4
Improve README and bench
paugier May 13, 2025
4d53bc5
Fix microbench_low_level to understand bench results
paugier May 14, 2025
b4a99aa
pythran 0.18 from GitHub
paugier May 14, 2025
010d2ad
Update GitHub Actions ci
paugier May 14, 2025
e736a2f
Fix bench output for CI
paugier May 14, 2025
7a3f182
Few fixes microbench_low_level
paugier May 14, 2025
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
38 changes: 19 additions & 19 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,43 @@ jobs:
strategy:
max-parallel: 5
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.11', '3.12', 'pypy-3.11']

steps:

- name: Setup Julia
uses: julia-actions/setup-julia@v1
uses: julia-actions/setup-julia@v2

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
- name: Checkout
uses: actions/checkout@v4

- name: Build and install deps
run: |
# install HPy from source if depending on a dev version
# git clone -b master --single-branch https://github.com/hpyproject/hpy
# git checkout 1234abcd
# cd hpy
# pip install .
pip install numpy cython pytest transonic pythran 'setuptools>=60.2' 'hpy>=0.9.0rc1'
pip install -e .[full]

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- if: startsWith(matrix.python-version, 'pypy') != true
name: Build universal extension (only needed for CPython)
run: |
pip install -e . --config-settings="--global-option=--hpy-abi=universal"

- name: build
- name: Remove _piconumpy_hpy.py
run: |
python setup.py develop
python setup.py --hpy-abi=universal develop
rm -f piconumpy/_piconumpy_hpy.py

- name: Run tests
run: |
pytest -s
pytest -v

- name: Run bench
run: |
cd bench
make tmp_result_julia.txt
make bench_hpy
make bench_full
# rerun bench_hpy to get these results also at the end
make bench_hpy
make
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@ build

**/tmp*.*
**/tmp*.*
**/tmp/*

*_cython.c
*_cython.c

piconumpy/_piconumpy_hpy.py

.venv*
3 changes: 3 additions & 0 deletions .mdformat.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
wrap = 89
number = true
end_of_line = "lf"
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2020, Pierre Augier
Copyright (c) 2020-2025, Pierre Augier
Copyright (c) 2021, 2023, Oracle and/or it's affiliates
All rights reserved.

Expand Down
60 changes: 48 additions & 12 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,43 +1,79 @@

ifeq ($(PYTHON),)
PYTHON := python
PYTHON := python3
endif

IMPLEMENTATION := $(shell $(PYTHON) -c "import sys; print(sys.implementation.name)")


all:
make develop_universal
ifeq ($(PYTHON),python)
make build_ext
make editable_universal
ifeq ($(IMPLEMENTATION),cpython)
make editable
endif


rm_hpy_py:
rm -f piconumpy/_piconumpy_hpy.py

editable:
$(PYTHON) -m pip install -e .
make rm_hpy_py

editable_universal:
$(PYTHON) -m pip install -e . --config-settings="--global-option=--hpy-abi=universal"
make rm_hpy_py

editable_full:
$(PYTHON) -m pip install -e .[full]
make rm_hpy_py


# deprecated but let's keep them
develop:
$(PYTHON) setup.py develop
make rm_hpy_py

develop_universal:
$(PYTHON) setup.py --hpy-abi=universal develop
rm -f piconumpy/_piconumpy_hpy.py

pip:
$(PYTHON) -m pip install -e .[dev]
make rm_hpy_py

build_ext_universal:
$(PYTHON) setup.py --hpy-abi=universal build_ext -if
make rm_hpy_py

build_ext:
$(PYTHON) setup.py build_ext -if
make rm_hpy_py

full:
$(PYTHON) -m pip install -e .[full]

format:
black -l 82 setup.py piconumpy/*.py
clang-format-7 -i piconumpy/*cpython_capi.c

tests:
tests: rm_hpy_py
$(PYTHON) -m pytest piconumpy -s

clean:
rm -f piconumpy/*.so
rm -rf build dist piconumpy.egg-info

black:
black -l 82 .
black -l 82 .


install_pypy:
uv python install pypy

install_graalpy:
uv python install graalpy

create_venv_cpy:
$(PYTHON) -m venv .venv_cpy --upgrade-deps

create_venv_pypy:
$(shell uv python find pypy) -m venv .venv_pypy --upgrade-deps

create_venv_graalpy:
# cannot use --upgrade-deps because pip is patched for GraalPy
$(shell uv python find graalpy) -m venv .venv_graalpy
Loading