"...composable_kernel_onnxruntime.git" did not exist on "b12bbceebca5e35ba2cde0b876d25be40187efe3"
Unverified Commit b1922518 authored by Yichen Yan's avatar Yichen Yan Committed by GitHub
Browse files

[Minor] Remove from __future__ import annotations for python 3.8 (#1273)

parent 220c3236
from __future__ import annotations
class TileDevice: class TileDevice:
""" """
Represents the architecture of a computing device, capturing various hardware specifications. Represents the architecture of a computing device, capturing various hardware specifications.
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
# Modifications Copyright (c) Microsoft. # Modifications Copyright (c) Microsoft.
# The code below is mostly copied from apache/tvm common_schedules.py in dlight. # The code below is mostly copied from apache/tvm common_schedules.py in dlight.
"""Common schedule strategies for TIR.""" """Common schedule strategies for TIR."""
from __future__ import annotations
from typing import Callable from typing import Callable
from tvm import tir from tvm import tir
......
"""Hint definition for schedule""" """Hint definition for schedule"""
from __future__ import annotations
from tvm import DataType from tvm import DataType
from . import PrimFuncNode from . import PrimFuncNode
import numpy as np import numpy as np
...@@ -218,7 +217,7 @@ class Hint: ...@@ -218,7 +217,7 @@ class Hint:
return dic return dic
@classmethod @classmethod
def from_dict(cls, dic: dict) -> Hint: def from_dict(cls, dic: dict) -> 'Hint':
hint = cls() hint = cls()
for k, v in dic.items(): for k, v in dic.items():
setattr(hint, k, v) setattr(hint, k, v)
......
from __future__ import annotations
import numpy as np import numpy as np
......
"""Rasteration Plan For L2 Cache Locality""" """Rasteration Plan For L2 Cache Locality"""
from __future__ import annotations
class Rasterization: class Rasterization:
......
from __future__ import annotations
from collections import OrderedDict from collections import OrderedDict
from tvm import arith from tvm import arith
......
from __future__ import annotations
from collections.abc import Mapping from collections.abc import Mapping
from tvm.tir.schedule.schedule import BlockRV from tvm.tir.schedule.schedule import BlockRV
from tvm.ir import structural_equal from tvm.ir import structural_equal
......
# Import necessary modules and classes # Import necessary modules and classes
from __future__ import annotations
from abc import ABC, abstractmethod # For defining abstract base classes from abc import ABC, abstractmethod # For defining abstract base classes
from dataclasses import dataclass, field # For defining data classes from dataclasses import dataclass, field # For defining data classes
from ..arch import ( # Import architecture-related utilities and classes from ..arch import ( # Import architecture-related utilities and classes
...@@ -42,7 +41,7 @@ class BaseTemplate(ABC): ...@@ -42,7 +41,7 @@ class BaseTemplate(ABC):
""" """
pass pass
def with_arch(self, arch: TileDevice) -> BaseTemplate: def with_arch(self, arch: TileDevice) -> 'BaseTemplate':
""" """
Sets the architecture for this template and returns itself. Sets the architecture for this template and returns itself.
...@@ -110,7 +109,7 @@ class BaseTemplate(ABC): ...@@ -110,7 +109,7 @@ class BaseTemplate(ABC):
""" """
raise NotImplementedError("initialize_function is not implemented") raise NotImplementedError("initialize_function is not implemented")
def set_function(self, func: PrimFunc) -> BaseTemplate: def set_function(self, func: PrimFunc) -> 'BaseTemplate':
""" """
Sets the function for this template and returns itself. Sets the function for this template and returns itself.
...@@ -123,7 +122,7 @@ class BaseTemplate(ABC): ...@@ -123,7 +122,7 @@ class BaseTemplate(ABC):
self._func = func self._func = func
return self return self
def set_output_nodes(self, output_nodes: list[OutputNode]) -> BaseTemplate: def set_output_nodes(self, output_nodes: list[OutputNode]) -> 'BaseTemplate':
""" """
Sets the output nodes for this template and returns itself. Sets the output nodes for this template and returns itself.
......
from __future__ import annotations
from dataclasses import dataclass from dataclasses import dataclass
from .base import BaseTemplate from .base import BaseTemplate
from tvm import te, tir from tvm import te, tir
......
# Import necessary modules # Import necessary modules
from __future__ import annotations
from dataclasses import dataclass # Used for defining data classes from dataclasses import dataclass # Used for defining data classes
from .base import BaseTemplate # Importing the base class for templates from .base import BaseTemplate # Importing the base class for templates
from tvm import te # Importing TVM's tensor expression module from tvm import te # Importing TVM's tensor expression module
......
from __future__ import annotations
from dataclasses import dataclass from dataclasses import dataclass
from .base import BaseTemplate from .base import BaseTemplate
from tvm import te from tvm import te
......
from __future__ import annotations
from dataclasses import dataclass from dataclasses import dataclass
from .base import BaseTemplate from .base import BaseTemplate
from tvm import te from tvm import te
......
from __future__ import annotations
from dataclasses import dataclass from dataclasses import dataclass
from .base import BaseTemplate from .base import BaseTemplate
from tvm import te from tvm import te
......
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
# specific language governing permissions and limitations # specific language governing permissions and limitations
# under the License. # under the License.
"""Util to invoke C/C++ compilers in the system.""" """Util to invoke C/C++ compilers in the system."""
from __future__ import annotations
import functools import functools
import os import os
import shutil import shutil
......
# pylint: disable=invalid-name # pylint: disable=invalid-name
# modified from apache tvm python/tvm/contrib/nvcc.py # modified from apache tvm python/tvm/contrib/nvcc.py
"""Utility to invoke nvcc compiler in the system""" """Utility to invoke nvcc compiler in the system"""
from __future__ import absolute_import as _abs
from __future__ import annotations from __future__ import annotations
import os import os
......
from __future__ import annotations
def shared_16x4_to_mma_a_32x4_layout(row, col, rep): def shared_16x4_to_mma_a_32x4_layout(row, col, rep):
tid = (row % 4) + 16 * ((row // 4) % 2) + 4 * (row // 8) + 8 * rep tid = (row % 4) + 16 * ((row // 4) % 2) + 4 * (row // 8) + 8 * rep
local_id = col local_id = col
......
"""The profiler and convert to torch utils""" """The profiler and convert to torch utils"""
from __future__ import annotations from __future__ import annotations
import torch import torch
from ..base import BaseKernelAdapter from ..base import BaseKernelAdapter
import ctypes import ctypes
......
"""The profiler and convert to torch utils""" """The profiler and convert to torch utils"""
from __future__ import annotations from __future__ import annotations
import ctypes import ctypes
import logging import logging
import torch import torch
......
"""The profiler and convert to torch utils""" """The profiler and convert to torch utils"""
from __future__ import annotations
import torch import torch
from tilelang.contrib.dlpack import to_pytorch_func from tilelang.contrib.dlpack import to_pytorch_func
from .base import BaseKernelAdapter from .base import BaseKernelAdapter
......
...@@ -13,8 +13,8 @@ Available allocation functions: ...@@ -13,8 +13,8 @@ Available allocation functions:
Each function takes shape and dtype parameters and returns a TVM buffer object Each function takes shape and dtype parameters and returns a TVM buffer object
with the appropriate memory scope. with the appropriate memory scope.
""" """
from __future__ import annotations from __future__ import annotations
from typing import overload, Literal from typing import overload, Literal
from tilelang import tvm as tvm from tilelang import tvm as tvm
from tvm.script import tir as T from tvm.script import tir as T
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment