pytorch - 💡(How to fix) Fix ROCm: `AssertionError` in `ATenBiasAddMMConfigHeuristics` with `max-autotune` and `addmm` [1 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
pytorch/pytorch#179023Fetched 2026-04-08 02:21:56
View on GitHub
Comments
1
Participants
1
Timeline
110
Reactions
0
Author
Participants
Assignees
Timeline (top)
subscribed ×48mentioned ×47labeled ×5referenced ×3

Error Message

torch._inductor.exc.InductorError: LoweringException: AssertionError: target: aten.addmm.default

Fix Action

Fix / Workaround

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): 32 On-line CPU(s) list: 0-31 Vendor ID: AuthenticAMD Model name: AMD RYZEN AI MAX+ 395 w/ Radeon 8060S CPU family: 26 Model: 112 Thread(s) per core: 2 Core(s) per socket: 16 Socket(s): 1 Stepping: 0 Frequency boost: enabled CPU(s) scaling MHz: 45% CPU max MHz: 5187.0000 CPU min MHz: 599.0000 BogoMIPS: 5988.24 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 amd_lbr_v2 nopl xtopology nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 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 ibrs_enhanced vmmcall fsgsbase tsc_adjust 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 user_shstk avx_vnni 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 x2avic v_spec_ctrl vnmi avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid bus_lock_detect movdiri movdir64b overflow_recov succor smca fsrm avx512_vp2intersect flush_l1d amd_lbr_pmc_freeze Virtualization: AMD-V L1d cache: 768 KiB (16 instances) L1i cache: 512 KiB (16 instances) L2 cache: 16 MiB (16 instances) L3 cache: 64 MiB (2 instances) NUMA node(s): 1 NUMA node0 CPU(s): 0-31 Vulnerability Gather data sampling: Not affected Vulnerability Ghostwrite: Not affected Vulnerability Indirect target selection: Not affected Vulnerability Itlb multihit: Not affected Vulnerability L1tf: Not affected Vulnerability Mds: Not affected Vulnerability Meltdown: Not affected Vulnerability Mmio stale data: Not affected Vulnerability Reg file data sampling: Not affected Vulnerability Retbleed: Not affected Vulnerability Spec rstack overflow: Mitigation; IBPB on VMEXIT only 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; Enhanced / Automatic IBRS; IBPB conditional; STIBP always-on; PBRSB-eIBRS Not affected; BHI Not affected Vulnerability Srbds: Not affected Vulnerability Tsa: Not affected Vulnerability Tsx async abort: Not affected Vulnerability Vmscape: Mitigation; IBPB on VMEXIT

Code Example

torch._inductor.exc.InductorError: LoweringException: AssertionError:
  target: aten.addmm.default

---

assert bias.get_stride()[0] == 0 and inductor_config.triton.autotune_cublasLt

---

import torch
m = torch.compile(torch.nn.Linear(64, 128).cuda(), mode="max-autotune")
m(torch.randn(4, 64, device="cuda"))

---

torch._inductor.exc.InductorError: LoweringException: AssertionError:
  target: aten.addmm.default
  args[0]: TensorBox(StorageBox(
    InputBuffer(name='primals_2', layout=FixedLayout('cuda:0', torch.float32, size=[128], stride=[1]))
  ))
  args[1]: TensorBox(StorageBox(
    InputBuffer(name='primals_3', layout=FixedLayout('cuda:0', torch.float32, size=[4, 64], stride=[64, 1]))
  ))
  args[2]: TensorBox(
    ReinterpretView(
      StorageBox(
        InputBuffer(name='primals_1', layout=FixedLayout('cuda:0', torch.float32, size=[128, 64], stride=[64, 1]))
      ),
      FixedLayout('cuda:0', torch.float32, size=[64, 128], stride=[1, 64]),
      origins=OrderedSet([permute])
    )
  )

  File "torch/_inductor/template_heuristics/aten.py", line 90, in _get_template_configs_impl
    assert bias.get_stride()[0] == 0 and inductor_config.triton.autotune_cublasLt

