@@ -2092,16 +2092,17 @@ static bool ggml_backend_cann_cpy_tensor_async(
2092
2092
ACL_CHECK (aclrtMemcpyAsync (dst->data , copy_size, src->data , copy_size,
2093
2093
ACL_MEMCPY_DEVICE_TO_DEVICE,
2094
2094
cann_ctx_src->stream ()));
2095
-
2096
2095
// record event on src stream after the copy
2097
- if (!cann_ctx_src->copy_event ) {
2098
- ACL_CHECK (aclrtCreateEventWithFlag (&cann_ctx_src->copy_event , ACL_EVENT_SYNC));
2099
- }
2100
- ACL_CHECK (aclrtRecordEvent (cann_ctx_src->copy_event , cann_ctx_src->stream ()));
2101
-
2102
- // wait on dst stream for the copy to complete
2103
- ggml_cann_set_device (cann_ctx_dst->device );
2104
- ACL_CHECK (aclrtStreamWaitEvent (cann_ctx_dst->stream (), cann_ctx_src->copy_event ));
2096
+ // TODO: this event is not effective with acl graph mode, change to use aclrtSynchronizeStream
2097
+ // if (!cann_ctx_src->copy_event) {
2098
+ // ACL_CHECK(aclrtCreateEventWithFlag(&cann_ctx_src->copy_event, ACL_EVENT_SYNC));
2099
+ // }
2100
+ // ACL_CHECK(aclrtRecordEvent(cann_ctx_src->copy_event, cann_ctx_src->stream()));
2101
+
2102
+ // // wait on dst stream for the copy to complete
2103
+ // ggml_cann_set_device(cann_ctx_dst->device);
2104
+ // ACL_CHECK(aclrtStreamWaitEvent(cann_ctx_dst->stream(), cann_ctx_src->copy_event));
2105
+ ACL_CHECK (aclrtSynchronizeStream (cann_ctx_src->stream ()));
2105
2106
} else {
2106
2107
// src and dst are on the same backend
2107
2108
ACL_CHECK (aclrtMemcpyAsync (dst->data , copy_size, src->data , copy_size,
0 commit comments