"vscode:/vscode.git/clone" did not exist on "5845ca0420bc881bf83478b4e1f0f24eac7e1f78"
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:
"""
Represents the architecture of a computing device, capturing various hardware specifications.
......
......@@ -19,7 +19,6 @@
# Modifications Copyright (c) Microsoft.
# The code below is mostly copied from apache/tvm common_schedules.py in dlight.
"""Common schedule strategies for TIR."""
from __future__ import annotations
from typing import Callable
from tvm import tir
......
"""Hint definition for schedule"""
from __future__ import annotations
from tvm import DataType
from . import PrimFuncNode
import numpy as np
......@@ -218,7 +217,7 @@ class Hint:
return dic
@classmethod
def from_dict(cls, dic: dict) -> Hint:
def from_dict(cls, dic: dict) -> 'Hint':
hint = cls()
for k, v in dic.items():
setattr(hint, k, v)
......
from __future__ import annotations
import numpy as np
......
"""Rasteration Plan For L2 Cache Locality"""
from __future__ import annotations
class Rasterization:
......
from __future__ import annotations
from collections import OrderedDict
from tvm import arith
......
from __future__ import annotations
from collections.abc import Mapping
from tvm.tir.schedule.schedule import BlockRV
from tvm.ir import structural_equal
......
# Import necessary modules and classes
from __future__ import annotations
from abc import ABC, abstractmethod # For defining abstract base classes
from dataclasses import dataclass, field # For defining data classes
from ..arch import ( # Import architecture-related utilities and classes
......@@ -42,7 +41,7 @@ class BaseTemplate(ABC):
"""
pass
def with_arch(self, arch: TileDevice) -> BaseTemplate:
def with_arch(self, arch: TileDevice) -> 'BaseTemplate':
"""
Sets the architecture for this template and returns itself.
......@@ -110,7 +109,7 @@ class BaseTemplate(ABC):
"""
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.
......@@ -123,7 +122,7 @@ class BaseTemplate(ABC):
self._func = func
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.
......
from __future__ import annotations
from dataclasses import dataclass
from .base import BaseTemplate
from tvm import te, tir
......
# Import necessary modules
from __future__ import annotations
from dataclasses import dataclass # Used for defining data classes
from .base import BaseTemplate # Importing the base class for templates
from tvm import te # Importing TVM's tensor expression module
......
from __future__ import annotations
from dataclasses import dataclass
from .base import BaseTemplate
from tvm import te
......
from __future__ import annotations
from dataclasses import dataclass
from .base import BaseTemplate
from tvm import te
......
from __future__ import annotations
from dataclasses import dataclass
from .base import BaseTemplate
from tvm import te
......
......@@ -15,7 +15,6 @@
# specific language governing permissions and limitations
# under the License.
"""Util to invoke C/C++ compilers in the system."""
from __future__ import annotations
import functools
import os
import shutil
......
# pylint: disable=invalid-name
# modified from apache tvm python/tvm/contrib/nvcc.py
"""Utility to invoke nvcc compiler in the system"""
from __future__ import absolute_import as _abs
from __future__ import annotations
import os
......
from __future__ import annotations
def shared_16x4_to_mma_a_32x4_layout(row, col, rep):
tid = (row % 4) + 16 * ((row // 4) % 2) + 4 * (row // 8) + 8 * rep
local_id = col
......
"""The profiler and convert to torch utils"""
from __future__ import annotations
import torch
from ..base import BaseKernelAdapter
import ctypes
......
"""The profiler and convert to torch utils"""
from __future__ import annotations
import ctypes
import logging
import torch
......
"""The profiler and convert to torch utils"""
from __future__ import annotations
import torch
from tilelang.contrib.dlpack import to_pytorch_func
from .base import BaseKernelAdapter
......
......@@ -13,8 +13,8 @@ Available allocation functions:
Each function takes shape and dtype parameters and returns a TVM buffer object
with the appropriate memory scope.
"""
from __future__ import annotations
from typing import overload, Literal
from tilelang import tvm as tvm
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