Why FuseOps pass is created by CreateFunctionPass rather than CreateModulePass

According to TMV docs Pass Infrastructure — tvm 0.10.dev0 documentation, at module-level passes, users can add and/or delete functions in a module. While, we cannot add or delete a function through function-level passes as they are not aware of the global information.

So it means there is no add/delete function happened on fuse_op pass?

Hi, @zhaoyang-star

Yes, that is the general recommendation, although function-level pass has some limited access to the global info since it takes IRModule as one of its arguments.

To memoize fusion decision, this pass will partition the function into a set of functions representing each fusion group. I cannot recall whether this creates a local function or global function, but if it is a local function, you would not need to update any global info based on my current understanding.