unitrace reports work-group size {0; 0; 0} for OpenMP offload kernels
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 70/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- cpp
- 領域
- devtools, performance
調査の方向性
Start in tools/unitrace/src/levelzero/ze_collector.h at the zeKernelSetGroupSize handler and the launch-call handler shown in the issue. Trace how launch parameters are recorded, then build and run the provided OpenMP offload reproducer with unitrace. Done when the reported group size is {64; 1; 1} rather than {0; 0; 0}, and existing launch handling still works.
索引モデルが issue の本文から書いたものです。
説明
unitrace reports the work-group size of every OpenMP offload kernel as {0; 0; 0}. The OpenMP runtime (libomptarget, Level Zero plugin) launches kernels with zeCommandListAppendLaunchKernelWithArguments and passes the group size in its pGroupSizes argument. It does not call zeKernelSetGroupSize. unitrace records the group size only in its handler of zeKernelSetGroupSize, so for these kernels the size stays 0.
Reproducer, built with icpx -fiopenmp -fopenmp-targets=spir64 repro.cpp -o repro:
#include <cstdio>
int main() {
const int N = 1 << 20;
static float a[N];
#pragma omp target teams distribute parallel for map(from : a[0 : N])
for (int i = 0; i < N; ++i)
a[i] = 2.0f * i;
printf("%f\n", a[N - 1]);
return 0;
}
unitrace -d -v ./repro reports:
"__omp_offloading_821_3df0002__Z4main_l6[SIMD32 {16384; 1; 1} {0; 0; 0}]", 1, 9760, ...
With the change below the same run reports {16384; 1; 1} {64; 1; 1}. The change passes the group size of the launch call to the existing zeKernelSetGroupSize handler:
--- a/tools/unitrace/src/levelzero/ze_collector.h
+++ b/tools/unitrace/src/levelzero/ze_collector.h
@@ -4908,6 +4908,12 @@ class ZeCollector {
ze_instance_data.instrument_ = false;
ze_instance_data.query_ = nullptr;
ZeCollector* collector = reinterpret_cast<ZeCollector*>(global_data);
+ // This launch call passes the group size instead of zeKernelSetGroupSize.
+ if (params->pgroupSizes != nullptr) {
+ ze_group_size_t gs = *(params->pgroupSizes);
+ ze_kernel_set_group_size_params_t p{params->phKernel, &gs.groupSizeX, &gs.groupSizeY, &gs.groupSizeZ};
+ OnExitKernelSetGroupSize(&p, ZE_RESULT_SUCCESS, global_data, instance_data);
+ }
if (collector->ShouldCaptureAppend(*(params->phCommandList),
*(params->pnumWaitEvents),
*(params->pphWaitEvents))) {
- 主要言語
- C++
- スター
- 278
- フォーク
- 75
- 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日 初心者へのやさしさ 48/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 20/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 50/100
似ている issue
-
ai_p2
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
ClickHouse/ClickHouse#130006 ·
メンテナーはふだん 1 日以内に返信
-
DepotMaintain: EN longer string moves the hint popup buttons out of reach // WpfGUI English Languageオープンclient: WpfGui module: depot question
難易度 2/5 1〜3時間 初心者へのやさしさ 64/100
MaaAssistantArknights/MaaAssistantArknights#19169 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
area: certificates bug outdated-version
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
RafaelNGP/xbox-cloud-gaming-ps5#381 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
apache/iceberg-cpp#1103 ·
メンテナーはふだん 2 日以内に返信