-
Notifications
You must be signed in to change notification settings - Fork 70
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
Added variance as a unary reduction #593
Added variance as a unary reduction #593
Conversation
See design doc for full details: https://docs.google.com/document/d/19H6xwGhuPq1ImGU3HryBusLlarqAC3Bxyn2e5f2gOKI This is much less complicated than #589 and also less memory efficient, but is much more numerically stable. |
@@ -33,6 +33,8 @@ enum class UnaryRedCode : int { | |||
MIN = CUNUMERIC_RED_MIN, | |||
PROD = CUNUMERIC_RED_PROD, | |||
SUM = CUNUMERIC_RED_SUM, | |||
SUM_SQUARES = CUNUMERIC_RED_SUM_SQUARES, | |||
VARIANCE = CUNUMERIC_RED_VARIANCE |
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.
VARIANCE = CUNUMERIC_RED_VARIANCE | |
VARIANCE = CUNUMERIC_RED_VARIANCE, |
@@ -143,6 +143,8 @@ enum CuNumericUnaryRedCode { | |||
CUNUMERIC_RED_MIN, | |||
CUNUMERIC_RED_PROD, | |||
CUNUMERIC_RED_SUM, | |||
CUNUMERIC_RED_SUM_SQUARES, | |||
CUNUMERIC_RED_VARIANCE |
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.
CUNUMERIC_RED_VARIANCE | |
CUNUMERIC_RED_VARIANCE, |
6fcdd64
to
ee97269
Compare
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
/ok to test |
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.
Some of my suggestions were not very well thought-out. We'll leave them as future work.
Adds algorithms for variance that try to balance numerical stability with memory efficiency. This uses a multi-pass algorithm to first compute the mean (more numerically stable) and then computes a single-pass unary reduction to compute the variance.