@@ -83,10 +83,7 @@ def compile_stabehlo_program(self, code: str) -> compiler.Executable:
8383 with self .mlir_context :
8484 module = ir .Module .parse (code )
8585 opts = self ._make_mlir_opts (self .trt_builder_opt_level )
86- out = compiler .compiler_stablehlo_to_executable (self .compiler_client , module .operation , opts )
87- # TODO: Debug:
88- print (opts )
89- return out
86+ return compiler .compiler_stablehlo_to_executable (self .compiler_client , module .operation , opts )
9087
9188 @utils .log_time
9289 def infer_shapes (self , mlir_module : ir .Module , flat_ir : Optional ["FlatIR" ] = None ):
@@ -118,36 +115,17 @@ def layer_metadata_callback(op):
118115 for name in trace_outputs :
119116 if name in flat_ir .tensor_map :
120117 tensor = flat_ir .tensor_map [name ]
121- # TODO: Decide what to use here:
122118 return _make_stack_info_message (tensor .stack_info , enable_color = False )
123- return ""
124- user_frame_index = tensor .stack_info .get_first_user_frame_index ()
125- last_tp_frame = tensor .stack_info [user_frame_index - 1 ]
126- return (
127- last_tp_frame ._dispatch_target
128- or f"{ last_tp_frame .file } :{ last_tp_frame .line } in { last_tp_frame .function } "
129- ) + "()"
130119
131120 return str (op .name )
132121
133- # TODO: Remove this debug code:
134- def _layer_meta_callback (op ):
135- out = layer_metadata_callback (op )
136- # print(out)
137- return out
138-
139- # opts = self._make_mlir_opts(self.trt_builder_opt_level, _layer_meta_callback)
140122 opts = self ._make_mlir_opts (self .trt_builder_opt_level , layer_metadata_callback )
141- # ================= 1764 passed, 53 skipped, 2842 deselected in 71.40s (0:01:11) =================
142- # opts = self._make_mlir_opts(self.trt_builder_opt_level)
143123
144124 try :
145125 with redirect_stderr () as outfile :
146126 executable = compiler .compiler_stablehlo_to_executable (
147127 self .compiler_client , mlir_module .operation , opts
148128 )
149- # TODO: Debug:
150- print (opts )
151129 except Exception as exc :
152130 outfile .flush ()
153131 outfile .seek (0 )
0 commit comments