- Notifications
You must be signed in to change notification settings - Fork26.3k
Open
Description
🐛 Describe the bug
This code (minimal reproducing example)
importtorchu=torch.randn((14,4096),device='cuda:0',dtype=torch.float16)v=torch.randn((4096,4096),device='cuda:0',dtype=torch.float16)torch.nn.functional.linear(u,v)
results in the following error:
Traceback (most recent call last): File "<python-input-3>", line 1, in <module> torch.nn.functional.linear(u,v) ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^RuntimeError: CUDA error: CUBLAS_STATUS_INVALID_VALUE when calling `cublasGemmEx( handle, opa, opb, m, n, k, alpha_ptr, a, CUDA_R_16F, lda, b, CUDA_R_16F, ldb, beta_ptr, c, std::is_same_v<C_Dtype, float> ? CUDA_R_32F : CUDA_R_16F, ldc, compute_type, CUBLAS_GEMM_DEFAULT_TENSOR_OP)`I have also seen this error on some different hardwares (like pytorch 2.9.1 on RTX 4090, but pytorch 2.8.0 is ok)
Versions
Collecting environment information...PyTorch version: 2.11.0.dev20251217+cu130Is debug build: FalseCUDA used to build PyTorch: 13.0ROCM used to build PyTorch: N/AOS: Ubuntu 24.04.3 LTS (x86_64)GCC version: (Ubuntu 14.2.0-4ubuntu2~24.04) 14.2.0Clang version: Could not collectCMake version: version 3.28.3Libc version: glibc-2.39Python version: 3.13.9 | packaged by Anaconda, Inc. | (main, Oct 21 2025, 19:16:10) [GCC 11.2.0] (64-bit runtime)Python platform: Linux-6.9.12-060912-generic-x86_64-with-glibc2.39Is CUDA available: TrueCUDA runtime version: 13.0.88CUDA_MODULE_LOADING set to: GPU models and configuration: GPU 0: NVIDIA B300 SXM6 ACGPU 1: NVIDIA B300 SXM6 ACGPU 2: NVIDIA B300 SXM6 ACGPU 3: NVIDIA B300 SXM6 ACGPU 4: NVIDIA B300 SXM6 ACGPU 5: NVIDIA B300 SXM6 ACGPU 6: NVIDIA B300 SXM6 ACGPU 7: NVIDIA B300 SXM6 ACNvidia driver version: 580.82.07cuDNN version: Could not collectIs XPU available: FalseHIP runtime version: N/AMIOpen runtime version: N/AIs XNNPACK available: TrueCaching allocator config: N/ACPU:Architecture: x86_64CPU op-mode(s): 32-bit, 64-bitAddress sizes: 52 bits physical, 57 bits virtualByte Order: Little EndianCPU(s): 256On-line CPU(s) list: 0-255Vendor ID: GenuineIntelBIOS Vendor ID: Intel(R) CorporationModel name: Intel(R) Xeon(R) 6767PBIOS Model name: Intel(R) Xeon(R) 6767P CPU @ 2.4GHzBIOS CPU family: 179CPU family: 6Model: 173Thread(s) per core: 2Core(s) per socket: 64Socket(s): 2Stepping: 1Frequency boost: enabledCPU(s) scaling MHz: 103%CPU max MHz: 2401.0000CPU min MHz: 800.0000BogoMIPS: 4800.00Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cat_l2 cdp_l3 intel_ppin cdp_l2 ssbd mba ibrs ibpb stibp ibrs_enhanced tpr_shadow flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm rdt_a avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb intel_pt avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local split_lock_detect user_shstk avx_vnni avx512_bf16 wbnoinvd dtherm ida arat pln pts hwp hwp_act_window hwp_epp hwp_pkg_req hfi vnmi avx512vbmi umip pku ospke waitpkg avx512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg tme avx512_vpopcntdq la57 rdpid bus_lock_detect cldemote movdiri movdir64b enqcmd fsrm md_clear serialize tsxldtrk pconfig arch_lbr ibt amx_bf16 avx512_fp16 amx_tile amx_int8 flush_l1d arch_capabilitiesVirtualization: VT-xL1d cache: 6 MiB (128 instances)L1i cache: 8 MiB (128 instances)L2 cache: 256 MiB (128 instances)L3 cache: 672 MiB (2 instances)NUMA node(s): 2NUMA node0 CPU(s): 0-63,128-191NUMA node1 CPU(s): 64-127,192-255Vulnerability Gather data sampling: Not affectedVulnerability Itlb multihit: Not affectedVulnerability L1tf: Not affectedVulnerability Mds: Not affectedVulnerability Meltdown: Not affectedVulnerability Mmio stale data: Not affectedVulnerability Reg file data sampling: Not affectedVulnerability Retbleed: Not affectedVulnerability Spec rstack overflow: Not affectedVulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctlVulnerability Spectre v1: Mitigation; usercopy/swapgs barriers and __user pointer sanitizationVulnerability Spectre v2: Mitigation; Enhanced / Automatic IBRS; IBPB conditional; RSB filling; PBRSB-eIBRS Not affected; BHI BHI_DIS_SVulnerability Srbds: Not affectedVulnerability Tsx async abort: Not affectedVersions of relevant libraries:[pip3] numpy==2.3.5[pip3] nvidia-cublas==13.1.0.3[pip3] nvidia-cuda-cupti==13.0.85[pip3] nvidia-cuda-nvrtc==13.0.88[pip3] nvidia-cuda-runtime==13.0.48[pip3] nvidia-cudnn-cu13==9.13.0.50[pip3] nvidia-cufft==12.0.0.61[pip3] nvidia-curand==10.4.0.35[pip3] nvidia-cusolver==12.0.4.66[pip3] nvidia-cusparse==12.6.3.3[pip3] nvidia-cusparselt-cu13==0.8.0[pip3] nvidia-nccl-cu13==2.28.9[pip3] nvidia-nvjitlink==13.0.88[pip3] nvidia-nvtx==13.0.85[pip3] pytorch-lightning==1.9.5[pip3] torch==2.11.0.dev20251217+cu130[pip3] torchmetrics==1.8.2[pip3] torchvision==0.25.0.dev20251217+cu130[pip3] triton==3.6.0+git8fedd49b[conda] numpy 2.3.5 pypi_0 pypi[conda] nvidia-cublas 13.1.0.3 pypi_0 pypi[conda] nvidia-cuda-cupti 13.0.85 pypi_0 pypi[conda] nvidia-cuda-nvrtc 13.0.88 pypi_0 pypi[conda] nvidia-cuda-runtime 13.0.48 pypi_0 pypi[conda] nvidia-cudnn-cu13 9.13.0.50 pypi_0 pypi[conda] nvidia-cufft 12.0.0.61 pypi_0 pypi[conda] nvidia-curand 10.4.0.35 pypi_0 pypi[conda] nvidia-cusolver 12.0.4.66 pypi_0 pypi[conda] nvidia-cusparse 12.6.3.3 pypi_0 pypi[conda] nvidia-cusparselt-cu13 0.8.0 pypi_0 pypi[conda] nvidia-nccl-cu13 2.28.9 pypi_0 pypi[conda] nvidia-nvjitlink 13.0.88 pypi_0 pypi[conda] nvidia-nvtx 13.0.85 pypi_0 pypi[conda] pytorch-lightning 1.9.5 pypi_0 pypi[conda] torch 2.11.0.dev20251217+cu130 pypi_0 pypi[conda] torchmetrics 1.8.2 pypi_0 pypi[conda] torchvision 0.25.0.dev20251217+cu130 pypi_0 pypi[conda] triton 3.6.0+git8fedd49b pypi_0 pypiMetadata
Metadata
Assignees
Labels
No labels