This PR introduces the group normalization high-level operator.

Prior to this PR, the group normalization operations in frontend models are 
translated to a series of operations, which brings inconvenience when we want 
to optimize the group norm op as a whole.

With the TOPI implementation of group norm being introduced by 
https://github.com/apache/tvm/pull/14193, we can now use it to legalize the 
high-level group norm op and optimize it using cross-thread reduction or 
rfactor via MetaSchedule.

Full implementation credit goes to Bohan.

Co-authored-by: Bohan Hou <spectromet...@gmail.com>
You can view, comment on, or merge this pull request online at:

  https://github.com/apache/tvm/pull/14194

-- Commit Summary --

  * [TOPI] Group normalization
  * [Unity][Op] Group normalization

-- File Changes --

    M include/tvm/relax/attrs/nn.h (21)
    A include/tvm/topi/nn/group_norm.h (151)
    M python/tvm/relax/frontend/torch/fx_translator.py (54)
    M python/tvm/relax/op/nn/nn.py (58)
    M python/tvm/relax/transform/legalize_ops/nn.py (14)
    M python/tvm/topi/nn/__init__.py (1)
    A python/tvm/topi/nn/group_norm.py (52)
    M python/tvm/topi/testing/__init__.py (1)
    A python/tvm/topi/testing/group_norm_python.py (82)
    M src/relax/op/nn/nn.cc (83)
    M src/relax/op/nn/nn.h (4)
    M src/topi/nn.cc (7)
    M tests/python/relax/test_ast_printer.py (4)
    M tests/python/relax/test_frontend_from_fx.py (32)
    M tests/python/relax/test_op_nn.py (238)
    M tests/python/relax/test_transform_legalize_ops_nn.py (162)
    A tests/python/topi/python/test_topi_group_norm.py (66)
    M tests/python/topi/python/test_topi_layer_norm.py (2)

-- Patch Links --

https://github.com/apache/tvm/pull/14194.patch
https://github.com/apache/tvm/pull/14194.diff

-- 
Reply to this email directly or view it on GitHub:
https://github.com/apache/tvm/pull/14194
You are receiving this because you are subscribed to this thread.

Message ID: <apache/tvm/pull/14...@github.com>

Reply via email to