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 RoctracerActivityProfilerTest Unit Tests #950

Closed
wants to merge 1 commit into from

Conversation

aaronenyeshi
Copy link
Member

Summary:
Adding 5 unit tests for the CuptiActivityProfiler and its interactions with RoctracerActivityApi. Mock the RoctracerLogger and the RoctracerActivityApi and pass them into the CuptiActivityProfiler orchestrator, then verify the trace files produced.

  • SyncTrace: Mocks 5 CPU ops, 3 CPU Kernel Runtime Launches, 2 CPU Memcpy Runtime events, 3 GPU Kernels, 2 GPU Memcpy events. Checks that the trace output matches what was passed in, and names are correct after parsing.
  • GpuNCCLCollectiveTest: Similar to CUPTI, check that NCCL metadata is properly passed into the CPU and GPU ops.
  • GpuUserAnnotationTest: Check that GPU user annotations added via CorrelationDomain1 works properly, and the annotations are in the final trace.
  • SubActivityProfilers: Check subactivityprofiler children will continue to work, such as glow runtime mock activity profiler.
  • JsonGPUIDSortTest: Check that JSON file contains expected number of process_labels and process_sort_index , so that GPU rows in Chrome traces will always be sorted after CPU rows.

Differential Revision: D58554825

Pulled By: aaronenyeshi

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D58554825

Summary:
Pull Request resolved: pytorch#950

Adding 5 unit tests for the CuptiActivityProfiler and its interactions with RoctracerActivityApi. Mock the RoctracerLogger and the RoctracerActivityApi and pass them into the CuptiActivityProfiler orchestrator, then verify the trace files produced.

- **SyncTrace:** Mocks 5 CPU ops, 3 CPU Kernel Runtime Launches, 2 CPU Memcpy Runtime events, 3 GPU Kernels, 2 GPU Memcpy events. Checks that the trace output matches what was passed in, and names are correct after parsing.
- **GpuNCCLCollectiveTest:** Similar to CUPTI, check that NCCL metadata is properly passed into the CPU and GPU ops.
- **GpuUserAnnotationTest:** Check that GPU user annotations added via CorrelationDomain1 works properly, and the annotations are in the final trace.
- **SubActivityProfilers:** Check subactivityprofiler children will continue to work, such as glow runtime mock activity profiler.
- **JsonGPUIDSortTest:** Check that JSON file contains expected number of process_labels and process_sort_index , so that GPU rows in Chrome traces will always be sorted after CPU rows.

Test Plan: Ran locally on AMDGPU.

Differential Revision: D58554825

Pulled By: aaronenyeshi
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D58554825

Copy link
Member

@houseroad houseroad left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@facebook-github-bot
Copy link
Contributor

@aaronenyeshi merged this pull request in 0063575.

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

Successfully merging this pull request may close these issues.

3 participants