[exir] operator.pow on a SymInt has no emitter target
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 1-2 dias
- Facilidade para iniciantes
- 25/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Estagnada
- Domínio
- backend, machine-learning
Direção de pesquisa
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.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
🐛 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.
- Linguagem predominante
- Python
- Estrelas
- 5.2k
- Forks
- 1.3k
- Merge médio
- 1d 7h
- PRs com merge (30d)
- 644
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de pytorch/executorch
-
to_edge_transform_and_lower ignores some ops_to_not_decompose requests: multi-output ops, and non-core ops without a decompositionTalvez já em andamento @Eureka-Zhang assumiu há 7 dias. Abertamodule: exir
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
pytorch/executorch#25620 ·
Mantenedores costumam responder em até 1 dia
-
Qualcomm AI Engine Direct - fp16a8w quantization crashes on layer_normTalvez já em andamento @psiddh assumiu há 21 dias. Abertabug module: qnn partner: qualcomm
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100
pytorch/executorch#24434 · 1 responsável ·
Mantenedores costumam responder em até 1 dia
-
enhancement triaged
Dificuldade 2/5 Meio dia Facilidade para iniciantes 68/100
pytorch/executorch#21640 ·
Mantenedores costumam responder em até 1 dia
-
quantize_per_channel and dequantize_per_tensor.tensor abort the process on a float32 scaleTalvez já em andamento @AxelNoun assumiu hoje. Aberta
Dificuldade 3/5 1-2 dias Facilidade para iniciantes 35/100
pytorch/executorch#25873 ·
Mantenedores costumam responder em até 1 dia
-
XNNPACK INT4 linear returns incorrect per-channel outputs and fails groupwise FP16 on Apple M4 MaxTalvez já em andamento Um pull request vinculado a esta issue está aberto ou já foi mesclado. Abertabug module: quantization module: xnnpack
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 43/100
pytorch/executorch#25854 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de pytorch/executorch
Issues semelhantes
-
Container fails to start when GitHub Releases is unavailable: uv run re-downloads the tvl wheelAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
trezor/trezor-user-env#421 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100
-
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 91/100
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
tangentcode/tangentswarm#167 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
Mantenedores costumam responder em até 1 dia