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

Added variance as a unary reduction #593

Merged

Conversation

jjwilke
Copy link
Contributor

@jjwilke jjwilke commented Sep 20, 2022

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.

@jjwilke jjwilke added the category:new-feature PR introduces a new feature and will be classified as such in release notes label Sep 20, 2022
@jjwilke
Copy link
Contributor Author

jjwilke commented Sep 20, 2022

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.

@jjwilke jjwilke mentioned this pull request Sep 20, 2022
@manopapad manopapad changed the base branch from branch-22.10 to branch-22.12 September 30, 2022 21:57
@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
CUNUMERIC_RED_VARIANCE
CUNUMERIC_RED_VARIANCE,

@marcinz marcinz changed the base branch from branch-22.12 to branch-23.03 January 26, 2023 00:59
@marcinz marcinz changed the base branch from branch-23.03 to branch-23.05 March 6, 2023 20:46
@marcinz marcinz changed the base branch from branch-23.05 to branch-23.07 May 18, 2023 20:29
@marcinz marcinz changed the base branch from branch-23.07 to branch-23.09 July 18, 2023 15:44
@jjwilke jjwilke force-pushed the variance-unary-red-cherry-pick branch from 6fcdd64 to ee97269 Compare August 4, 2023 22:42
@copy-pr-bot
Copy link

copy-pr-bot bot commented Aug 30, 2023

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@marcinz marcinz changed the base branch from branch-23.09 to branch-23.11 September 26, 2023 00:38
cunumeric/array.py Outdated Show resolved Hide resolved
cunumeric/eager.py Outdated Show resolved Hide resolved
cunumeric/eager.py Outdated Show resolved Hide resolved
cunumeric/module.py Outdated Show resolved Hide resolved
src/cunumeric/unary/scalar_unary_red_template.inl Outdated Show resolved Hide resolved
src/cunumeric/unary/unary_red_util.h Outdated Show resolved Hide resolved
src/cunumeric/unary/unary_red_util.h Outdated Show resolved Hide resolved
src/cunumeric/unary/unary_red_util.h Outdated Show resolved Hide resolved
src/cunumeric/unary/unary_red_util.h Show resolved Hide resolved
cunumeric/array.py Outdated Show resolved Hide resolved
@manopapad
Copy link
Contributor

/ok to test

Copy link
Contributor

@manopapad manopapad left a 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.

@aschaffer aschaffer merged commit 8138188 into nv-legate:branch-23.11 Oct 19, 2023
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-feature PR introduces a new feature and will be classified as such in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants