Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
67228c3
Update README.md with the high-level technical plan
davorchap Sep 30, 2025
f2f3c80
Create GPU_vs_Tenstorrent.md
davorchap Sep 30, 2025
70af1a6
Create kernel_authoring_comparison.md
davorchap Sep 30, 2025
8fb44f7
Update README.md with links to GPU comparison docs
davorchap Sep 30, 2025
3e30147
Update docs link typo in README.md
davorchap Sep 30, 2025
a0ebb83
Update README.md with correct link
davorchap Sep 30, 2025
fb0eb12
Add Tenstorrent matmul MVP project plan
davorchap Oct 1, 2025
02b290e
Add prompt record for TT matmul MVP plan
davorchap Oct 2, 2025
8489145
Merge pull request #1 from davorchap/tt-matmul-mvp-plan
davorchap Oct 3, 2025
a10c29f
Add Workstream 1 ticket docs
davorchap Oct 3, 2025
f69da9d
Detail Tenstorrent target registration ticket
davorchap Oct 3, 2025
0bd5e5f
Document Workstream 1 dependency graph
davorchap Oct 3, 2025
fdd7855
Merge pull request #2 from davorchap/tt-matmul-mvp-plan
davorchap Oct 3, 2025
83cd2f8
Register Tenstorrent target name
davorchap Oct 4, 2025
e26c53b
Add Tenstorrent target registration tests
davorchap Oct 4, 2025
98b342d
Rename available target constant
davorchap Oct 4, 2025
5a7dc1b
Revert "Rename available target constant"
davorchap Oct 4, 2025
93c43aa
Merge pull request #3 from davorchap/tt-matmul-mvp-plan
davorchap Oct 4, 2025
d61530e
Add Tenstorrent engine adapter stub
davorchap Oct 4, 2025
df6d00d
Style fixes after review
davorchap Oct 4, 2025
76c0f9f
Improve Tenstorrent engine adapter stub implementation
davorchap Oct 4, 2025
4241a4b
Add Tenstorrent backend CI workflow
davorchap Oct 4, 2025
9ccf604
Address PR review feedback
davorchap Oct 4, 2025
96eab2a
Reorder imports for better readability
davorchap Oct 4, 2025
25a762a
Address additional Copilot review feedback
davorchap Oct 4, 2025
7b661a5
Merge pull request #4 from davorchap/ws1-engine-adapter
davorchap Oct 4, 2025
f8d4899
Fix black formatting violations
davorchap Oct 4, 2025
4815187
Fix tzdata interactive prompt in CI
davorchap Oct 4, 2025
1503145
Merge pull request #5 from davorchap/fix-black-formatting
davorchap Oct 4, 2025
6df6ae8
Apply yapf formatting
davorchap Oct 4, 2025
f2a17db
Add TVM build caching to CI
davorchap Oct 4, 2025
fdb42bc
Replace black/ruff with format.sh in CI
davorchap Oct 4, 2025
131643e
Merge pull request #6 from davorchap/ci-improvements
davorchap Oct 4, 2025
1a244b7
Add caching for CI dependencies
davorchap Oct 4, 2025
aec02f4
Add CI documentation for Tenstorrent backend
davorchap Oct 4, 2025
9aed13f
Add requirements-mypy.txt for consistent caching
davorchap Oct 4, 2025
638c1e9
Update CI.md to document requirements-mypy.txt
davorchap Oct 4, 2025
02253d2
Use requirements-test.txt for build job pip packages
davorchap Oct 4, 2025
cb6a9ab
Merge pull request #7 from davorchap/cache-ci-dependencies
davorchap Oct 4, 2025
ea1e076
Replace heavy NVIDIA container with lightweight Ubuntu runner
davorchap Oct 4, 2025
e620037
Fix system dependencies package names
davorchap Oct 4, 2025
9b11081
Merge pull request #8 from davorchap/lighter-ci-container
davorchap Oct 4, 2025
782d533
Fix CI: Set dummy CUDA_HOME for setup.py
davorchap Oct 4, 2025
8d85dfc
Merge pull request #10 from davorchap/fix-ci-cuda-home
davorchap Oct 4, 2025
883b486
Add logging for TVM cache hit status in CI workflow
davorchap Oct 4, 2025
ac3cee9
Fix CI: Set USE_LLVM=true and skip nvcc check
davorchap Oct 4, 2025
28eea6f
Merge pull request #12 from davorchap/fix-ci-skip-commitid
davorchap Oct 4, 2025
e7c8b32
Merge pull request #11 from davorchap/feature/ci-cache-logging
davorchap Oct 4, 2025
257e72f
Update Tenstorrent CI workflow (#13)
davorchap Oct 5, 2025
52e6762
Update CI documentation with implementation details (#14)
davorchap Oct 5, 2025
9afe7f9
Add CLAUDE.md for AI assistant guidance
Oct 6, 2025
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
13 changes: 13 additions & 0 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copilot Instructions for TileLang Repository

## Review Guidelines
- Ensure all Python code follows PEP 8 standards.
- Check for proper documentation in docstrings.
- Verify that changes to CI workflows improve efficiency without breaking existing functionality.
- For C++ code, ensure clang-format compliance.
- Suggest improvements for performance in tensor operations.

## Additional Contexts
- TileLang is built on TVM and targets Tenstorrent hardware.
- Prioritize security in dependency updates.
- Encourage use of type hints in Python code.
218 changes: 218 additions & 0 deletions .github/workflows/tenstorrent-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,218 @@
name: Tenstorrent Backend CI

on:
pull_request:
paths:
- 'tilelang/engine/tt/**'
- 'testing/python/tt/**'
- 'tilelang/utils/target.py'
- '.github/workflows/tenstorrent-ci.yml'
push:
branches:
- main
- 'ws1-**'

# Auto-cancel superseded runs on the same branch/PR
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

env:
PYTHON_VERSION: '3.10'
PIP_DISABLE_PIP_VERSION_CHECK: '1'

jobs:
lint-and-format:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
# Include any file that can affect the lock of Python deps
cache-dependency-path: |
requirements-lint.txt
requirements-dev.txt
pyproject.toml

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-lint.txt

- name: Run format.sh check
run: |
bash format.sh
# Fail if the formatter changed files
if ! git diff --quiet; then
echo "Code formatting issues found."
git diff
exit 1
fi

build-and-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
cache-dependency-path: |
requirements-test.txt
requirements-build.txt
requirements.txt
pyproject.toml

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
cmake \
ninja-build \
llvm \
libedit-dev \
libxml2-dev \
zlib1g-dev

- name: Install Python dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-test.txt

# Compiler cache persisted via GitHub Actions cache
- name: Enable ccache
uses: hendrikmuhs/[email protected]
with:
# Key on OS and build config; ccache handles file-level caching internally
key: ${{ runner.os }}-ccache-llvm-${{ hashFiles('CMakeLists.txt') }}-v1
max-size: 2G
create-symlink: true

- name: Generate TVM cache key
id: tvm-cache-key
run: |
# Cache key based on TVM submodule commit hash
TVM_COMMIT=$(git rev-parse HEAD:3rdparty/tvm)
echo "tvm_commit=$TVM_COMMIT" >> $GITHUB_OUTPUT
echo "TVM submodule at commit: $TVM_COMMIT"

- name: Restore TVM build cache
id: cache-tvm-restore
uses: actions/cache/restore@v4
with:
path: |
build/tvm/
build/libtilelang*.so
build/3rdparty/
key: tvm-build-llvm-${{ steps.tvm-cache-key.outputs.tvm_commit }}-${{ runner.os }}
restore-keys: |
tvm-build-llvm-${{ steps.tvm-cache-key.outputs.tvm_commit }}-
tvm-build-llvm-

- name: Build TileLang with LLVM (ccache-enabled)
run: |
mkdir -p build
cd build
# Create config.cmake for TVM
cp ../3rdparty/tvm/cmake/config.cmake .
echo "set(USE_LLVM ON)" >> config.cmake
echo "set(USE_CUDA OFF)" >> config.cmake
# Configure with CMake; enable ccache via compiler launcher
cmake .. \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
# Build (use fewer jobs to avoid OOM on GitHub runners)
cmake --build . --config Release -j 2

- name: Install TileLang
run: |
# Copy built libraries to tilelang/lib
mkdir -p tilelang/lib
cp build/*.so tilelang/lib/ || true
# Install TVM Python package
# Set TVM_LIBRARY_PATH so TVM can find the built libraries
export TVM_LIBRARY_PATH=$(pwd)/build/tvm
cd 3rdparty/tvm/python
pip install -e .
cd ../../..
# Install TileLang
export USE_LLVM=true
pip install -e .

- name: Print ccache stats
if: always()
run: |
if command -v ccache >/dev/null 2>&1; then
ccache -s
else
echo "ccache not found; skipping stats."
fi

- name: Run Tenstorrent target registration tests
run: |
export LD_LIBRARY_PATH=$(pwd)/build/tvm:$LD_LIBRARY_PATH
cd testing/python/tt
pytest test_target_registration.py -v --tb=short
continue-on-error: true # Don't fail if TVM isn't fully available

- name: Run all Python tests (if TVM available)
run: |
export LD_LIBRARY_PATH=$(pwd)/build/tvm:$LD_LIBRARY_PATH
cd testing/python
pytest tt/ -v --tb=short -k "not gpu" || echo "Some tests skipped (no GPU)"
continue-on-error: true

- name: Save TVM build cache
uses: actions/cache/save@v4
if: always() && steps.cache-tvm-restore.outputs.cache-hit != true
with:
path: |
build/tvm/
build/libtilelang*.so
build/3rdparty/
key: tvm-build-llvm-${{ steps.tvm-cache-key.outputs.tvm_commit }}-${{ runner.os }}

static-analysis:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: 'pip'
cache-dependency-path: |
requirements-mypy.txt
pyproject.toml

- name: Install mypy
run: pip install -r requirements-mypy.txt

- name: Type check Tenstorrent backend
run: mypy tilelang/engine/tt/ --ignore-missing-imports || true
continue-on-error: true
Loading