Skip to content

Commit 6d23bef

Browse files
authored
Blas\Lapack (#52)
* codex: add complete BLAS correctness project * add lapach example * require meson and ninja * require f2py to only wrap the necessary routines * use unique names for jobs * use unique names for jobs * fix job expectation names * require job order * change job order * change job order * clean blas and lapack examples * unify the testing of blas+lapack * simplify blas and lapack examples * clean blas and lapack examples * clean blas and lapack examples * clean blas and lapack examples * fix double symbol error bug * use getters to read the parameters value * complexity * fix bug * fix bug * improve READMEs
1 parent 15b26ce commit 6d23bef

2,337 files changed

Lines changed: 16955 additions & 989 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/blas-lapack.yml

Lines changed: 46 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,18 @@
1-
name: BLAS + LAPACK
1+
name: Native Libraries
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize, reopened, labeled, unlabeled]
64
push:
75
branches:
86
- main
97
- release/*
10-
workflow_call:
118

129
env:
1310
PRIK_GFORTRAN_BINARY: gfortran-13
1411
PRIK_GFORTRAN_PACKAGE: gfortran-13
1512

1613
jobs:
1714
real-library-wrappers:
18-
name: Python 3.12
15+
name: BLAS + LAPACK · Ubuntu 24.04 · Python 3.12
1916
if: >-
2017
${{
2118
github.event_name != 'pull_request' ||
@@ -38,13 +35,20 @@ jobs:
3835
run: |
3936
python -m pip install --upgrade pip
4037
python -m pip install -e ".[qa]"
41-
- name: Install pinned GFortran
38+
python -m pip install \
39+
"numpy==2.5.1" \
40+
"meson==1.11.2" \
41+
"ninja==1.13.0" \
42+
"scipy==1.18.0"
43+
- name: Install pinned GFortran and LAPACK link dependencies
4244
shell: bash
4345
run: |
46+
packages=(libblas-dev liblapack-dev)
4447
if ! command -v "$PRIK_GFORTRAN_BINARY" >/dev/null 2>&1; then
45-
sudo apt-get update
46-
sudo apt-get install --yes "$PRIK_GFORTRAN_PACKAGE"
48+
packages+=("$PRIK_GFORTRAN_PACKAGE")
4749
fi
50+
sudo apt-get update
51+
sudo apt-get install --yes "${packages[@]}"
4852
compiler_dir="$RUNNER_TEMP/prik-gfortran"
4953
mkdir -p "$compiler_dir"
5054
ln -sf "$(command -v "$PRIK_GFORTRAN_BINARY")" "$compiler_dir/gfortran"
@@ -54,13 +58,42 @@ jobs:
5458
uses: actions/cache@v4
5559
with:
5660
path: ${{ runner.temp }}/prik-real-library-native
57-
key: real-libraries-${{ runner.os }}-gfortran13-${{ hashFiles('tests/fortran/building_shared_library/end_to_end/real_libraries/blas/native/**', 'tests/fortran/building_shared_library/end_to_end/real_libraries/lapack/native/**') }}
58-
- name: Run full BLAS and LAPACK wrapper tests
61+
key: real-libraries-${{ runner.os }}-gfortran13-${{ hashFiles('examples/blas/native/**', 'examples/lapack/native/**') }}
62+
- name: Run BLAS example and CI full-surface audit
5963
env:
6064
PYTHONPATH: .
6165
HYPOTHESIS_PROFILE: ci
6266
PRIK_REAL_LIBRARY_NATIVE_CACHE_DIR: ${{ runner.temp }}/prik-real-library-native
6367
run: |
64-
python -m pytest -q --randomly-seed=1 \
65-
"tests/fortran/building_shared_library/end_to_end/real_libraries/test_full_libraries.py::test_full_library_wrapper_imports_every_root_procedure_from_cached_shared_library[blas]" \
66-
"tests/fortran/building_shared_library/end_to_end/real_libraries/test_full_libraries.py::test_full_library_wrapper_imports_every_root_procedure_from_cached_shared_library[lapack]"
68+
source examples/blas/build_all.sh
69+
python -m pytest -q examples/blas/tests examples/blas/ci/full_surface.py
70+
- name: Report reviewed LAPACK inventory
71+
env:
72+
PYTHONPATH: .
73+
run: |
74+
python - <<'PY'
75+
from examples.lapack.routine_inventory import (
76+
EXPECTED_LAPACK_PROCEDURES,
77+
EXPECTED_LAPACK_SOURCE_FILES,
78+
F2PY_SCALAR_WRITEBACK_ROUTINES,
79+
ROUTINE_GROUPS,
80+
ROUTINES,
81+
SCIPY_VERSION,
82+
)
83+
84+
print(f"SciPy version: {SCIPY_VERSION}")
85+
print(f"LAPACK implementation sources: {EXPECTED_LAPACK_SOURCE_FILES}")
86+
print(f"Expected PRIK procedures: {EXPECTED_LAPACK_PROCEDURES}")
87+
print(f"Selected float64 correctness routines: {len(ROUTINES)}")
88+
print(f"f2py scalar writebacks: {len(F2PY_SCALAR_WRITEBACK_ROUTINES)}")
89+
for family, routines in ROUTINE_GROUPS.items():
90+
print(f" {family}: {len(routines)}")
91+
PY
92+
- name: Run LAPACK example and CI full-surface audit
93+
env:
94+
PYTHONPATH: .
95+
HYPOTHESIS_PROFILE: ci
96+
PRIK_REAL_LIBRARY_NATIVE_CACHE_DIR: ${{ runner.temp }}/prik-real-library-native
97+
run: |
98+
source examples/lapack/build_all.sh
99+
python -m pytest -q examples/lapack/tests examples/lapack/ci/full_surface.py

.github/workflows/claude.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Claude Code
1+
name: Repository Automation
22

33
on:
44
issue_comment:
@@ -12,7 +12,7 @@ on:
1212

1313
jobs:
1414
claude:
15-
name: Respond
15+
name: Claude Code response to mention
1616
if: |
1717
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
1818
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||

.github/workflows/coverage.yml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,18 @@
1-
name: Coverage
1+
name: Quality Metrics
22

33
on:
44
push:
55
branches:
66
- main
7-
pull_request:
8-
types: [opened, synchronize, reopened, labeled, unlabeled]
97
workflow_dispatch:
10-
workflow_call:
118

129
env:
1310
PRIK_GFORTRAN_BINARY: gfortran-13
1411
PRIK_GFORTRAN_PACKAGE: gfortran-13
1512

1613
jobs:
1714
coverage:
18-
name: Python 3.12
19-
if: >-
20-
${{
21-
github.event_name != 'pull_request' ||
22-
contains(github.event.pull_request.labels.*.name, 'run-coverage')
23-
}}
15+
name: Project coverage · Ubuntu 24.04 · Python 3.12
2416
runs-on: ubuntu-24.04
2517
permissions:
2618
contents: read

.github/workflows/docs.yml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,22 @@ name: Documentation
33
on:
44
push:
55
branches: [main]
6-
pull_request:
7-
paths:
8-
- ".github/workflows/docs.yml"
9-
- "README.md"
10-
- "benchmarks/**"
11-
- "docs/**"
12-
- "docs_theme/**"
13-
- "mkdocs.yml"
14-
- "pyproject.toml"
15-
- "tests/shared/architecture/test_test_suite_layout.py"
16-
- "tests/shared/docs/**"
17-
- "tests/shared/tools/test_generate_performance_docs.py"
18-
- "tools/generate_performance_docs.py"
19-
- "tools/mkdocs_publication.py"
206
workflow_dispatch:
217

228
permissions:
239
contents: read
2410

2511
concurrency:
2612
group: documentation-${{ github.ref }}
27-
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
13+
cancel-in-progress: true
2814

2915
env:
3016
PRIK_GFORTRAN_BINARY: gfortran-13
3117
PRIK_GFORTRAN_PACKAGE: gfortran-13
3218

3319
jobs:
3420
benchmark:
35-
name: Benchmark
36-
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
21+
name: Documentation performance benchmark · Ubuntu 24.04 ARM64 · Python 3.12
3722
runs-on: ubuntu-24.04-arm
3823
timeout-minutes: 90
3924
permissions:
@@ -117,7 +102,7 @@ jobs:
117102
retention-days: 90
118103

119104
build:
120-
name: Build
105+
name: Documentation site build · Ubuntu 24.04 · Python 3.12
121106
needs: benchmark
122107
if: always() && (needs.benchmark.result == 'success' || needs.benchmark.result == 'skipped')
123108
runs-on: ubuntu-24.04
@@ -139,7 +124,6 @@ jobs:
139124
run: python -m pip install -e ".[docs,qa]"
140125

141126
- name: Download generated Performance snapshot
142-
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
143127
uses: actions/download-artifact@v4
144128
with:
145129
name: performance-snapshot
@@ -162,7 +146,7 @@ jobs:
162146
path: site
163147

164148
deploy:
165-
name: Deploy
149+
name: Documentation deployment · GitHub Pages
166150
if: github.ref == 'refs/heads/main' && github.event_name != 'pull_request'
167151
environment:
168152
name: github-pages

.github/workflows/fortran-toolchain-smoke.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
name: Smoke Tests
1+
name: Compiler Compatibility
22

33
on:
4-
pull_request:
5-
types: [opened, synchronize, reopened]
64
push:
75
branches:
86
- main
@@ -22,7 +20,7 @@ env:
2220

2321
jobs:
2422
toolchain-smoke:
25-
name: ${{ matrix.display_name }}
23+
name: Compiler smoke · ${{ matrix.display_name }}
2624
runs-on: ubuntu-24.04
2725
timeout-minutes: 60
2826
permissions:
@@ -32,13 +30,13 @@ jobs:
3230
matrix:
3331
include:
3432
- toolchain: ifx
35-
display_name: Linux · Intel IFX 2026.1.1 · Python 3.12
33+
display_name: Ubuntu 24.04 · Intel IFX 2026.1.1 · Python 3.12
3634
environment: prik-ifx-2026.1.1
3735
fortran_compiler: ifx
3836
c_compiler: icx
3937
cache_version: "2026.1.1-v2"
4038
- toolchain: flang
41-
display_name: Linux · LLVM Flang 22.1.8 · Python 3.12
39+
display_name: Ubuntu 24.04 · LLVM Flang 22.1.8 · Python 3.12
4240
environment: prik-flang-22.1.8
4341
fortran_compiler: flang
4442
c_compiler: clang
@@ -120,7 +118,7 @@ jobs:
120118
done
121119
122120
macos-flang-smoke:
123-
name: macOS 15 ARM64 · LLVM Flang · Python 3.12
121+
name: Compiler smoke · macOS 15 ARM64 · LLVM Flang · Python 3.12
124122
runs-on: macos-15
125123
timeout-minutes: 60
126124
permissions:

0 commit comments

Comments
 (0)