[exir] operator.pow on a SymInt has no emitter target
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 25/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Estancado
- Área
- backend, machine-learning
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
🐛 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.
- Lenguaje dominante
- Python
- Estrellas
- 5.2k
- Forks
- 1.3k
- Merge medio
- 1 d 7 h
- PR fusionados (30 d)
- 644
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
-
to_edge_transform_and_lower ignores some ops_to_not_decompose requests: multi-output ops, and non-core ops without a decompositionPosiblemente ocupada @Eureka-Zhang la tomó hace 7 días. Abiertomodule: exir
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
pytorch/executorch#25620 ·
Los mantenedores suelen responder en 1 día
-
Qualcomm AI Engine Direct - fp16a8w quantization crashes on layer_normPosiblemente ocupada @psiddh la tomó hace 21 días. Abiertobug module: qnn partner: qualcomm
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
pytorch/executorch#24434 · 1 asignado ·
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
-
quantize_per_channel and dequantize_per_tensor.tensor abort the process on a float32 scalePosiblemente ocupada @AxelNoun la tomó hoy. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 35/100
pytorch/executorch#25873 ·
Los mantenedores suelen responder en 1 día
-
XNNPACK INT4 linear returns incorrect per-channel outputs and fails groupwise FP16 on Apple M4 MaxPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertobug module: quantization module: xnnpack
Dificultad 4/5 3-5 días Aptitud para principiantes 43/100
pytorch/executorch#25854 ·
Los mantenedores suelen responder en 1 día
Todos los issues de pytorch/executorch
Issues similares
-
Container fails to start when GitHub Releases is unavailable: uv run re-downloads the tvl wheelAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
trezor/trezor-user-env#421 ·
-
Support new version of pythonAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 91/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
tangentcode/tangentswarm#167 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día