Skip to content

Commit 2bf9d53

Browse files
authored
sycl: GGML_SYCL_DISABLE_OPT on by default for all Intel Devices (#13973)
1 parent 73e53dc commit 2bf9d53

File tree

5 files changed

+10
-30
lines changed

5 files changed

+10
-30
lines changed

docs/backend/SYCL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -757,7 +757,7 @@ use 1 SYCL GPUs: [0] with Max compute units:512
757757
| Name | Value | Function |
758758
|-------------------|------------------|---------------------------------------------------------------------------------------------------------------------------|
759759
| GGML_SYCL_DEBUG | 0 (default) or 1 | Enable log function by macro: GGML_SYCL_DEBUG |
760-
| GGML_SYCL_DISABLE_OPT | 0 (default) or 1 | Disable optimize features based on Intel GPU type, to compare the performance increase |
760+
| GGML_SYCL_DISABLE_OPT | 0 (default) or 1 | Disable optimize features for Intel GPUs. (Recommended to 1 for intel devices older than Gen 10) |
761761
| GGML_SYCL_DISABLE_GRAPH | 0 or 1 (default) | Disable running computations through SYCL Graphs feature. Disabled by default because graph performance isn't yet better than non-graph performance. |
762762
| GGML_SYCL_DISABLE_DNN | 0 (default) or 1 | Disable running computations through oneDNN and always use oneMKL. |
763763
| ZES_ENABLE_SYSMAN | 0 (default) or 1 | Support to get free memory of GPU by sycl::aspect::ext_intel_free_memory.<br>Recommended to use when --split-mode = layer |

ggml/src/ggml-sycl/common.hpp

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ struct sycl_device_info {
199199
// size_t smpb; // max. shared memory per block
200200
bool vmm; // virtual memory support
201201
size_t total_vram;
202-
sycl_hw_info hw_info;
202+
//sycl_hw_info hw_info; \\ device id and aarch, currently not used
203203
optimize_feature opt_feature;
204204
};
205205

@@ -286,29 +286,6 @@ struct ggml_tensor_extra_gpu {
286286

287287
void release_extra_gpu(ggml_tensor_extra_gpu * extra, std::vector<queue_ptr> streams={});
288288

289-
inline optimize_feature check_gpu_optimize_feature(syclex::architecture &arch) {
290-
optimize_feature opt;
291-
292-
opt.reorder =
293-
(arch == syclex::architecture::intel_gpu_dg1 ||
294-
arch == syclex::architecture::intel_gpu_acm_g10 ||
295-
arch == syclex::architecture::intel_gpu_acm_g11 ||
296-
arch == syclex::architecture::intel_gpu_acm_g12 ||
297-
arch == syclex::architecture::intel_gpu_pvc ||
298-
arch == syclex::architecture::intel_gpu_pvc_vg ||
299-
arch == syclex::architecture::intel_gpu_mtl_u ||
300-
arch == syclex::architecture::intel_gpu_mtl_s ||
301-
arch == syclex::architecture::intel_gpu_mtl_h ||
302-
arch == syclex::architecture::intel_gpu_arl_u ||
303-
arch == syclex::architecture::intel_gpu_arl_s ||
304-
arch == syclex::architecture::intel_gpu_arl_h ||
305-
arch == syclex::architecture::intel_gpu_bmg_g21 ||
306-
arch == syclex::architecture::intel_gpu_lnl_m
307-
);
308-
309-
return opt;
310-
}
311-
312289
namespace sycl_ex = sycl::ext::oneapi::experimental;
313290
struct ggml_backend_sycl_context {
314291
int device;

ggml/src/ggml-sycl/ggml-sycl.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,7 @@ static ggml_sycl_device_info ggml_sycl_init() {
8383

8484
info.devices[i].cc =
8585
100 * prop.get_major_version() + 10 * prop.get_minor_version();
86-
info.devices[i].hw_info = get_device_hw_info(&device);
87-
info.devices[i].opt_feature = check_gpu_optimize_feature(info.devices[i].hw_info.arch);
88-
86+
info.devices[i].opt_feature.reorder = !device.ext_oneapi_architecture_is(syclex::arch_category::intel_gpu);
8987
info.max_work_group_sizes[i] = prop.get_max_work_group_size();
9088
}
9189

@@ -195,7 +193,7 @@ static void ggml_check_sycl() try {
195193

196194
if (!initialized) {
197195
g_ggml_sycl_debug = get_sycl_env("GGML_SYCL_DEBUG", 0);
198-
g_ggml_sycl_disable_optimize= get_sycl_env("GGML_SYCL_DISABLE_OPT", 1);
196+
g_ggml_sycl_disable_optimize = get_sycl_env("GGML_SYCL_DISABLE_OPT", 0);
199197
g_ggml_sycl_disable_graph = get_sycl_env("GGML_SYCL_DISABLE_GRAPH", 1);
200198
g_ggml_sycl_disable_dnn = get_sycl_env("GGML_SYCL_DISABLE_DNN", 0);
201199
g_ggml_sycl_prioritize_dmmv = get_sycl_env("GGML_SYCL_PRIORITIZE_DMMV", 0);

ggml/src/ggml-sycl/sycl_hw.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include "sycl_hw.hpp"
22

3-
3+
// TODO: currently not used
4+
/*
45
sycl_hw_info get_device_hw_info(sycl::device *device_ptr) {
56
sycl_hw_info res;
67
int32_t id = device_ptr->get_info<sycl::ext::intel::info::device::device_id>();
@@ -11,3 +12,4 @@ sycl_hw_info get_device_hw_info(sycl::device *device_ptr) {
1112
1213
return res;
1314
}
15+
*/

ggml/src/ggml-sycl/sycl_hw.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
namespace syclex = sycl::ext::oneapi::experimental;
1212

13+
// TODO: currently not used
14+
/*
1315
struct sycl_hw_info {
1416
syclex::architecture arch;
1517
int32_t device_id;
@@ -18,6 +20,7 @@ struct sycl_hw_info {
1820
bool is_in_vector(std::vector<int> &vec, int item);
1921
2022
sycl_hw_info get_device_hw_info(sycl::device *device_ptr);
23+
*/
2124

2225

2326
#endif // SYCL_HW_HPP

0 commit comments

Comments
 (0)