[Feature][Relax][ONNX] Support RotaryEmbedding (RoPE) operator in Relax ONNX frontend
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 58/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
Start in python/tvm/relax/frontend/onnx/onnx_frontend.py and inspect how the Relax ONNX frontend maps operators to converters. Check the ONNX RotaryEmbedding operator specification and cover both standard ONNX and com.microsoft forms, including interleaved and partial rotation. Add converter tests for the described input layouts and attributes; done means importing these operators produces the expected output with pass-through dimensions preserved.
索引モデルが issue の本文から書いたものです。
説明
Feature Description
Support the ONNX RotaryEmbedding (Rotary Position Embedding / RoPE) operator in the Apache TVM Relax ONNX frontend (python/tvm/relax/frontend/onnx/onnx_frontend.py).
Motivation
Rotary Position Embedding (RoPE) has become the de facto standard positional encoding technique for modern Large Language Models (LLMs), including LLaMA (1, 2, 3), Mistral, Gemma, Qwen 2/2.5, and DeepSeek.
When exporting modern LLMs from PyTorch / Hugging Face Transformers to ONNX, attention modules frequently emit the RotaryEmbedding operator (both in standard ONNX opset 23+ and the common com.microsoft domain). Attempting to import these models into TVM Relax currently fails with:
NotImplementedError: The following operators are not supported: ['RotaryEmbedding']
Adding native converter support for RotaryEmbedding in the Relax ONNX frontend will enable direct compilation of state-of-the-art generative LLMs into Relax IR without requiring manual graph surgery or decomposition passes.
Operator Specification (ONNX Opset 23+ / com.microsoft)
- Inputs:
X: Input tensor of shape(batch_size, sequence_length, num_heads, head_size)or(batch_size, num_heads, sequence_length, head_size).pos_ids: 1D or 2D tensor specifying token position IDs for each sequence.cos_cache: Precomputed cosine frequency cache matrix.sin_cache: Precomputed sine frequency cache matrix.
- Attributes:
interleaved: int (default 0) - whether real and imaginary components are interleaved (e.g.[-x2, x1, -x4, x3]) or separated along half the head dimension (e.g.[-x_half2, x_half1]).num_heads: int (optional) - number of attention heads.rotary_embedding_dim: int (optional) - dimension to rotate (can be smaller thanhead_sizefor partial rotary embeddings).
- Outputs:
Y: Output tensor with the same shape and dtype asXwith rotary embeddings applied.
Expected Behavior
The Relax ONNX frontend should implement RotaryEmbedding by slicing the rotary dimension, rotating components according to the interleaved flag, multiplying with corresponding cos and sin tables, and concatenating any pass-through non-rotated dimensions.
- 主要言語
- 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 日以内に返信