From e60580be587559b465ecb81324b7192eb32e0189 Mon Sep 17 00:00:00 2001 From: Soumyadip Sarkar Date: Thu, 23 Apr 2026 05:38:12 +0530 Subject: [PATCH] Add Python 3.14 and lint job to CI --- .github/workflows/lint.yml | 25 +++++++++++++++++++++++++ .github/workflows/{ci.yml => tests.yml} | 4 ++-- README.md | 7 ++++--- docs/generate_figures.py | 4 ++-- pyproject.toml | 1 + tests/paper_examples.py | 5 ++++- 6 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/lint.yml rename .github/workflows/{ci.yml => tests.yml} (86%) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..536dec4 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +name: Lint + +on: + push: + branches: [main] + pull_request: + branches: [main] + +jobs: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set up Python 3.12 + uses: actions/setup-python@v5 + with: + python-version: "3.12" + + - name: Install package + run: pip install -e ".[dev]" + + - name: Run lint + run: ruff check . diff --git a/.github/workflows/ci.yml b/.github/workflows/tests.yml similarity index 86% rename from .github/workflows/ci.yml rename to .github/workflows/tests.yml index f559f42..095f1d6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/tests.yml @@ -1,4 +1,4 @@ -name: CI +name: Tests on: push: @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12", "3.13"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - uses: actions/checkout@v4 diff --git a/README.md b/README.md index 2f18cd8..760b2ae 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ tensor-layouts

-[![CI](https://github.com/facebookresearch/tensor-layouts/actions/workflows/ci.yml/badge.svg)](https://github.com/facebookresearch/tensor-layouts/actions/workflows/ci.yml) +[![Lint](https://github.com/facebookresearch/tensor-layouts/actions/workflows/lint.yml/badge.svg)](https://github.com/facebookresearch/tensor-layouts/actions/workflows/lint.yml) +[![Tests](https://github.com/facebookresearch/tensor-layouts/actions/workflows/tests.yml/badge.svg)](https://github.com/facebookresearch/tensor-layouts/actions/workflows/tests.yml) [![PyPI](https://img.shields.io/pypi/v/tensor-layouts)](https://pypi.org/project/tensor-layouts/) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/facebookresearch/tensor-layouts/blob/main/LICENSE) @@ -222,10 +223,10 @@ pytest tests/oracle_amd.py - [CuTe Layout Representation and Algebra — Cris Cecka](https://arxiv.org/abs/2603.02298) - [Categorical Foundations for CuTe Layouts — Jack Carlisle, Jay Shah, Reuben Stern, Paul VanKoughnett](https://arxiv.org/abs/2601.05972) -- [CuTe Documentation](https://github.com/NVIDIA/cutlass/blob/main/media/docs/cute/00_quickstart.md) +- [CuTe Documentation](https://github.com/NVIDIA/cutlass/blob/main/media/docs/cpp/cute/00_quickstart.md) - [NVIDIA PTX ISA](https://docs.nvidia.com/cuda/parallel-thread-execution/) - [NVIDIA Cutlass](https://github.com/NVIDIA/cutlass) -- [Cutlass MMA Atoms](https://github.com/NVIDIA/cutlass/blob/main/media/docs/cute/0t_mma_atom.md) +- [Cutlass MMA Atoms](https://github.com/NVIDIA/cutlass/blob/main/media/docs/cpp/cute/0t_mma_atom.md) - [AMD Matrix Instruction Calculator](https://github.com/ROCm/amd_matrix_instruction_calculator) - [AMD Matrix Cores Lab Notes](https://gpuopen.com/learn/amd-lab-notes/amd-lab-notes-matrix-cores-readme/) - [Intel DPAS / VISA instruction specification](https://github.com/intel/intel-graphics-compiler/blob/master/documentation/visa/instructions/DPAS.md) diff --git a/docs/generate_figures.py b/docs/generate_figures.py index d2b593a..693a5a7 100644 --- a/docs/generate_figures.py +++ b/docs/generate_figures.py @@ -75,8 +75,8 @@ def _draw_grid(ax, cell_text_fn, title, subtitle): """Draw M×K grid with colored tiles and per-cell text.""" for r in range(M): for c in range(K): - om, im = r // tm, r % tm - ok, ik = c // tk, c % tk + om = r // tm + ok = c // tk y = M - 1 - r rect = patches.Rectangle( (c, y), 1, 1, diff --git a/pyproject.toml b/pyproject.toml index 991fd02..3700a62 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -23,6 +23,7 @@ classifiers = [ "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Topic :: Scientific/Engineering", "Topic :: Software Development :: Libraries", ] diff --git a/tests/paper_examples.py b/tests/paper_examples.py index 814399e..74e5391 100644 --- a/tests/paper_examples.py +++ b/tests/paper_examples.py @@ -583,7 +583,10 @@ def test_table1_integer_linear_form(): def test_table1_coordinate_linear_form(): """Table 1: coordinate strides form the 2×3 matrix [e1, e0, 6e1].""" - coord_layout = lambda row, col0, col1: (col0, row + 6 * col1) + + def coord_layout(row, col0, col1): + return (col0, row + 6 * col1) + assert coord_layout(1, 0, 0) == (0, 1) assert coord_layout(0, 1, 0) == (1, 0) assert coord_layout(0, 0, 1) == (0, 6)