-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Add rfactor patterns for NaN-propagating min/max #8587
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
base: main
Are you sure you want to change the base?
Conversation
@@ -249,6 +249,29 @@ void populate_ops_table_single_uint32_select(const vector<Type> &types, vector<A | |||
table.emplace_back(select(x0 < -y0, y0, tmax_0), zero_0, true); // Saturating add | |||
} | |||
|
|||
Expr is_nan_not_strict(Expr x) { |
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.
is_nan without strict_float can legally simplify to false, so this code threw me at first. But I realize what you're writing here is not an expression with a value - it's a pattern you're trying to pattern-match an expression against, and you don't want the strict_float to be part of the pattern because you don't want to strip it. If that's correct, please add a clarifying comment.
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.
Done
a4b0ba6
to
27597da
Compare
These are required to write schedules for PyTorch pipelines, whose operators use these semantics for min/max.
These rules were checked by Z3 manually.