[Bug] InferLayoutStack does not handle negative axis
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
調査の方向性
Start at src/relax/op/tensor/manipulate.cc around line 1787, where InferLayoutStack handles the axis, and reproduce the failure with the provided R.stack(..., axis=-1) example followed by ConvertLayout({}). Trace how the axis is validated and used to insert into layout_str; done means this negative-axis case no longer crashes and the relevant tests pass.
索引モデルが issue の本文から書いたものです。
説明
https://github.com/apache/tvm/blob/main/src/relax/op/tensor/manipulate.cc#L1787 trys to convert axis to size_t and insert a character at such position to layout_str. However as described by https://tvm.apache.org/docs/reference/api/python/relax/op.html#tvm.relax.op.stack, the axis can be negative. Program will crash if the axis is negative.
C++ does check whether the position is valid, and throws errors like tvm.error.InternalError: basic_string::replace: __pos (which is 18446744073709551615) > this->size() (which is 2)
Steps to reproduce
from tvm.script import ir as I
from tvm.script import relax as R
@I.ir_module
class Module:
@R.function
def main(inp_0: R.Tensor((2, 3), dtype="float32")) -> R.Tuple(R.Tensor((2, 3, 2), dtype="float32")):
with R.dataflow():
lv: R.Tensor((2, 3, 2), dtype="float32") = R.stack((inp_0, inp_0), axis=-1)
gv: R.Tuple(R.Tensor((2, 3, 2), dtype="float32")) = (lv,)
R.output(gv)
return gv
import tvm
tvm.relax.transform.ConvertLayout({})(Module)
- 主要言語
- Python
- スター
- 13.9k
- フォーク
- 4k
- 平均マージ
- 8時間 2分
- マージ済み PR(30日)
- 180
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/tvm のほかの issue
-
needs-triage type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
[Bug] [Relax][ONNX] OneHot does not convert floating-point depth to int64対応中かも @tandede が 1 日前に担当しました。 オープンneeds-triage type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
needs-triage type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
needs-triage type: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
[Bug][Relax] ReorderTakeAfterMatmul fails on vector dot products対応中かも @hiyufan が 11 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
FinanceFlash/unvibecode#509 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
FAIRmat-NFDI/nomad-distro-dev#161 ·
-
bug v2
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
modelcontextprotocol/python-sdk#3821 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug severity:low
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 2 日以内に返信
-
Log-odds calibration uses upper middle score instead of median for even candidate sets対応中かも @flysheep-ai が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信