docstr: Make sure autotuning addmm in sub processes work without crashes.
docstr_tok: ["Make","sure","autotuning","addmm","in","sub","processes","work","without","crashes","."]
code: def test_max_autotune_addmm(self, dynamic=False):
      """
      Make sure autotuning addmm in sub processes work without crashes.
      """
  
      torch.backends.cuda.matmul.allow_fp16_reduced_precision_reduction = (
          False
      )
  
      def addmm(x, a, b):
          return torch.addmm(x, a, b)
  
      x = torch.randn(100).cuda()
      a = torch.randn(100, 10).cuda()
      b = torch.randn(10, 100).cuda()
      with config.patch(
          {"max_autotune": True, "autotune_in_subproc": True}
      ):
          Y_compiled = torch.compile(addmm, dynamic=dynamic)(x, a, b)
          Y = addmm(x, a, b)
          torch.testing.assert_close(
              Y_compiled, Y, atol=1e-2, rtol=1e-2
          )
  
imports: import os
  import unittest
  from typing import Callable, List, Optional
  import torch
  from torch import multiprocessing
  from torch._dynamo.test_case import run_tests, TestCase
  from torch._dynamo.testing import reset_rng_state
  from torch._dynamo.utils import counters
  from torch._inductor import config
  from torch._inductor.autotune_process import BenchmarkRequest, CUDA_VISIBLE_DEVICES, TuningProcessPool
  from torch._inductor.graph import GraphLowering
  from torch._inductor.ir import Buffer, FixedLayout
  from torch._inductor.kernel.mm_plus_mm import aten_mm_plus_mm
  from torch._inductor.select_algorithm import AlgorithmSelectorCache, ChoiceCaller, TritonTemplateCaller
  from torch._inductor.utils import run_and_get_code
  from torch._inductor.virtualized import V
  from torch.fx.experimental.proxy_tensor import make_fx
  from torch.testing import FileCheck
  from torch.testing._internal.common_cuda import SM75OrLater, SM90OrLater
  from torch.testing._internal.common_utils import instantiate_parametrized_tests, parametrize, skipIfRocm
  from torch.testing._internal.inductor_utils import HAS_CPU, HAS_CUDA
label_desc: Use image node_id 20 for calling the TestMaxAutotune obj's underlying member method code with example usage: obj.test_max_autotune_addmm(dynamic) and returns: torch