Internal stack trace (with TORCHDYNAMO_VERBOSE=1):
  File "torch/_dynamo/output_graph.py", line 2695, in compile_and_call_fx_graph
    compiled_fn = self.call_user_compiler(gm, self.example_inputs())
  File "torch/_inductor/compile_fx.py", line 1037, in _compile_fx_inner
    mb_compiled_graph = fx_codegen_and_compile(
  File "torch/_inductor/compile_fx.py", line 1489, in codegen_and_compile
    graph.run(*example_inputs)
  File "torch/_inductor/graph.py", line 1445, in call_function
    out = lowerings[target](*args, **kwargs)
  File "torch/_inductor/kernel/mm.py", line 677, in tuned_addmm
    V.choices.get_template_configs(kernel_inputs_aten, aten_templates, name)
  File "torch/_inductor/choices.py", line 186, in _finalize_template_configs
    choices.extend(choice_gen)
  File "torch/_inductor/template_heuristics/aten.py", line 90, in _get_template_configs_impl
    assert bias.get_stride()[0] == 0 and inductor_config.triton.autotune_cublasLt

---

Collecting environment information...
PyTorch version: 2.12.0a0+git57c1d2d
Is debug build: False
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: 7.13.60800

OS: Ubuntu 24.04.3 LTS (x86_64)
GCC version: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
Clang version: Could not collect
CMake version: version 4.3.1
Libc version: glibc-2.39

Python version: 3.12.3 (main, Jan  8 2026, 11:30:50) [GCC 13.3.0] (64-bit runtime)
Python platform: Linux-6.14.0-1019-oem-x86_64-with-glibc2.39
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: 
GPU models and configuration: Radeon 8060S Graphics (gfx1151)
Nvidia driver version: Could not collect
cuDNN version: Could not collect
Is XPU available: False
HIP runtime version: 7.13.60800
MIOpen runtime version: 3.5.1
Is XNNPACK available: True
Caching allocator config: N/A

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):                                  32
On-line CPU(s) list:                     0-31
Vendor ID:                               AuthenticAMD
Model name:                              AMD RYZEN AI MAX+ 395 w/ Radeon 8060S
CPU family:                              26
Model:                                   112
Thread(s) per core:                      2
Core(s) per socket:                      16
Socket(s):                               1
Stepping:                                0
Frequency boost:                         enabled
CPU(s) scaling MHz:                      45%
CPU max MHz:                             5187.0000
CPU min MHz:                             599.0000
BogoMIPS:                                5988.24
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 amd_lbr_v2 nopl xtopology nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 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 ibrs_enhanced vmmcall fsgsbase tsc_adjust 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 user_shstk avx_vnni 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 x2avic v_spec_ctrl vnmi avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid bus_lock_detect movdiri movdir64b overflow_recov succor smca fsrm avx512_vp2intersect flush_l1d amd_lbr_pmc_freeze
Virtualization:                          AMD-V
L1d cache:                               768 KiB (16 instances)
L1i cache:                               512 KiB (16 instances)
L2 cache:                                16 MiB (16 instances)
L3 cache:                                64 MiB (2 instances)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-31
Vulnerability Gather data sampling:      Not affected
Vulnerability Ghostwrite:                Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Mitigation; IBPB on VMEXIT only
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; Enhanced / Automatic IBRS; IBPB conditional; STIBP always-on; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Mitigation; IBPB on VMEXIT

Versions of relevant libraries:
[pip3] numpy==2.4.4
[pip3] optree==0.19.0
[pip3] torch==2.12.0a0+git57c1d2d
[pip3] triton==3.6.0+rocm7.13.0a20260401
[conda] Could not collect
RAW_BUFFERClick to expand / collapse

🐛 Describe the bug

On ROCm, any torch.compile(mode="max-autotune") model containing nn.Linear with bias crashes during Inductor lowering with:

