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

Add option to disable measuring buffer copy #11996

Conversation

liurenjie1024
Copy link
Collaborator

@liurenjie1024 liurenjie1024 commented Jan 22, 2025

This is the first step of #11995 .

It adds an option to disable measuring copy buffer time in spark-rapids. It doesn't actually disable it for kudo serializer, but could hide metrics.

Signed-off-by: Ray Liu <[email protected]>
Signed-off-by: Ray Liu <[email protected]>
@liurenjie1024
Copy link
Collaborator Author

build

@@ -2025,6 +2025,15 @@ val SHUFFLE_COMPRESSION_LZ4_CHUNK_SIZE = conf("spark.rapids.shuffle.compression.
.booleanConf
.createWithDefault(false)

val SHUFFLE_KUDO_SERIALIZER_MEASURE_BUFFER_COPY_ENABLED =
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is there any case we still need measuring buffer on for kudo? If not, should consider removing it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I want to keep it to do some experiments.

@liurenjie1024 liurenjie1024 changed the base branch from branch-25.02 to branch-25.04 January 24, 2025 08:02
@@ -172,6 +172,9 @@ abstract class GpuShuffleExchangeExecBase(
import GpuMetric._

private lazy val useKudo = RapidsConf.SHUFFLE_KUDO_SERIALIZER_ENABLED.get(child.conf)
private lazy val kudoMeasureBufferCopy = RapidsConf
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we please consider another name for this variable? I quite like the convention used for the conf key:

Suggested change
private lazy val kudoMeasureBufferCopy = RapidsConf
private lazy val kudoBufferCopyMeasurementEnabled = RapidsConf

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Cool, will do this in next pr to unblock merging.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed in #12081

Copy link
Collaborator

@mythrocks mythrocks left a comment

Choose a reason for hiding this comment

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

A minor suggestion added. But LGTM!

@liurenjie1024 liurenjie1024 merged commit b49aee9 into NVIDIA:branch-25.04 Feb 6, 2025
52 checks passed
@liurenjie1024 liurenjie1024 deleted the ray/option_to_disable_buffer_copy branch February 6, 2025 06:24
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.

I am concerned and confused by this patch. It appears that this patch does not actually reduce the copy time overhead at all. It just takes a step and adds a config to stop collecting a metric. But it does not disabling that metric when it happens.

METRIC_SHUFFLE_SER_COPY_HEADER_TIME ->
gpu.createNanoTimingMetric(DEBUG_LEVEL, METRIC_DESC_SHUFFLE_SER_COPY_HEADER_TIME),
METRIC_SHUFFLE_SER_COPY_BUFFER_TIME ->
gpu.createNanoTimingMetric(DEBUG_LEVEL, METRIC_DESC_SHUFFLE_SER_COPY_BUFFER_TIME)

So if someone enables debug metrics and kudo then these are not going to show up at all (by default), but it will still display a number saying that it is 0. This is also not documented anywhere so if someone did look, which I doubt that they would, they would not find much of anything and just assume that the value is actually 0.

Can we at least have a follow on issue to fix this? At a minimum document it, ideally if the config is disabled we disable the metric also.

@liurenjie1024
Copy link
Collaborator Author

Hi, @revans2

I am concerned and confused by this patch. It appears that this patch does not actually reduce the copy time overhead at all. It just takes a step and adds a config to stop collecting a metric. But it does not disabling that metric when it happens.

To fully enable/disable measuring buffer copy time, I've split the whole issue to three parts, see #11995 for more details, and this pr is just the first step. Second pr is here: NVIDIA/spark-rapids-jni#2759.

So if someone enables debug metrics and kudo then these are not going to show up at all (by default), but it will still display a number saying that it is 0.

It's not. Even if we created the metrics, as long as we didn't do any modification to this metric, it still will not show up in ui. I did experiments in local and verified it.

@sameerz sameerz added the task Work required that improves the product but is not user facing label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
task Work required that improves the product but is not user facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants