Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
6 changes: 3 additions & 3 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
submodules: recursive

- name: Install compiler and CMake
run: sudo apt-get install -y cmake clang
run: sudo apt-get install -y cmake gcc-14 g++-14

- name: Install torch (CPU) and the build backend
run: |
Expand All @@ -37,6 +37,6 @@ jobs:

- name: Build and install bartorch
env:
CC: clang
CXX: clang++
CC: gcc-14
CXX: g++-14
run: pip install -e . --no-build-isolation
11 changes: 6 additions & 5 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,10 @@ jobs:
python-version: "3.12"
cache: pip

# libbartorch is a clang build: BART's nested functions become Blocks.
- name: Install the compiler, OpenMP and CMake
run: sudo apt-get install -y cmake clang libomp-dev
# GCC 14, as upstream BART builds on Linux: its heap trampolines are
# what BART's nested functions need.
- name: Install the compiler and CMake
run: sudo apt-get install -y cmake gcc-14 g++-14

- name: Install torch (CPU) and the build backend
run: |
Expand All @@ -119,8 +120,8 @@ jobs:

- name: Build and install bartorch
env:
CC: clang
CXX: clang++
CC: gcc-14
CXX: g++-14
run: pip install -e . --no-build-isolation

- name: Install the documentation and example requirements
Expand Down
18 changes: 12 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,19 +208,25 @@ jobs:
-w wheelhouse/ --plat manylinux_2_28_x86_64 \
--exclude libcudart.so.12 --exclude libcufft.so.11 \
--exclude libcublas.so.12 --exclude libcublasLt.so.12
- name: Check that it loads without a card
# The wheel carries no interpreter, so it is loaded from each Python the
# package supports.
- name: Check that it loads without a card, on every Python
run: |
/opt/python/cp312-cp312/bin/python -m pip install wheelhouse/*.whl \
torch --index-url https://download.pytorch.org/whl/cpu \
--extra-index-url https://pypi.org/simple
/opt/python/cp312-cp312/bin/python -c "
for py in cp310-cp310 cp311-cp311 cp312-cp312 cp313-cp313 cp314-cp314; do
python=/opt/python/$py/bin/python
$python -m pip install wheelhouse/*.whl \
torch --index-url https://download.pytorch.org/whl/cpu \
--extra-index-url https://pypi.org/simple
$python -c "
import sys
import bartorch
from bartorch import _cuda
info = bartorch.build_info()
print(info)
print(sys.version.split()[0], info)
assert 'cuda=ON' in info, info
print('devices:', _cuda.device_count())
"
done
- uses: actions/upload-artifact@v4
with:
name: cuda-wheel
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"

jobs:
# BART's nested functions become Blocks under clang and heap trampolines
# under GCC 14. Each platform runs the oldest and the newest Python the
# The toolchains are upstream BART's: GCC 14 on Linux, whose heap
# trampolines carry BART's nested functions, and clang on macOS, where they
# become Blocks. Each platform runs the oldest and the newest Python the
# package supports; the wheel workflow tests the wheel on both as well.
# Windows is clang from MSYS2's CLANG64 environment, linked against the
# Universal C Runtime that official CPython uses.
Expand All @@ -26,7 +27,7 @@ jobs:
extras: "[mkl]"
- os: ubuntu-latest
python-version: "3.14"
cc: clang
cc: gcc-14
# One job measures coverage for Codecov; the rest only test.
coverage: true
- os: macos-latest
Expand Down Expand Up @@ -210,8 +211,8 @@ jobs:
python-version: "3.12"
cache: pip

- name: Install the CUDA toolkit, clang and OpenMP
run: sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends cmake clang libomp-dev nvidia-cuda-toolkit
- name: Install the CUDA toolkit and GCC
run: sudo apt-get update -qq && sudo apt-get install -y --no-install-recommends cmake gcc-14 g++-14 g++-12 nvidia-cuda-toolkit

- name: Install torch (CPU) and the build backend
run: |
Expand All @@ -226,10 +227,13 @@ jobs:
- name: Install torchvision from the same index as torch
run: pip install torchvision --index-url https://download.pytorch.org/whl/cpu

# BART is GCC 14's, for its heap trampolines; the host side of the
# kernels is GCC 12's, the newest this distribution's nvcc accepts.
- name: Build with BART's CUDA kernels
env:
CC: clang
CXX: clang++
CC: gcc-14
CXX: g++-14
CUDAHOSTCXX: g++-12
run: pip install -e . --no-build-isolation --config-settings=cmake.define.BARTORCH_CUDA=ON

- name: The CUDA build must report its device code and run on the host
Expand Down
4 changes: 3 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -624,7 +624,9 @@ the stack needs an executable stack, which glibc 2.41 refuses to `dlopen`; so
GCC 14's `-ftrampoline-impl=heap` is required and older GCC is rejected at
configure time. BART's own `NOEXEC_STACK` workaround does not help here: it
parses a trampoline layout GCC emits only for non-PIC executables, not for a
shared library. Both compilers are built and tested in CI.
shared library. CI builds and tests with upstream BART's toolchains, GCC 14 on
Linux and clang on macOS, and with clang on Windows, whose Blocks come from the
vendored runtime.

**Windows** is LLP64: `long` is 32 bits, so BART keeps every extent, stride
and flag set in the fixed-width types of `misc/dimtypes.h` (`bart_dim_t`,
Expand Down
3 changes: 1 addition & 2 deletions docs/guides/developer/pull-requests.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@ template:
| Validation | The commands run and their results; for a numerical change, the reference and the tolerance; hardware or optional dependencies that were not available |
| Public API and documentation | Changes to public behaviour and the documentation updated for them |

CI runs the test matrix (Linux with GCC 14 and clang, macOS and Windows with
clang, each on Python 3.10 and 3.14, and a CUDA build without a device), the lint and spelling checks, and two documentation builds:
CI runs the test matrix (Linux with GCC 14, macOS and Windows with clang, each on Python 3.10 and 3.14, and a CUDA build without a device), the lint and spelling checks, and two documentation builds:
the reference without the compiled library, and the executed gallery, which is
published from `main` and from release tags. A pull request is merged when CI passes and a
maintainer has approved it.
Loading