torch._inductor.exc.InductorError: LoweringException: AssertionError:
  target: aten.addmm.default

from the assertion at torch/_inductor/template_heuristics/aten.py:

assert bias.get_stride()[0] == 0 and inductor_config.triton.autotune_cublasLt

Minimal reproducer

import torch
m = torch.compile(torch.nn.Linear(64, 128).cuda(), mode="max-autotune")
m(torch.randn(4, 64, device="cuda"))

cc: @guangzlu @paulzhan @njriasan @naromero77amd @jansel

Error logs

torch._inductor.exc.InductorError: LoweringException: AssertionError:
  target: aten.addmm.default
  args[0]: TensorBox(StorageBox(
    InputBuffer(name='primals_2', layout=FixedLayout('cuda:0', torch.float32, size=[128], stride=[1]))
  ))
  args[1]: TensorBox(StorageBox(
    InputBuffer(name='primals_3', layout=FixedLayout('cuda:0', torch.float32, size=[4, 64], stride=[64, 1]))
  ))
  args[2]: TensorBox(
    ReinterpretView(
      StorageBox(
        InputBuffer(name='primals_1', layout=FixedLayout('cuda:0', torch.float32, size=[128, 64], stride=[64, 1]))
      ),
      FixedLayout('cuda:0', torch.float32, size=[64, 128], stride=[1, 64]),
      origins=OrderedSet([permute])
    )
  )

  File "torch/_inductor/template_heuristics/aten.py", line 90, in _get_template_configs_impl
    assert bias.get_stride()[0] == 0 and inductor_config.triton.autotune_cublasLt

