[PyTorch/Triton with ROCm 5.5] torch._dynamo.exc.BackendCompilerFailed: debug_wrapper raised TypeError: 'NoneType' object is not subscriptable
Labels: module: rocm, triaged, oncall: pt2, module: inductor

### 🐛 Describe the bug

I'm attempting to train a new model using the DreamBooth extension with Automatic1111's webui for Stable Diffusion. I'm currently running Torch, Vision and Triton compiled with ROCm support.

Error message:

```
I found myself at /home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/pytorch_triton_rocm-2.0.2-py3.8-linux-x86_64.egg/triton/_C/../third_party/rocm/lib/libdrm_amdgpu.so 170
I found myself at /home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/pytorch_triton_rocm-2.0.2-py3.8-linux-x86_64.egg/triton/_C/../third_party/rocm/lib/libdrm_amdgpu.so 170
I found myself at /home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/pytorch_triton_rocm-2.0.2-py3.8-linux-x86_64.egg/triton/_C/../third_party/rocm/lib/libdrm_amdgpu.so 170
I found myself at /home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/pytorch_triton_rocm-2.0.2-py3.8-linux-x86_64.egg/triton/_C/../third_party/rocm/lib/libdrm_amdgpu.so 170
Error: Attempting to get amgpu ISA Details 'NoneType' object has no attribute 'group'
I found myself at /home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/pytorch_triton_rocm-2.0.2-py3.8-linux-x86_64.egg/triton/_C/../third_party/rocm/lib/libdrm_amdgpu.so 170
I found myself at /home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/pytorch_triton_rocm-2.0.2-py3.8-linux-x86_64.egg/triton/_C/../third_party/rocm/lib/libdrm_amdgpu.so 170
I found myself at /home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/pytorch_triton_rocm-2.0.2-py3.8-linux-x86_64.egg/triton/_C/../third_party/rocm/lib/libdrm_amdgpu.so 170
I found myself at /home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/pytorch_triton_rocm-2.0.2-py3.8-linux-x86_64.egg/triton/_C/../third_party/rocm/lib/libdrm_amdgpu.so 170
Error: Attempting to get amgpu ISA Details 'NoneType' object has no attribute 'group'
Traceback (most recent call last):
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/output_graph.py", line 670, in call_user_compiler
    compiled_fn = compiler_fn(gm, self.fake_example_inputs())
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/debug_utils.py", line 1055, in debug_wrapper
    compiled_gm = compiler_fn(gm, example_inputs)
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/__init__.py", line 1388, in __call__
    from torch._inductor.compile_fx import compile_fx
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_inductor/compile_fx.py", line 21, in <module>
    from . import config, metrics, overrides, pattern_matcher
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_inductor/pattern_matcher.py", line 18, in <module>
    from . import config, ir
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_inductor/ir.py", line 29, in <module>
    from . import config, dependencies
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_inductor/dependencies.py", line 10, in <module>
    from .codegen.common import index_prevent_reordering
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_inductor/codegen/common.py", line 13, in <module>
    from ..utils import (
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_inductor/utils.py", line 32, in <module>
    from triton.testing import do_bench
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/pytorch_triton_rocm-2.0.2-py3.8-linux-x86_64.egg/triton/__init__.py", line 20, in <module>
    from .runtime import (
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/pytorch_triton_rocm-2.0.2-py3.8-linux-x86_64.egg/triton/runtime/__init__.py", line 1, in <module>
    from .autotuner import Config, Heuristics, autotune, heuristics
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/pytorch_triton_rocm-2.0.2-py3.8-linux-x86_64.egg/triton/runtime/autotuner.py", line 7, in <module>
    from ..compiler import OutOfResources
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/pytorch_triton_rocm-2.0.2-py3.8-linux-x86_64.egg/triton/compiler.py", line 1895, in <module>
    @static_vars(amdgcn_bitcode_paths = _get_amdgcn_bitcode_paths())
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/pytorch_triton_rocm-2.0.2-py3.8-linux-x86_64.egg/triton/compiler.py", line 1874, in _get_amdgcn_bitcode_paths
    gfx_arch = _get_amdgcn_bitcode_paths.discovered_gfx_arch_fulldetails[1]
TypeError: 'NoneType' object is not subscriptable

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/user/SD/stable-diffusion-webui/extensions/sd_dreambooth_extension/dreambooth/ui_functions.py", line 727, in start_training
    result = main(class_gen_method=class_gen_method)
  File "/home/user/SD/stable-diffusion-webui/extensions/sd_dreambooth_extension/dreambooth/train_dreambooth.py", line 1371, in main
    return inner_loop()
  File "/home/user/SD/stable-diffusion-webui/extensions/sd_dreambooth_extension/dreambooth/memory.py", line 119, in decorator
    return function(batch_size, grad_size, prof, *args, **kwargs)
  File "/home/user/SD/stable-diffusion-webui/extensions/sd_dreambooth_extension/dreambooth/train_dreambooth.py", line 1169, in inner_loop
    noise_pred = unet(
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/eval_frame.py", line 82, in forward
    return self.dynamo_ctx(self._orig_mod.forward)(*args, **kwargs)
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/eval_frame.py", line 209, in _fn
    return fn(*args, **kwargs)
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/diffusers/models/unet_2d_condition.py", line 556, in forward
    t_emb = self.time_proj(timesteps)
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/nn/modules/module.py", line 1501, in _call_impl
    return forward_call(*args, **kwargs)
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/eval_frame.py", line 337, in catch_errors
    return callback(frame, cache_size, hooks)
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/convert_frame.py", line 404, in _convert_frame
    result = inner_convert(frame, cache_size, hooks)
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/convert_frame.py", line 104, in _fn
    return fn(*args, **kwargs)
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/convert_frame.py", line 262, in _convert_frame_assert
    return _compile(
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/utils.py", line 163, in time_wrapper
    r = func(*args, **kwargs)
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/convert_frame.py", line 324, in _compile
    out_code = transform_code_object(code, transform)
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/bytecode_transformation.py", line 445, in transform_code_object
    transformations(instructions, code_options)
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/convert_frame.py", line 311, in transform
    tracer.run()
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 1726, in run
    super().run()
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 576, in run
    and self.step()
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 540, in step
    getattr(self, inst.opname)(inst)
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/symbolic_convert.py", line 1792, in RETURN_VALUE
    self.output.compile_subgraph(
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/output_graph.py", line 517, in compile_subgraph
    self.compile_and_call_fx_graph(tx, list(reversed(stack_values)), root)
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/output_graph.py", line 588, in compile_and_call_fx_graph
    compiled_fn = self.call_user_compiler(gm)
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/utils.py", line 163, in time_wrapper
    r = func(*args, **kwargs)
  File "/home/user/SD/stable-diffusion-webui/venv/lib/python3.8/site-packages/torch/_dynamo/output_graph.py", line 675, in call_user_compiler
    raise BackendCompilerFailed(self.compiler_fn, e) from e
torch._dynamo.exc.BackendCompilerFailed: debug_wrapper raised TypeError: 'NoneType' object is not subscriptable

Set torch._dynamo.config.verbose=True for more information
```

