Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Enhance Simplification to remove unused function arguments #215

Closed
2 tasks done
LeiWang1999 opened this issue Oct 7, 2024 · 3 comments
Closed
2 tasks done

Comments

@LeiWang1999
Copy link
Contributor

LeiWang1999 commented Oct 7, 2024

Ref to PR #214.

The scheduling template in TL is quite complex because, for different tensor arguments, we need to implement separate TL templates. This complexity arises because TL cannot automatically remove unused tensor arguments, and the tensor arguments cannot be extended as flexibly as needed.

Expected Behavior:

# Given Program
@T.prim_func
def main(A, B, Scale, C):
    if with_scale:
        f(A, B, Scale, C)
    else:
        f(A, B, C)

If with_scale is set to False, the Scale argument should be removed from the function's argument list.

Tasks

Preview Give feedback
@LeiWang1999
Copy link
Contributor Author

LeiWang1999 commented Oct 7, 2024

I think the best solution is to implement a new tl prim_func pass, such as tl.Simplify, similar to tir.Specialize found in 3rdparty/tvm/src/tir/ir/specialize.cc.”

@tzj-fxz
Copy link
Contributor

tzj-fxz commented Oct 9, 2024

Thanks. PR #216 has been created to implement tl.transform.Simplify pass and add test case for it.

I think the best solution is to implement a new tl prim_func pass, such as tl.Simplify, similar to tir.Specialize found in 3rdparty/tvm/src/tir/ir/specialize.cc.”

@LeiWang1999
Copy link
Contributor Author

Resloved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants