No portable kernel or core-ATen decomposition for cummax / cummin

未關閉
#25,778 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
1-2 天
新手友好度
55/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
python, pytorch

研究方向

Start by tracing how ExecuTorch handles Core ATen decompositions and portable kernels for aten.cummax.default; the issue does not name specific source files or tests. Reproduce the failure with the minimal torch.export.export example and to_edge_transform_and_lower. Done means export succeeds and produces a .pte through a supported decomposition or portable kernel.

由索引模型根據 Issue 內容生成。

描述

This is item 4 of the tracker for ExecuTorch export bugs hit by 🤗 Transformers models (Grounding DINO, MM Grounding DINO, ESMFold2, Qwen3-Omni-MoE):
https://github.com/huggingface/transformers/issues/51303

🐛 bug description

Exporting a model that uses torch.cummax fails in to_edge_transform_and_lower, because aten.cummax.default is not in the Core ATen opset and has no decomposition or portable kernel.

Minimal repro (no transformers needed):

import torch
from executorch.exir import to_edge_transform_and_lower


class M(torch.nn.Module):
    def forward(self, x):
        return torch.cummax(x, dim=-1).values


ep = torch.export.export(M(), (torch.randn(1, 2, 6, 7),))
to_edge_transform_and_lower(ep).to_executorch()

Observed error:

torch._export.verifier.SpecViolationError: 
Operator torch._ops.aten.cummax.default is not in Core ATen opset (https://pytorch.org/docs/stable/torch.compiler_ir.html#core-aten-ir)."
There are a few things to try:
1. You can proceed with `to_edge(compile_config=EdgeCompileConfig(_core_aten_ops_exception_list=[torch.ops.aten.cummax.default]))`.
   Please make sure that the backend(s) you are planning to lower to is able to handle aten.cummax.default, or you have a corresponding kernel linked to your runtime.
2. Sometimes inference and training gives slightly different op set. Try adding `with torch.no_grad():` context manager if you are export for inference only.
3. If the error persists after 2, this is likely caused by torch.export() + core ATen decomposition producing unexpected operators for your model.
   If you believe this operator should be included into core ATen opset, please create an issue in https://github.com/pytorch/pytorch/issues and add `module: core aten` tag.

Expected: the export succeeds and produces a .pte (e.g. via a decomposition into supported ops, or a portable kernel for cummax).

Versions
PyTorch version: 2.15.0
Is debug build: False
CUDA used to build PyTorch: None
ROCm SDK used to build PyTorch: N/A
HIP used to build PyTorch: N/A

OS: macOS 26.6.2 (arm64)
GCC version: Could not collect
Clang version: 21.0.0 (clang-2100.4.1.1)
CMake version: version 3.31.5
Libc version: N/A

Python version: 3.15.2 (main, Oct 25 2026, 16:57:51) [Clang 21.0.0 (clang-2100.3.34.2)] (64-bit runtime)
Python platform: macOS-26.6.2-arm64-arm-64bit-Mach-O
Is CUDA available: False
CUDA runtime version: No CUDA
CUDA_MODULE_LOADING set to: N/A
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA
Is XPU available: False
HIP runtime version: N/A
MIOpen runtime version: N/A
Is XNNPACK available: False
Caching allocator config: N/A

CPU:
Apple M1

Versions of relevant libraries:
[pip3] executorch==1.6.0
[pip3] numpy==2.5.5
[pip3] pytorch_tokenizers==1.6.0
[pip3] torch==2.15.0
[pip3] torchao==0.18.0
[conda] Could not collect
主要語言
Python
星號
5.2k
分支
1.3k
平均合併
1 天 7 小時
30 天內合併 PR
644

環境準備

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

pytorch/executorch 的其他 Issue

查看 pytorch/executorch 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。