Skip to content

Commit 94a6c49

Browse files
committed
Add missing transpose, fix for python 3.13 issue
1 parent f421b16 commit 94a6c49

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

comfy_kitchen/backends/cuda/CMakeLists.txt

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,23 @@ set(CPP_SOURCES
112112
)
113113

114114
# Create the nanobind module
115-
nanobind_add_module(_C
116-
NB_STATIC
117-
LTO
118-
${CPP_SOURCES}
119-
${CUDA_SOURCES}
120-
)
115+
if(Python_VERSION VERSION_GREATER_EQUAL "3.12")
116+
nanobind_add_module(_C
117+
NB_STATIC
118+
STABLE_ABI
119+
LTO
120+
${CPP_SOURCES}
121+
${CUDA_SOURCES}
122+
)
123+
else()
124+
# Python 3.10/3.11: version-specific module
125+
nanobind_add_module(_C
126+
NB_STATIC
127+
LTO
128+
${CPP_SOURCES}
129+
${CUDA_SOURCES}
130+
)
131+
endif()
121132

122133
# Set target properties
123134
target_compile_options(_C PRIVATE

comfy_kitchen/backends/eager/quantization.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ def scaled_mm_nvfp4(
163163

164164
result = torch._scaled_mm(
165165
a.view(torch.float4_e2m1fn_x2),
166-
b.view(torch.float4_e2m1fn_x2),
166+
b.view(torch.float4_e2m1fn_x2).t(),
167167
block_scale_a.view(-1),
168168
block_scale_b.view(-1),
169169
bias=None if should_add_bias_separately else bias,

0 commit comments

Comments
 (0)