Discuss PTI library Callback API
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
- issue の種類
- 機能追加
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- cpp
調査の方向性
まず、この issue で提案されている PTI Callback API を確認します。これには、そのドメイン、API グループ、コールバックデータ構造、subscribe/enable 関数が含まれます。併せて、すでに進行中の API ID の作業も確認します。完了とは、コールバック API の設計について合意に達することを意味します。この issue では実装ファイルやテストは特定されていません。
索引モデルが issue の本文から書いたものです。
説明
PTI plans to implement Callback functionality. Some work related to API IDs is already in progress.
Please, provide your comments.
PTI Callback API
Overview
PTI Callback API allows a PTI user to register a callback function that is called at the enter and exit of a driver or runtime function call, as well as critical events happens in PTI itself.
To distinguish the APIs to which a user wants to set a callback, PTI introduces PTI Domains, API Groups and API IDs within API Groups. API Groups are to distinguish, for example, between different APIs that could serve as driver: OpenCL and Level-Zero.
Ones API ID for a function is published in a PTI header file - it is constant and will never change.
Critical events are those that occur during profiling and either prevent profiling from continuing or cause significant data loss or corruption. Some of these events may be explicitly reported through return code from PTI functions. But others may occur during profiling and cannot be reported to the user via the return code. This is what the Callback domain PTI_DOMAIN_PTI_CRITICAL_EVENT is made for.
Data structures
typedef enum _pti_callback_domain {
PTI_DOMAIN_INVALID = 0,
PTI_DOMAIN_DRIVER_API = 1,
PTI_DOMAIN_RUNTIME_API = 2,
PTI_DOMAIN_PTI_CRITICAL_EVENT = 3
} pti_callback_domain;
typedef enum _pti_api_group_id {
PTI_API_GROUP_RESERVED = 0,
PTI_API_GROUP_LEVELZERO = 1,
PTI_API_GROUP_OPENCL = 2,
PTI_API_GROUP_SYCL = 3,
} pti_api_group_id;
typedef enum _pti_callback_site {
PTI_SITE_ENTER = 0,
PTI_SITE_EXIT = 1
} pti_callback_site;
typedef struct _pti_apicall_callback_data {
pti_callback_site _site; // ENTER or EXIT
const char* _api_name;
const void* _args; // pointer to the arguments passed to the function,
// in case arguments not provided by PTI - it will be nullptr
const char* _kernel_name; // valid only for DRIVER or RUNTIME APIs related to GPU kernel submission
const void* _return_code; // will be valid only for L0 API EXIT, for others will be nullptr
pti_backend_ctx_t _backend_context_handle; // L0 or OpenCL context
uint32_t _correlation_id; // ID that corresponds to the same call reported by View API records
uint64_t* _local_data; // user data passed between ENTER and EXIT
} pti_apicall_callback_data;
typedef struct _pti_critical_event_callback_data {
pti_result _pti_event;
char* _message;
} pti_critical_event_callback_data;
typedef void (*pti_callback_function)(
void* user_data,
pti_callback_domain domain,
pti_api_group_id group_id, // For Driver domain it might be L0, OpenCL..
uint32_t api_id,
void* cb_data); // depending on the domain it should be type-casted to the pointer to either pti_apicall_callback_data or pti_critical_event_callback_data
Functions
pti_result ptiCallbackSubscribe(
pti_callback_subscriber* subscriber,
pti_callback_function callback,
void* user_data);
pti_result ptiCallbackUnsubscribe( pti_callback_subscriber subscriber);
// Enables/Disables callbacks to all APIs within domain
pti_result ptiCallbackEnableDomain(
uint32_t enable,
pti_callback_subscriber subscriber,
pti_callback_domain domain);
// Enables/Disables callback for the specific functions within domain and api_group
pti_result ptiCallbackEnable(
uint32_t enable,
pti_callback_subscriber subscriber,
pti_api_group_id api_group_id, // one of L0, OpenCL, Sycl
pti_api_id api_id);
- 主要言語
- C++
- スター
- 276
- フォーク
- 74
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
intel/pti-gpu のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 92/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 50/100
-
[unitrace] Do not fetch for 3rd party projects 1) at build stage, 2) if they are already installedオープン
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
似ている issue
-
Remove source files from packaging for deb, zip, etc対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
OpenSpace/OpenSpace#4353 · コメント 1 件 ·
メンテナーはふだん 5 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
justcallmekoko/ESP32Marauder#1656 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
-
Decompiler: convertCharRef() in xml.y overflows its int4 accumulator on long character references対応中かも @kaayzouee が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
NationalSecurityAgency/ghidra#10009 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
mutationpp/Mutationpp#337 ·