@@ -2092,16 +2092,17 @@ static bool ggml_backend_cann_cpy_tensor_async(
20922092 ACL_CHECK (aclrtMemcpyAsync (dst->data , copy_size, src->data , copy_size,
20932093 ACL_MEMCPY_DEVICE_TO_DEVICE,
20942094 cann_ctx_src->stream ()));
2095-
20962095 // 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 ()));
21052106 } else {
21062107 // src and dst are on the same backend
21072108 ACL_CHECK (aclrtMemcpyAsync (dst->data , copy_size, src->data , copy_size,
0 commit comments