Skip to content

Commit

Permalink
To support XPU profiler in Kineto (1/3) (#723)
Browse files Browse the repository at this point in the history
Summary:
This commit is aimed to add a enum flag to support the XPU runtime tracing path.

The next step is to add registrator for XPU extensions in the IActivityProfiler layer.

Signed-off-by: Xunsong, Huang <xunsong.huang@intel.com>

Pull Request resolved: #723

Reviewed By: xuzhao9

Differential Revision: D43541750

Pulled By: aaronenyeshi

fbshipit-source-id: 7ff4925b55252446fe40fca4984e388d623fa158
  • Loading branch information
xunsongh authored and facebook-github-bot committed Feb 24, 2023
1 parent 13554b0 commit be3fb3f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions libkineto/include/ActivityType.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ enum class ActivityType {
GLOW_RUNTIME, // host side glow runtime events
CUDA_PROFILER_RANGE, // CUPTI Profiler range for performance metrics
HPU_OP, // HPU host side runtime event
XPU_RUNTIME, // host side xpu runtime events

ENUM_COUNT, // This is to add buffer and not used for any profiling logic. Add your new type before it.
OPTIONAL_ACTIVITY_TYPE_START = GLOW_RUNTIME,
Expand Down
1 change: 1 addition & 0 deletions libkineto/src/ActivityType.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ static constexpr std::array<ActivityTypeName, activityTypeCount + 1> map{{
{"glow_runtime", ActivityType::GLOW_RUNTIME},
{"cuda_profiler_range", ActivityType::CUDA_PROFILER_RANGE},
{"hpu_op", ActivityType::HPU_OP},
{"xpu_runtime", ActivityType::XPU_RUNTIME},
{"ENUM_COUNT", ActivityType::ENUM_COUNT}
}};

Expand Down
4 changes: 4 additions & 0 deletions libkineto/test/ConfigTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,10 @@ TEST(ParseTest, ActivityTypes) {
EXPECT_TRUE(cfg2.parse("ACTIVITY_TYPES = cpu_op"));
EXPECT_EQ(cfg2.selectedActivityTypes(),
std::set<ActivityType>({ActivityType::CPU_OP}));

EXPECT_TRUE(cfg2.parse("ACTIVITY_TYPES = xpu_Runtime"));
EXPECT_EQ(cfg2.selectedActivityTypes(),
std::set<ActivityType>({ActivityType::XPU_RUNTIME}));
}

TEST(ParseTest, SamplePeriod) {
Expand Down

0 comments on commit be3fb3f

Please sign in to comment.