torch.var_mean and torch.std_mean fail in to_edge: aten.var_mean.correction is not core ATen and has no core decomposition
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 58/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Lĩnh vực
- backend, machine-learning
Hướng nghiên cứu
Start by reading _default_decomposition_table and the handling of core_aten_decompositions() in ExecuTorch’s decomposition path; the issue identifies the missing var_mean.correction decomposition. Check how existing decompositions map operators to lowerable ATen ops, then verify torch.var_mean and torch.std_mean on the portable and XNNPACK paths, including the dimensions and correction cases described. Done means both export through to_edge and match eager outputs.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
🐛 Describe the bug
A model that calls torch.var_mean or torch.std_mean exports fine with torch.export, but to_edge rejects it. This happens on both the portable path and with the XNNPACK partitioner:
import torch
from executorch.exir import to_edge
class M(torch.nn.Module):
def forward(self, x):
return torch.var_mean(x, dim=1, correction=0)
ep = torch.export.export(M(), (torch.randn(3, 7),))
to_edge(ep).to_executorch()
torch._export.verifier.SpecViolationError:
Operator torch._ops.aten.var_mean.correction is not in Core ATen opset (https://pytorch.org/docs/stable/torch.compiler_ir.html#core-aten-ir)."
torch.std_mean(x, dim=1) fails the same way.
torch.var_mean exports to aten.var_mean.correction. aten.var_mean.dim and aten.std_mean.correction also decompose to it. It isn't a core ATen op, and core_aten_decompositions() has no entry for it, so run_decompositions() leaves it in the graph. Its only registered decomposition is the torch._refs one, which produces prims ops. So adding it to additional_decomp_ops in _default_decomposition_table (as for linalg_vector_norm) only moves the failure to RuntimeError: Missing out variants: {'prims::var', 'prims::sum', 'prims::div'}.
Decomposing it to aten.var.correction and aten.mean.dim in _default_decomposition_table makes both ops lower and run on the portable and XNNPACK paths, with outputs matching eager, for dim=None, keepdim=True, a default and an explicit correction, and torch.std_mean(..., unbiased=False). I'll open a PR with that.
Versions
executorch 1.5.1 (_default_decomposition_table is the same on main at f2575be), torch 2.14.1+cpu, Python 3.12, Linux x86_64 (WSL2).
- Ngôn ngữ chính
- Python
- Star
- 5.1k
- Fork
- 1.2k
- Merge trung bình
- 2 ngày 9 giờ
- Pull request đã merge (30 ngày)
- 632
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
-
Portable remainder kernel: wrong sign for integers and float64 rounded to floatCó thể đã có người làm @usmanmateen đã nhận 1 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
pytorch/executorch#23682 ·
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
-
Portable floor_divide returns non-whole numbers for floats and wrong values for a zero divisorCó thể đã có người làm @usmanmateen đã nhận 1 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
pytorch/executorch#23684 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Prompts of max_seq_len tokens fail to prefill: export_llm bounds the KV-cache token input at max_seq_len - 1 but publishes get_max_seq_len = max_seq_lenCó thể đã có người làm @alpharomercoma đã nhận 1 ngày trước. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 20/100
pytorch/executorch#23678 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[v1.6.0] Release Schedule and TrackerCó thể đã có người làm @JacobSzwejbka đã nhận 3 ngày trước. Đang mở
pytorch/executorch#23608 · 1 người được giao ·
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ự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
vllm-project/vllm#61131 ·
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 78/100
kubernetes-client/python#2735 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
desktop help wanted test
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Broken links found in docsĐang mởdocs pydanty:is-working
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
pydantic/pydantic-ai#10113 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Tutorial unit test leaks sample data into tutorial doctestCó thể đã có người làm @Gambit-Checkmate đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100