-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
[Arith] Inverse affine map #8384
Conversation
* [Arith] Inverse affine map * Update iter_affine_map.h * Update iter_affine_map.h * Update iter_affine_map.py * Topology order visit * doc * fix * address comments
0e9cdb4
to
8002518
Compare
iter_map = tvm.arith.detect_iter_map([l0_1_l1_1_fused[0], l0_0[0], l1_0[0]], var_dom([l0, l1])) | ||
outputs = [tvm.tir.Var("output_{}".format(i), "int32") for i in range(len(iter_map))] | ||
res = tvm.arith.inverse_affine_iter_map(iter_map, outputs) | ||
print(res) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line can be removed
ICHECK(base_scale.defined()); | ||
std::vector<IterSplitExpr> iters; | ||
std::vector<bool> visited(sum_expr->args.size(), false); | ||
PrimExpr expected_scale = base_scale; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can expect the sum expression has its children in descending order, so to search for base scale is not necessary
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if the sum expression is produced by DetectIterMap
this is true, can we can simply this whole function, I can add some assertions to check this assumption @tqchen
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry I've just merged it...
@vinx13 let us followup with another PR to address the last comment @spectrometerHBH bought up |
* [Arith] Inverse affine map * [Arith] Inverse affine map * Update iter_affine_map.h * Update iter_affine_map.h * Update iter_affine_map.py * Topology order visit * doc * fix * address comments * lint * remove print
* [Arith] Inverse affine map * [Arith] Inverse affine map * Update iter_affine_map.h * Update iter_affine_map.h * Update iter_affine_map.py * Topology order visit * doc * fix * address comments * lint * remove print
This PR added a utility function to perform inverse transformation for the bijective affine map. This will be helpful for tensorization in the future.
@tqchen