Commit 4837bf72 authored by Alan Turner's avatar Alan Turner
Browse files

Add flag to remove last output (for BERT perfruns)

parent b37d1a81
...@@ -39,6 +39,8 @@ ...@@ -39,6 +39,8 @@
namespace migraphx { namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
MIGRAPHX_DECLARE_ENV_VAR(MIGRAPHX_REMOVE_LAST_OUTPUT);
namespace onnx { namespace onnx {
static onnx_parser::attribute_map get_attributes(const onnx::NodeProto& node) static onnx_parser::attribute_map get_attributes(const onnx::NodeProto& node)
...@@ -362,6 +364,8 @@ void onnx_parser::parse_graph(module* mod, const onnx::GraphProto& graph) ...@@ -362,6 +364,8 @@ void onnx_parser::parse_graph(module* mod, const onnx::GraphProto& graph)
std::back_inserter(output_ins), std::back_inserter(output_ins),
[&](const auto& name) { return instructions[name]; }); [&](const auto& name) { return instructions[name]; });
if(enabled(MIGRAPHX_REMOVE_LAST_OUTPUT{}) and output_ins.size() > 1)
output_ins.pop_back();
// add the return instuction // add the return instuction
mod->add_return(output_ins); mod->add_return(output_ins);
......
Markdown is supported
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