diff --git a/mindspore/ccsrc/kernel/rts/recv.cc b/mindspore/ccsrc/kernel/rts/recv.cc index b68380dac8e9252012a490f9d3891c03985abba1..c195fd1c92eb877db4aca08d14f20b575c01650d 100644 --- a/mindspore/ccsrc/kernel/rts/recv.cc +++ b/mindspore/ccsrc/kernel/rts/recv.cc @@ -37,6 +37,9 @@ bool RecvKernel::Init(const AnfNodePtr &anf_node) { MS_EXCEPTION_IF_NULL(anf_node); auto primitive = AnfAlgo::GetCNodePrimitive(anf_node); MS_EXCEPTION_IF_NULL(primitive); + if (!AnfAlgo::HasNodeAttr(kAttrEventId, anf_node->cast())) { + MS_LOG(EXCEPTION) << "RecvKernel has no attr kAttrEventId"; + } event_id_ = GetValue(primitive->GetAttr(kAttrEventId)); MS_LOG(INFO) << "recv op event_id_:" << event_id_; return true; diff --git a/mindspore/ccsrc/kernel/rts/send.cc b/mindspore/ccsrc/kernel/rts/send.cc index ebcb53069eb5408aa33c27d06bd881cac72c6a41..ccdd43ebb61189d437782139c83208868cca20cc 100644 --- a/mindspore/ccsrc/kernel/rts/send.cc +++ b/mindspore/ccsrc/kernel/rts/send.cc @@ -34,6 +34,9 @@ bool SendKernel::Init(const AnfNodePtr &anf_node) { MS_EXCEPTION_IF_NULL(anf_node); auto primitive = AnfAlgo::GetCNodePrimitive(anf_node); MS_EXCEPTION_IF_NULL(primitive); + if (!AnfAlgo::HasNodeAttr(kAttrEventId, anf_node->cast())) { + MS_LOG(EXCEPTION) << "SendKernel has no attr kAttrEventId"; + } event_id_ = GetValue(primitive->GetAttr(kAttrEventId)); MS_LOG(INFO) << "send op event id:" << event_id_; return true; diff --git a/mindspore/ccsrc/kernel/rts/stream_active.cc b/mindspore/ccsrc/kernel/rts/stream_active.cc index 3666dd670f7ae62d162189d7a8438a67d5bb7316..4f0895a0be27c3832d38a159a52fd1ef4ef5f72c 100644 --- a/mindspore/ccsrc/kernel/rts/stream_active.cc +++ b/mindspore/ccsrc/kernel/rts/stream_active.cc @@ -36,6 +36,9 @@ bool StreamActiveKernel::Init(const AnfNodePtr &anf_node) { MS_LOG(INFO) << "stream active op init start"; auto primitive = AnfAlgo::GetCNodePrimitive(anf_node); MS_EXCEPTION_IF_NULL(primitive); + if (!AnfAlgo::HasNodeAttr(kAttrActiveStreamList, anf_node->cast())) { + MS_LOG(EXCEPTION) << "StreamActiveKernel has no attr kAttrActiveStreamList"; + } active_streams_index_ = GetValue>(primitive->GetAttr(kAttrActiveStreamList)); return true; } diff --git a/mindspore/ccsrc/kernel/rts/stream_switch.cc b/mindspore/ccsrc/kernel/rts/stream_switch.cc index 9dfb3e8de04fe195b93cf435c0e1828e7d53f973..bab6b043669c46d78b9a62a53f1de873c16b2f6e 100644 --- a/mindspore/ccsrc/kernel/rts/stream_switch.cc +++ b/mindspore/ccsrc/kernel/rts/stream_switch.cc @@ -42,8 +42,17 @@ bool StreamSwitchKernel::Init(const AnfNodePtr &anf_node) { MS_LOG(INFO) << "stream switch op init start"; auto primitive = AnfAlgo::GetCNodePrimitive(anf_node); MS_EXCEPTION_IF_NULL(primitive); + if (!AnfAlgo::HasNodeAttr(kAttrSwitchCondition, anf_node->cast())) { + MS_LOG(EXCEPTION) << "StreamSwitchKernel has no attr kAttrSwitchCondition"; + } cond_ = tagRtCondition(GetValue(primitive->GetAttr(kAttrSwitchCondition))); + if (!AnfAlgo::HasNodeAttr(kAttrTrueBranchStream, anf_node->cast())) { + MS_LOG(EXCEPTION) << "StreamSwitchKernel has no attr kAttrTrueBranchStream"; + } true_stream_index_ = GetValue(primitive->GetAttr(kAttrTrueBranchStream)); + if (!AnfAlgo::HasNodeAttr(kAttrDataType, anf_node->cast())) { + MS_LOG(EXCEPTION) << "StreamSwitchKernel has no attr kAttrDataType"; + } data_type_ = tagRtSwitchDataType(GetValue(primitive->GetAttr(kAttrDataType))); MS_LOG(INFO) << "cond_:" << static_cast(cond_) << ", true_stream_index_:" << true_stream_index_ << ", data_type_:" << static_cast(data_type_); @@ -54,7 +63,7 @@ bool StreamSwitchKernel::Launch(const std::vector &inputs, const std const std::vector &outputs, void *stream_ptr) { MS_LOG(INFO) << "stream switch op launch start"; if (inputs.size() != 2) { - MS_LOG(ERROR) << "Stream switch inputs size is " << inputs.size() << ", only support 2"; + MS_LOG(EXCEPTION) << "Stream switch inputs size is " << inputs.size() << ", only support 2"; } void *loop_cnt = inputs[0]->addr; @@ -73,7 +82,7 @@ std::vector StreamSwitchKernel::GenTask(const std::vector