Skip to content
Snippets Groups Projects
Unverified Commit 059e9e1f authored by Li Xinqi's avatar Li Xinqi Committed by GitHub
Browse files

disable eager_op consistent mode (#5647)


* disable eager_op consistent mode

* auto format by CI

Co-authored-by: default avataroneflow-ci-bot <69100618+oneflow-ci-bot@users.noreply.github.com>
Co-authored-by: default avataroneflow-ci-bot <ci-bot@oneflow.org>
parent 6de35463
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
#include <sstream>
#include "oneflow/core/framework/to_string.h"
#include "oneflow/core/framework/op_interpreter.h"
#include "oneflow/core/framework/op_interpreter/op_interpreter_util.h"
......@@ -28,10 +29,32 @@ limitations under the License.
#include "oneflow/core/job/placement_scope.h"
#include "oneflow/core/eager/foreign_boxing_util.h"
#include "oneflow/core/operator/operator.h"
#include "oneflow/user/kernels/stateful_local_opkernel.h"
namespace oneflow {
namespace one {
namespace {
std::string GetDynamicOpConsistentFailedDebugString(const UserOpExpr& user_op_expr,
const StatefulLocalOpKernel& kernel) {
CHECK(!kernel.output_tuple_indexes4mut2_obns().empty());
std::string plentysuffix = kernel.output_tuple_indexes4mut2_obns().size() == 1 ? "s" : "";
std::stringstream ss;
ss << "operator `" << user_op_expr.op_type_name() << "`"
<< " does not support consistent mode because the shape" << plentysuffix << " of output tensor"
<< plentysuffix << " ";
int i = 0;
for (const auto& out_index : kernel.output_tuple_indexes4mut2_obns()) {
if (i++ > 0) { ss << ", "; }
ss << out_index;
}
ss << " are not infered before op computation.";
return ss.str();
}
} // namespace
Maybe<void> Interpret(const UserOpExpr& user_op_expr, const TensorTuple& inputs,
TensorTuple* outputs, const OpExprInterpContext& ctx) {
CHECK_EQ_OR_RETURN(outputs->size(), user_op_expr.output_size());
......@@ -57,6 +80,8 @@ Maybe<void> Interpret(const UserOpExpr& user_op_expr, const TensorTuple& inputs,
if (!device) { return Maybe<void>::Ok(); }
// Run instruction LocalCallOpKernel
const auto& kernel = JUST(user_op_expr.MutKernel4Device(*device));
CHECK_EQ_OR_RETURN(kernel->output_tuple_indexes4mut2_obns().size(), 0)
<< Error::Unimplemented() << GetDynamicOpConsistentFailedDebugString(user_op_expr, *kernel);
std::shared_ptr<EagerBlobObjectList> input_eager_blob_objects =
std::make_shared<EagerBlobObjectList>(inputs.size());
for (int i = 0; i < inputs.size(); ++i) {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment