Skip to content

[VL] Update shuffle write metrics per batch#11083

Merged
marin-ma merged 4 commits into
apache:mainfrom
Yohahaha:update-shuffle-metrics-by-batch
Dec 3, 2025
Merged

[VL] Update shuffle write metrics per batch#11083
marin-ma merged 4 commits into
apache:mainfrom
Yohahaha:update-shuffle-metrics-by-batch

Conversation

@Yohahaha

Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

In our prod env, some stages write out hundreds of terabytes of shuffle data, but current UI does not shown it.

How was this patch tested?

@github-actions github-actions Bot added the VELOX label Nov 14, 2025
@Yohahaha
Yohahaha force-pushed the update-shuffle-metrics-by-batch branch 2 times, most recently from 47d339c to af3860e Compare November 18, 2025 07:37
@Yohahaha

Copy link
Copy Markdown
Contributor Author

@kerwin-zk @marin-ma please help review this pr, thank you!

@kerwin-zk kerwin-zk left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM. Thanks!

Comment thread cpp/core/shuffle/PartitionWriter.h Outdated
@Yohahaha

Copy link
Copy Markdown
Contributor Author

@marin-ma thank you for the detailed review, it's my mistake for lost some codes when rebasing.

@marin-ma

Copy link
Copy Markdown
Contributor

@Yohahaha Thanks for the clarification and updates. Can we simply add an API for the PartitionWriter to count the total written bytes, and calculate then return the delta of the bytes written in the native ShuffleWriter?

@Yohahaha

Copy link
Copy Markdown
Contributor Author

@Yohahaha Thanks for the clarification and updates. Can we simply add an API for the PartitionWriter to count the total written bytes, and calculate then return the delta of the bytes written in the native ShuffleWriter?

thank you for the suggestion, I will refactor it later.

@Yohahaha
Yohahaha force-pushed the update-shuffle-metrics-by-batch branch from f673f41 to 6dbd27e Compare November 28, 2025 06:14
@Yohahaha

Yohahaha commented Dec 1, 2025

Copy link
Copy Markdown
Contributor Author

@marin-ma please help review again, thank you!

@marin-ma marin-ma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Some comments. Thanks!

@@ -77,7 +77,7 @@ class VeloxCelebornColumnarShuffleWriter[K, V](
val columnarBatchHandle =
ColumnarBatches.getNativeHandle(BackendsApiManager.getBackendName, cb)
val startTime = System.nanoTime()
shuffleWriterJniWrapper.write(
val bytesWritten = shuffleWriterJniWrapper.write(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think VeloxUniffleColumnarShuffleWriter also needs to be updated. It's using the same native partition writer as celeborn.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Uniffle does not call incBytesWritten and the logic of metrics collecting differs with local and celeborn, it's better to let related developer to change it.

@@ -61,8 +61,8 @@ int32_t ShuffleWriter::numPartitions() const {
return numPartitions_;
}

int64_t ShuffleWriter::totalBytesWritten() const {
return metrics_.totalBytesWritten;
int64_t ShuffleWriter::bytesWritten() const {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can we simply modify the signature ofShuffleWriter::write and ShuffleWriter::stop to return the bytes evicted as Result<int64_t>? And seems like this value is not updated and used for local shuffle write, please add some explanation that only rss shuffle write returns the evicted bytes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Can we simply modify the signature ofShuffleWriter::write and ShuffleWriter::stop to return the bytes evicted as Result<int64_t>

The write api can be easily modified, but the stop api is not, stop api collect and return whole shuffle metrics of task, I prefer do refactor work for api change in another pr and make current pr as simple as possible.

@Yohahaha
Yohahaha force-pushed the update-shuffle-metrics-by-batch branch from 98784f0 to e1bee6d Compare December 2, 2025 03:12
@Yohahaha

Yohahaha commented Dec 3, 2025

Copy link
Copy Markdown
Contributor Author

@marin-ma any more comments?

@marin-ma

marin-ma commented Dec 3, 2025

Copy link
Copy Markdown
Contributor

@Yohahaha Thanks

@marin-ma
marin-ma merged commit 0f76034 into apache:main Dec 3, 2025
103 of 106 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants