apeskov commented on code in PR #11508:
URL: https://github.com/apache/tvm/pull/11508#discussion_r886052480
##########
src/runtime/contrib/dnnl/dnnl_json_runtime.cc:
##########
@@ -1084,6 +1086,47 @@ class DNNLJSONRuntime : public JSONRuntimeBase {
{DNNL_ARG_VARIANCE, variance_memory}});
}
+ void LayerNorm(const size_t& nid) {
+ auto node = nodes_[nid];
+
+ auto data_entry = node.GetInputs()[0];
+ auto gamma_entry = node.GetInputs()[1];
+ auto beta_entry = node.GetInputs()[2];
+
+ dnnl::memory::dims data_shape =
nodes_[data_entry.id_].GetOpShape()[data_entry.index_];
+
+ float epsilon =
std::stof(node.GetAttr<std::vector<std::string>>("epsilon")[0]);
Review Comment:
original "nn.layer_norm" has not only epsilon argument. At least `axis`,
`center` and `scale`. By this code you assume that they always equal `axis =
-1`, `center=true` and `scale=true`.
Could you please add support of all attributes or verify their values on
codegen stage.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]