Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Try usingsysconfig to configure the SS JIT#515

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
eriknw wants to merge8 commits intopython-graphblas:main
base:main
Choose a base branch
Loading
fromeriknw:sysconfig_for_jit
Draft
Show file tree
Hide file tree
Changes fromall commits
Commits
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
19 changes: 11 additions & 8 deletions.github/workflows/test_and_build.yml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -85,12 +85,12 @@ jobs:
shell: bash -l {0}
strategy:
# To "stress test" in CI, set `fail-fast` to `false` and perhaps add more items to `matrix.slowtask`
fail-fast:true
fail-fast:false
# The build matrix is [os]x[slowtask] and then randomly chooses [pyver] and [sourcetype].
# This should ensure we'll have full code coverage (i.e., no chance of getting unlucky),
# since we need to run all slow tests on Windows and non-Windoes OSes.
matrix:
os: ["ubuntu-latest", "macos-latest", "windows-latest"]
os: ["ubuntu-latest", "macos-latest", "windows-latest", "ubuntu-latest", "macos-latest", "windows-latest"]
slowtask: ["pytest_normal", "pytest_bizarro", "notebooks"]
env:
# Wheels on OS X come with an OpenMP that conflicts with OpenMP from conda-forge.
Expand DownExpand Up@@ -213,12 +213,15 @@ jobs:
fi
elif [[ ${{ steps.sourcetype.outputs.selected}} == "conda-forge" ]] ; then
psgver=$(python -c 'import random ; print(random.choice(["=7.4.0", "=7.4.1", "=7.4.2", "=7.4.3.0", "=7.4.3.1", "=7.4.3.2", "=8.0.2.1", "=8.2.0.1", "=8.2.1.0", ""]))')
psgver="" # XXX
psg=python-suitesparse-graphblas${psgver}
elif [[ ${{ steps.sourcetype.outputs.selected}} == "wheel" ]] ; then
psgver=$(python -c 'import random ; print(random.choice(["==7.4.3.2", "==8.0.2.1", "==8.2.0.1", "==8.2.1.0", ""]))')
psgver="" # XXX
elif [[ ${{ steps.sourcetype.outputs.selected}} == "source" ]] ; then
# These should be exact versions
psgver=$(python -c 'import random ; print(random.choice(["==7.4.0.0", "==7.4.1.0", "==7.4.2.0", "==7.4.3.0", "==7.4.3.1", "==7.4.3.2", "==8.0.2.1", "==8.2.0.1", "==8.2.1.0", ""]))')
psgver="" # XXX
fi
if [[ ${npver} == "=1.26" ]] ; then
numbaver=""
Expand DownExpand Up@@ -318,7 +321,7 @@ jobs:
G=${{ needs.rngs.outputs.backend == 'G' || '' }} ; H=${{ needs.rngs.outputs.backend == 'H' || '' }}
normal=${{ matrix.slowtask == 'pytest_normal' || '' }} ; bizarro=${{ matrix.slowtask == 'pytest_bizarro' || '' }}
ubuntu=${{ matrix.os == 'ubuntu-latest' || '' }} ; windows=${{ matrix.os == 'windows-latest' || '' }} ; macos=${{ matrix.os == 'macos-latest' || '' }}
mapnumpy='--mapnumpy' ; nomapnumpy='--no-mapnumpy' ; suitesparse='--backend=suitesparse' ; vanilla='--backend=suitesparse-vanilla'
mapnumpy='--mapnumpy' ; nomapnumpy='--no-mapnumpy' ; suitesparse='' ; vanilla=''
args=$(
if [[ $A && $normal ]] ; then if [[ $ubuntu ]] ; then echo " $mapnumpy" ; elif [[ $windows ]] ; then echo " $nomapnumpy" ; fi ; fi)$( \
if [[ $A && $bizarro ]] ; then if [[ $ubuntu ]] ; then echo " $nomapnumpy" ; elif [[ $windows ]] ; then echo " $mapnumpy" ; fi ; fi)$( \
Expand All@@ -338,8 +341,8 @@ jobs:
if [[ $H && $bizarro ]] ; then if [[ $macos ]] ; then echo " $suitesparse" ; elif [[ $windows ]] ; then echo " $vanilla" ; fi ; fi)
echo ${args}
set -x # echo on
coverage run -m pytest --color=yes --randomly -v ${args} \
${{ matrix.slowtask == 'pytest_normal' && '--runslow' || '' }}
coverage run -m pytest --color=yes --randomly -v ${args}--backend=suitesparse\
${{ matrix.slowtask == 'pytest_normal' && '--runslow' || '' }} graphblas/tests/test_ssjit.py
- name: Unit tests (bizarro scalars)
run: |
# Run tests again with Scalars being C scalars by default
Expand All@@ -354,7 +357,7 @@ jobs:
G=${{ needs.rngs.outputs.backend == 'G' || '' }} ; H=${{ needs.rngs.outputs.backend == 'H' || '' }}
normal=${{ matrix.slowtask == 'pytest_normal' || '' }} ; bizarro=${{ matrix.slowtask == 'pytest_bizarro' || '' }}
ubuntu=${{ matrix.os == 'ubuntu-latest' || '' }} ; windows=${{ matrix.os == 'windows-latest' || '' }} ; macos=${{ matrix.os == 'macos-latest' || '' }}
mapnumpy='--mapnumpy' ; nomapnumpy='--no-mapnumpy' ; suitesparse='--backend=suitesparse' ; vanilla='--backend=suitesparse-vanilla'
mapnumpy='--mapnumpy' ; nomapnumpy='--no-mapnumpy' ; suitesparse='' ; vanilla=''
args=$(
if [[ $A && $normal ]] ; then if [[ $ubuntu ]] ; then echo " $nomapnumpy" ; elif [[ $windows ]] ; then echo " $mapnumpy" ; fi ; fi)$( \
if [[ $A && $bizarro ]] ; then if [[ $ubuntu ]] ; then echo " $mapnumpy" ; elif [[ $windows ]] ; then echo " $nomapnumpy" ; fi ; fi)$( \
Expand All@@ -374,8 +377,8 @@ jobs:
if [[ $H && $bizarro ]] ; then if [[ $macos ]] ; then echo " $vanilla" ; elif [[ $windows ]] ; then echo " $suitesparse" ; fi ; fi)
echo ${args}
set -x # echo on
coverage run -a -m pytest --color=yes --randomly -v ${args} \
${{ matrix.slowtask == 'pytest_bizarro' && '--runslow' || '' }}
coverage run -a -m pytest --color=yes --randomly -v ${args}--backend=suitesparse\
${{ matrix.slowtask == 'pytest_bizarro' && '--runslow' || '' }} graphblas/tests/test_ssjit.py
git checkout . # Undo changes to scalar default
- name: Miscellaneous tests
if: matrix.slowtask == 'pytest_normal'
Expand Down
13 changes: 13 additions & 0 deletionsgraphblas/tests/test_ssjit.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
import os
import pathlib
import sys
import sysconfig

import numpy as np
import pytest
Expand All@@ -26,6 +27,18 @@

@pytest.fixture(scope="module", autouse=True)
def _setup_jit():
if _IS_SSGB7:
return
gb.ss.config["jit_c_control"] = "on"
if val := sysconfig.get_config_var("CC"):
gb.ss.config["jit_c_compiler_name"] = val
if val := sysconfig.get_config_var("CFLAGS"):
gb.ss.config["jit_c_compiler_flags"] = val
if val := sysconfig.get_config_var("LIBS"):
gb.ss.config["jit_c_libraries"] = val
print(gb.ss.config)
return

# Configuration values below were obtained from the output of the JIT config
# in CI, but with paths changed to use `{conda_prefix}` where appropriate.
if "CONDA_PREFIX" not in os.environ or _IS_SSGB7:
Expand Down
2 changes: 1 addition & 1 deletionpyproject.toml
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -87,7 +87,7 @@ pandas = [
"pandas >=1.2",
]
scipy = [
"scipy >=1.8",
"scipy >=1.9",
]
suitesparse-udf = [ # udf requires numba
"python-graphblas[suitesparse,numba]",
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp