mirror of
https://github.com/Comfy-Org/comfy-kitchen.git
synced 2026-11-04 23:37:42 +00:00
[GH-ISSUE #32] Fatal access violation (0xC0000005) in _scaled_mm_v2 on ROCm Windows #17
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Comfy-Org/comfy-kitchen#17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @0xDELUXA on GitHub (Mar 19, 2026).
Original GitHub issue: https://github.com/Comfy-Org/comfy-kitchen/issues/32
Environment
gfx1200)7.13.0a20260318(torch.version.hip = "7.2.0")Problem
Running a Flux2 FP8-quantized model causes a fatal Windows access violation (
0xC0000005) insidetorch_hip.dllatat::cuda::_scaled_mm_v2.This is not a catchable Python exception - the process is killed by the OS before Python regains control, so the existing
except (RuntimeError, TypeError)fallback in_handle_fp8_linearnever fires.Stack trace (key frames)
Root cause
torch.ops.aten._scaled_mm_v2exists in the ROCm PyTorch build and is importable, but calling it on RDNA4/gfx1200triggers a segfault - the required HIP kernel appears to be missing or not compiled for this architecture in the current PyTorch ROCm release.I'm considering whether I should also report this issue in the TheRock repo as well.
Full crash log
@0xDELUXA commented on GitHub (Mar 19, 2026):
Workaround
This makes
_HAS_SCALED_MM_V2returnFalseon ROCm regardless of whetherscaled_mmexists, routing all FP8 matmuls through theelsebranch which usestorch._scaled_mm.torch._scaled_mmwithfloat8_e4m3fnworks perfectly. Only_scaled_mm_v2/torch.nn.functional.scaled_mmis broken.@tvukovic-amd commented on GitHub (Apr 2, 2026):
https://github.com/pytorch/pytorch/pull/179138 solves this issue