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
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -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 .
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml → .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: Tests

on:
push:
Expand All @@ -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
Expand Down
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
<img src="https://raw.githubusercontent.com/facebookresearch/tensor-layouts/main/docs/images/logo.svg" alt="tensor-layouts" width="520">
</p>

[![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)

Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions docs/generate_figures.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed unused variables and computation to align with ruff lint

ok = c // tk
y = M - 1 - r
rect = patches.Rectangle(
(c, y), 1, 1,
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down
5 changes: 4 additions & 1 deletion tests/paper_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Converted lambda expression to function to align with ruff lint

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes that all makes sense. Thanks Soumyadip!

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)
Expand Down
Loading