Browse Source

!9951 Print the row_id for map when error happens

From: @alexyuyue
Reviewed-by: 
Signed-off-by:
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 5 years ago
parent
commit
a575af7198
4 changed files with 11 additions and 4 deletions
  1. +8
    -2
      mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/cpu_map_job.cc
  2. +1
    -1
      mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/gpu_map_job.cc
  3. +1
    -0
      mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/map_op.cc
  4. +1
    -1
      mindspore/ccsrc/minddata/dataset/kernels/tensor_op.h

+ 8
- 2
mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/cpu_map_job.cc View File

@@ -39,7 +39,14 @@ Status CpuMapJob::Run(std::vector<TensorRow> in, std::vector<TensorRow> *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<TensorRow> in, std::vector<TensorRow> *out) {
}
out->push_back(std::move(result_row));
}

return Status::OK();
}



+ 1
- 1
mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/gpu_map_job.cc View File

@@ -27,7 +27,7 @@ GpuMapJob::GpuMapJob(std::vector<std::shared_ptr<TensorOp>> 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<TensorRow> in, std::vector<TensorRow> *out) {
// Do nothing for now
return Status::OK();


+ 1
- 0
mindspore/ccsrc/minddata/dataset/engine/datasetops/map_op/map_op.cc View File

@@ -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));
}


+ 1
- 1
mindspore/ccsrc/minddata/dataset/kernels/tensor_op.h View File

@@ -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;


Loading…
Cancel
Save