Skip to content

Commit da7aa62

Browse files
committed
[Build] Update Docker distribution scripts for manylinux compatibility
- Changed base image from `tilelang-builder:18.04` to `tilelang-builder:manylinux` in both local and PyPI distribution scripts. - Updated Dockerfile references to use `pypi.manylinux.Dockerfile`. - Added `--gpus all` flag to the Docker run command to enable GPU support during execution.
1 parent fe6ef1d commit da7aa62

File tree

7 files changed

+51
-20
lines changed

7 files changed

+51
-20
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Get the CUDA version from the command line
2-
IMAGE="tilelang-builder:18.04"
3-
docker build . -f "$(dirname "${BASH_SOURCE[0]}")/pypi.Dockerfile" --tag ${IMAGE}
2+
IMAGE="tilelang-builder:manylinux"
3+
docker build . -f "$(dirname "${BASH_SOURCE[0]}")/pypi.manylinux.Dockerfile" --tag ${IMAGE}
44

55
install_pip="python3.8 -m pip install --upgrade pip && python3.8 -m pip install -r requirements-build.txt"
66

77
tox_command="python3.8 -m tox -e py38,py39,py310,py311,py312"
88

9-
docker run --rm -v $(pwd):/tilelang ${IMAGE} /bin/bash -c "$install_pip && $tox_command"
9+
docker run --rm --gpus all -v $(pwd):/tilelang ${IMAGE} /bin/bash -c "$install_pip && $tox_command"
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# Get the CUDA version from the command line
2-
IMAGE="tilelang-builder:18.04"
3-
docker build . -f "$(dirname "${BASH_SOURCE[0]}")/pypi.Dockerfile" --tag ${IMAGE}
2+
IMAGE="tilelang-builder:manylinux"
3+
docker build . -f "$(dirname "${BASH_SOURCE[0]}")/pypi.manylinux.Dockerfile" --tag ${IMAGE}
44

55
install_pip="python3.8 -m pip install --upgrade pip && python3.8 -m pip install -r requirements-build.txt"
66

7-
tox_command="python3.8 -m tox -e py38-pypi,py39-pypi,py310-pypi,py311-pypi,py312-pypi,audit_2_27"
7+
tox_command="python3.8 -m tox -e py38-pypi,py39-pypi,py310-pypi,py311-pypi,py312-pypi"
88

