From 8102606bd3118752205be424044df6c7f9a27efa Mon Sep 17 00:00:00 2001 From: Haibin Lin Date: Thu, 31 Jan 2019 09:43:57 -0800 Subject: [PATCH] Fix inconsistent handling for FResourceRequestEx for imperative and symbolic executor (#14007) * Update op_attr_types.h * Update attach_op_resource_pass.cc --- include/mxnet/op_attr_types.h | 2 ++ src/executor/attach_op_resource_pass.cc | 2 -- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/mxnet/op_attr_types.h b/include/mxnet/op_attr_types.h index 41be554953fd..aba59ce5f0ea 100644 --- a/include/mxnet/op_attr_types.h +++ b/include/mxnet/op_attr_types.h @@ -238,6 +238,8 @@ using FResourceRequest = std::function< /*! * \brief The resource request from the operator. * An operator could register ResourceRequestEx, or ResourceRequest, or neither. + * If an operator registers both ResourceRequestEx and ResourceRequest, + * ResourceRequest is ignored. * * \note Register under "FResourceRequestEx" */ diff --git a/src/executor/attach_op_resource_pass.cc b/src/executor/attach_op_resource_pass.cc index 56122cda6ff0..c4a6dc42984c 100644 --- a/src/executor/attach_op_resource_pass.cc +++ b/src/executor/attach_op_resource_pass.cc @@ -55,8 +55,6 @@ void AttachOpResources( const auto op = inode.source->op(); const bool rsc_req = (fresource.count(op) != 0); const bool rsc_ex_req = (fresource_ex.count(op) != 0); - CHECK(!(rsc_req && rsc_ex_req)) - << "An operator could not register both ResourceRequestEx and ResourceRequest"; if (rsc_req || rsc_ex_req) { auto reqs = rsc_ex_req ? fresource_ex[op](inode.source->attrs, dev_masks[nid],