M post: the history encode relies on a driver conversion fold without a start-up check

オープン
#232 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
15/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cpp, python

調査の方向性

Read #231 first to see the Model L guard this mirrors, then the history-encode block in clean/dx12/kernels/post.hlsl around lines 1127-1132 where the mad(log2(..), kEncK, 0.0f) result feeds cvt3_f16. Pair that with the earlier round-to-odd encode to build the needs=nofold port, add the needs=fold port, and write the start-up self-test that runs both real post shaders over the crafted midpoint frame and compares raw bytes. Add the isa= rules in build_dx12.py last; done when the probe selects a port from real shader output and both sites are guarded.

索引モデルが issue の本文から書いたものです。

説明

Model M's D3D12 post kernels (clean/dx12/kernels/post.hlsl, around lines 1127-1132) write the history texel as
mad(log2(..), kEncK, 0.0f) fed into the driver's round-to-nearest-even matrix conversion (cvt3_f16). The gfx1201
D3D12 compiler folds that into v_fma_mixlo_f16 .., kEncK, 0, which is HIP's own instruction, so today's bytes match HIP.

The exactness depends on that fold. A driver that does not fold would round the FP32 product first and then convert
it: two roundings, one FP16 ulp off wherever the FP32 product lands exactly on an FP16 midpoint. The frame checks would
likely not see it, because synthetic data rarely hits such midpoints.

Model L's post is getting the same guard in #231. M's post should get it too:

  • a needs=fold / needs=nofold pair of post ports, with the previous round-to-odd form as the no-fold fallback;
  • a start-up self-test that runs the REAL fold and no-fold post shaders on one small crafted frame whose history-encode
    inputs sit on FP16 midpoints from both sides, ties, +-0, subnormals and the floor, and compares their raw bytes
    (equal: fold port; different or any error: no-fold port). A separate probe shader is not enough, because the driver
    can compile the real post shader differently;
  • an isa= rule in build_dx12.py on each port that relies on the fold, tied to the actual sites.
主要言語
C++
スター
12
フォーク
2
平均マージ
3時間 10分
マージ済み PR(30日)
171

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

phantoslayer21/wronggpu のほかの issue

phantoslayer21/wronggpu の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。