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

Propagate local properties to broadcast execs #9610

Merged
merged 3 commits into from
Nov 3, 2023

Conversation

thirtiseven
Copy link
Collaborator

@thirtiseven thirtiseven commented Nov 2, 2023

Closes #9464

This PR adds propagating local properties to GpuBroadcastExchangeExecBase and GpuSubqueryBroadcastExec.

apache/spark@2f4a71252cc Added propagating local properties to subquery broadcast exec, because the local properties of subquery broadcast exec (which are usually propagated by broadcast exchange exec) to the broadcast threads would be wrong in some cases. And we have the same code in the plugin.

The test case in the commit message will fail because we didn't propagate local properties to GpuBroadcastExchangeExecBase so I added it. But after I adding it, the test case will pass no matter if the propagating local properties to GpuSubqueryBroadcastExec is added and no matter if I added the Thread.sleep as the guide from the Spark commit.

I personnally think the spark commit is reasonable and also applicable for plugin so I added it in this PR, but I haven't found a good way to test it.

As the spark commit message said, It is difficult to write a unit test that reproduces this behavior because usually BroadcastExchangeExec is the first computing the broadcast variable.

BTW, GpuBroadcastToRowExec already implements propagation, we may want to keep it and GpuSubqueryBroadcastExec consistent if propagation is really unnecessary.

This PR also fixes a nit from my previous commit.

Signed-off-by: Haoyang Li <haoyangl@nvidia.com>
Signed-off-by: Haoyang Li <haoyangl@nvidia.com>
@thirtiseven thirtiseven self-assigned this Nov 2, 2023
revans2
revans2 previously approved these changes Nov 2, 2023
data_gen = StructGen([['child'+str(ind), sub_gen] for ind, sub_gen in
enumerate(all_basic_gens + decimal_gens)], nullable=False)
enumerate(base_gens)], nullable=False)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there a reason this test changed? I get that we wanted to make this change for stack anyways. I'm just not sure combining it with an unrelated PR is a good thing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok got it, I will avoid combining unrelated things in one PR in the future. Thanks for the reminding.

@revans2
Copy link
Collaborator

revans2 commented Nov 2, 2023

Oops it looks like 312 and 313 do not like the code change. We might have to put in some shims to make this work properly.

Signed-off-by: Haoyang Li <haoyangl@nvidia.com>
@revans2
Copy link
Collaborator

revans2 commented Nov 2, 2023

build

@thirtiseven thirtiseven merged commit f1362a8 into NVIDIA:branch-23.12 Nov 3, 2023
37 checks passed
@thirtiseven thirtiseven deleted the subquery branch November 3, 2023 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[AUD] Audit [SPARK-44897][SQL] Propagating local properties to subquery broadcastexec
3 participants