core.ops._compat#

Deprecated import-path forwarding for modules that moved into megatron.core.ops.

A forwarder module is two lines::

from megatron.core.ops._compat import deprecated_module
__getattr__, __dir__ = deprecated_module(__name__, "megatron.core.ops.ssm.mamba2.mixer")

It resolves every attribute lazily through PEP 562 module __getattr__, so importing the old path does not import the new module (or its optional kernel dependencies) until a name is actually used. from old import *, private names, and pickles that recorded the old __module__ all keep working, and every object is the canonical one – no copies.

The forwarder emits a DeprecationWarning once per process at import. It never adds an import hook or alias registry; it is a plain module that can be deleted on the removal date.

Module Contents#

Functions#

deprecated_module

Return (__getattr__, __dir__) for a forwarder at old_name.

Data#

API#

core.ops._compat.REMOVAL_VERSION#

‘0.22’

core.ops._compat.deprecated_module(
old_name: str,
*targets: str,
removal_version: str = REMOVAL_VERSION,
) → tuple[Callable[[str], object], Callable[[], list[str]]]#

Return (__getattr__, __dir__) for a forwarder at old_name.

targets are tried in order, so a module that was split during the move can list each new home. The first target is the documented replacement in the warning.