ReemaAlzaid commented on code in PR #12838:
URL: https://github.com/apache/gluten/pull/12838#discussion_r3872097046


##########
backends-velox/src/test/scala/org/apache/gluten/execution/CudfBroadcastJoinSuite.scala:
##########
@@ -72,7 +72,28 @@ class CudfBroadcastJoinSuite extends 
VeloxWholeStageTransformerSuite {
         // demoted or fallen back.
         val bhj = collect(plan) { case j: BroadcastHashJoinExecTransformer => 
j }
         assert(bhj.nonEmpty, s"expected an offloaded broadcast hash join, 
got:\n$plan")
-        assert(df.count() > 0, "broadcast join must not return empty results 
(GLUTEN-12471)")
+        assert(df.count() > 0, "broadcast join must not return empty results 
(GLUTEN-12812)")
+    }
+  }
+
+  test("GLUTEN-12838: broadcast build side follows the consuming stage's cuDF 
tag") {
+    // We need a broadcast that lands in a CPU stage. NOT IN gives us one for 
free: it

Review Comment:
   Yes. I instrumented the test to check the tag directly:
   
   ```text
   bhj offloadCuda=false  nullAware=true
   stage offloadCuda=false  (both WholeStageTransformers in the plan)
   ```
   
   So both the broadcast hash join and its stages are not offloaded, even with 
`spark.gluten.sql.columnar.cudf=true`. This is exactly the case where the 
session config was incorrectly selecting the GPU serializer and passing 
device-resident `CudfVectors` into a host side value stream.
   
   I also confirmed the test catches the regression. Reverting the serializer 
selection back to the session config makes it fail with:
   
   ```text
   childAt: index < childrenSize_ (0 vs. 0)
   ```
   
   on:
   
   ```text
   ROW<"node_value-stream:0_0":BIGINT, …>
   ```
   
   because the CPU stage receives a device vector with no children.
   
   With the fix, both tests pass.



-- 
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]

Reply via email to