sunggg commented on code in PR #15898:
URL: https://github.com/apache/tvm/pull/15898#discussion_r1358598491


##########
python/tvm/relax/ir/instrument.py:
##########
@@ -25,13 +25,19 @@ class WellFormedInstrument:
     is well formed. It will skip specific passes, like Normalize.
     """
 
-    def __init__(self):
+    def __init__(self, check_struct_info=True):
         self.skip_pass_name = ["Normalize", "ResolveGlobals"]
+        self.check_struct_info = check_struct_info
 
     def run_before_pass(self, mod, pass_info):
-        if pass_info.name not in self.skip_pass_name:
-            assert relax.analysis.well_formed(mod)
+        self._check(mod, pass_info.name, "Before")
 
     def run_after_pass(self, mod, pass_info):
-        if pass_info.name not in self.skip_pass_name:
-            assert relax.analysis.well_formed(mod)
+        self._check(mod, pass_info.name, "After")

Review Comment:
   Nit: Do we need in both before and after? If we have consecutive passes, we 
would have redundant checks running. 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to