diff --git a/colossalai/fx/tracer/tracer.py b/colossalai/fx/tracer/tracer.py index d9cb587b5d39..205a3edb2fd8 100644 --- a/colossalai/fx/tracer/tracer.py +++ b/colossalai/fx/tracer/tracer.py @@ -149,6 +149,11 @@ def create_proxy(self, kind, target, args, kwargs, name=None, type_expr=None, pr return proxy + def getattr(self, attr, attr_val, parameter_proxy_cache): + if getattr(self, "_disable_module_getattr", False): + return attr_val + return super().getattr(attr, attr_val, parameter_proxy_cache) + def _module_getattr(self, attr, attr_val, parameter_proxy_cache): if getattr(self, "_disable_module_getattr", False): return attr_val