Skip to content

[query] Fix BAD loop deoptimization with StreamAgg - #12995

Merged
danking merged 2 commits into
hail-is:mainfrom
tpoterba:nesting-depth-streamagg-oof
Jun 29, 2023
Merged

[query] Fix BAD loop deoptimization with StreamAgg#12995
danking merged 2 commits into
hail-is:mainfrom
tpoterba:nesting-depth-streamagg-oof

Conversation

@tpoterba

@tpoterba tpoterba commented May 5, 2023

Copy link
Copy Markdown
Contributor

CHANGELOG: Fixed bug causing poor performance and memory leaks for Matrix.annotate_rows aggregations

CHANGELOG: Fixed bug causing poor performance and memory leaks for Matrix.annotate_rows aggregations
@tpoterba tpoterba added the prio:high CI tests and merges this PR first label May 5, 2023
patrick-schultz
patrick-schultz previously approved these changes May 5, 2023
@danking

danking commented May 9, 2023

Copy link
Copy Markdown
Contributor

bump, has a bug

@tpoterba tpoterba removed the prio:high CI tests and merges this PR first label May 16, 2023
@danking

danking commented May 23, 2023

Copy link
Copy Markdown
Contributor

bump

@danking

danking commented Jun 8, 2023

Copy link
Copy Markdown
Contributor

@patrick-schultz can you adopt this PR?

@patrick-schultz

Copy link
Copy Markdown
Member

Yeah, I got it

@patrick-schultz
patrick-schultz dismissed their stale review June 8, 2023 17:53

new changes

@patrick-schultz

Copy link
Copy Markdown
Member

@tpoterba I think I understand what was happening. I think NestingDepth wasn't handling aggregation right at all. AggLet was getting its nesting depth from the eval scope, which got compared to the nesting depth of the ref's agg scope. So even if both were at the same level inside an aggregation, we weren't forwarding. We were also ignoring StreamAggScan.

Could you check if this looks right to you?

@patrick-schultz

Copy link
Copy Markdown
Member

I think there's another separate bug. The problem was that an ir fragment containing a StreamAgg was getting compiled, and it still had an AggLet after LowerArrayAggsToRunAggs. It's now getting inlined, but this should still work even if it isn't inlined. Maybe LowerArrayAggsToRunAggs needs to convert that to a normal Let.

@danking
danking merged commit 71ea012 into hail-is:main Jun 29, 2023
@danking

danking commented Jun 29, 2023

Copy link
Copy Markdown
Contributor

@patrick-schultz can you confirm that you anticipated this to succeed now and it just needed to be retried or something? Just a bit concerning to see a merge after two weeks without changes.

@patrick-schultz

Copy link
Copy Markdown
Member

Yeah, I've been continually retrying. It was passing non-service tests when I approved two weeks ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants