apple / coremltools

Core ML tools contain supporting tools for Core ML model conversion, editing, and validation.
https://coremltools.readme.io
BSD 3-Clause "New" or "Revised" License
4.33k stars 627 forks source link

Potentially wrong number of argument in cumsum op #2303

Open msluszniak opened 1 month ago

msluszniak commented 1 month ago

I discovered that the expected number of arguments to cumsum op in coremltools might be wrong while exporting PyTorch module to *.pte file (executorch). See https://github.com/apple/coremltools/blob/8b7048ebc034a8b40e48c39df3f33ba9f60feda9/coremltools/converters/mil/frontend/torch/ops.py#L931 Number of arguments is set to 3 while only two are used. Indeed, in my export, I got an error that cumsum op expects 3 arguments while only 2 were provided. Changing this value to 2 fixed suppressed the error.

To Reproduce

I'm not able to reproduce the error with small code sample.

System environment (please complete the following information):

Additional context

Discovered this while exporting Pytorch model to executorch with CoreML backend.

jakesabathia2 commented 1 month ago

Right now the torch version coremltools officially supports is 2.3.0 (https://github.com/apple/coremltools/blob/main/coremltools/_deps/__init__.py#L156), while your enviroment got 2.5.0.