You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tvm.apache.org by "tlopex (via GitHub)" <gi...@apache.org> on 2025/04/18 14:11:24 UTC

[PR] [Relax][PyTorch] Support norm op for ExportedProgram importer [tvm]

tlopex opened a new pull request, #17857:
URL: https://github.com/apache/tvm/pull/17857

   This pr supports norm op for ExportedProgram importer and refactors FX side tests.


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Relax][PyTorch] Refactor norm op for ExportedProgram importer [tvm]

Posted by "tlopex (via GitHub)" <gi...@apache.org>.
tlopex commented on PR #17857:
URL: https://github.com/apache/tvm/pull/17857#issuecomment-2817147911

   cc @mshr-h 


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Relax][PyTorch] Refactor norm op for ExportedProgram importer [tvm]

Posted by "tlopex (via GitHub)" <gi...@apache.org>.
tlopex commented on code in PR #17857:
URL: https://github.com/apache/tvm/pull/17857#discussion_r2052150708


##########
python/tvm/relax/frontend/torch/fx_translator.py:
##########
@@ -422,6 +422,48 @@ def _lerp(self, node: fx.Node) -> relax.Var:
             relax.op.add(start, relax.op.multiply(weight, relax.op.subtract(end, start)))
         )
 
+    ########## Statistical ##########
+
+    def _norm(self, node: fx.Node) -> relax.Var:

Review Comment:
   I separated them since the `_linalg_vector_norm` in the exported program doesn't support frobenius_norm but `torch.norm` in the fx does.



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Relax][PyTorch] Refactor norm op for ExportedProgram importer [tvm]

Posted by "mshr-h (via GitHub)" <gi...@apache.org>.
mshr-h merged PR #17857:
URL: https://github.com/apache/tvm/pull/17857


-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [Relax][PyTorch] Refactor norm op for ExportedProgram importer [tvm]

Posted by "mshr-h (via GitHub)" <gi...@apache.org>.
mshr-h commented on code in PR #17857:
URL: https://github.com/apache/tvm/pull/17857#discussion_r2052143945


##########
python/tvm/relax/frontend/torch/fx_translator.py:
##########
@@ -422,6 +422,48 @@ def _lerp(self, node: fx.Node) -> relax.Var:
             relax.op.add(start, relax.op.multiply(weight, relax.op.subtract(end, start)))
         )
 
+    ########## Statistical ##########
+
+    def _norm(self, node: fx.Node) -> relax.Var:

Review Comment:
   Looks like this function is exactly the same as the `_linalg_vector_norm` in exported program frontend. Can we create a shared func between fx and exported program?



-- 
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: commits-unsubscribe@tvm.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org