9-
docker run --rm -v $(pwd):/tilelang ${IMAGE} /bin/bash -c "$install_pip && $tox_command"
9+
docker run --rm --gpus all -v $(pwd):/tilelang ${IMAGE} /bin/bash -c "$install_pip && $tox_command"
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
FROM pytorch/manylinux-builder:cuda12.1
2+
3+
ENV DEBIAN_FRONTEND=noninteractive \
4+
TZ=Etc/UTC
5+
6+
RUN set -eux; \
7+
yum -y update && yum install -y \
8+
zlib-devel openssl-devel \
9+
libedit-devel libxml2-devel \
10+
bzip2 bzip2-devel xz xz-devel \
11+
epel-release
12+
13+
RUN set -eux; \
14+
conda create -n py38 python=3.8 -y && \
15+
conda create -n py39 python=3.9 -y && \
16+
conda create -n py310 python=3.10 -y && \
17+
conda create -n py311 python=3.11 -y && \
18+
conda create -n py312 python=3.12 -y && \
19+
ln -sf /opt/conda/envs/py38/bin/python3.8 /usr/bin/python3.8 && \
20+
ln -sf /opt/conda/envs/py39/bin/python3.9 /usr/bin/python3.9 && \
21+
ln -sf /opt/conda/envs/py310/bin/python3.10 /usr/bin/python3.10 && \
22+
ln -sf /opt/conda/envs/py311/bin/python3.11 /usr/bin/python3.11 && \
23+
ln -sf /opt/conda/envs/py312/bin/python3.12 /usr/bin/python3.12 && \
24+
conda install -y cmake patchelf
25+
26+
WORKDIR /tilelang

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
[build-system]
22
requires = [
33
"build",
4-
"cmake>=3.26",
54
"packaging",
65
"setuptools>=61",
76
"wheel",

tilelang/transform/add_bufstore_wrapper.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from tvm.tir import (BufferStore, For, AttrStmt, ForKind, Var, PrimFunc, BufferLoad, Buffer, IntImm)
22
from tvm.tir.stmt_functor import ir_transform, post_order_visit
33
from tvm.tir.transform import prim_func_pass
4-
4+
from typing import Tuple, List, Dict
55

66
def AddWrapperForSingleBufStore():
77
"""
@@ -41,7 +41,7 @@ def visit_variable(node):
4141
post_order_visit(operation, visit_variable)
4242
return used_variables
4343

44-
def collect_buffer_accesses(statement) -> tuple[list[Buffer], list[Buffer]]:
44+
def collect_buffer_accesses(statement) -> Tuple[List[Buffer], List[Buffer]]:
4545
"""
4646
Categorizes buffers accessed in the statement by their scope.
4747
@@ -68,7 +68,7 @@ def visit_buffer_access(node):
6868
local_buffers.append(buffer)
6969
return local_buffers, fragment_buffers
7070

71-
def collect_buffer_indices(statement) -> dict[Buffer, list[int]]:
71+
def collect_buffer_indices(statement) -> Dict[Buffer, List[int]]:
7272
"""
7373
Maps each buffer to its access indices.
7474

tilelang/utils/sparse.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import os
22
import torch
33
import warnings
4-
from typing import Optional
4+
from typing import Optional, Tuple
55
from tilelang.contrib import nvcc
66
from torch.utils.cpp_extension import load, _import_module_from_library
77
from tilelang import env
@@ -44,7 +44,7 @@ def _get_cached_lib():
4444

4545

4646
def compress_sm90(A: torch.Tensor, block_k: int,
47-
transposed: bool) -> tuple[torch.Tensor, torch.Tensor]:
47+
transposed: bool) -> Tuple[torch.Tensor, torch.Tensor]:
4848
if block_k > 128:
4949
block_k = 128
5050
# Ref: https://github.com/NVIDIA/cutlass/blob/c2ad7c5b20f131c4ba33601860f1da3f9c9df0f3/include/cutlass/gemm/collective/builders/sm90_sparse_gmma_builder.inl#L145-L146
@@ -56,7 +56,7 @@ def compress_sm90(A: torch.Tensor, block_k: int,
5656
return compress_lib.compress_sm90(A, block_k, transposed)
5757

5858

59-
def compress_sm80(A: torch.Tensor, transposed: bool) -> tuple[torch.Tensor, torch.Tensor]:
59+
def compress_sm80(A: torch.Tensor, transposed: bool) -> Tuple[torch.Tensor, torch.Tensor]:
6060
try:
6161
from torch.sparse import to_sparse_semi_structured, SparseSemiStructuredTensor
6262
except ImportError as err:
@@ -76,7 +76,7 @@ def compress_sm80(A: torch.Tensor, transposed: bool) -> tuple[torch.Tensor, torc
7676
def compress(A: torch.Tensor,
7777
transposed: bool,
7878
arch: Optional[str] = None,
79-
**kwargs) -> tuple[torch.Tensor, torch.Tensor]:
79+
**kwargs) -> Tuple[torch.Tensor, torch.Tensor]:
8080
"""
8181
Compress a tensor using the appropriate method based on the CUDA architecture.
8282
"""

tox.ini

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,36 @@
11
[tox]
22
envlist = py38,py39,py310,py311,py312
3-
isolated_build = True
3+
isolated_build = False
44

55
[testenv:py{38,39,310,311,312}]
6+
skip_install = false
67
deps =
78
wheel
89
build
10+
setenv =
11+
PYTHON_EXECUTABLE = {envpython}
12+
Python3_EXECUTABLE = {envpython}
913
commands =
1014
python -m build --wheel -o {toxinidir}/dist
1115

12-
1316
[testenv:py{38,39,310,311,312}-pypi]
17+
skip_install = false
1418
setenv =
1519
PYPI_BUILD = TRUE
20+
PYTHON_EXECUTABLE = {envpython}
21+
Python3_EXECUTABLE = {envpython}
1622
commands =
17-
python setup.py bdist_wheel
23+
python setup.py bdist_wheel --plat-name=manylinux2014_x86_64
1824

19-
[testenv:audit_2_27]
25+
[testenv:audit_manylinux2014]
2026
skip_install = true
2127
allowlist_externals =
2228
bash
2329
deps =
2430
auditwheel
2531
patchelf
2632
commands =
27-
bash -c 'auditwheel repair -L=/lib --exclude=/usr/local/cuda* --exclude=libcuda.so.1 --plat=manylinux_2_27_x86_64 dist/*'
33+
bash -c 'auditwheel repair -L=/lib --exclude=/usr/local/cuda* --exclude=libcuda.so.1 --plat=manylinux2014_x86_64 dist/*'
2834

2935
[testenv:py38]
3036
basepython = python3.8

0 commit comments

Comments
 (0)