[exir] operator.pow on a SymInt has no emitter target
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 25/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Lĩnh vực
- backend, machine-learning
Hướng nghiên cứu
Start with executorch/exir/passes/replace_edge_with_backend_pass.py and trace how EdgeToBackendOpsPass handles symbolic operators and propagates meta["val"]. The issue describes rewriting integer powers as multiplication chains and includes a minimal reproducer; check for existing tests covering symbolic power lowering. Done means the reproducer exports successfully and tests cover the lowering. A linked pull request is already open.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
🐛 Describe the bug
When lowering an exported program with dynamic shapes where a SymInt is raised to an integer power (such as x.shape[0] ** 2, used in SeamlessM4T's relative positional bias calculation), to_executorch() fails with:
executorch.exir.error.InternalError: Failed with error: invalid target for call_function <built-in function pow>
While executing %pow_1 : [num_users=1] = call_function[target=operator.pow](args = (%sym_size, 2), kwargs = {})
Because executorch_prim does not have a pow kernel, EdgeToBackendOpsPass leaves operator.pow untouched, and _Emitter.call_function fails on the unregistered operator.
This bug breaks export of real models such as Hugging Face's SeamlessM4T, tracked in huggingface/transformers#51303 (Item 1).
Versions / Environment
executorch: 1.6.0 / main
PyTorch: 2.15.0+cpu
Python: 3.12 / 3.11
OS: Windows 11 / Linux
Minimal Reproducer
import torch
from executorch.exir import to_edge_transform_and_lower
class M(torch.nn.Module):
def forward(self, x):
return x.new_zeros(x.shape[0] ** 2)
ep = torch.export.export(M(), (torch.randn(4),), dynamic_shapes=({0: torch.export.Dim.AUTO},))
to_edge_transform_and_lower(ep).to_executorch()
Proposed Fix & Investigation
In EdgeToBackendOpsPass (executorch/exir/passes/replace_edge_with_backend_pass.py):
Rewrite operator.pow(base, exp) for integer exponents ($n \ge 1$) into a multiplication chain using _PYTHON_SYM_OPS_TO_EXECUTORCH_SYM_OPS[operator.mul], properly propagating symbolic meta["val"] across intermediate nodes. I have verified this fix and will submit a pull request with unit test coverage.
- Ngôn ngữ chính
- Python
- Star
- 5.2k
- Fork
- 1.3k
- Merge trung bình
- 1 ngày 7 giờ
- Pull request đã merge (30 ngày)
- 644
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của pytorch/executorch
-
to_edge_transform_and_lower ignores some ops_to_not_decompose requests: multi-output ops, and non-core ops without a decompositionCó thể đã có người làm @Eureka-Zhang đã nhận 7 ngày trước. Đang mởmodule: exir
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
pytorch/executorch#25620 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Qualcomm AI Engine Direct - fp16a8w quantization crashes on layer_normCó thể đã có người làm @psiddh đã nhận 21 ngày trước. Đang mởbug module: qnn partner: qualcomm
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
pytorch/executorch#24434 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement triaged
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 68/100
pytorch/executorch#21640 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
quantize_per_channel and dequantize_per_tensor.tensor abort the process on a float32 scaleCó thể đã có người làm @AxelNoun đã nhận hôm nay. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
pytorch/executorch#25873 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
XNNPACK INT4 linear returns incorrect per-channel outputs and fails groupwise FP16 on Apple M4 MaxCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởbug module: quantization module: xnnpack
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 43/100
pytorch/executorch#25854 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của pytorch/executorch
Issue tương tự
-
Container fails to start when GitHub Releases is unavailable: uv run re-downloads the tvl wheelĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
trezor/trezor-user-env#421 ·
-
Support new version of pythonĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 91/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
tangentcode/tangentswarm#167 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Maintainer thường phản hồi trong vòng 1 ngày