Skip to content

Commit c92ed15

Browse files
committed
python and cutile in build not host
1 parent 8f8e721 commit c92ed15

3 files changed

Lines changed: 119 additions & 21 deletions

File tree

conda/recipes/libcuvs/recipe.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ cache:
7272
- ninja
7373
- if: cuda_major == "13"
7474
then:
75+
- python
7576
- cutile-python
7677
- cuda-tileiras
7778
- ${{ stdlib("c") }}

cpp/cmake/modules/generate_cutile_kernels.cmake

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,17 @@ function(_cutile_kernels_setup)
3636
set(multi_value)
3737
cmake_parse_arguments(_CUTILE "${options}" "${one_value}" "${multi_value}" ${ARGN})
3838

39-
find_package(Python3 REQUIRED COMPONENTS Interpreter)
39+
if(DEFINED ENV{BUILD_PREFIX})
40+
find_program(
41+
_cutile_build_python
42+
NAMES python3 python
43+
PATHS "$ENV{BUILD_PREFIX}/bin"
44+
NO_DEFAULT_PATH REQUIRED NO_CACHE
45+
)
46+
set(Python3_EXECUTABLE "${_cutile_build_python}")
47+
else()
48+
find_package(Python3 REQUIRED COMPONENTS Interpreter)
49+
endif()
4050
find_package(CUDAToolkit REQUIRED)
4151

4252
if(CUDAToolkit_VERSION VERSION_LESS 13.0)
@@ -68,6 +78,7 @@ function(_cutile_kernels_setup)
6878
"Install cutile-python and cuda-tileiras (conda), or cuda-tile[tileiras] (pip)."
6979
)
7080
endif()
81+
message(STATUS "Using cuTile Python: ${Python3_EXECUTABLE}")
7182

7283
set_property(
7384
DIRECTORY

cpp/src/distance/detail/fused_distance_nn/cutile/fused_1nn_cutile_matrix.json

Lines changed: 106 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
],
3131
"_tile": [
3232
{
33-
"tile_m": 128,
33+
"tile_m": 64,
3434
"tile_n": 128,
3535
"tile_k": 32
3636
}
@@ -63,12 +63,18 @@
6363
{
6464
"matrix_layout": "strict",
6565
"abi_abbrev": "strict",
66-
"abi_tag": "cutile_abi_strict"
66+
"abi_tag": "cutile_abi_strict",
67+
"tile_m": 128,
68+
"tile_n": 128,
69+
"tile_k": 32
6770
},
6871
{
6972
"matrix_layout": "relaxed",
7073
"abi_abbrev": "relaxed",
71-
"abi_tag": "cutile_abi_relaxed"
74+
"abi_tag": "cutile_abi_relaxed",
75+
"tile_m": 128,
76+
"tile_n": 256,
77+
"tile_k": 16
7278
}
7379
],
7480
"_data": [
@@ -92,13 +98,6 @@
9298
"index_abbrev": "i32"
9399
}
94100
],
95-
"_tile": [
96-
{
97-
"tile_m": 128,
98-
"tile_n": 128,
99-
"tile_k": 32
100-
}
101-
],
102101
"_export": [
103102
{
104103
"output_format": "cubin",
@@ -109,17 +108,51 @@
109108
"cc_major": 10,
110109
"cc_minor": 0,
111110
"arch_tag": "cutile_arch_10_0"
111+
}
112+
]
113+
},
114+
{
115+
"_abi": [
116+
{
117+
"matrix_layout": "strict",
118+
"abi_abbrev": "strict",
119+
"abi_tag": "cutile_abi_strict"
112120
},
113121
{
114-
"output_format": "cubin",
115-
"artifact_ext": "cubin",
116-
"artifact_basename": "@data_type@_@index_abbrev@_@abi_abbrev@_@gpu_code@",
117-
"register": "cubin",
118-
"gpu_code": "sm_90",
119-
"cc_major": 9,
120-
"cc_minor": 0,
121-
"arch_tag": "cutile_arch_9_0"
122+
"matrix_layout": "relaxed",
123+
"abi_abbrev": "relaxed",
124+
"abi_tag": "cutile_abi_relaxed"
125+
}
126+
],
127+
"_data": [
128+
{
129+
"data_type": "half",
130+
"data_abbrev": "h"
122131
},
132+
{
133+
"data_type": "float",
134+
"data_abbrev": "f"
135+
}
136+
],
137+
"_metric": [
138+
{
139+
"metric": "runtime"
140+
}
141+
],
142+
"_index": [
143+
{
144+
"index_type": "int32",
145+
"index_abbrev": "i32"
146+
}
147+
],
148+
"_tile": [
149+
{
150+
"tile_m": 128,
151+
"tile_n": 128,
152+
"tile_k": 32
153+
}
154+
],
155+
"_export": [
123156
{
124157
"output_format": "tileir_bytecode",
125158
"artifact_ext": "tilebc",
@@ -136,8 +169,8 @@
136169
"matrix_layout": "strict",
137170
"abi_abbrev": "strict",
138171
"abi_tag": "cutile_abi_strict",
139-
"tile_m": 128,
140-
"tile_n": 128,
172+
"tile_m": 64,
173+
"tile_n": 256,
141174
"tile_k": 32
142175
},
143176
{
@@ -146,7 +179,60 @@
146179
"abi_tag": "cutile_abi_relaxed",
147180
"tile_m": 128,
148181
"tile_n": 128,
182+
"tile_k": 64
183+
}
184+
],
185+
"_data": [
186+
{
187+
"data_type": "half",
188+
"data_abbrev": "h"
189+
},
190+
{
191+
"data_type": "float",
192+
"data_abbrev": "f"
193+
}
194+
],
195+
"_metric": [
196+
{
197+
"metric": "runtime"
198+
}
199+
],
200+
"_index": [
201+
{
202+
"index_type": "int32",
203+
"index_abbrev": "i32"
204+
}
205+
],
206+
"_export": [
207+
{
208+
"output_format": "cubin",
209+
"artifact_ext": "cubin",
210+
"artifact_basename": "@data_type@_@index_abbrev@_@abi_abbrev@_@gpu_code@",
211+
"register": "cubin",
212+
"gpu_code": "sm_90",
213+
"cc_major": 9,
214+
"cc_minor": 0,
215+
"arch_tag": "cutile_arch_9_0"
216+
}
217+
]
218+
},
219+
{
220+
"_abi": [
221+
{
222+
"matrix_layout": "strict",
223+
"abi_abbrev": "strict",
224+
"abi_tag": "cutile_abi_strict",
225+
"tile_m": 64,
226+
"tile_n": 128,
149227
"tile_k": 32
228+
},
229+
{
230+
"matrix_layout": "relaxed",
231+
"abi_abbrev": "relaxed",
232+
"abi_tag": "cutile_abi_relaxed",
233+
"tile_m": 64,
234+
"tile_n": 128,
235+
"tile_k": 64
150236
}
151237
],
152238
"_data": [

0 commit comments

Comments
 (0)