Internal stack trace (with TORCHDYNAMO_VERBOSE=1):
  File "torch/_dynamo/output_graph.py", line 2695, in compile_and_call_fx_graph
    compiled_fn = self.call_user_compiler(gm, self.example_inputs())
  File "torch/_inductor/compile_fx.py", line 1037, in _compile_fx_inner
    mb_compiled_graph = fx_codegen_and_compile(
  File "torch/_inductor/compile_fx.py", line 1489, in codegen_and_compile
    graph.run(*example_inputs)
  File "torch/_inductor/graph.py", line 1445, in call_function
    out = lowerings[target](*args, **kwargs)
  File "torch/_inductor/kernel/mm.py", line 677, in tuned_addmm
    V.choices.get_template_configs(kernel_inputs_aten, aten_templates, name)
  File "torch/_inductor/choices.py", line 186, in _finalize_template_configs
    choices.extend(choice_gen)
  File "torch/_inductor/template_heuristics/aten.py", line 90, in _get_template_configs_impl
    assert bias.get_stride()[0] == 0 and inductor_config.triton.autotune_cublasLt

Versions

Collecting environment information...
PyTorch version: 2.12.0a0+git57c1d2d
Is debug build: False
CUDA used to build PyTorch: N/A
ROCM used to build PyTorch: 7.13.60800

OS: Ubuntu 24.04.3 LTS (x86_64)
GCC version: (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0
Clang version: Could not collect
CMake version: version 4.3.1
Libc version: glibc-2.39

Python version: 3.12.3 (main, Jan  8 2026, 11:30:50) [GCC 13.3.0] (64-bit runtime)
Python platform: Linux-6.14.0-1019-oem-x86_64-with-glibc2.39
Is CUDA available: True
CUDA runtime version: Could not collect
CUDA_MODULE_LOADING set to: 
GPU models and configuration: Radeon 8060S Graphics (gfx1151)
Nvidia driver version: Could not collect
cuDNN version: Could not collect
Is XPU available: False
HIP runtime version: 7.13.60800
MIOpen runtime version: 3.5.1
Is XNNPACK available: True
Caching allocator config: N/A

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):                                  32
On-line CPU(s) list:                     0-31
Vendor ID:                               AuthenticAMD
Model name:                              AMD RYZEN AI MAX+ 395 w/ Radeon 8060S
CPU family:                              26
Model:                                   112
Thread(s) per core:                      2
Core(s) per socket:                      16
Socket(s):                               1
Stepping:                                0
Frequency boost:                         enabled
CPU(s) scaling MHz:                      45%
CPU max MHz:                             5187.0000
CPU min MHz:                             599.0000
BogoMIPS:                                5988.24
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 amd_lbr_v2 nopl xtopology nonstop_tsc cpuid extd_apicid aperfmperf rapl pni pclmulqdq monitor ssse3 fma cx16 sse4_1 sse4_2 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 ibrs_enhanced vmmcall fsgsbase tsc_adjust 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 user_shstk avx_vnni 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 x2avic v_spec_ctrl vnmi avx512vbmi umip pku ospke avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq rdpid bus_lock_detect movdiri movdir64b overflow_recov succor smca fsrm avx512_vp2intersect flush_l1d amd_lbr_pmc_freeze
Virtualization:                          AMD-V
L1d cache:                               768 KiB (16 instances)
L1i cache:                               512 KiB (16 instances)
L2 cache:                                16 MiB (16 instances)
L3 cache:                                64 MiB (2 instances)
NUMA node(s):                            1
NUMA node0 CPU(s):                       0-31
Vulnerability Gather data sampling:      Not affected
Vulnerability Ghostwrite:                Not affected
Vulnerability Indirect target selection: Not affected
Vulnerability Itlb multihit:             Not affected
Vulnerability L1tf:                      Not affected
Vulnerability Mds:                       Not affected
Vulnerability Meltdown:                  Not affected
Vulnerability Mmio stale data:           Not affected
Vulnerability Reg file data sampling:    Not affected
Vulnerability Retbleed:                  Not affected
Vulnerability Spec rstack overflow:      Mitigation; IBPB on VMEXIT only
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; Enhanced / Automatic IBRS; IBPB conditional; STIBP always-on; PBRSB-eIBRS Not affected; BHI Not affected
Vulnerability Srbds:                     Not affected
Vulnerability Tsa:                       Not affected
Vulnerability Tsx async abort:           Not affected
Vulnerability Vmscape:                   Mitigation; IBPB on VMEXIT

Versions of relevant libraries:
[pip3] numpy==2.4.4
[pip3] optree==0.19.0
[pip3] torch==2.12.0a0+git57c1d2d
[pip3] triton==3.6.0+rocm7.13.0a20260401
[conda] Could not collect

cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang @chauhang @penguinwu @voznesenskym @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @aakhundov @coconutruben

extent analysis

TL;DR

The issue can be resolved by modifying the torch.compile function to handle the nn.Linear layer with bias correctly, possibly by adjusting the inductor_config.triton.autotune_cublasLt setting.

Guidance

  • The error occurs due to an assertion failure in torch/_inductor/template_heuristics/aten.py, indicating that the bias.get_stride()[0] is not equal to 0 or inductor_config.triton.autotune_cublasLt is not enabled.
  • To fix this, you can try setting inductor_config.triton.autotune_cublasLt to True before compiling the model.
  • Alternatively, you can modify the torch.compile function to handle the nn.Linear layer with bias correctly, possibly by adding a special case for this layer.
  • You can also try updating the PyTorch version to a newer one, as this issue might be fixed in a later version.

Example

import torch
inductor_config = torch._inductor.config.Config()
inductor_config.triton.autotune_cublasLt = True
m = torch.compile(torch.nn.Linear(64, 128).cuda(), mode="max-autotune", config=inductor_config)
m(torch.randn(4, 64, device="cuda"))

Notes

  • The provided code snippet is a minimal reproducer, and the actual fix might depend on the specific use case and PyTorch version.
  • The inductor_config.triton.autotune_cublasLt setting is not well-documented, and its effect on the compilation process is not clear.

Recommendation

Apply workaround: Set inductor_config.triton.autotune_cublasLt to True before compiling the model, as shown in the example code snippet. This might resolve the issue, but further investigation is needed to determine the root cause and a permanent fix.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING