Composite ops API reference¶
Use these module subclasses (and ATen-derived ops) to preserve an operation’s boundary through Core AI conversion as named composite ops the compiler can recognize and optimize.
Overview¶
Public import:
from coreai_torch.composite_ops import GatherMM, GatedDeltaUpdate, RMSNormImpl, RoPE, SDPA
coreai-torch provides composite ops in two categories:
Module-class composite ops —
nn.Modulesubclasses you build into your model and externalize with anExternalizeSpec. Pass them (orExternalizeSpecobjects) to theexternalize_modulesparameter ofadd_pytorch_module()to trigger externalization. For a tutorial walkthrough, see Composite Ops Guide.ATen-derived composite ops — recognized automatically from the ATen nodes in your
ExportedProgramduring conversion. These have no correspondingnn.Modulewrapper; use the standard PyTorch APIs (e.g.,torch.nn.BatchNorm2d,torch.nn.functional.pixel_shuffle) and Core AI preserves them as composite ops.
Notices¶
PyTorch is a trademark of Meta Platforms, Inc. Hugging Face is a trademark of Hugging Face, Inc.