jinchengchenghh commented on code in PR #10889:
URL: 
https://github.com/apache/incubator-gluten/pull/10889#discussion_r2444947419


##########
backends-velox/src/main/scala/org/apache/gluten/extension/CudfNodeValidationRule.scala:
##########
@@ -37,7 +38,22 @@ case class CudfNodeValidationRule(glutenConf: GlutenConfig) 
extends Rule[SparkPl
             case _: LeafTransformSupport => true
             case _ => false
           }.isDefined
-          transformer.setTagValue(CudfTag.CudfTag, !hasLeaf)
+          if (!hasLeaf && VeloxConfig.get.cudfEnableValidation) {
+            if (
+              VeloxCudfPlanValidatorJniWrapper.validate(
+                transformer.substraitPlan.toProtobuf.toByteArray)
+            ) {
+              transformer.foreach {
+                case _: LeafTransformSupport =>
+                case t: TransformSupport =>
+                  t.setTagValue(CudfTag.CudfTag, true)
+                case _ =>
+              }
+              transformer.setTagValue(CudfTag.CudfTag, true)
+            }
+          } else {
+            transformer.setTagValue(CudfTag.CudfTag, !hasLeaf)
+          }

Review Comment:
   Will not check if the pan is fully offloaded to GPU, may introduce extra 
cudf to velox format conversion. This is not a suggested behavior.



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