Skip to content

Commit a09e8f5

Browse files
committed
Collectives disabled by default.
1 parent 7f9b659 commit a09e8f5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ggml/src/ggml-vulkan/ggml-vulkan.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3041,7 +3041,7 @@ static void ggml_vk_load_shaders(vk_device& device) {
30413041
// Enables subgroup ops for preventing the re-calculation of indices.
30423042
uint32_t use_collectives = 0;
30433043
// CRS block size should be capped at sugroup size for correctness when shuffle is used.
3044-
if(device->subgroup_shuffle){
3044+
if(getenv("GGML_VK_USE_COLLECTIVES") != nullptr && device->subgroup_shuffle){
30453045
use_collectives = 1;
30463046
conv2d_BS_CRS = std::min(device->subgroup_size, conv2d_BS_CRS);
30473047
}
@@ -3050,10 +3050,13 @@ static void ggml_vk_load_shaders(vk_device& device) {
30503050
uint32_t conv2d_shmem_req = (conv2d_BS_K*(conv2d_BS_CRS+1) + conv2d_BS_CRS*(conv2d_BS_NPQ+1))*sizeof(float);
30513051
if(device->properties.limits.maxComputeSharedMemorySize < conv2d_shmem_req){
30523052
conv2d_BS_CRS = 8;
3053-
if(device->subgroup_shuffle){
3053+
if(getenv("GGML_VK_USE_COLLECTIVES") != nullptr && device->subgroup_shuffle){
30543054
conv2d_BS_CRS = std::min(device->subgroup_size, conv2d_BS_CRS);
30553055
}
30563056
}
3057+
3058+
std::cerr << " --> BS_CRS=" << conv2d_BS_CRS << " use_collectives=" << use_collectives << std::endl;
3059+
30573060
if(device->subgroup_shuffle){
30583061
ggml_vk_create_pipeline(device, device->pipeline_conv2d_f32, "conv2d_f32", conv2d_f32_len, conv2d_f32_data, "main", 3, sizeof(vk_op_conv2d_push_constants), {conv2d_BS_K, conv2d_BS_NPQ, 1}, {conv2d_WG_SIZE, conv2d_BS_K, conv2d_BS_CRS, conv2d_BS_NPQ, conv2d_TS_K, use_collectives}, 1, true, true);
30593062
}else{

0 commit comments

Comments
 (0)