-
Notifications
You must be signed in to change notification settings - Fork 88
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
Rewrite reduce mean/variance #2883
Conversation
Check results before merge 🔆 |
🔴bert_large_uncased_fp16: FAILED: MIGraphX is not within tolerance - check verbose output |
src/targets/gpu/prepare_reduce.cpp
Outdated
}); | ||
auto preduce = m.insert_instruction(last, parallel_reduce{op}, inputs); | ||
int i = 0; | ||
for(auto reduce : reduces) |
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.
Might be a slight nit-pick in naming but make "reduces" into something like "reductions" Just makes this a but more readable and then be clearer when you grab a reduce from the list of reductions.
Same goes for "preduce" make this into parallel_reductions since this might get interpreted as pointer-to-reduce with the name preduce.
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 use the name reduce
since the operator name is reduce
. It seems confusing to call it reduction when the operator is not named reduction
. I guess i can make these single letters and then you can interpret it however makes sense for you.
} | ||
EXPECT(p1.sort() == p2.sort()); | ||
} | ||
|
||
TEST_CASE(reduce_reduce_mismatch_axis) |
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 test case is good and I'm sure these can be massaged to create the other tests to handle cases where matching fails and some of the other coverage error warnings
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.
- Add additional test coverage rewrite_reduce.cpp
- Readability for prepare_reduce.cpp
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.
Looks good.
Rewrites mean/variance to use
reduce_mean(x)
andreduce_mean(x*x)
so it can be fused in the same reduction.