Lunderberg commented on code in PR #16785:
URL: https://github.com/apache/tvm/pull/16785#discussion_r1539376002
##########
python/tvm/relax/frontend/nn/exporter.py:
##########
@@ -135,9 +136,18 @@ def _effects() -> typing.List[typing.Tuple[str,
core.Effect]]:
with self.builder.dataflow():
outputs, inputs = _emit_method(self.builder,
method_spec, params, effects)
self.builder.emit_func_output(outputs, inputs)
+
+ # TODO(Lunderberg): Make a `ir.transform.ConvertSSA`,
+ # similar to the existing `tir.transform.ConvertSSA`,
+ # that converts an entire module to SSA, including TIR
+ # variable definitions used in either TIR or Relax.
Review Comment:
Both Relax and TIR require SSA to be well-formed. However, there's a number
of cases where a module could be unambiguously converted to SSA. (e.g. Two
functions use the same `relax.Var` as a parameter, which can be fixed by
substituting a new variable in one of the functions.)
So, it wouldn't be a pass that would be called directly by end users, but
would be for internal use. If a pass is most easily written in a way that
results in the same symbolic variable occurring in multiple different
functions, then this would be used as a post-processing pass. (e.g. Apply
`BindSymbolicVars` to one variable in a function, then save the result as a new
function in the same IRModule. Useful, but would duplicate all other symbolic
variables.)
--
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]