[DNR] feat(native): Extend sidecar to support GPU execution#27164
Draft
pramodsatya wants to merge 7 commits intoprestodb:masterfrom
Draft
[DNR] feat(native): Extend sidecar to support GPU execution#27164pramodsatya wants to merge 7 commits intoprestodb:masterfrom
pramodsatya wants to merge 7 commits intoprestodb:masterfrom
Conversation
Contributor
Reviewer's GuideAdds GPU (cuDF) execution awareness to the native sidecar by introducing cuDF-specific session properties, exposing them over new HTTP endpoints, and enforcing that converted Velox plans and expressions are compatible with cuDF when GPU support is enabled, along with build/test wiring for cuDF components. Sequence diagram for Velox plan and expression conversion with cuDF validationsequenceDiagram
participant QC as QueryCoordinator
participant VQPC as VeloxQueryPlanConverterBase
participant VEC as VeloxExprConverter
participant CPC as CudfPlanNodeChecker
participant CEC as CudfExpressionChecker
QC->>VQPC: toVeloxQueryPlan(prestoPlan)
loop For each logical operator
VQPC->>VQPC: build PlanNode
alt ProjectNode
VQPC->>CPC: isProjectNodeSupported(projectNode)
alt Supported
CPC-->>VQPC: true
VQPC-->>QC: use projectNode
else Not supported
CPC-->>VQPC: false
VQPC-->>QC: VELOX_FAIL("Project PlanNode not supported in cudf")
end
else FilterNode
VQPC->>CPC: isFilterNodeSupported(filterNode)
alt Supported
CPC-->>VQPC: true
else Not supported
CPC-->>VQPC: false
VQPC-->>QC: VELOX_FAIL("Filter PlanNode not supported in cudf")
end
else HashJoinNode
VQPC->>CPC: isHashJoinNodeSupported(hashJoinNode)
alt Supported
CPC-->>VQPC: true
else Not supported
CPC-->>VQPC: false
VQPC-->>QC: VELOX_FAIL("HashJoin PlanNode not supported in cudf")
end
else AggregationNode
VQPC->>CPC: isAggregationNodeSupported(aggNode)
alt Supported
CPC-->>VQPC: true
else Not supported
CPC-->>VQPC: false
VQPC-->>QC: VELOX_FAIL("Aggregation PlanNode not supported in cudf")
end
else TableScanNode
VQPC->>CPC: isTableScanNodeSupported(scanNode)
alt Supported
CPC-->>VQPC: true
else Not supported
CPC-->>VQPC: false
VQPC-->>QC: VELOX_FAIL("TableScan PlanNode not supported in cudf")
end
end
end
QC->>VEC: toVeloxExpr(rowExpression)
VEC->>VEC: convert to TypedExprPtr
VEC->>CEC: canBeEvaluatedByCudf([typedExpr])
alt Expression supported by cuDF
CEC-->>VEC: true
VEC-->>QC: typedExpr
else Expression not supported
CEC-->>VEC: false
VEC-->>QC: VELOX_FAIL("Expression not supported in cudf")
end
Class diagram for cuDF session properties and configurationclassDiagram
namespace facebook_presto {
class CudfSessionProperties {
+static const char* kCudfEnabled
+static const char* kCudfDebugEnabled
+static const char* kCudfMemoryResource
+static const char* kCudfMemoryPercent
+static const char* kCudfFunctionNamePrefix
+static const char* kCudfAstExpressionEnabled
+static const char* kCudfAstExpressionPriority
+static const char* kCudfJitExpressionEnabled
+static const char* kCudfJitExpressionPriority
+static const char* kCudfAllowCpuFallback
+static const char* kCudfLogFallback
+static CudfSessionProperties* instance()
+CudfSessionProperties()
+json serialize() const
-void addSessionProperty(name, description, type, isHidden, defaultValue)
-unordered_map~string, shared_ptr~SessionProperty~~ sessionProperties_
}
class SessionProperty {
+SessionProperty(name, description, typeString, isHidden, range, defaultValue)
+protocol_SessionPropertyMetadata getMetadata() const
}
}
namespace facebook_velox_cudf_velox {
class CudfConfig {
+static CudfConfig& getInstance()
+bool enabled
+bool debugEnabled
+string memoryResource
+int32_t memoryPercent
+string functionNamePrefix
+bool astExpressionEnabled
+int32_t astExpressionPriority
+bool jitExpressionEnabled
+int32_t jitExpressionPriority
+bool allowCpuFallback
+bool logFallback
}
}
namespace facebook_velox_type {
class Type {
+string toString() const
}
}
CudfSessionProperties --> CudfConfig : reads defaults from
CudfSessionProperties --> SessionProperty : creates
CudfSessionProperties --> Type : uses in addSessionProperty
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
11eeb9d to
35e75c8
Compare
04cba83 to
90e3144
Compare
c094543 to
49d9a71
Compare
49d9a71 to
f375e18
Compare
6 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Motivation and Context
Impact
Test Plan
Contributor checklist
Release Notes
Please follow release notes guidelines and fill in the release notes below.
If release note is NOT required, use:
Summary by Sourcery
Add GPU/cuDF-aware planning and session configuration to native execution sidecar
New Features:
Enhancements:
Build:
Tests: