ReemaAlzaid opened a new pull request, #12838:
URL: https://github.com/apache/gluten/pull/12838
<!--
Thank you for submitting a pull request! Here are some tips:
1. For first-time contributors, please read our contributing guide:
https://github.com/apache/gluten/blob/main/CONTRIBUTING.md
2. If necessary, create a GitHub issue for discussion beforehand to avoid
duplicate work.
3. If the PR is specific to a single backend, include [VL] or [CH] in the PR
title to indicate the
Velox or ClickHouse backend, respectively.
4. If the PR is not ready for review, please mark it as a draft.
-->
## What changes are proposed in this pull request?
<!--
Provide a clear and concise description of the changes introduced in this PR.
Ensure the PR description aligns with the code changes, especially after
updates.
If applicable, include "Fixes #<GitHub_Issue_ID>" to automatically close the
corresponding issue
when the PR is merged.
-->
With `spark.gluten.sql.columnar.cudf=true`, `BuildSideRelation#deserialized`
creates its Runtime from the session conf, so
`VeloxRuntime::createColumnarBatchSerializer` returns
VeloxGpuColumnarBatchSerializer and every broadcast batch is uploaded to the
device even when the consuming stage was not offloaded to cuDF and planned a
host-contract value stream. The stream contract is decided per stage (the cudf
tag), but broadcast residency was decided per session, and the two can disagree.
TPCH q16 reproduces this deterministically: its not in subquery is a nul
-aware anti join, which Spark always executes as a broadcast join even with
`spark.sql.autoBroadcastJoinThreshold=-1`, so the untagged consumer receives
device resident CudfVectors on its first batch and fails.
Fix: pass a per instance `COLUMNAR_CUDF_ENABLED=false` override so broadcast
batches always deserialize to host. Both serializer flavors share the same wire
format (the GPU one only overrides deserialize), and cuDF offloaded consumers
upload host batches themselves via CudfVectorStream (#12471 this PR depends on
that upload path for the GPU consumer case).
## How was this patch tested?
<!--
Describe how the changes were tested, if applicable.
Include new tests to validate the functionality, if necessary.
For UI-related changes, attach screenshots to demonstrate the updates.
-->
Verified on an L40S (TPC-H sf1, queries-compare): fallback mode with
broadcasts disabled goes from failing to 22/22; pure-GPU mode with broadcasts
enabled holds its baseline (remaining failures are pre-existing cuDF
expression-coverage gaps: row_constructor_with_null, spark_legacy_cast).
## Was this patch authored or co-authored using generative AI tooling?
<!--
If generative AI tooling has been used in the process of authoring this
patch, please include the
phrase: 'Generated-by: ' followed by the name of the tool and its version.
If no, write 'No'.
Please refer to the [ASF Generative Tooling
Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]