From 4757552004c89726a6422d905111a2f95ad6a137 Mon Sep 17 00:00:00 2001 From: Samaresh Kumar Singh Date: Sat, 18 Apr 2026 19:55:12 -0500 Subject: [PATCH] fix infinite recursion in ColoTracer when using newer PyTorch versions --- colossalai/fx/tracer/tracer.py | 5 +++++ 1 file changed, 5 insertions(+) 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