Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 0 additions & 1 deletion conda/recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ outputs:
- {{ pin_subpackage(pkg_name + '-libs', exact=True) }}
run:
- python
- decorator
- psutil
- scipy
- typing_extensions
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.demo_opencl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ RUN apt-install-and-clear -y apt-utils sudo cmake g++ llvm git libopenblas-dev

RUN echo "Installing Python"
RUN apt-install-and-clear -y python3-dev python3-pip
RUN pip3 install setuptools numpy pytest cython decorator scipy tornado psutil xgboost
RUN pip3 install setuptools numpy pytest cython scipy tornado psutil xgboost

RUN echo "Installing Jupyter notebook"
RUN pip3 install matplotlib Image "Pillow<7" jupyter[notebook]
Expand Down
1 change: 0 additions & 1 deletion docker/install/ubuntu2004_install_python_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pip3 install --upgrade \
"Pygments>=2.4.0" \
cloudpickle \
cython \
decorator \
mypy \
numpy==1.21.* \
orderedset \
Expand Down
1 change: 0 additions & 1 deletion docker/install/ubuntu_install_python_package.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ pip3 install --upgrade \
"Pygments>=2.4.0" \
cloudpickle \
cython \
decorator \
mypy \
numpy==1.21.* \
orderedset \
Expand Down
2 changes: 1 addition & 1 deletion docs/install/from_source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ The following commands can be used to install the extra Python dependencies:

.. code:: bash

pip3 install numpy decorator
pip3 install numpy

* If you want to use RPC Tracker

Expand Down
2 changes: 0 additions & 2 deletions python/gen_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"Base requirements needed to install tvm",
[
"cloudpickle",
"decorator",
"ml_dtypes",
"numpy",
"packaging",
Expand Down Expand Up @@ -241,7 +240,6 @@
("commonmark", ">=0.7.3"), # From PR #213.
("coremltools", None),
("cpplint", None),
("decorator", None),
(
"docutils",
"<0.17",
Expand Down
16 changes: 0 additions & 16 deletions python/tvm/_ffi/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,22 +121,6 @@ def c_array(ctype, values):
return (ctype * len(values))(*values)


def decorate(func, fwrapped):
"""A wrapper call of decorator package, differs to call time

Parameters
----------
func : function
The original function

fwrapped : function
The wrapped function
"""
import decorator

return decorator.decorate(func, fwrapped)


# -----------------------------------------
# Base code for structured error handling.
# -----------------------------------------
Expand Down
9 changes: 5 additions & 4 deletions python/tvm/contrib/pickle_memoize.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import pathlib
import sys

from decorator import decorate
import functools
from .._ffi.base import string_types

try:
Expand Down Expand Up @@ -123,7 +123,8 @@ def _register(f):
cargs = tuple(x.cell_contents for x in f.__closure__) if f.__closure__ else ()
cargs = (len(cargs),) + cargs

def _memoized_f(func, *args, **kwargs):
@functools.wraps(f)
def _memoized_f(*args, **kwargs):
assert not kwargs, "Only allow positional call"
key = cargs + args
for arg in key:
Expand All @@ -134,11 +135,11 @@ def _memoized_f(func, *args, **kwargs):
assert isinstance(arg, allow_types)
if key in cache.cache:
return cache.cache[key]
res = func(*args)
res = f(*args)
cache.cache[key] = res
cache.dirty = True
return res

return decorate(f, _memoized_f)
return _memoized_f

return _register
9 changes: 5 additions & 4 deletions python/tvm/te/tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.
"""Tag class for TVM operators."""
import warnings
from tvm._ffi.base import decorate
import functools


class TagScope(object):
Expand Down Expand Up @@ -51,11 +51,12 @@ def __exit__(self, ptype, value, trace):
TagScope._current = self._old_scope

def __call__(self, fdecl):
def tagged_fdecl(func, *args, **kwargs):
@functools.wraps(fdecl)
def tagged_fdecl(*args, **kwargs):
with self:
return func(*args, **kwargs)
return fdecl(*args, **kwargs)

return decorate(fdecl, tagged_fdecl)
return tagged_fdecl


def tag_scope(tag):
Expand Down