Skip to content

Commit bd0f3de

Browse files
author
Ewan Crawford
committed
SYCL: Support sycl_ext_oneapi_limited_graph
The current usage of the SYCL-Graph extension checks for the `sycl_ext_oneapi_graph` device aspect. However, it is also possible to support `sycl_ext_oneapi_limied_graph` devices that don't support update
1 parent fe5b78c commit bd0f3de

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3700,7 +3700,8 @@ static ggml_status ggml_backend_sycl_graph_compute(ggml_backend_t backend, ggml_
37003700

37013701
#ifdef GGML_SYCL_GRAPH
37023702
if (!g_ggml_sycl_disable_graph) {
3703-
if (!sycl_ctx->exec_graph && !dpct::get_device(sycl_ctx->device).has(sycl::aspect::ext_oneapi_graph)) {
3703+
const bool graph_support = dpct::get_device(sycl_ctx->device).has(sycl::aspect::ext_oneapi_limited_graph);
3704+
if (!graph_support) {
37043705
GGML_SYCL_DEBUG("[SYCL-GRAPH] can not use graphs on device:%d\n", sycl_ctx->device);
37053706
ggml_backend_sycl_graph_compute_impl(sycl_ctx, cgraph);
37063707
return GGML_STATUS_SUCCESS;
@@ -3711,8 +3712,10 @@ static ggml_status ggml_backend_sycl_graph_compute(ggml_backend_t backend, ggml_
37113712
ggml_backend_sycl_graph_compute_impl(sycl_ctx, cgraph);
37123713
model_sycl_graph.end_recording();
37133714

3714-
if (!sycl_ctx->exec_graph) {
3715-
auto exec_graph = model_sycl_graph.finalize({sycl_ex::property::graph::updatable{}});
3715+
const bool graph_update_support = dpct::get_device(sycl_ctx->device).has(sycl::aspect::ext_oneapi_graph);
3716+
if (!sycl_ctx->exec_graph || !graph_update_support) {
3717+
auto exec_graph = graph_update_support ? model_sycl_graph.finalize(sycl_ex::property::graph::updatable{}) :
3718+
model_sycl_graph.finalize();
37163719
sycl_ctx->exec_graph = std::make_unique<
37173720
sycl_ex::command_graph<sycl_ex::graph_state::executable>>(exec_graph);
37183721
} else {

0 commit comments

Comments
 (0)