[Bug] `DataflowUseInplaceCalls` produces CUDA TIR that fails scheduling
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
Start with the DataflowUseInplaceCalls pass and the TIR scheduling path that emits the compact-dataflow ScheduleError; the issue does not name source files or tests. Reproduce using the supplied Relax module, comparing compilation before and after the pass with the stated CUDA target and pipelines. Done when the transformed module compiles while the existing reproduction still covers the failure.
索引モデルが issue の本文から書いたものです。
説明
Expected behavior
Applying relax.transform.DataflowUseInplaceCalls to the valid Relax function below should preserve a compilable program. The untransformed module compiles for CUDA with the same target and pipeline.
Actual behavior
The untransformed module compiles. After DataflowUseInplaceCalls, compilation raises ScheduleError:
The queried subtree root tirx.For#0 in SRef tree does not have compact dataflow,
because its child block tirx.SBlock#1 on SRef tree is neither a local complete
block nor a local reduction block.
...
No overlap between the buffers the block reads and writes
The same failure reproduced in two fresh processes. Batch 15 also produced the same diagnostic from several distinct parent programs; the standalone example below is one confirmed representative.
Environment
- TVM
0.26.dev0+source.8f328e8 - Linux
6.8.0-52-generic, x86_64 - CUDA target; Python environment
/opt/conda/envs/tvm-env
Steps to reproduce
import os
import sys
os.environ.setdefault("CUDA_PATH", sys.prefix)
os.environ.setdefault("CUDA_HOME", sys.prefix)
os.environ["PATH"] = sys.prefix + "/bin:" + os.environ.get("PATH", "")
import tvm
from tvm import relax
from tvm.script import ir as I, relax as R, tirx as T
@I.ir_module
class Module:
@R.function
def main(x: R.Tensor((1, 4, 1), dtype="float32")) -> R.Tensor((4, 2), dtype="float32"):
with R.dataflow():
lv: R.Tensor((4, 1), dtype="float32") = R.squeeze(x, axis=[0])
lv1: R.Tensor((4, 1), dtype="float32") = R.squeeze(x, axis=[0])
lv2: R.Tensor((4, 1), dtype="float32") = R.multiply(lv, lv1)
lv3: R.Tensor((4, 2), dtype="float32") = R.concat((lv2, lv1), axis=1)
lv1_1: R.Tensor((4, 2), dtype="float32") = R.clip(lv3, T.float64(-0.25), T.float64(0.25))
lv2_1: R.Tensor((4, 2), dtype="float32") = R.clip(lv3, T.float64(-0.25), T.float64(2.0))
lv3_1: R.Tensor((4, 2), dtype="float32") = R.multiply(lv2_1, R.const(0.5, "float32"))
lv4: R.Tensor((4, 2), dtype="float32") = R.subtract(lv1_1, lv3_1)
lv5: R.Tensor((4, 2), dtype="float32") = R.exp(lv4)
lv6: R.Tensor((4, 2), dtype="float32") = R.clip(lv3, T.float64(-0.25), T.float64(0.25))
lv7: R.Tensor((4, 2), dtype="float32") = R.clip(lv5, T.float64(-0.25), T.float64(2.0))
lv8: R.Tensor((4, 2), dtype="float32") = R.multiply(lv7, R.const(0.5, "float32"))
lv9: R.Tensor((4, 2), dtype="float32") = R.subtract(lv6, lv8)
gv: R.Tensor((4, 2), dtype="float32") = R.exp(lv9)
R.output(gv)
return gv
before = Module
after = relax.transform.DataflowUseInplaceCalls()(before)
for label, mod in [("OFF", before), ("ON", after)]:
try:
with tvm.target.Target("cuda"), tvm.transform.PassContext(
opt_level=0, disabled_pass=["DataflowInsertInPlaceCalls"]
):
tvm.compile(mod, target="cuda", relax_pipeline="default", tir_pipeline="default")
print(label, "compiled")
except Exception as exc:
print(label, type(exc).__name__, str(exc)[-1000:])
Observed: OFF compiled, followed by ON ScheduleError with the compact-dataflow diagnostic above.
Triage
- needs-triage
- 主要言語
- Python
- スター
- 13.9k
- フォーク
- 4.1k
- 平均マージ
- 4日 22時間
- マージ済み PR(30日)
- 22
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/tvm のほかの issue
-
[Bug] [Relax] `relax.op.unique(return_inverse=True)` returns an input-shaped inverse for N-D input when `axis` is None対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 3 日以内に返信
-
[Bug][TOPI] `topi.scanop` (`cumsum` / `cumprod`) performs out-of-bounds write/read on empty tensorsオープンneeds-triage type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 3 日以内に返信
-
[Bug] [Relax] take_backward does not normalize negative axis causing heap OOB write and wrong gradients対応中かも @pierceluu10 が 4 日前に担当しました。 オープンneeds-triage type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 3 日以内に返信
-
[Bug][Relax][ONNX] NonZero returns the wrong output shape for scalar inputs対応中かも @tandede が 9 日前に担当しました。 オープンneeds-triage type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 3 日以内に返信
-
needs-triage type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 3 日以内に返信
似ている issue
-
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
web-push-libs/pywebpush#216 · コメント 1 件 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
AgriciDaniel/claude-seo#572 ·
メンテナーはふだん 5 日以内に返信
-
area:print-dispatch
難易度 2/5 1〜3時間 初心者へのやさしさ 92/100
メンテナーはふだん 1 日以内に返信
-
area: docs domain: technical-writing good first issue type: documentation
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
Deepak3699/Ai_Mentor#919 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信