Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preparation for the coming Kudo support #11667

Merged
merged 8 commits into from
Nov 4, 2024

Conversation

firestarman
Copy link
Collaborator

@firestarman firestarman commented Oct 28, 2024

contributes to #11590

This is some code refactor for easily adding in the Kudo support in Shuffle coalesce and join execs. The main idea is to abstract the batch operations (SerializedTableOperator) from the coalesce read process.

Some code refactor for easily adding in the Kudo support in Shuffle coalesce and join execs.

Signed-off-by: Firestarman <[email protected]>
Signed-off-by: Firestarman <[email protected]>
@firestarman
Copy link
Collaborator Author

build

Copy link
Collaborator

@revans2 revans2 left a comment

Choose a reason for hiding this comment

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

Mostly nits, but I would like a few more sets of eyes on this.


object CoalesceReadOption {
def apply(conf: RapidsConf): CoalesceReadOption = {
// TODO get the value from conf
Copy link
Collaborator

Choose a reason for hiding this comment

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

Do we need to do this?

Copy link
Collaborator Author

@firestarman firestarman Oct 31, 2024

Choose a reason for hiding this comment

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

It is better to have.
It will be quite easy to add in new fields that can be got from the conf. And you do not need to update all the places where the CoalesceReadOption(conf) is called.

metricsMap: Map[String, GpuMetric],
prefetchFirstBatch: Boolean = false): Iterator[ColumnarBatch] = {
val hostIter = if (readOption.kudoEnabled) {
// TODO replace with the actual Kudo host iterator
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we please throw an exception instead? If this is true we have problems and making the data disappear feels wrong to me.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Good suggestion, done

def getCoalescedBufferSize(concated: AnyRef): Long = concated match {
// TODO add the Kudo case
case c: HostConcatResult => c.getTableHeader.getDataLen
case g => GpuColumnVector.getTotalDeviceMemoryUsed(g.asInstanceOf[ColumnarBatch])
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: can we please have some better error messages here or something? I don't like that we have g.asInstanceOf, when the match should do that for us. It also means that the error message if something goes wrong will just be a class cast exception instead of a cleaner message

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This function is removed.

@firestarman
Copy link
Collaborator Author

firestarman commented Oct 29, 2024

Thx for review, but I will drop this PR since it is not necessary for only the table operator part.

@liurenjie1024 Seems it would be better to have a single PR for the Kudo support.

@firestarman firestarman reopened this Oct 31, 2024
Signed-off-by: Firestarman <[email protected]>
Signed-off-by: Firestarman <[email protected]>
@firestarman
Copy link
Collaborator Author

build

jlowe
jlowe previously approved these changes Oct 31, 2024
Copy link
Member

@jlowe jlowe left a comment

Choose a reason for hiding this comment

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

lgtm, but it would be good to have @revans2 have a second look.

Signed-off-by: Firestarman <[email protected]>
@firestarman
Copy link
Collaborator Author

build

Copy link
Collaborator

@liurenjie1024 liurenjie1024 left a comment

Choose a reason for hiding this comment

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

Generally LGTM, just a nit

@firestarman
Copy link
Collaborator Author

@revans2 Could you help take a look ? Thanks.

@revans2 revans2 merged commit 35980d6 into NVIDIA:branch-24.12 Nov 4, 2024
46 of 47 checks passed
@firestarman firestarman deleted the refactor-coalesce-shuffle branch November 5, 2024 01:40
@sameerz sameerz added the performance A performance related task/issue label Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance A performance related task/issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants