Skip to content

Commit

Permalink
Remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Giuseppe5 committed Nov 26, 2023
1 parent 66d4679 commit 98da0df
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 38 deletions.
7 changes: 1 addition & 6 deletions src/brevitas/export/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from brevitas.proxy.quant_proxy import QuantProxyProtocol
from brevitas.quant_tensor import QuantTensor
from brevitas.utils.jit_utils import clear_class_registry
# from brevitas.utils.jit_utils import jit_patches_generator
from brevitas.utils.python_utils import patch


Expand Down Expand Up @@ -162,7 +161,6 @@ class BaseManager(ABC):

target_name = None
handlers = []
_base_trace_patches_generator = None # jit_patches_generator
_fn_to_cache = []
_fn_cache = []
_cached_io_handler_map = {}
Expand All @@ -183,10 +181,7 @@ def _gen_patches(cls, fn_dispatcher):

@classmethod
def _trace_patches(cls):
patches = []
if cls._base_trace_patches_generator is not None:
patches += cls._base_trace_patches_generator()
patches += cls._gen_patches(cls._trace_fn_dispatcher)
patches = cls._gen_patches(cls._trace_fn_dispatcher)
return patches

@classmethod
Expand Down
6 changes: 0 additions & 6 deletions src/brevitas/jit.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

from brevitas.config import JIT_ENABLED

# IS_ABOVE_110 = version.parse(torch.__version__) > version.parse('1.1.0')


def _disabled(fn):
return fn
Expand All @@ -19,11 +17,7 @@ def _disabled(fn):
script = torch.jit.script
ScriptModule = torch.jit.ScriptModule
Attribute = torch.jit.Attribute

script_method_110_disabled = script_method
# script_method_110_disabled = _disabled
# if not IS_ABOVE_110:
# else:

else:

Expand Down
26 changes: 0 additions & 26 deletions src/brevitas/utils/jit_utils.py
Original file line number Diff line number Diff line change
@@ -1,37 +1,11 @@
# Copyright (C) 2023, Advanced Micro Devices, Inc. All rights reserved.
# SPDX-License-Identifier: BSD-3-Clause

# import inspect

# from dependencies import Injector
from packaging import version
import torch

from brevitas import torch_version

# try:
# from torch._jit_internal import get_torchscript_modifier
# except:
# get_torchscript_modifier = None

# from brevitas.inject import ExtendedInjector
# from brevitas.jit import IS_ABOVE_110

# from .python_utils import patch

# def _get_modifier_wrapper(fn):
# if inspect.isclass(fn) and issubclass(fn, (Injector, ExtendedInjector)):
# return None
# else:
# return get_torchscript_modifier(fn)

# if IS_ABOVE_110:

# def jit_patches_generator():
# return [patch(torch._jit_internal, 'get_torchscript_modifier', _get_modifier_wrapper)]
# else:
# jit_patches_generator = None


def clear_class_registry():
# torch.jit.trace leaks memory, this should help
Expand Down

0 comments on commit 98da0df

Please sign in to comment.