Skip to content

Commit

Permalink
Add RoctracerActivityProfilerTest Unit Tests (#950)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: #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
  • Loading branch information
aaronenyeshi authored and facebook-github-bot committed Jun 14, 2024
1 parent c0c0dbd commit 7b9fe6d
Show file tree
Hide file tree
Showing 2 changed files with 760 additions and 1 deletion.
2 changes: 1 addition & 1 deletion libkineto/src/RoctracerActivityApi.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class RoctracerActivityApi {
void clearActivities();
void teardownContext() {}

int processActivities(
virtual int processActivities(
std::function<void(const roctracerBase*)> handler,
std::function<void(uint64_t, uint64_t, RoctracerLogger::CorrelationDomain)> correlationHandler);

Expand Down
Loading

0 comments on commit 7b9fe6d

Please sign in to comment.