-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description
I would like to make a PR to unify the cuDF operators with a common base class.
Motivation
Currently, cuDF operators (CudfTopN, CudfLimit, CudfOrderBy, etc.) don't extend from a common base class. Each operator directly extends exec::Operator and NvtxHelper, leading to:
- Code duplication (across operators)
- Inconsistent debug logging patterns (some operators log, others don't)
- No common type for passing operators - meaning, e.g., no direct access to NVTX/cuDF features without casting
- Difficult to enforce consistent behavior across operators
Proposed Solution
Introduce a unified base class architecture with two complementary classes:
CudfOperator- Lightweight base for user-defined GPU operators:
- Extends NvtxHelper only, based on feat(cudf): Support user defined gpu operator #15375.
CudfOperatorBase- Comprehensive base for built-in operators:
- Extends from both
CudfOperatorandexec::Operator. - Implements template method pattern: overrides
addInput(),getOutput(),noMoreInput(), andclose()to call correspondingdo*methods (doAddInput(),doGetOutput(),doNoMoreInput(),doClose()) - Each wrapper method adds
VELOX_NVTX_OPERATOR_FUNC_RANGE()profiling andVLOG(2)debug logging (guarded byCudfConfig::getInstance().debugEnabled) - Derived operators override only the do* methods they need (all have default implementations)
- Enforces consistent NVTX profiling and debug logging across all built-in cuDF operators
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request