From 5bed80a030d270e4f4c7124dd4ee69f3989b8fab Mon Sep 17 00:00:00 2001 From: youngsik kim Date: Fri, 27 Sep 2024 11:18:08 +0900 Subject: [PATCH] [circledump] Support RoPE Operation (#14111) This commit adds RoPE Printer in circle dump ONE-DCO-1.0-Signed-off-by: youngsik kim --- compiler/circledump/src/OpPrinter.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/compiler/circledump/src/OpPrinter.cpp b/compiler/circledump/src/OpPrinter.cpp index e14db02d0eb..0ee858711e2 100644 --- a/compiler/circledump/src/OpPrinter.cpp +++ b/compiler/circledump/src/OpPrinter.cpp @@ -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(); @@ -927,6 +941,7 @@ OpPrinterRegistry::OpPrinterRegistry() _op_map[circle::BuiltinOperator_GRU] = make_unique(); _op_map[circle::BuiltinOperator_INSTANCE_NORM] = make_unique(); _op_map[circle::BuiltinOperator_RMS_NORM] = make_unique(); + _op_map[circle::BuiltinOperator_ROPE] = make_unique(); } } // namespace circledump