diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/cpu_map_job.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/cpu_map_job.cc index adebacc393..1847538e48 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/cpu_map_job.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/cpu_map_job.cc @@ -39,7 +39,14 @@ Status CpuMapJob::Run(std::vector in, std::vector *out) { TensorRow result_row; for (size_t i = 0; i < ops_.size(); i++) { // Call compute function for cpu - RETURN_IF_NOT_OK(ops_[i]->Compute(input_row, &result_row)); + Status rc = ops_[i]->Compute(input_row, &result_row); + if (rc.IsError()) { + if (input_row.getId() >= 0) { + MS_LOG(ERROR) << "The TensorRow with id=" + std::to_string(input_row.getId()) + " failed on " + + std::to_string(i) + " TensorOp in Map: " + ops_[i]->Name(); + } + return rc; + } // Assign result_row to to_process for the next TensorOp processing, except for the last TensorOp in the list. if (i + 1 < ops_.size()) { @@ -48,7 +55,6 @@ Status CpuMapJob::Run(std::vector in, std::vector *out) { } out->push_back(std::move(result_row)); } - return Status::OK(); } diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/gpu_map_job.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/gpu_map_job.cc index 64502d6da2..801f0ac231 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/gpu_map_job.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/gpu_map_job.cc @@ -27,7 +27,7 @@ GpuMapJob::GpuMapJob(std::vector> operations) : MapJob // Destructor GpuMapJob::~GpuMapJob() = default; -// A function to execute a cpu map job +// A function to execute a gpu map job Status GpuMapJob::Run(std::vector in, std::vector *out) { // Do nothing for now return Status::OK(); diff --git a/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/map_op.cc b/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/map_op.cc index 2ae4204086..68afd43875 100644 --- a/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/map_op.cc +++ b/mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/map_op.cc @@ -287,6 +287,7 @@ Status MapOp::WorkerCompute(DataBuffer *in_buffer, TensorQTable *new_tensor_tabl // From the current row, select the Tensor that need to be passed to TensorOp (void)std::transform(to_process_indices_.begin(), to_process_indices_.end(), std::back_inserter(to_process), [&cur_row](const auto &it) { return std::move(cur_row[it]); }); + to_process.setId(cur_row.getId()); job_input_table.push_back(std::move(to_process)); original_table.push_back(std::move(cur_row)); } diff --git a/mindspore/ccsrc/minddata/dataset/kernels/tensor_op.h b/mindspore/ccsrc/minddata/dataset/kernels/tensor_op.h index ef1bb7d37c..a3ae2eb34d 100644 --- a/mindspore/ccsrc/minddata/dataset/kernels/tensor_op.h +++ b/mindspore/ccsrc/minddata/dataset/kernels/tensor_op.h @@ -135,7 +135,7 @@ constexpr char kCFuncOp[] = "CFuncOp"; constexpr char kPyFuncOp[] = "PyFuncOp"; constexpr char kNoOp[] = "NoOp"; -// A class that does a computation on a Tensor +// A class that does a computation on a Tensor class TensorOp { public: TensorOp() = default;