From f91d3183027fe8a9df62dc04da1167928b27f841 Mon Sep 17 00:00:00 2001 From: Andrew Fitzgibbon Date: Wed, 15 Apr 2026 18:17:45 +0100 Subject: [PATCH 01/12] CI: add cached linux/386 test lane and 32-bit xfails --- .github/workflows/ci.yaml | 34 ++++++++++++++++++++++ BUILDING.md | 5 ++++ etc/linux-386.Dockerfile | 19 +++++++++++++ etc/test-linux-386.sh | 40 ++++++++++++++++++++++++++ test/conftest.py | 59 +++++++++++++++++++++++++++++++++++++++ test/test_jax.py | 5 ++-- test/test_microxcaling.py | 16 +++++------ test/test_torch.py | 3 +- 8 files changed, 170 insertions(+), 11 deletions(-) create mode 100644 etc/linux-386.Dockerfile create mode 100644 etc/test-linux-386.sh create mode 100644 test/conftest.py diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index ffa0db7..941fe8d 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -41,3 +41,37 @@ jobs: - name: Ensure that docs build run: | cd docs && make html + + pytest-linux-386: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Restore cached linux/386 docker image + id: cache-linux-386-image + uses: actions/cache@v4 + with: + path: /tmp/gfloat-linux-386-image.tar + key: ${{ runner.os }}-linux-386-image-${{ hashFiles('etc/linux-386.Dockerfile', 'requirements.txt', 'requirements-dev.txt', 'pyproject.toml') }} + + - name: Enable QEMU for 32-bit emulation + uses: docker/setup-qemu-action@v3 + with: + platforms: 386 + + - name: Load cached linux/386 docker image + run: | + if [ -f /tmp/gfloat-linux-386-image.tar ]; then + docker load -i /tmp/gfloat-linux-386-image.tar + fi + + - name: Run full unit tests on linux/386 + run: | + bash etc/test-linux-386.sh + + - name: Save linux/386 docker image to cache path + if: always() + run: | + docker image inspect gfloat-linux-386:py310-uv >/dev/null 2>&1 + docker save gfloat-linux-386:py310-uv -o /tmp/gfloat-linux-386-image.tar diff --git a/BUILDING.md b/BUILDING.md index c62cab2..f3a99c2 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -8,6 +8,11 @@ pip install -e . # Install packages for testing - will install JAX, Torch, etc. pip install -r requirements-dev.txt pytest . + +# Full unit test suite (test/) on 32-bit linux/386 in Docker +bash etc/test-linux-386.sh +# Rebuild the cached linux/386 test image when dependencies change +GFLOAT_LINUX386_REBUILD=1 bash etc/test-linux-386.sh ``` #### Pushing diff --git a/etc/linux-386.Dockerfile b/etc/linux-386.Dockerfile new file mode 100644 index 0000000..7c861f6 --- /dev/null +++ b/etc/linux-386.Dockerfile @@ -0,0 +1,19 @@ +# Copyright (c) 2024 Graphcore Ltd. All rights reserved. + +FROM python:3.10-slim + +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update \ + && apt-get install -y --no-install-recommends build-essential \ + && rm -rf /var/lib/apt/lists/* + +RUN python -m pip install -U pip uv \ + && uv pip install --system \ + "numpy<2" \ + pytest \ + nbval \ + ml_dtypes \ + array-api-compat \ + array-api-strict \ + more_itertools diff --git a/etc/test-linux-386.sh b/etc/test-linux-386.sh new file mode 100644 index 0000000..b01b2a9 --- /dev/null +++ b/etc/test-linux-386.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +# Copyright (c) 2024 Graphcore Ltd. All rights reserved. + +set -euo pipefail + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)" + +IMAGE="gfloat-linux-386:py310-uv" +PLATFORM="linux/386" +DOCKERFILE="etc/linux-386.Dockerfile" + +echo "Running full unit tests in Docker (${PLATFORM})" + +if ! docker info >/dev/null 2>&1; then + echo "Docker daemon is not running; start Docker and rerun this script." >&2 + exit 1 +fi + +if [[ "${GFLOAT_LINUX386_REBUILD:-0}" == "1" ]] || ! docker image inspect "${IMAGE}" >/dev/null 2>&1; then + echo "Building test image ${IMAGE} for ${PLATFORM} (cached after first build)" + docker buildx build \ + --platform "${PLATFORM}" \ + --load \ + -t "${IMAGE}" \ + -f "${REPO_DIR}/${DOCKERFILE}" \ + "${REPO_DIR}" +fi + +docker run --rm \ +--platform "${PLATFORM}" \ +-v "${REPO_DIR}:/work" \ +-w /work \ +"${IMAGE}" \ +bash -lc ' + set -euo pipefail + export PYTHONPATH="/work/src${PYTHONPATH:+:${PYTHONPATH}}" + python -m pytest -vv test +' diff --git a/test/conftest.py b/test/conftest.py new file mode 100644 index 0000000..9968275 --- /dev/null +++ b/test/conftest.py @@ -0,0 +1,59 @@ +# Copyright (c) 2024 Graphcore Ltd. All rights reserved. + +import struct + +import pytest + + +def _is_32bit_python() -> bool: + return struct.calcsize("P") * 8 == 32 + + +def pytest_collection_modifyitems( + config: pytest.Config, items: list[pytest.Item] +) -> None: + if not _is_32bit_python(): + return + + mark = pytest.mark.xfail( + reason="Known 32-bit regressions (issue #57)", + strict=False, + ) + + for item in items: + nodeid = item.nodeid + + if nodeid.startswith("test/test_array_api.py::"): + item.add_marker(mark) + continue + + if nodeid.startswith( + "test/test_round.py::test_stochastic_rounding_scalar_eq_array" + ): + item.add_marker(mark) + continue + + if nodeid.startswith("test/test_encode.py::test_encode["): + item.add_marker(mark) + continue + + if nodeid.startswith("test/test_encode.py::test_encode_edges[encode_ndarray-"): + item.add_marker(mark) + continue + + if ( + nodeid.startswith("test/test_decode.py::test_spot_check_") + and "[array]" in nodeid + ): + item.add_marker(mark) + continue + + if ( + nodeid.startswith("test/test_decode.py::test_specials_decode[") + and "[array-" in nodeid + ): + item.add_marker(mark) + continue + + if nodeid.startswith("test/test_decode.py::test_consistent_decodes_all_values["): + item.add_marker(mark) diff --git a/test/test_jax.py b/test/test_jax.py index 02d5d04..e0697d9 100644 --- a/test/test_jax.py +++ b/test/test_jax.py @@ -1,9 +1,10 @@ # Copyright (c) 2024 Graphcore Ltd. All rights reserved. import numpy as np +import pytest -import jax -import jax.numpy as jnp +jax = pytest.importorskip("jax") +jnp = pytest.importorskip("jax.numpy") import ml_dtypes diff --git a/test/test_microxcaling.py b/test/test_microxcaling.py index d1edcb8..a155f2d 100644 --- a/test/test_microxcaling.py +++ b/test/test_microxcaling.py @@ -5,14 +5,14 @@ import numpy as np from numpy.typing import NDArray -import torch - -from torchao.prototype.mx_formats.mx_tensor import MXTensor -from torchao.prototype.mx_formats.constants import ( - DTYPE_FP6_E2M3, - DTYPE_FP6_E3M2, - DTYPE_FP4, -) +torch = pytest.importorskip("torch") +mx_tensor_module = pytest.importorskip("torchao.prototype.mx_formats.mx_tensor") +mx_constants_module = pytest.importorskip("torchao.prototype.mx_formats.constants") + +MXTensor = mx_tensor_module.MXTensor +DTYPE_FP6_E2M3 = mx_constants_module.DTYPE_FP6_E2M3 +DTYPE_FP6_E3M2 = mx_constants_module.DTYPE_FP6_E3M2 +DTYPE_FP4 = mx_constants_module.DTYPE_FP4 from gfloat import ( BlockFormatInfo, diff --git a/test/test_torch.py b/test/test_torch.py index 2b81cff..91a1080 100644 --- a/test/test_torch.py +++ b/test/test_torch.py @@ -3,7 +3,8 @@ import pytest import numpy.typing as npt -import torch + +torch = pytest.importorskip("torch") from gfloat import FormatInfo, RoundMode, round_ndarray from gfloat.formats import format_info_ocp_e5m2, format_info_p3109 From fdc04435c8950cf2ff041fa790589356c22571cc Mon Sep 17 00:00:00 2001 From: Andrew Fitzgibbon Date: Wed, 15 Apr 2026 21:23:04 +0100 Subject: [PATCH 02/12] Improve linux/386 build log visibility --- etc/linux-386.Dockerfile | 24 +++++++++++++++--------- etc/test-linux-386.sh | 1 + 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/etc/linux-386.Dockerfile b/etc/linux-386.Dockerfile index 7c861f6..578029a 100644 --- a/etc/linux-386.Dockerfile +++ b/etc/linux-386.Dockerfile @@ -8,12 +8,18 @@ RUN apt-get update \ && apt-get install -y --no-install-recommends build-essential \ && rm -rf /var/lib/apt/lists/* -RUN python -m pip install -U pip uv \ - && uv pip install --system \ - "numpy<2" \ - pytest \ - nbval \ - ml_dtypes \ - array-api-compat \ - array-api-strict \ - more_itertools +RUN python -m pip install -U pip uv + +RUN NINJAFLAGS='-v' python -m pip install -v --no-cache-dir \ + "numpy<2" + +RUN NINJAFLAGS='-v' UV_NO_PROGRESS=1 uv pip install --system \ + psutil \ + ml_dtypes + +RUN UV_NO_PROGRESS=1 uv pip install --system \ + pytest \ + nbval \ + array-api-compat \ + array-api-strict \ + more_itertools diff --git a/etc/test-linux-386.sh b/etc/test-linux-386.sh index b01b2a9..a79a758 100644 --- a/etc/test-linux-386.sh +++ b/etc/test-linux-386.sh @@ -21,6 +21,7 @@ fi if [[ "${GFLOAT_LINUX386_REBUILD:-0}" == "1" ]] || ! docker image inspect "${IMAGE}" >/dev/null 2>&1; then echo "Building test image ${IMAGE} for ${PLATFORM} (cached after first build)" docker buildx build \ + --progress=plain \ --platform "${PLATFORM}" \ --load \ -t "${IMAGE}" \ From 1ff6517f2d91f2d180838c46840bc79d0352f166 Mon Sep 17 00:00:00 2001 From: Andrew Fitzgibbon Date: Wed, 15 Apr 2026 22:37:26 +0100 Subject: [PATCH 03/12] Speed up ml_dtypes build on linux/386 --- etc/linux-386.Dockerfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/etc/linux-386.Dockerfile b/etc/linux-386.Dockerfile index 578029a..053470d 100644 --- a/etc/linux-386.Dockerfile +++ b/etc/linux-386.Dockerfile @@ -13,11 +13,13 @@ RUN python -m pip install -U pip uv RUN NINJAFLAGS='-v' python -m pip install -v --no-cache-dir \ "numpy<2" -RUN NINJAFLAGS='-v' UV_NO_PROGRESS=1 uv pip install --system \ - psutil \ +RUN NINJAFLAGS='-v' UV_NO_PROGRESS=1 uv pip install -v --system \ + psutil + +RUN NINJAFLAGS='-v' python -m pip install -v --no-build-isolation --no-cache-dir \ ml_dtypes -RUN UV_NO_PROGRESS=1 uv pip install --system \ +RUN UV_NO_PROGRESS=1 uv pip install -v --system \ pytest \ nbval \ array-api-compat \ From 58514c1cf352c31dbbcebfcb24fda2ef2f984d24 Mon Sep 17 00:00:00 2001 From: Andrew Fitzgibbon Date: Thu, 16 Apr 2026 09:25:29 +0100 Subject: [PATCH 04/12] comment, and CI cache test --- BUILDING.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/BUILDING.md b/BUILDING.md index f3a99c2..65c4910 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -9,7 +9,7 @@ pip install -e . pip install -r requirements-dev.txt pytest . -# Full unit test suite (test/) on 32-bit linux/386 in Docker +# Run tests on 32-bit linux/386 in Docker bash etc/test-linux-386.sh # Rebuild the cached linux/386 test image when dependencies change GFLOAT_LINUX386_REBUILD=1 bash etc/test-linux-386.sh From 8bc818e1e17888d93e97b44d4cacb068efcc8276 Mon Sep 17 00:00:00 2001 From: Andrew Fitzgibbon Date: Thu, 16 Apr 2026 09:40:21 +0100 Subject: [PATCH 05/12] Update CI actions for Node 24 runtime --- .github/workflows/ci.yaml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 941fe8d..b56eb73 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -6,13 +6,16 @@ on: push: branches: [main] +env: + FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true + jobs: pytest-container: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - uses: actions/setup-python@v4 + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 with: python-version: "3.10" cache: "pip" @@ -46,17 +49,17 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v6 - name: Restore cached linux/386 docker image id: cache-linux-386-image - uses: actions/cache@v4 + uses: actions/cache@v5 with: path: /tmp/gfloat-linux-386-image.tar key: ${{ runner.os }}-linux-386-image-${{ hashFiles('etc/linux-386.Dockerfile', 'requirements.txt', 'requirements-dev.txt', 'pyproject.toml') }} - name: Enable QEMU for 32-bit emulation - uses: docker/setup-qemu-action@v3 + uses: docker/setup-qemu-action@v4 with: platforms: 386 From 5662496952e4731381f3e1e1b30f3deba4c0d1f6 Mon Sep 17 00:00:00 2001 From: Andrew Fitzgibbon Date: Thu, 16 Apr 2026 10:13:16 +0100 Subject: [PATCH 06/12] Add load/build/run modes for linux/386 test script --- BUILDING.md | 9 +++++-- etc/test-linux-386.sh | 58 ++++++++++++++++++++++++++++++++++--------- 2 files changed, 53 insertions(+), 14 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 65c4910..ae334ad 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -10,9 +10,14 @@ pip install -r requirements-dev.txt pytest . # Run tests on 32-bit linux/386 in Docker +# Build image if missing, then run tests bash etc/test-linux-386.sh -# Rebuild the cached linux/386 test image when dependencies change -GFLOAT_LINUX386_REBUILD=1 bash etc/test-linux-386.sh +# Build image if missing +bash etc/test-linux-386.sh load +# Force rebuild image +bash etc/test-linux-386.sh build +# Run tests only (requires existing image) +bash etc/test-linux-386.sh run ``` #### Pushing diff --git a/etc/test-linux-386.sh b/etc/test-linux-386.sh index a79a758..25b13dc 100644 --- a/etc/test-linux-386.sh +++ b/etc/test-linux-386.sh @@ -10,6 +10,20 @@ REPO_DIR="$(cd "${SCRIPT_DIR}/.." && pwd)" IMAGE="gfloat-linux-386:py310-uv" PLATFORM="linux/386" DOCKERFILE="etc/linux-386.Dockerfile" +MODE="${1:-all}" + +usage() { + echo "Usage: bash etc/test-linux-386.sh [load|build|run]" + echo " load Build image only if missing" + echo " build Force rebuild image" + echo " run Run tests (image must already exist)" + echo " (no arg) Build image if missing, then run tests" +} + +if [[ "${MODE}" != "all" && "${MODE}" != "load" && "${MODE}" != "build" && "${MODE}" != "run" ]]; then + usage + exit 2 +fi echo "Running full unit tests in Docker (${PLATFORM})" @@ -18,8 +32,8 @@ if ! docker info >/dev/null 2>&1; then exit 1 fi -if [[ "${GFLOAT_LINUX386_REBUILD:-0}" == "1" ]] || ! docker image inspect "${IMAGE}" >/dev/null 2>&1; then - echo "Building test image ${IMAGE} for ${PLATFORM} (cached after first build)" +if [[ "${MODE}" == "build" ]]; then + echo "Force-building test image ${IMAGE} for ${PLATFORM}" docker buildx build \ --progress=plain \ --platform "${PLATFORM}" \ @@ -29,13 +43,33 @@ if [[ "${GFLOAT_LINUX386_REBUILD:-0}" == "1" ]] || ! docker image inspect "${IMA "${REPO_DIR}" fi -docker run --rm \ ---platform "${PLATFORM}" \ --v "${REPO_DIR}:/work" \ --w /work \ -"${IMAGE}" \ -bash -lc ' - set -euo pipefail - export PYTHONPATH="/work/src${PYTHONPATH:+:${PYTHONPATH}}" - python -m pytest -vv test -' +if [[ "${MODE}" == "load" || "${MODE}" == "all" ]]; then + if ! docker image inspect "${IMAGE}" >/dev/null 2>&1; then + echo "Building test image ${IMAGE} for ${PLATFORM} (cached after first build)" + docker buildx build \ + --progress=plain \ + --platform "${PLATFORM}" \ + --load \ + -t "${IMAGE}" \ + -f "${REPO_DIR}/${DOCKERFILE}" \ + "${REPO_DIR}" + fi +fi + +if [[ "${MODE}" == "run" || "${MODE}" == "all" ]]; then + if ! docker image inspect "${IMAGE}" >/dev/null 2>&1; then + echo "Image ${IMAGE} not found. Run 'bash etc/test-linux-386.sh load' first." >&2 + exit 1 + fi + + docker run --rm \ + --platform "${PLATFORM}" \ + -v "${REPO_DIR}:/work" \ + -w /work \ + "${IMAGE}" \ + bash -lc ' + set -euo pipefail + export PYTHONPATH="/work/src${PYTHONPATH:+:${PYTHONPATH}}" + python -m pytest -vv test + ' +fi From 646ef179ccf2754bdb13ae4c7900d5bd92a5320e Mon Sep 17 00:00:00 2001 From: Andrew Fitzgibbon Date: Thu, 16 Apr 2026 10:15:05 +0100 Subject: [PATCH 07/12] Split linux/386 CI load/run and DRY buildx call --- .github/workflows/ci.yaml | 6 +++++- etc/test-linux-386.sh | 26 ++++++++++++-------------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b56eb73..5fdbf97 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -69,9 +69,13 @@ jobs: docker load -i /tmp/gfloat-linux-386-image.tar fi + - name: Ensure linux/386 test image is available + run: | + bash etc/test-linux-386.sh load + - name: Run full unit tests on linux/386 run: | - bash etc/test-linux-386.sh + bash etc/test-linux-386.sh run - name: Save linux/386 docker image to cache path if: always() diff --git a/etc/test-linux-386.sh b/etc/test-linux-386.sh index 25b13dc..d2752fc 100644 --- a/etc/test-linux-386.sh +++ b/etc/test-linux-386.sh @@ -20,6 +20,16 @@ usage() { echo " (no arg) Build image if missing, then run tests" } +build_image() { + docker buildx build \ + --progress=plain \ + --platform "${PLATFORM}" \ + --load \ + -t "${IMAGE}" \ + -f "${REPO_DIR}/${DOCKERFILE}" \ + "${REPO_DIR}" +} + if [[ "${MODE}" != "all" && "${MODE}" != "load" && "${MODE}" != "build" && "${MODE}" != "run" ]]; then usage exit 2 @@ -34,25 +44,13 @@ fi if [[ "${MODE}" == "build" ]]; then echo "Force-building test image ${IMAGE} for ${PLATFORM}" - docker buildx build \ - --progress=plain \ - --platform "${PLATFORM}" \ - --load \ - -t "${IMAGE}" \ - -f "${REPO_DIR}/${DOCKERFILE}" \ - "${REPO_DIR}" + build_image fi if [[ "${MODE}" == "load" || "${MODE}" == "all" ]]; then if ! docker image inspect "${IMAGE}" >/dev/null 2>&1; then echo "Building test image ${IMAGE} for ${PLATFORM} (cached after first build)" - docker buildx build \ - --progress=plain \ - --platform "${PLATFORM}" \ - --load \ - -t "${IMAGE}" \ - -f "${REPO_DIR}/${DOCKERFILE}" \ - "${REPO_DIR}" + build_image fi fi From af42ed5b1a5c83c1e9fe171376266a8966da7243 Mon Sep 17 00:00:00 2001 From: Andrew Fitzgibbon Date: Thu, 16 Apr 2026 10:17:41 +0100 Subject: [PATCH 08/12] Factor linux/386 test run into helper --- etc/test-linux-386.sh | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/etc/test-linux-386.sh b/etc/test-linux-386.sh index d2752fc..4ef4632 100644 --- a/etc/test-linux-386.sh +++ b/etc/test-linux-386.sh @@ -30,6 +30,19 @@ build_image() { "${REPO_DIR}" } +run_tests() { + docker run --rm \ + --platform "${PLATFORM}" \ + -v "${REPO_DIR}:/work" \ + -w /work \ + "${IMAGE}" \ + bash -lc ' + set -euo pipefail + export PYTHONPATH="/work/src${PYTHONPATH:+:${PYTHONPATH}}" + python -m pytest -vv test + ' +} + if [[ "${MODE}" != "all" && "${MODE}" != "load" && "${MODE}" != "build" && "${MODE}" != "run" ]]; then usage exit 2 @@ -59,15 +72,6 @@ if [[ "${MODE}" == "run" || "${MODE}" == "all" ]]; then echo "Image ${IMAGE} not found. Run 'bash etc/test-linux-386.sh load' first." >&2 exit 1 fi - - docker run --rm \ - --platform "${PLATFORM}" \ - -v "${REPO_DIR}:/work" \ - -w /work \ - "${IMAGE}" \ - bash -lc ' - set -euo pipefail - export PYTHONPATH="/work/src${PYTHONPATH:+:${PYTHONPATH}}" - python -m pytest -vv test - ' + + run_tests fi From 7f570948f2adfca77a04821304b63763134de6ca Mon Sep 17 00:00:00 2001 From: Andrew Fitzgibbon Date: Thu, 16 Apr 2026 10:42:24 +0100 Subject: [PATCH 09/12] pre-commit --- etc/test-linux-386.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/test-linux-386.sh b/etc/test-linux-386.sh index 4ef4632..5517d47 100644 --- a/etc/test-linux-386.sh +++ b/etc/test-linux-386.sh @@ -72,6 +72,6 @@ if [[ "${MODE}" == "run" || "${MODE}" == "all" ]]; then echo "Image ${IMAGE} not found. Run 'bash etc/test-linux-386.sh load' first." >&2 exit 1 fi - + run_tests fi From 3a79f95f43b4e691aa5b610af14f3f5c257799bc Mon Sep 17 00:00:00 2001 From: Andrew Fitzgibbon Date: Thu, 16 Apr 2026 10:59:46 +0100 Subject: [PATCH 10/12] simplify pip --- etc/linux-386.Dockerfile | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/etc/linux-386.Dockerfile b/etc/linux-386.Dockerfile index 053470d..6d07716 100644 --- a/etc/linux-386.Dockerfile +++ b/etc/linux-386.Dockerfile @@ -8,18 +8,10 @@ RUN apt-get update \ && apt-get install -y --no-install-recommends build-essential \ && rm -rf /var/lib/apt/lists/* -RUN python -m pip install -U pip uv - -RUN NINJAFLAGS='-v' python -m pip install -v --no-cache-dir \ - "numpy<2" - -RUN NINJAFLAGS='-v' UV_NO_PROGRESS=1 uv pip install -v --system \ - psutil - RUN NINJAFLAGS='-v' python -m pip install -v --no-build-isolation --no-cache-dir \ - ml_dtypes - -RUN UV_NO_PROGRESS=1 uv pip install -v --system \ + "numpy<2" \ + psutil \ + ml_dtypes \ pytest \ nbval \ array-api-compat \ From 73b2397a580bf0ac1544ca723c36c4919fea7321 Mon Sep 17 00:00:00 2001 From: Andrew Fitzgibbon Date: Thu, 16 Apr 2026 12:58:45 +0100 Subject: [PATCH 11/12] linux/386: install numpy before ml_dtypes build --- etc/linux-386.Dockerfile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/etc/linux-386.Dockerfile b/etc/linux-386.Dockerfile index 6d07716..f6e96bc 100644 --- a/etc/linux-386.Dockerfile +++ b/etc/linux-386.Dockerfile @@ -8,10 +8,14 @@ RUN apt-get update \ && apt-get install -y --no-install-recommends build-essential \ && rm -rf /var/lib/apt/lists/* -RUN NINJAFLAGS='-v' python -m pip install -v --no-build-isolation --no-cache-dir \ - "numpy<2" \ +RUN NINJAFLAGS='-v' python -m pip install -v --no-cache-dir \ + "numpy<2" + +RUN NINJAFLAGS='-v' python -m pip install -v --no-build-isolation --no-deps --no-cache-dir \ + ml_dtypes + +RUN NINJAFLAGS='-v' python -m pip install -v --no-cache-dir \ psutil \ - ml_dtypes \ pytest \ nbval \ array-api-compat \ From fce9215944392821df1ada8957082a4af8fad260 Mon Sep 17 00:00:00 2001 From: Andrew Fitzgibbon Date: Thu, 16 Apr 2026 15:37:45 +0100 Subject: [PATCH 12/12] update doc --- BUILDING.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index ae334ad..6474f96 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -2,14 +2,16 @@ ## BUILDING -``` +```sh pip install -e . ( cd docs && make html ) # Install packages for testing - will install JAX, Torch, etc. pip install -r requirements-dev.txt pytest . +``` -# Run tests on 32-bit linux/386 in Docker +To run tests on 32-bit linux/386 in Docker: +```sh # Build image if missing, then run tests bash etc/test-linux-386.sh # Build image if missing @@ -20,7 +22,9 @@ bash etc/test-linux-386.sh build bash etc/test-linux-386.sh run ``` -#### Pushing -``` +#### Packaging for pypi release: + +Edit version number in +```sh sh etc/package.sh ```