Rename operation name getter to `name` from `getName`.
Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
public:
virtual void accept(OperationVisitor &v) const = 0;
- virtual std::string getName() const = 0;
+ virtual std::string name() const = 0;
public:
void replaceInput(const OperandIndex &from, const OperandIndex &to);
public:
void accept(OperationVisitor &v) const override;
- virtual std::string getName(void) const override { return "Subgraph"; }
+ virtual std::string name(void) const override { return "Subgraph"; }
public:
void appendOperation(const OperationIndex &index, const Operation &node)
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Abs"; }
+ std::string name() const override { return "Abs"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Add"; }
+ std::string name() const override { return "Add"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "ArgMax"; }
+ std::string name() const override { return "ArgMax"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "AvgPool2D"; }
+ std::string name() const override { return "AvgPool2D"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "BatchToSpaceND"; }
+ std::string name() const override { return "BatchToSpaceND"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Cast"; }
+ std::string name() const override { return "Cast"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Comparison"; }
+ std::string name() const override { return "Comparison"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Concat"; }
+ std::string name() const override { return "Concat"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Conv2D"; }
+ std::string name() const override { return "Conv2D"; }
public:
const Param ¶m() const { return _param; }
*/
const std::string &id() const;
- std::string getName() const override;
+ std::string name() const override;
/**
* @return user-provided data
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "DepthToSpace"; }
+ std::string name() const override { return "DepthToSpace"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "DepthwiseConv2D"; }
+ std::string name() const override { return "DepthwiseConv2D"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Dequantize"; }
+ std::string name() const override { return "Dequantize"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Div"; }
+ std::string name() const override { return "Div"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "EmbeddingLookup"; }
+ std::string name() const override { return "EmbeddingLookup"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Exp"; }
+ std::string name() const override { return "Exp"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Floor"; }
+ std::string name() const override { return "Floor"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "FullyConnected"; }
+ std::string name() const override { return "FullyConnected"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Gather"; }
+ std::string name() const override { return "Gather"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "HashTableLookup"; }
+ std::string name() const override { return "HashTableLookup"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "InstanceNorm"; }
+ std::string name() const override { return "InstanceNorm"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "L2Normalization"; }
+ std::string name() const override { return "L2Normalization"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "L2Pool2D"; }
+ std::string name() const override { return "L2Pool2D"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "LSTM"; }
+ std::string name() const override { return "LSTM"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "LocalResponseNormalization"; }
+ std::string name() const override { return "LocalResponseNormalization"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "LogicalAnd"; }
+ std::string name() const override { return "LogicalAnd"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "LogicalNot"; }
+ std::string name() const override { return "LogicalNot"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "LogicalOr"; }
+ std::string name() const override { return "LogicalOr"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Logistic"; }
+ std::string name() const override { return "Logistic"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "MaxPool2D"; }
+ std::string name() const override { return "MaxPool2D"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Mean"; }
+ std::string name() const override { return "Mean"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Mul"; }
+ std::string name() const override { return "Mul"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Neg"; }
+ std::string name() const override { return "Neg"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "PReLU"; }
+ std::string name() const override { return "PReLU"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Pack"; }
+ std::string name() const override { return "Pack"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Pad"; }
+ std::string name() const override { return "Pad"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Permute"; }
+ std::string name() const override { return "Permute"; }
public:
Permute(const OperandIndex &input, const OperandIndex &output,
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "RNN"; }
+ std::string name() const override { return "RNN"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "RSQRT"; }
+ std::string name() const override { return "RSQRT"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "ReLU"; }
+ std::string name() const override { return "ReLU"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "ReLU1"; }
+ std::string name() const override { return "ReLU1"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "ReLU6"; }
+ std::string name() const override { return "ReLU6"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "ReduceMax"; }
+ std::string name() const override { return "ReduceMax"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "ReduceMin"; }
+ std::string name() const override { return "ReduceMin"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "ReduceSum"; }
+ std::string name() const override { return "ReduceSum"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Reshape"; }
+ std::string name() const override { return "Reshape"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "ResizeBilinear"; }
+ std::string name() const override { return "ResizeBilinear"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "SQRT"; }
+ std::string name() const override { return "SQRT"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "SoftMax"; }
+ std::string name() const override { return "SoftMax"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "SpaceToBatchND"; }
+ std::string name() const override { return "SpaceToBatchND"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "SpaceToDepth"; }
+ std::string name() const override { return "SpaceToDepth"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Split"; }
+ std::string name() const override { return "Split"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "SquaredDifference"; }
+ std::string name() const override { return "SquaredDifference"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Squeeze"; }
+ std::string name() const override { return "Squeeze"; }
const Param ¶m() const { return _param; }
private:
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "StridedSlice"; }
+ std::string name() const override { return "StridedSlice"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Sub"; }
+ std::string name() const override { return "Sub"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Tanh"; }
+ std::string name() const override { return "Tanh"; }
};
} // namespace operation
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "TopKV2"; }
+ std::string name() const override { return "TopKV2"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Transpose"; }
+ std::string name() const override { return "Transpose"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "TransposeConv"; }
+ std::string name() const override { return "TransposeConv"; }
public:
const Param ¶m() const { return _param; }
public:
void accept(OperationVisitor &v) const override;
- std::string getName() const override { return "Unpack"; }
+ std::string name() const override { return "Unpack"; }
public:
const Param ¶m() const { return _param; }
Adding exception in stage doesn't help. Because if there is a record for add without
broadcast, scheduling will select it since it doesn't distinguish broadcast and
non-broadcast like it does for quant non-quantized*/
- if (backend->config()->id() == "cpu" && node.getName() == "Add")
+ if (backend->config()->id() == "cpu" && node.name() == "Add")
{
const auto lhs_index{node.getInputs().at(model::operation::Add::Input::LHS)};
const auto rhs_index{node.getInputs().at(model::operation::Add::Input::RHS)};
Adding exception in stage doesn't help. Because if there is a record for Mul without
broadcast, scheduling will select it since it doesn't distinguish broadcast and
non-broadcast like it does for quant non-quantized*/
- else if (backend->config()->id() == "acl_neon" && node.getName() == "Mul")
+ else if (backend->config()->id() == "acl_neon" && node.name() == "Mul")
{
const auto lhs_index{node.getInputs().at(model::operation::Mul::Input::LHS)};
const auto rhs_index{node.getInputs().at(model::operation::Mul::Input::RHS)};
continue;
}
const auto exec_time =
- _exec_time->getOperationExecTime(_all_backends[backend_ind], node.getName(), quant, size);
+ _exec_time->getOperationExecTime(_all_backends[backend_ind], node.name(), quant, size);
// Scheduling to measure data transfer must be done after measuring all backends separately
assert(exec_time != _exec_time->NOT_FOUND);
if (exec_time == _exec_time->getMax())
continue;
}
_backend_resolver->setBackend(rank.second, _all_backends[backend_ind]);
- VERBOSE(HEScheduler::schedule) << "backend for " << node.getName() << " is "
+ VERBOSE(HEScheduler::schedule) << "backend for " << node.name() << " is "
<< _all_backends[backend_ind]->config()->id() << std::endl;
++backend_ind;
break;
const auto size = getOperationsFlattenedIOSize(*_graph, node);
for (const auto *backend : _all_backends)
{
- const auto exec_time = _exec_time->getOperationExecTime(backend, node.getName(), quant, size);
+ const auto exec_time = _exec_time->getOperationExecTime(backend, node.name(), quant, size);
if (exec_time == _exec_time->NOT_FOUND)
return false;
}
if (!util::getConfigBool(util::config::PROFILING_MODE))
{
VERBOSE(HEScheduler::tryBackend)
- << "Trying to HE schedule while there is no profiling info for " << node.getName()
+ << "Trying to HE schedule while there is no profiling info for " << node.name()
<< " on backend " << backend->config()->id() << ". So this backend won't be used. "
<< std::endl;
- _is_supported[backend][node.getName()] = false;
+ _is_supported[backend][node.name()] = false;
return _exec_time->getMax();
}
auto iter = _is_supported.find(backend);
if (iter != _is_supported.end())
{
- auto it2 = iter->second.find(node.getName());
+ auto it2 = iter->second.find(node.name());
if (it2 != iter->second.end())
{
- return _is_supported[backend][node.getName()] ? 1 : _exec_time->getMax();
+ return _is_supported[backend][node.name()] ? 1 : _exec_time->getMax();
}
}
try
{
_backend_resolver->getBackendContext(backend)->shape_fixer->fix(node);
- _is_supported[backend][node.getName()] = true;
+ _is_supported[backend][node.name()] = true;
}
catch (std::runtime_error &e)
{
- _is_supported[backend][node.getName()] = false;
+ _is_supported[backend][node.name()] = false;
}
- return _is_supported[backend][node.getName()] ? 1 : _exec_time->getMax();
+ return _is_supported[backend][node.name()] ? 1 : _exec_time->getMax();
}
void HEScheduler::makeRank()
// get average exec time of this op
for (const auto &backend : _all_backends)
{
- auto exec_time = _exec_time->getOperationExecTime(backend, node.getName(), quant, size);
+ auto exec_time = _exec_time->getOperationExecTime(backend, node.name(), quant, size);
if (exec_time == _exec_time->NOT_FOUND)
{
exec_time = tryBackend(node, backend);
}
if (supported_backends_quantity == 0)
{
- throw std::runtime_error{"Encountered unsupported op: " + node.getName()};
+ throw std::runtime_error{"Encountered unsupported op: " + node.name()};
}
rank /= supported_backends_quantity;
int64_t std = 0;
for (const auto backend : _all_backends)
{
- const auto exec_time = getOpTime(backend, node.getName(), quant, size);
+ const auto exec_time = getOpTime(backend, node.name(), quant, size);
if (exec_time < _exec_time->getMax())
{
std += (exec_time - rank) * (exec_time - rank);
assert(rank >= 0);
_rank_to_op.emplace(rank, index);
_op_to_rank->emplace(index, rank);
- VERBOSE(HEScheduler::DFSMaxRank) << "rank of operation (" << index.value() << ")"
- << node.getName() << " is " << rank << std::endl;
+ VERBOSE(HEScheduler::DFSMaxRank) << "rank of operation (" << index.value() << ")" << node.name()
+ << " is " << rank << std::endl;
return rank;
}
_backends_avail_time[chosen_backend].emplace(eft, eft - selected_exec_time);
_backend_resolver->setBackend(index, chosen_backend);
- VERBOSE(HEScheduler::schedule) << "backend for " << node.getName() << " is "
+ VERBOSE(HEScheduler::schedule) << "backend for " << node.name() << " is "
<< chosen_backend->config()->id() << ". Its eft: " << eft
<< std::endl;
return true;
return {_exec_time->getMax(), _exec_time->getMax()};
}
// get average exec time of the op on this backend
- auto exec_time = getOpTime(backend, node.getName(), quant, size);
+ auto exec_time = getOpTime(backend, node.name(), quant, size);
if (backend->config()->id() == "cpu" && is_parallel_exec)
{
exec_time *= CPU_DELAY;
if (!is_parallel_exec)
{
VERBOSE(HEScheduler::ESTAndExecTime)
- << "exec_time of (" << index.value() << ") " << node.getName() << " quant==" << quant
- << " on " << backend->config()->id() << " is " << exec_time
+ << "exec_time of (" << index.value() << ") " << node.name() << " quant==" << quant << " on "
+ << backend->config()->id() << " is " << exec_time
<< " microseconds. Data transfer cost: " << total_transfer_cost << std::endl;
return {total_transfer_cost, exec_time};
}
VERBOSE(HEScheduler::ESTAndExecTime)
- << "exec_time of (" << index.value() << ") " << node.getName() << " quant==" << quant
- << " on " << backend->config()->id() << ": " << exec_time
+ << "exec_time of (" << index.value() << ") " << node.name() << " quant==" << quant << " on "
+ << backend->config()->id() << ": " << exec_time
<< " microseconds. Backend available time: " << prev_op_ft
<< " Parent's max eft: " << max_pred_eft - total_transfer_cost
<< " data transfer cost: " << total_transfer_cost << std::endl;
const neurun::model::Operation &node)
: Node{"operation" + std::to_string(index.value())}
{
- setAttribute("label", std::to_string(index.value()) + " : " + node.getName());
+ setAttribute("label", std::to_string(index.value()) + " : " + node.name());
setAttribute("shape", OPERATION_SHAPE);
setAttribute("colorscheme", BG_COLOR_SCHEME);
setAttribute("fillcolor", DEFAULT_FILLCOLOR);
auto it = _indexed_ranks->find(element.index);
if (it == _indexed_ranks->end())
{
- assert(element.node->getName() == "Permute");
+ assert(element.node->name() == "Permute");
// assign int32_t::max to prevent integer overflow
rank += std::numeric_limits<int32_t>::max();
}
_timer->handleEnd();
const auto timer_res = _timer->getTime();
- auto node_name = node->getName();
+ auto node_name = node->name();
VERBOSE(ProfileInfo) << "Time for " << node_name << " : " << timer_res << std::endl;
// fill ExecTime:
void execute(const model::OperationIndex &idx)
{
- const auto nodeName = _env->model().operations.at(idx).getName();
+ const auto nodeName = _env->model().operations.at(idx).name();
VERBOSE(INTERPRETER) << "Prepare output operands and execute " << nodeName
<< " operation (id: " << idx.value() << ")" << std::endl;
_env->model().operations.at(idx).accept(*this);
const auto current_operation_index = operation_stack.top();
operation_stack.pop();
VERBOSE(INTERPRETER) << "Poped operation: " << current_operation_index.value() << "("
- << _env->model().operations.at(current_operation_index).getName() << ")"
+ << _env->model().operations.at(current_operation_index).name() << ")"
<< std::endl;
// execution
const auto &node_backend_id = _backend_resolver->getBackend(node_index)->config()->id();
VERBOSE(Lower) << "SUBG#" << subg_index.value() << " { " << subg_backend_id << "("
<< model::to_string(subg_backend_layout) << ") } "
- << " NODE#" << node_index.value() << " (" << node.getName() << ") { "
+ << " NODE#" << node_index.value() << " (" << node.name() << ") { "
<< node_backend_id << "(" << model::to_string(layout) << ") } " << std::endl;
if (subg_backend_id != node_backend_id || subg_backend_layout != layout)
return false;
if (node_outputs.contains(input))
{
VERBOSE(Lower) << "SUBG#" << subg_index.value() << " 's NODE#" << n_index.value()
- << "(" << n.getName() << ") is connected to NODE#"
- << node_index.value() << "(" << node.getName() << ")" << std::endl;
+ << "(" << n.name() << ") is connected to NODE#" << node_index.value()
+ << "(" << node.name() << ")" << std::endl;
return true;
}
}
if (node_inputs.contains(output))
{
VERBOSE(Lower) << "SUBG#" << subg_index.value() << " 's NODE#" << n_index.value()
- << " (" << n.getName() << ") is connected to NODE#"
- << node_index.value() << std::endl;
+ << " (" << n.name() << ") is connected to NODE#" << node_index.value()
+ << std::endl;
return true;
}
}
}
VERBOSE(Lower) << "SUBG#" << subg_index.value() << " is not connected to NODE#"
- << node_index.value() << "(" << node.getName() << ")" << std::endl;
+ << node_index.value() << "(" << node.name() << ")" << std::endl;
}
return false;
lower_info->addDefPermuteFactor(operand::PermuteFactor{backend, backend_layout});
}
- if (node.getName() == "Split")
+ if (node.name() == "Split")
{
// Ideally this condition must be like 'node.getOutputs().size() > 1' but
// this is true for HashtableLookup also. TODO: Come up with more clever solution
subg = &(_subgraphs->at(new_subg_index));
VERBOSE(Lower) << "SUBG#" << subg_index.value() << " is created for "
- << "NODE#" << node_index.value() << "(" << node.getName() << ")"
- << std::endl;
+ << "NODE#" << node_index.value() << "(" << node.name() << ")" << std::endl;
}
else
{
subg->setInputs(node.getInputs());
VERBOSE(Lower) << "SUBG#" << subg_index.value() << " merges "
- << "NODE#" << node_index.value() << "(" << node.getName() << ")"
- << std::endl;
+ << "NODE#" << node_index.value() << "(" << node.name() << ")" << std::endl;
}
bool finish = false;
ss << " ) -> {";
for (const auto &elem : _operations)
{
- ss << " " << elem.index.value() << "(" << elem.node->getName() << ")";
+ ss << " " << elem.index.value() << "(" << elem.node->name() << ")";
}
ss << " } -> OUT(";
for (const auto &index : getOutputs())
Custom::~Custom() { delete[] _userdata.data; }
-std::string Custom::getName() const { return id(); }
+std::string Custom::name() const { return id(); }
} // namespace operation
} // namespace model
public:
void accept(neurun::model::OperationVisitor &) const override {}
- std::string getName() const override { return "SimpleMock"; }
+ std::string name() const override { return "SimpleMock"; }
};
} // namespace graph