File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -229,7 +229,20 @@ def hijacked_compile_fx_inner(*args, **kwargs):
229229 inductor_compiled_graph = output
230230 if inductor_compiled_graph is not None :
231231 nonlocal file_path
232- file_path = inductor_compiled_graph .current_callable .__code__ .co_filename # noqa
232+ compiled_fn = inductor_compiled_graph .current_callable
233+ file_path = compiled_fn .__code__ .co_filename # noqa
234+ if not file_path .startswith (self .cache_dir ):
235+ # hooked in the align_inputs_from_check_idxs function
236+ # in torch/_inductor/utils.py
237+ for cell in compiled_fn .__closure__ :
238+ if not callable (cell .cell_contents ):
239+ continue
240+ code = cell .cell_contents .__code__
241+ if code .co_filename .startswith (self .cache_dir ):
242+ # this is the real file path
243+ # compiled from Inductor
244+ file_path = code .co_filename
245+ break
233246 hash_str = inductor_compiled_graph ._fx_graph_cache_key
234247 return output
235248
You can’t perform that action at this time.
0 commit comments