### Versions

```
$ python3.8 collect_env.py
[W interface.cpp:47] Warning: Loading nvfuser library failed with: Error in dlopen: libnvfuser_codegen.so: cannot open shared object file: No such file or directory (function LoadingNvfuserLibrary)
Collecting environment information...
PyTorch version: 2.0.0a0+gitc263bd4
Is debug build: False
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: 5.5.30201-c1741e9b

OS: Ubuntu 22.04.2 LTS (x86_64)
GCC version: (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
Clang version: Could not collect
CMake version: version 3.26.3
Libc version: glibc-2.35

Python version: 3.8.16 (default, Dec  7 2022, 01:12:06)  [GCC 11.3.0] (64-bit runtime)
Python platform: Linux-5.19.0-41-generic-x86_64-with-glibc2.35
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: LAZY
GPU models and configuration: Radeon RX 7900 XTX
Nvidia driver version: Could not collect
cuDNN version: Could not collect
HIP runtime version: 5.5.30201
MIOpen runtime version: 2.19.0
Is XNNPACK available: True

CPU:
Architecture:                    x86_64
CPU op-mode(s):                  32-bit, 64-bit
Address sizes:                   48 bits physical, 48 bits virtual
Byte Order:                      Little Endian
CPU(s):                          12
On-line CPU(s) list:             0-11
Vendor ID:                       AuthenticAMD
Model name:                      AMD Ryzen 5 7600X 6-Core Processor
CPU family:                      25
Model:                           97
Thread(s) per core:              2
Core(s) per socket:              6
Socket(s):                       1
Stepping:                        2
Frequency boost:                 enabled
CPU max MHz:                     5452,7339
CPU min MHz:                     3000,0000
BogoMIPS:                        9382.61
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt tce topoext perfctr_core perfctr_nb bpext perfctr_llc mwaitx cpb cat_l3 cdp_l3 hw_pstate ssbd mba perfmon_v2 ibrs ibpb stibp vmmcall fsgsbase bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local avx512_bf16 clzero irperf xsaveerptr rdpru wbnoinvd cppc arat npt lbrv svm_lock nrip_save tsc_scale vmcb_clean flushbyasid decodeassists pausefilter pfthreshold avic v_vmsave_vmload vgif v_spec_ctrl avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid overflow_recov succor smca fsrm flush_l1d
Virtualization:                  AMD-V
L1d cache:                       192 KiB (6 instances)
L1i cache:                       192 KiB (6 instances)
L2 cache:                        6 MiB (6 instances)
L3 cache:                        32 MiB (1 instance)
NUMA node(s):                    1
NUMA node0 CPU(s):               0-11
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Mmio stale data:   Not affected
Vulnerability Retbleed:          Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Retpolines, IBPB conditional, IBRS_FW, STIBP always-on, RSB filling, PBRSB-eIBRS Not affected
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Not affected

Versions of relevant libraries:
[pip3] lion-pytorch==0.0.8
[pip3] numpy==1.23.5
[pip3] open-clip-torch==2.7.0
[pip3] pytorch-lightning==1.7.7
[pip3] pytorch-triton-rocm==2.0.2
[pip3] torch==2.0.0a0+gitc263bd4
[pip3] torchdiffeq==0.2.3
[pip3] torchmetrics==0.11.4
[pip3] torchsde==0.2.5
[pip3] torchvision==0.15.1a0+42759b1
[pip3] triton==2.1.0
[conda] Could not collect
```

cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @dllehr-amd @jataylo @ezyang @soumith @msaroufim @wconstab @ngimel @bdhirsh @anijain2305 @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @Xia-Weiwen @wenzhe-nrv @jiayisunx @peterbell10 @desertfire