torch.var_mean and torch.std_mean fail in to_edge: aten.var_mean.correction is not core ATen and has no core decomposition
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 58/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- backend, machine-learning
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
🐛 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).
cc @JacobSzwejbka @angelayi
- Lenguaje dominante
- Python
- Estrellas
- 5.1k
- Forks
- 1.2k
- Merge medio
- 2 d 8 h
- PR fusionados (30 d)
- 610
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de pytorch/executorch
-
Portable remainder kernel: wrong sign for integers and float64 rounded to floatPosiblemente ocupada @JakeStevens la tomó hoy. Abiertobug module: kernels triaged
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
pytorch/executorch#23682 · 2 asignados ·
Los mantenedores suelen responder en 1 día
-
enhancement triaged
Dificultad 2/5 Medio día Aptitud para principiantes 68/100
pytorch/executorch#21640 ·
Los mantenedores suelen responder en 1 día
-
Feedback about ToolsAbiertoinvalid module: doc
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
pytorch/executorch#23706 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Portable floor_divide returns non-whole numbers for floats and wrong values for a zero divisorPosiblemente ocupada @JakeStevens la tomó hoy. Abiertobug module: kernels
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
pytorch/executorch#23684 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
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_lenPosiblemente ocupada @alpharomercoma la tomó hace 2 días. Abiertobug module: extension module: llm triaged
Dificultad 3/5 1-2 días Aptitud para principiantes 20/100
pytorch/executorch#23678 ·
Los mantenedores suelen responder en 1 día
Todos los issues de pytorch/executorch
Issues similares
-
Consolidate the now-identical CLI-native and composed tasks_packages guards (#5945 follow-up)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
spec-kitty/spec-kitty#6112 ·
Los mantenedores suelen responder en 1 día
-
[Bug]: OpenRouter streaming chunks report the requested router name instead of the model OpenRouter servedPosiblemente ocupada @Mrun25 la tomó hoy. Abiertobug llm translation
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
BerriAI/litellm#46095 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
uberdeveloper/fastbt#29 ·
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
andrew-blake/melcloudhome#368 ·
Los mantenedores suelen responder en 1 día
-
lane:discover
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
SPARDiffData/differential-data-collection#33 ·
Los mantenedores suelen responder en 1 día