@@ -395,17 +395,16 @@ struct ggml_backend_cann_context {
395395#ifdef USE_ACL_GRAPH
396396 // / Cached CANN ACL graph used for executing the current ggml computation graph.
397397 std::unique_ptr<ggml_cann_graph> cann_graph;
398+ bool acl_graph_mode = true ;
398399#endif
399400 cann_task_queue task_queue;
400401 bool async_mode;
401- bool eager_mode; // not use acl graph
402402 // Rope Cache
403403 ggml_cann_rope_cache rope_cache;
404404 // Constant Pool
405405 ggml_cann_tensor_cache rms_norm_one_tensor_cache;
406406 ggml_cann_tensor_cache rms_norm_zero_tensor_cache;
407407
408-
409408 aclrtStream streams[GGML_CANN_MAX_STREAMS] = {nullptr }; /* *< Array of streams for the device. */
410409
411410 /* *
@@ -420,10 +419,13 @@ struct ggml_backend_cann_context {
420419 async_mode = parse_bool (get_env (" GGML_CANN_ASYNC_MODE" ).value_or (" " ));
421420 GGML_LOG_INFO (" %s: device %d async operator submission is %s\n " , __func__,
422421 device, async_mode ? " ON" : " OFF" );
423-
424- eager_mode = parse_bool (get_env (" GGML_CANN_EAGER_MODE" ).value_or (" " ));
425- GGML_LOG_INFO (" %s: device %d eager execution mode is %s (acl graph disabled)\n " ,
426- __func__, device, eager_mode ? " ON" : " OFF" );
422+ #ifdef USE_ACL_GRAPH
423+ acl_graph_mode = !(parse_bool (get_env (" GGML_CANN_DISABLE_ACL_GRAPH" ).value_or (" " )));
424+ GGML_LOG_INFO (" %s: device %d execution mode is %s (%s)\n " ,
425+ __func__, device,
426+ acl_graph_mode ? " GRAPH" : " EAGER" ,
427+ acl_graph_mode ? " acl graph enabled" : " acl graph disabled" );
428+ #endif
427429 }
428430
429431 /* *
0 commit comments