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

Add rfactor patterns for NaN-propagating min/max #8587

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alexreinking
Copy link
Member

These are required to write schedules for PyTorch pipelines, whose operators use these semantics for min/max.

These rules were checked by Z3 manually.

@alexreinking alexreinking requested a review from abadams March 6, 2025 20:24
@alexreinking alexreinking added the enhancement New user-visible features or improvements to existing features. label Mar 6, 2025
@@ -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) {
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New user-visible features or improvements to existing features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants