Skip to content

Commit 3a5916e

Browse files
authored
Merge pull request #276 from AInVFX/main
fix: enhance Conv3d workaround compatibility for PyTorch dev builds and AMD ROCm Fixes #178 and #265
2 parents c71138d + b64d526 commit 3a5916e

4 files changed

Lines changed: 35 additions & 13 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ We're actively working on improvements and new features. To stay informed:
3636

3737
## 🚀 Updates
3838

39+
**2025.11.10 - Version 2.5.7**
40+
41+
- **🔧 Fix: Conv3d workaround compatibility** - Enhanced platform detection and added graceful fallback to prevent errors on PyTorch dev builds and AMD ROCm systems
42+
3943
**2025.11.09 - Version 2.5.6**
4044

4145
- 🎨 **Fix: Restored natural look for 7b model** - Corrected torch.compile optimization that was causing overly plastic/ high-specular appearance in upscaled videos with 7b model.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "seedvr2_videoupscaler"
33
description = "SeedVR2 official ComfyUI integration: ByteDance-Seed's one-step diffusion-based video/image upscaling with memory-efficient inference"
4-
version = "2.5.6"
4+
version = "2.5.7"
55
authors = [
66
{name = "numz"},
77
{name = "adrientoupet"}

src/models/video_vae_v3/modules/causal_inflation_lib.py

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,21 @@ def _conv_forward(self, input, weight, bias, *args, **kwargs):
9696
hasattr(torch.backends.cudnn, 'is_available') and
9797
torch.backends.cudnn.is_available() and
9898
getattr(torch.backends.cudnn, 'enabled', True)):
99-
# Direct cuDNN call bypasses buggy PyTorch dispatch layer (NVIDIA only)
100-
out = torch.cudnn_convolution(
101-
input, weight, self.padding, self.stride, self.dilation, self.groups,
102-
benchmark=False, deterministic=False, allow_tf32=True
103-
)
104-
if bias is not None:
105-
out += bias.reshape((1, -1) + (1,) * (out.ndim - 2))
106-
return out
107-
else:
108-
# Use standard path for unaffected configurations
109-
return super()._conv_forward(input, weight, bias, *args, **kwargs)
99+
try:
100+
# Direct cuDNN call bypasses buggy PyTorch dispatch layer (NVIDIA only)
101+
out = torch.cudnn_convolution(
102+
input, weight, self.padding, self.stride, self.dilation, self.groups,
103+
benchmark=False, deterministic=False, allow_tf32=True
104+
)
105+
if bias is not None:
106+
out += bias.reshape((1, -1) + (1,) * (out.ndim - 2))
107+
return out
108+
except RuntimeError:
109+
# Fallback if direct cuDNN call fails (dev builds, edge cases)
110+
pass
111+
112+
# Use standard path for unaffected configurations or if workaround failed
113+
return super()._conv_forward(input, weight, bias, *args, **kwargs)
110114

111115
def memory_limit_conv(
112116
self,

src/optimization/compatibility.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,21 @@ def _check_conv3d_memory_bug():
105105
with fp16/bfloat16 due to buggy dispatch layer.
106106
"""
107107
try:
108-
if not (torch.cuda.is_available() and torch.cuda.get_device_capability()[0] >= 3):
108+
# Exclude AMD ROCm/HIP builds (they use MIOpen, not cuDNN)
109+
if hasattr(torch.version, 'hip') and torch.version.hip is not None:
110+
return False
111+
112+
# Must have CUDA available
113+
if not (hasattr(torch, 'cuda') and torch.cuda.is_available()):
114+
return False
115+
116+
# Must have cuDNN actually available (not just the attribute)
117+
if not (hasattr(torch.backends.cudnn, 'is_available') and
118+
torch.backends.cudnn.is_available()):
119+
return False
120+
121+
# Check device capability (NVIDIA GPUs)
122+
if torch.cuda.get_device_capability()[0] < 3:
109123
return False
110124

111125
# Parse torch version

0 commit comments

Comments
 (0)