diff --git a/pyproject.toml b/pyproject.toml index 27a745615..4a9557789 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,7 +59,7 @@ nvcc = [ [build-system] requires = [ - "cython>=3.0.0", + "cython>=3.1.0", "scikit-build-core", "z3-solver>=4.13.0", # Not for auditwheel, explicitly add patchelf for repairing libz3.so. diff --git a/tilelang/_typing.py b/tilelang/_typing.py index c2c3fce1d..e834d7916 100644 --- a/tilelang/_typing.py +++ b/tilelang/_typing.py @@ -11,6 +11,8 @@ except ImportError: # Python < 3.10 from typing_extensions import TypeAlias +from typing import Union + from tvm import ir from tvm import tir @@ -18,10 +20,10 @@ from tilelang.dtypes import dtype # Barrier can only be a Buffer, a BufferLoad -BarrierType: TypeAlias = tir.Buffer | BufferLoad +BarrierType: TypeAlias = Union[tir.Buffer, BufferLoad] # BufferLikeType can be a Buffer, a BufferLoad, a BufferRegion -BufferLikeType: TypeAlias = tir.Buffer | BufferLoad | BufferRegion +BufferLikeType: TypeAlias = Union[tir.Buffer, BufferLoad, BufferRegion] # This is for Python 3.9 compatibility. # In Python 3.9, we can only use isinstance(a, (TypeA, TypeB, ...)) instead of isinstance(a, TypeA | TypeB | ...)) @@ -31,5 +33,5 @@ # - AnyDType is a union of all possible types that can represent a data type, including torch.dtype # - DType is a more specific type alias that represents a data type in the context of TileLang, and must be # adapted to string. -DType: TypeAlias = dtype | ir.Type | str | type -ShapeType: TypeAlias = list[tir.PrimExpr | int] | tuple[tir.PrimExpr | int, ...] +DType: TypeAlias = Union[dtype, ir.Type, str, type] +ShapeType: TypeAlias = Union[list[Union[tir.PrimExpr, int]], tuple[Union[tir.PrimExpr, int], ...]]