Skip to content

Unify cuDF operators with a common base class architecture#16934

Open
coreylammie wants to merge 3 commits intofacebookincubator:mainfrom
coreylammie:cudf_operator_nvtx_tagging
Open

Unify cuDF operators with a common base class architecture#16934
coreylammie wants to merge 3 commits intofacebookincubator:mainfrom
coreylammie:cudf_operator_nvtx_tagging

Conversation

@coreylammie
Copy link
Copy Markdown

Corresponding PR for #16885.

@meta-cla meta-cla bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Mar 26, 2026
@netlify
Copy link
Copy Markdown

netlify bot commented Mar 26, 2026

Deploy Preview for meta-velox canceled.

Name Link
🔨 Latest commit 6ff89ed
🔍 Latest deploy log https://app.netlify.com/projects/meta-velox/deploys/69c55197d92ce80009511bc6

Copy link
Copy Markdown
Collaborator

@devavret devavret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. Mostly the thing that sticks out to me is the possibility of seeing the same operator name in nvtx ranges.

Comment on lines +82 to +89
inline nvtx3::event_attributes create_nvtx_attributes(const std::string& category, const std::string& tag) {
std::hash<std::string> hasher;
nvtx3::named_category_in<facebook::velox::cudf_velox::VeloxDomain> category_{
static_cast<uint32_t>(hasher(category)),
category.c_str()
};
return nvtx3::event_attributes{tag, category_};
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this being used for? I couldn't find any reference to it in this PR or in nvtx headers

if (CudfConfig::getInstance().debugEnabled) {
VLOG(2) << "Calling " << className_ << "::addInput";
}
VELOX_NVTX_OPERATOR_FUNC_RANGE();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can add a new one called VELOX_NVTX_OPERATOR_FUNC_RANGE_IF() modeled after NVTX3_V1_FUNC_RANGE_IF(). With it, you can put the condition inside the macro and have a single doAddInput call

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the macro won't able to serve us now. I think it'll capture the base class' name now? We want to see CudfHashAggregation::addInput and not CudfOperatorBase::addInput. please correct me if i'm wrong.

operatorId,
fmt::format("[{}]", topNNode->id())),
"CudfTopN",
nvtx3::rgb{255, 140, 0}, // Dark Orange
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: try to retain the previous colors. We've sort of gotten used to them :)

className_(operatorName),
nvtxMethods_(nvtxMethods) {}

void addInput(RowVectorPtr input) override {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you'd also want to mark them final instead of override

operatorName,
spillConfig),
NvtxHelper(
color.value_or(nvtx3::rgb{160, 82, 45}),
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about we let NvtxHelper manage the default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants