Skip to content

Commit 3dccdc2

Browse files
mcremon-metafacebook-github-bot
authored andcommitted
Migrate check_op_args.h validations to meta kernels and remove it (#19207)
Summary: Move operator argument validation from runtime C++ checks (check_op_args.h) to AOT meta kernels (ops_registrations.py), enabling compile-time error detection and reducing on-device binary size. - Delete check_op_args.h (~3,244 lines) and check_macros.h (~175 lines) - Add torch._check() validation to ~50 meta kernels in ops_registrations.py covering dtype, dimension, shape, and scalar parameter constraints - Inline the 4 data-dependent runtime checks (division-by-zero, attention_mask bounds) directly into kernel implementations across generic, HiFi, and G3 backends - Remove codegen wrapper generation from codegen.py (generate_wrapper_code, insert_runtime_context, etc.) since checks no longer need wrapper functions - Update ops.bzl to remove wrapper.cpp references and wrapper library creation - Update targets.bzl to remove deleted header references Reviewed By: abeakkas Differential Revision: D102624163
1 parent 80997fd commit 3dccdc2

3 files changed

Lines changed: 153 additions & 0 deletions

File tree

0 commit comments

Comments
 (0)