Skip to content

Commit

Permalink
[circledump] Support RoPE Operation (Samsung#14111)
Browse files Browse the repository at this point in the history
This commit adds RoPE Printer in circle dump

ONE-DCO-1.0-Signed-off-by: youngsik kim <[email protected]>
  • Loading branch information
ys44kim authored Sep 27, 2024
1 parent 0aa5ce0 commit 5bed80a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions compiler/circledump/src/OpPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,20 @@ class RmsNormPrinter : public OpPrinter
}
};

class RoPEPrinter : public OpPrinter
{
public:
void options(const circle::Operator *op, std::ostream &os) const override
{
if (auto *params = op->builtin_options_as_RoPEOptions())
{
os << " ";
os << "mode(" << EnumNameRoPEMode(params->mode()) << ") ";
os << std::endl;
}
}
};

OpPrinterRegistry::OpPrinterRegistry()
{
_op_map[circle::BuiltinOperator_ADD] = make_unique<AddPrinter>();
Expand Down Expand Up @@ -927,6 +941,7 @@ OpPrinterRegistry::OpPrinterRegistry()
_op_map[circle::BuiltinOperator_GRU] = make_unique<GRUPrinter>();
_op_map[circle::BuiltinOperator_INSTANCE_NORM] = make_unique<InstanceNormPrinter>();
_op_map[circle::BuiltinOperator_RMS_NORM] = make_unique<RmsNormPrinter>();
_op_map[circle::BuiltinOperator_ROPE] = make_unique<RoPEPrinter>();
}

} // namespace circledump

0 comments on commit 5bed80a

Please sign in to comment.