-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
[async] Add element-wise info into TaskMeta for fusion #1884
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1884 +/- ##
=======================================
Coverage 43.19% 43.19%
=======================================
Files 44 44
Lines 6330 6330
Branches 1092 1092
=======================================
Hits 2734 2734
Misses 3426 3426
Partials 170 170 Continue to review full report at Codecov.
|
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.
Awesome!! LGTM.
How does the element-wise info affect mask/list states?
Great question. The short answer is we don't need to worry about it.
If a write access is element-wise, the activation will be demoted here:
taichi/taichi/transforms/flag_access.cpp
Line 114 in f2a798d
void visit(GlobalPtrStmt *stmt) { |
So by the time you are doing the is_element_wise
test, whether a task needs list generation/gc/mask state output is already determined. We don't need to handle that once more.
(Sorry I didn't notice we already have a similar implementation of is_element_wise
there - maybe we can unify two implementations sometime in the future.)
Co-authored-by: Yuanming Hu <yuanming-hu@users.noreply.github.com>
Interesting! It looks like the element-wise check in for I in ti.grouped(x):
y[I] = 1 ( A fusible example: x = ti.field(ti.i32)
y = ti.field(ti.i32)
ti.root.pointer(ti.i, 4).place(x)
ti.root.pointer(ti.i, 8).place(y)
@ti.kernel
def foo():
for i in x:
y[i] = 1
@ti.kernel
def bar():
for i in x:
y[i] = 2
foo()
bar()
ti.sync()
|
Why |
Related issue = #742
Changes:
std::unordered_map<SNode *, bool> TaskMeta::element_wise
AsyncStateHash
intostd::hash<AsyncState>
because I think we don't need other hashes ofAsyncState
Question:
[Click here for the format server]