comaniac commented on a change in pull request #5288: [BYOC] Refine DNNL Codegen
URL: https://github.com/apache/incubator-tvm/pull/5288#discussion_r406504773
 
 

 ##########
 File path: src/relay/backend/vm/compiler.cc
 ##########
 @@ -924,19 +924,20 @@ IRModule VMCompiler::OptimizeModule(const IRModule& mod, 
const TargetsMap& targe
   pass_seqs.push_back(transform::LambdaLift());
   pass_seqs.push_back(transform::InlinePrimitives());
 
+  // Manifest the allocations.
+  pass_seqs.push_back(transform::ManifestAlloc(this->target_host_));
+  // Compute away possibly introduced constant computation.
+  pass_seqs.push_back(transform::FoldConstant());
+  // Fuse the shape functions.
+  pass_seqs.push_back(transform::FuseOps());
+
 
 Review comment:
   zhiics previously made a PR to outline all partition function to avoid being 
touched by some passes such as `fuse_ops`, but you can see that before this PR 
the second run of `fuse_ops` pass is invoked after the inline pass, resulting 
in the decomposition of `batch_norm`. After this change, we inline the 
partition functions back after finishing all other passes so that `batch_norm` 
could be preserved safely to external codegen.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to