Update ROCPROFILER_CALLBACK_* references to ROCPROFILER_BUFFER_*#1295
Closed
ryanzhang22 wants to merge 1 commit intopytorch:mainfrom
Closed
Update ROCPROFILER_CALLBACK_* references to ROCPROFILER_BUFFER_*#1295ryanzhang22 wants to merge 1 commit intopytorch:mainfrom
ryanzhang22 wants to merge 1 commit intopytorch:mainfrom
Conversation
|
@ryanzhang22 has exported this pull request. If you are a Meta employee, you can view the originating Diff in D96124233. |
ryanzhang22
added a commit
to ryanzhang22/kineto
that referenced
this pull request
Mar 11, 2026
…orch#1295) Summary: While debugging the test_disable_external_correlation profiler test, I found a bug where ROCm profiles didn't seem to produce "gpu_memcpy" events, leading to a validation error (see [code ref](https://www.internalfb.com/code/fbsource/[475c7d69dbbe]/fbcode/caffe2/test/profiler/test_profiler.py?lines=2392%2C2419)). The payload here is doing .cuda() calls which should trigger the memcpy. In the RocprofLogger.cpp file, we request Rocprofiler to return 'ROCPROFILER_BUFFER_TRACING_MEMORY_COPY' events thru [`rocprofiler_configure_buffer_tracing_service`](https://www.internalfb.com/code/fbsource/[475c7d69dbbe]/fbcode/kineto/libkineto/src/RocprofLogger.cpp?lines=427). However throughout the rest of the Rocprof logic we are expecting ROCPROFILER_CALLBACK_TRACING_MEMORY_COPY calls. In the switch statements modified in this diff, this causes the mem copy calls to fall back to kernel type by default -- so gpu_memcpy events are missing from the gpu trace + we're unable to get the kind of mem copy. Differential Revision: D96124233
85002c0 to
ee0e447
Compare
ryanzhang22
added a commit
to ryanzhang22/kineto
that referenced
this pull request
Mar 11, 2026
…orch#1295) Summary: Pull Request resolved: pytorch#1295 While debugging the test_disable_external_correlation profiler test, I found a bug where ROCm profiles didn't seem to produce "gpu_memcpy" events, leading to a validation error (see [code ref](https://www.internalfb.com/code/fbsource/[475c7d69dbbe]/fbcode/caffe2/test/profiler/test_profiler.py?lines=2392%2C2419)). The payload here is doing .cuda() calls which should trigger the memcpy. In the RocprofLogger.cpp file, we request Rocprofiler to return 'ROCPROFILER_BUFFER_TRACING_MEMORY_COPY' events thru [`rocprofiler_configure_buffer_tracing_service`](https://www.internalfb.com/code/fbsource/[475c7d69dbbe]/fbcode/kineto/libkineto/src/RocprofLogger.cpp?lines=427). However throughout the rest of the Rocprof logic we are expecting ROCPROFILER_CALLBACK_TRACING_MEMORY_COPY calls. In the switch statements modified in this diff, this causes the mem copy calls to fall back to kernel type by default -- so gpu_memcpy events are missing from the gpu trace + we're unable to get the kind of mem copy. Reviewed By: scotts Differential Revision: D96124233
…orch#1295) Summary: While debugging the test_disable_external_correlation profiler test, I found a bug where ROCm profiles didn't seem to produce "gpu_memcpy" events, leading to a validation error (see [code ref](https://www.internalfb.com/code/fbsource/[475c7d69dbbe]/fbcode/caffe2/test/profiler/test_profiler.py?lines=2392%2C2419)). The payload here is doing .cuda() calls which should trigger the memcpy. In the RocprofLogger.cpp file, we request Rocprofiler to return 'ROCPROFILER_BUFFER_TRACING_MEMORY_COPY' events thru [`rocprofiler_configure_buffer_tracing_service`](https://www.internalfb.com/code/fbsource/[475c7d69dbbe]/fbcode/kineto/libkineto/src/RocprofLogger.cpp?lines=427). However throughout the rest of the Rocprof logic we are expecting ROCPROFILER_CALLBACK_TRACING_MEMORY_COPY calls. In the switch statements modified in this diff, this causes the mem copy calls to fall back to kernel type by default -- so gpu_memcpy events are missing from the gpu trace + we're unable to get the kind of mem copy. Reviewed By: scotts Differential Revision: D96124233
ee0e447 to
1afd12e
Compare
|
This pull request has been merged in 03ab8cb. |
pytorchmergebot
pushed a commit
to pytorch/pytorch
that referenced
this pull request
Mar 19, 2026
#177745) 1. Validates that some important keys are present in the metadata for kernel events in the output json. Previously we had an issue where "grid" was not being returned in JSON, so we check that all of "device", "stream", "correlation", "grid", "block" are present. 2. Modifies the `payload()` used in the profiler tests to configure tensor size. We were experiencing issues on ROCm `test_disable_external_correlation` because gpu_memcpy events were not showing up in the trace. Half of this was fixed in pytorch/kineto#1295, but gpu_memcpy is only triggered when the kernel being copied is larger than some size, so we increase the tensor size to fix the test. Pull Request resolved: #177745 Approved by: https://github.com/jiannanWang, https://github.com/divyanshk
ryanzhang22
added a commit
to ryanzhang22/pytorch
that referenced
this pull request
Mar 19, 2026
pytorch#177745) 1. Validates that some important keys are present in the metadata for kernel events in the output json. Previously we had an issue where "grid" was not being returned in JSON, so we check that all of "device", "stream", "correlation", "grid", "block" are present. 2. Modifies the `payload()` used in the profiler tests to configure tensor size. We were experiencing issues on ROCm `test_disable_external_correlation` because gpu_memcpy events were not showing up in the trace. Half of this was fixed in pytorch/kineto#1295, but gpu_memcpy is only triggered when the kernel being copied is larger than some size, so we increase the tensor size to fix the test. Pull Request resolved: pytorch#177745 Approved by: https://github.com/jiannanWang, https://github.com/divyanshk
AaronWang04
pushed a commit
to AaronWang04/pytorch
that referenced
this pull request
Mar 31, 2026
pytorch#177745) 1. Validates that some important keys are present in the metadata for kernel events in the output json. Previously we had an issue where "grid" was not being returned in JSON, so we check that all of "device", "stream", "correlation", "grid", "block" are present. 2. Modifies the `payload()` used in the profiler tests to configure tensor size. We were experiencing issues on ROCm `test_disable_external_correlation` because gpu_memcpy events were not showing up in the trace. Half of this was fixed in pytorch/kineto#1295, but gpu_memcpy is only triggered when the kernel being copied is larger than some size, so we increase the tensor size to fix the test. Pull Request resolved: pytorch#177745 Approved by: https://github.com/jiannanWang, https://github.com/divyanshk
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
While debugging the test_disable_external_correlation profiler test, I found a bug where ROCm profiles didn't seem to produce "gpu_memcpy" events, leading to a validation error (see code ref). The payload here is doing .cuda() calls which should trigger the memcpy.
In the RocprofLogger.cpp file, we request Rocprofiler to return 'ROCPROFILER_BUFFER_TRACING_MEMORY_COPY' events thru
rocprofiler_configure_buffer_tracing_service. However throughout the rest of the Rocprof logic we are expecting ROCPROFILER_CALLBACK_TRACING_MEMORY_COPY calls. In the switch statements modified in this diff, this causes the mem copy calls to fall back to kernel type by default -- so gpu_memcpy events are missing from the gpu trace + we're unable to get the kind of mem copy.Differential Revision: D96124233