File tree Expand file tree Collapse file tree 2 files changed +18
-7
lines changed
Expand file tree Collapse file tree 2 files changed +18
-7
lines changed Original file line number Diff line number Diff 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
123134target_compile_options (_C PRIVATE
Original file line number Diff line number Diff 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 ,
You can’t perform that action at this time.
0 commit comments