Getting BackendCompilerFailed

sachinsharma9780: <p>I am trying to run <a href="https://github.com/pyg-team/pytorch_geometric/blob/master/examples/ogbn_products_sage.py#L146" rel="noopener nofollow ugc">SAGEConv</a> model with <code>torch.compile</code> mode i.e after defining the model I am using.<br>
<code>model = torch_geometric.compile(model) </code></p>
<p>but receiving an error:</p>
<p>`BackendCompilerFailed                     Traceback (most recent call last)<br>
Cell In[20], line 5<br>
3 for epoch in range(1, 5):<br>
4     train_start = time.time()<br>
----&gt; 5     loss, acc = train(epoch)<br>
6     print(“— %s train seconds —” % (time.time() - train_start))<br>
7     train_times.append(time.time() - train_start)</p>
<p>Cell In[16], line 10, in train(epoch)<br>
8 for batch in train_loader:<br>
9     optimizer.zero_grad()<br>
—&gt; 10     out = model(batch.x, batch.edge_index.to(device))[:batch.batch_size]<br>
11     y = batch.y[:batch.batch_size].squeeze()<br>
12     loss = F.cross_entropy(out, y)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/nn/modules/module.py:1518, in Module._wrapped_call_impl(self, *args, **kwargs)<br>
1516     return self._compiled_call_impl(*args, **kwargs)  # type: ignore[misc]<br>
1517 else:<br>
 → 1518     return self._call_impl(*args, **kwargs)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/nn/modules/module.py:1527, in Module._call_impl(self, *args, **kwargs)<br>
1522 # If we don’t have any hooks, we want to skip the rest of the logic in<br>
1523 # this function, and just call forward.<br>
1524 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks<br>
1525         or _global_backward_pre_hooks or _global_backward_hooks<br>
1526         or _global_forward_hooks or _global_forward_pre_hooks):<br>
 → 1527     return forward_call(*args, **kwargs)<br>
1529 try:<br>
1530     result = None</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/eval_frame.py:328, in _TorchDynamoContext.<strong>call</strong>.._fn(*args, **kwargs)<br>
326 dynamic_ctx.<strong>enter</strong>()<br>
327 try:<br>
 → 328     return fn(*args, **kwargs)<br>
329 finally:<br>
330     set_eval_frame(prior)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/nn/modules/module.py:1518, in Module._wrapped_call_impl(self, *args, **kwargs)<br>
1516     return self._compiled_call_impl(*args, **kwargs)  # type: ignore[misc]<br>
1517 else:<br>
 → 1518     return self._call_impl(*args, **kwargs)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/nn/modules/module.py:1527, in Module._call_impl(self, *args, **kwargs)<br>
1522 # If we don’t have any hooks, we want to skip the rest of the logic in<br>
1523 # this function, and just call forward.<br>
1524 if not (self._backward_hooks or self._backward_pre_hooks or self._forward_hooks or self._forward_pre_hooks<br>
1525         or _global_backward_pre_hooks or _global_backward_hooks<br>
1526         or _global_forward_hooks or _global_forward_pre_hooks):<br>
 → 1527     return forward_call(*args, **kwargs)<br>
1529 try:<br>
1530     result = None</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/eval_frame.py:490, in catch_errors_wrapper..catch_errors(frame, cache_entry, frame_state)<br>
487             return hijacked_callback(frame, cache_entry, hooks, frame_state)<br>
489 with compile_lock, _disable_current_modes():<br>
 → 490     return callback(frame, cache_entry, hooks, frame_state)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py:641, in convert_frame.._convert_frame(frame, cache_size, hooks, frame_state)<br>
639 counters[“frames”][“total”] += 1<br>
640 try:<br>
 → 641     result = inner_convert(frame, cache_size, hooks, frame_state)<br>
642     counters[“frames”][“ok”] += 1<br>
643     return result</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py:133, in wrap_convert_context.._fn(*args, **kwargs)<br>
131 cleanup = setup_compile_debug()<br>
132 try:<br>
 → 133     return fn(*args, **kwargs)<br>
134 finally:<br>
135     cleanup.close()</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py:389, in convert_frame_assert.._convert_frame_assert(frame, cache_entry, hooks, frame_state)<br>
376 compile_id = CompileId(frame_id, frame_compile_id)<br>
378 signpost_event(<br>
379     “dynamo”,<br>
380     “_convert_frame_assert._compile”,<br>
(…)<br>
386     },<br>
387 )<br>
 → 389 return _compile(<br>
390     frame.f_code,<br>
391     frame.f_globals,<br>
392     frame.f_locals,<br>
393     frame.f_builtins,<br>
394     compiler_fn,<br>
395     one_graph,<br>
396     export,<br>
397     export_constraints,<br>
398     hooks,<br>
399     cache_size,<br>
400     frame,<br>
401     frame_state=frame_state,<br>
402     compile_id=compile_id,<br>
403 )</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py:569, in _compile(code, globals, locals, builtins, compiler_fn, one_graph, export, export_constraints, hooks, cache_size, frame, frame_state, compile_id)<br>
567 with compile_context(CompileContext(compile_id)):<br>
568     try:<br>
 → 569         guarded_code = compile_inner(code, one_graph, hooks, transform)<br>
570         return guarded_code<br>
571     except (<br>
572         Unsupported,<br>
573         TorchRuntimeError,<br>
(…)<br>
578         ValidationException,<br>
579     ) as e:</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/utils.py:189, in dynamo_timed..dynamo_timed_inner..time_wrapper(*args, **kwargs)<br>
187 with torch.profiler.record_function(f"{key} (dynamo_timed)"):<br>
188     t0 = time.time()<br>
 → 189     r = func(*args, **kwargs)<br>
190     time_spent = time.time() - t0<br>
191 compilation_time_metrics[key].append(time_spent)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py:491, in _compile..compile_inner(code, one_graph, hooks, transform)<br>
489 for attempt in itertools.count():<br>
490     try:<br>
 → 491         out_code = transform_code_object(code, transform)<br>
492         orig_code_map[out_code] = code<br>
493         break</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/bytecode_transformation.py:1028, in transform_code_object(code, transformations, safe)<br>
1025 instructions = cleaned_instructions(code, safe)<br>
1026 propagate_line_nums(instructions)<br>
 → 1028 transformations(instructions, code_options)<br>
1029 return clean_and_assemble_instructions(instructions, keys, code_options)[1]</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/convert_frame.py:458, in _compile..transform(instructions, code_options)<br>
456 try:<br>
457     with tracing(tracer.output.tracing_context):<br>
 → 458         tracer.run()<br>
459 except (exc.RestartAnalysis, exc.SkipFrame):<br>
460     raise</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py:2069, in InstructionTranslator.run(self)<br>
2068 def run(self):<br>
 → 2069     super().run()</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py:719, in InstructionTranslatorBase.run(self)<br>
714 try:<br>
715     self.output.push_tx(self)<br>
716     while (<br>
717         self.instruction_pointer is not None<br>
718         and not self.output.should_exit<br>
 → 719         and self.step()<br>
720     ):<br>
721         pass<br>
722 except BackendCompilerFailed:</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py:683, in InstructionTranslatorBase.step(self)<br>
679         unimplemented(f"missing: {inst.opname}")<br>
680     TracingContext.set_current_loc(<br>
681         self.f_code.co_filename, self.lineno, self.f_code.co_name<br>
682     )<br>
 → 683     getattr(self, inst.opname)(inst)<br>
685     return inst.opname != “RETURN_VALUE”<br>
686 except Unsupported:</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/symbolic_convert.py:2157, in InstructionTranslator.RETURN_VALUE(self, inst)<br>
2152 _step_logger()(<br>
2153     logging.INFO,<br>
2154     f"torchdynamo done tracing {self.f_code.co_name} (RETURN_VALUE)",<br>
2155 )<br>
2156 log.debug(“RETURN_VALUE triggered compile”)<br>
 → 2157 self.output.compile_subgraph(<br>
2158     self,<br>
2159     reason=GraphCompileReason(<br>
2160         “return_value”, [self.frame_summary()], graph_break=False<br>
2161     ),<br>
2162 )<br>
2163 self.output.add_output_instructions([create_instruction(“RETURN_VALUE”)])</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/output_graph.py:833, in OutputGraph.compile_subgraph(self, tx, partial_convert, reason)<br>
830     append_prefix_insts()<br>
831     # optimization to generate better code in a common case<br>
832     self.add_output_instructions(<br>
 → 833         self.compile_and_call_fx_graph(tx, list(reversed(stack_values)), root)<br>
834         + [create_instruction(“UNPACK_SEQUENCE”, arg=len(stack_values))]<br>
835     )<br>
836 else:<br>
837     graph_output_var = self.new_var(“graph_out”)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/contextlib.py:81, in ContextDecorator.<strong>call</strong>..inner(*args, **kwds)<br>
78 <span class="mention">@wraps</span>(func)<br>
79 def inner(*args, **kwds):<br>
80     with self._recreate_cm():<br>
—&gt; 81         return func(*args, **kwds)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/output_graph.py:957, in OutputGraph.compile_and_call_fx_graph(self, tx, rv, root)<br>
952 graph_tabular_log.debug(“%s”, lazy_format_graph_tabular(name, gm))<br>
953 graph_sizes_log.debug(<br>
954     “%s”, LazyString(lambda: self.get_graph_sizes_log_str(name))<br>
955 )<br>
 → 957 compiled_fn = self.call_user_compiler(gm)<br>
958 compiled_fn = disable(compiled_fn)<br>
960 counters[“stats”][“unique_graphs”] += 1</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/utils.py:189, in dynamo_timed..dynamo_timed_inner..time_wrapper(*args, **kwargs)<br>
187 with torch.profiler.record_function(f"{key} (dynamo_timed)"):<br>
188     t0 = time.time()<br>
 → 189     r = func(*args, **kwargs)<br>
190     time_spent = time.time() - t0<br>
191 compilation_time_metrics[key].append(time_spent)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/output_graph.py:1024, in OutputGraph.call_user_compiler(self, gm)<br>
1022     unimplemented_with_warning(e, self.root_tx.f_code, msg)<br>
1023 except Exception as e:<br>
 → 1024     raise BackendCompilerFailed(self.compiler_fn, e).with_traceback(<br>
1025         e.<strong>traceback</strong><br>
1026     ) from None<br>
1028 signpost_event(<br>
1029     “dynamo”,<br>
1030     “OutputGraph.call_user_compiler”,<br>
(…)<br>
1036     },<br>
1037 )<br>
1039 return compiled_fn</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/output_graph.py:1009, in OutputGraph.call_user_compiler(self, gm)<br>
1007 if config.verify_correctness:<br>
1008     compiler_fn = WrapperBackend(compiler_fn)<br>
 → 1009 compiled_fn = compiler_fn(gm, self.example_inputs())<br>
1010 _step_logger()(logging.INFO, f"done compiler function {name}")<br>
1011 assert callable(compiled_fn), “compiler_fn did not return callable”</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/repro/after_dynamo.py:117, in wrap_backend_debug..debug_wrapper(gm, example_inputs, **kwargs)<br>
115             raise<br>
116 else:<br>
 → 117     compiled_gm = compiler_fn(gm, example_inputs)<br>
119 return compiled_gm</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/<strong>init</strong>.py:1568, in <em>TorchCompileInductorWrapper.<strong>call</strong>(self, model</em>, inputs_)<br>
1565 def <strong>call</strong>(self, model_, inputs_):<br>
1566     from torch.<em>inductor.compile_fx import compile_fx<br>
 → 1568     return compile_fx(model</em>, inputs_, config_patches=self.config)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/<em>inductor/compile_fx.py:1150, in compile_fx(model</em>, example_inputs_, inner_compile, config_patches, decompositions)<br>
1143 tracing_context = (<br>
1144     torch._guards.TracingContext.get() or torch.<em>guards.TracingContext(fake_mode)<br>
1145 )<br>
1147 with V.set_fake_mode(fake_mode), torch.<em>guards.tracing(  # type: ignore[call-arg]<br>
1148     tracing_context<br>
1149 ), compiled_autograd.disable():<br>
 → 1150     return aot_autograd(<br>
1151         fw_compiler=fw_compiler,<br>
1152         bw_compiler=bw_compiler,<br>
1153         inference_compiler=inference_compiler,<br>
1154         decompositions=decompositions,<br>
1155         partition_fn=partition_fn,<br>
1156         keep_inference_input_mutations=True,<br>
1157     )(model</em>, example_inputs</em>)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/backends/common.py:55, in aot_autograd..compiler_fn(gm, example_inputs)<br>
52 try:<br>
53     # NB: NOT cloned!<br>
54     with enable_aot_logging(), patch_config:<br>
—&gt; 55         cg = aot_module_simplified(gm, example_inputs, **kwargs)<br>
56         counters[“aot_autograd”][“ok”] += 1<br>
57         return disable(cg)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_functorch/aot_autograd.py:3891, in aot_module_simplified(mod, args, fw_compiler, bw_compiler, partition_fn, decompositions, keep_inference_input_mutations, inference_compiler)<br>
3875 aot_config = AOTConfig(<br>
3876     fw_compiler=fw_compiler,<br>
3877     bw_compiler=bw_compiler,<br>
(…)<br>
3887     no_tangents=False,<br>
3888 )<br>
3890 with compiled_autograd.disable():<br>
 → 3891     compiled_fn = create_aot_dispatcher_function(<br>
3892         functional_call,<br>
3893         full_args,<br>
3894         aot_config,<br>
3895     )<br>
3897 # TODO: There is something deeply wrong here; compiled_fn running with<br>
3898 # the boxed calling convention, but aot_module_simplified somehow<br>
3899 # historically returned a function that was not the boxed calling<br>
3900 # convention.  This should get fixed…<br>
3901 def forward(*runtime_args):</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/utils.py:189, in dynamo_timed..dynamo_timed_inner..time_wrapper(*args, **kwargs)<br>
187 with torch.profiler.record_function(f"{key} (dynamo_timed)"):<br>
188     t0 = time.time()<br>
 → 189     r = func(*args, **kwargs)<br>
190     time_spent = time.time() - t0<br>
191 compilation_time_metrics[key].append(time_spent)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_functorch/aot_autograd.py:3429, in create_aot_dispatcher_function(flat_fn, flat_args, aot_config)<br>
3426 compiler_fn = partial(aot_wrapper_dedupe, compiler_fn=compiler_fn)<br>
3427 # You can put more passes here<br>
 → 3429 compiled_fn = compiler_fn(flat_fn, fake_flat_args, aot_config, fw_metadata=fw_metadata)<br>
3430 if aot_config.is_export:<br>
3432     mutated_user_inp_locs = [<br>
3433         idx - aot_config.num_params_buffers<br>
3434         for idx in fw_metadata.mutated_inp_indices<br>
3435         if idx &gt;= aot_config.num_params_buffers<br>
3436     ]</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_functorch/aot_autograd.py:2212, in aot_wrapper_dedupe(flat_fn, flat_args, aot_config, compiler_fn, fw_metadata)<br>
2209         break<br>
2211 if ok:<br>
 → 2212     return compiler_fn(flat_fn, leaf_flat_args, aot_config, fw_metadata=fw_metadata)<br>
2214 # export path: ban duplicate inputs for now, add later if requested.<br>
2215 if aot_config.is_export:</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_functorch/aot_autograd.py:2392, in aot_wrapper_synthetic_base(flat_fn, flat_args, aot_config, fw_metadata, needs_autograd, compiler_fn)<br>
2390 # Happy path: we don’t need synthetic bases<br>
2391 if synthetic_base_info is None:<br>
 → 2392     return compiler_fn(flat_fn, flat_args, aot_config, fw_metadata=fw_metadata)<br>
2394 # export path: ban synthetic bases for now, add later if requested.<br>
2395 if aot_config.is_export:</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_functorch/aot_autograd.py:2917, in aot_dispatch_autograd(flat_fn, flat_args, aot_config, fw_metadata)<br>
2914         torch._guards.TracingContext.get().fw_metadata = fw_metadata<br>
2916     with TracingContext.report_output_strides() as fwd_output_strides:<br>
 → 2917         compiled_fw_func = aot_config.fw_compiler(<br>
2918             fw_module, adjusted_flat_args<br>
2919         )<br>
2921 # NB: It’s important to compile backwards ahead of time, as this may<br>
2922 # add extra guards which we need to apply to the Dynamo cache at<br>
2923 # forwards<br>
2924 with track_graph_compiling(aot_config, “backward”):</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/utils.py:189, in dynamo_timed..dynamo_timed_inner..time_wrapper(*args, **kwargs)<br>
187 with torch.profiler.record_function(f"{key} (dynamo_timed)"):<br>
188     t0 = time.time()<br>
 → 189     r = func(*args, **kwargs)<br>
190     time_spent = time.time() - t0<br>
191 compilation_time_metrics[key].append(time_spent)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_inductor/compile_fx.py:1092, in compile_fx..fw_compiler_base(model, example_inputs, is_inference)<br>
1070     # We makes the following assumption<br>
1071     # For inference<br>
1072     #   len(orig_model_outputs) == len(model_outputs)<br>
(…)<br>
1080     # To make things safe, we’ll use original_output_start_index field<br>
1081     # set by AOTAutograd to decide where the original module outputs start.<br>
1083     user_visible_outputs = {<br>
1084         n.name<br>
1085         for n in model_outputs[<br>
(…)<br>
1089         if isinstance(n, torch.fx.Node)<br>
1090     }<br>
 → 1092 return inner_compile(<br>
1093     model,<br>
1094     example_inputs,<br>
1095     num_fixed=fixed,<br>
1096     cudagraphs=cudagraphs,<br>
1097     graph_id=graph_id,<br>
1098     is_inference=is_inference,<br>
1099     boxed_forward_device_index=forward_device,<br>
1100     user_visible_outputs=user_visible_outputs,<br>
1101 )</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/repro/after_aot.py:80, in wrap_compiler_debug..debug_wrapper(gm, example_inputs, **kwargs)<br>
75 assert config.repro_after in (“dynamo”, “aot”, None)<br>
77 try:<br>
78     # Call the compiler_fn - which is either aot_autograd or inductor<br>
79     # with fake inputs<br>
—&gt; 80     inner_compiled_fn = compiler_fn(gm, example_inputs)<br>
81 except Exception as e:<br>
82     # TODO: Failures here are troublesome because no real inputs,<br>
83     # need a different serialization strategy<br>
84     if config.repro_after == “aot”:</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_inductor/debug.py:228, in DebugContext.wrap..inner(*args, **kwargs)<br>
225 <span class="mention">@functools.wraps</span>(fn)<br>
226 def inner(*args, **kwargs):<br>
227     with DebugContext():<br>
 → 228         return fn(*args, **kwargs)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/contextlib.py:81, in ContextDecorator.<strong>call</strong>..inner(*args, **kwds)<br>
78 <span class="mention">@wraps</span>(func)<br>
79 def inner(*args, **kwds):<br>
80     with self._recreate_cm():<br>
—&gt; 81         return func(*args, **kwds)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_inductor/compile_fx.py:54, in time_and_log..wrap..newFunction(*args, **kwargs)<br>
52 <span class="mention">@wraps</span>(old_func)<br>
53 def newFunction(*args, **kwargs):<br>
—&gt; 54     return old_func(*args, **kwargs)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_inductor/compile_fx.py:341, in compile_fx_inner(gm, example_inputs, cudagraphs, num_fixed, is_backward, graph_id, cpp_wrapper, aot_mode, is_inference, boxed_forward_device_index, user_visible_outputs, layout_opt)<br>
328 graph_args = [gm, example_inputs]<br>
329 graph_kwargs = {<br>
330     “cudagraphs”: cudagraphs,<br>
331     “num_fixed”: num_fixed,<br>
(…)<br>
338     “layout_opt”: layout_opt,<br>
339 }<br>
 → 341 compiled_graph: CompiledFxGraph = fx_codegen_and_compile(<br>
342     *graph_args, **graph_kwargs  # type: ignore[arg-type]<br>
343 )<br>
345 if aot_mode:<br>
346     return compiled_graph</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_inductor/compile_fx.py:565, in fx_codegen_and_compile(gm, example_inputs, cudagraphs, num_fixed, is_backward, graph_id, cpp_wrapper, aot_mode, is_inference, user_visible_outputs, layout_opt)<br>
563         else:<br>
564             context.output_strides.append(None)<br>
 → 565 compiled_fn = graph.compile_to_fn()<br>
567 if graph.disable_cudagraphs:<br>
568     BoxedBool.disable(cudagraphs)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_inductor/graph.py:970, in GraphLowering.compile_to_fn(self)<br>
968     return AotCodeCache.compile(self, code, cuda=self.cuda)<br>
969 else:<br>
 → 970     return self.compile_to_module().call</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/utils.py:189, in dynamo_timed..dynamo_timed_inner..time_wrapper(*args, **kwargs)<br>
187 with torch.profiler.record_function(f"{key} (dynamo_timed)"):<br>
188     t0 = time.time()<br>
 → 189     r = func(*args, **kwargs)<br>
190     time_spent = time.time() - t0<br>
191 compilation_time_metrics[key].append(time_spent)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_inductor/graph.py:938, in GraphLowering.compile_to_module(self)<br>
934 <span class="mention">@dynamo_timed</span><br>
935 def compile_to_module(self):<br>
936     from .codecache import PyCodeCache<br>
 → 938     code, linemap = self.codegen()<br>
939     linemap = [(line_no, node.stack_trace) for line_no, node in linemap]<br>
940     key, path = PyCodeCache.write(code)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_inductor/graph.py:915, in GraphLowering.codegen(self)<br>
913 self.scheduler = Scheduler(self.buffers)<br>
914 assert self.scheduler is not None  # mypy can’t figure this out<br>
 → 915 self.scheduler.codegen()<br>
916 assert self.wrapper_code is not None<br>
917 return self.wrapper_code.generate()</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_dynamo/utils.py:189, in dynamo_timed..dynamo_timed_inner..time_wrapper(*args, **kwargs)<br>
187 with torch.profiler.record_function(f"{key} (dynamo_timed)"):<br>
188     t0 = time.time()<br>
 → 189     r = func(*args, **kwargs)<br>
190     time_spent = time.time() - t0<br>
191 compilation_time_metrics[key].append(time_spent)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_inductor/scheduler.py:1690, in Scheduler.codegen(self)<br>
1688     self.get_backend(device).codegen_foreach(node)<br>
1689 elif isinstance(node, (FusedSchedulerNode, SchedulerNode)):<br>
 → 1690     self.get_backend(device).codegen_nodes(node.get_nodes())<br>
1691 else:<br>
1692     assert isinstance(node, NopKernelSchedulerNode)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_inductor/codegen/cpp.py:2805, in CppScheduling.codegen_nodes(self, nodes)<br>
2800 “”"<br>
2801 Turn an set of pre-fused nodes into a C++ kernel.<br>
2802 “”"<br>
2803 kernel_group = self.kernel_group<br>
 → 2805 cpp_kernel_proxy = CppKernelProxy(kernel_group)<br>
2806 cpp_kernel_proxy.codegen_nodes(nodes)<br>
2808 kernel_group.finalize_kernel(cpp_kernel_proxy, nodes)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_inductor/codegen/cpp.py:2352, in CppKernelProxy.<strong>init</strong>(self, kernel_group)<br>
2350 self.loop_nest = None<br>
2351 self.call_ranges = None<br>
 → 2352 self.picked_vec_isa: codecache.VecISA = codecache.pick_vec_isa()</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_inductor/codecache.py:633, in pick_vec_isa()<br>
632 def pick_vec_isa():<br>
 → 633     _valid_vec_isa_list: List[VecISA] = valid_vec_isa_list()<br>
634     if not _valid_vec_isa_list:<br>
635         return invalid_vec_isa</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_inductor/codecache.py:627, in valid_vec_isa_list()<br>
625 _cpu_info_content = _cpu_info.read()<br>
626 for isa in supported_vec_isa_list:<br>
 → 627     if str(isa) in _cpu_info_content and isa:<br>
628         isa_list.append(isa)<br>
629 return isa_list</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_inductor/codecache.py:548, in VecISA.<strong>bool</strong>(self)<br>
545 with lock:<br>
546     output_path = input_path[:-3] + “so”<br>
547     build_cmd = shlex.split(<br>
 → 548         cpp_compile_command(<br>
549             input_path, output_path, warning_all=False, vec_isa=self<br>
550         )<br>
551     )<br>
552     try:<br>
553         # Check build result<br>
554         compile_file(input_path, output_path, build_cmd)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_inductor/codecache.py:899, in cpp_compile_command(input, output, warning_all, shared, include_pytorch, vec_isa, cuda, aot_mode)<br>
893     out_name = output<br>
894     linker_paths = “”  # let the compiler pick<br>
895 return re.sub(<br>
896     r"[ \n]+“,<br>
897     " “,<br>
898     f””"<br>
 → 899         {cpp_compiler()} {inp_name} {get_shared(shared)}<br>
900         {get_warning_all_flag(warning_all)} {cpp_flags()}<br>
901         {ipaths} {lpaths} {libs} {macros} {linker_paths}<br>
902         {optimization_flags()}<br>
903         {use_custom_generated_macros()}<br>
904         {use_fb_internal_macros()}<br>
905         {use_standard_sys_dir_headers()}<br>
906         -o {out_name}<br>
907     “”",<br>
908 ).strip()</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_inductor/codecache.py:411, in cpp_compiler()<br>
409 else:<br>
410     search = (config.cpp.cxx,)<br>
 → 411 return cpp_compiler_search(search)</p>
<p>File ~/anaconda3/envs/intel_pyg/lib/python3.11/site-packages/torch/_inductor/codecache.py:438, in cpp_compiler_search(search)<br>
436     except (subprocess.SubprocessError, FileNotFoundError, ImportError):<br>
437         continue<br>
 → 438 raise exc.InvalidCxxCompiler()</p>
<p>BackendCompilerFailed: backend=‘inductor’ raised:<br>
InvalidCxxCompiler: No working C++ compiler found in torch._inductor.config.cpp.cxx: (None, ‘g++’)</p>
<p>Set TORCH_LOGS=“+dynamo” and TORCHDYNAMO_VERBOSE=1 for more information`</p>
<p><strong>Dependencies:</strong><br>
I have installed pytorch=2.0.1+cpu and pyg=2.4<br>
<strong>System:</strong><br>
AWS: t2.2xlarge</p>