Skip to content

View op asserts should use non-fatal input checks #9130

@GregoryComer

Description

@GregoryComer

🐛 Describe the bug

The current implementation of the view operator (et_view.cpp) uses ET_CHECK macros to check input args. This has the effect of unrecoverably crashing the process when input checks fail. We have observed this on an internal app, where a check failure causes a full app crash.

The kernel should use non-fatal ET_KERNEL_CHECK assertions (logging and returning an error code, rather than calling abort), similar to other portable ops. This allows the caller to gracefully handle model execution failures. See https://github.com/pytorch/executorch/pull/2115/files for an example of how other kernels were updated to use ET_KERNEL_CHECK instead of ET_CHECK macros.

Versions

N/A

cc @larryliu0820 @manuelcandales

Metadata

Metadata

Assignees

No one assigned

    Labels

    actionableItems in the backlog waiting for an appropriate impl/fixgood first issueGood for newcomersmodule: kernelsIssues related to kernel libraries and utilities, and code under kernels/triagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions