ml_switcheroo.compiler.backend¶

Compiler Backend Protocol.

Defines the abstract interface for backends that consume the Logical Graph IR and emit target specific code (e.g. RDNA Assembly, SASS, or High-Level Python).

Classes¶

CompilerBackend

Abstract base class for compilation backends.

Module Contents¶

class ml_switcheroo.compiler.backend.CompilerBackend[source]¶

Bases: abc.ABC

Abstract base class for compilation backends.

abstractmethod compile(graph: ml_switcheroo.compiler.ir.LogicalGraph) → Any[source]¶

Compiles the Logical Intermediate Representation (IR) into a target artifact.

Parameters:

graph (LogicalGraph) – The intermediate representation of the model structure.

Returns:

The compiled output (e.g., source code string, binary buffer, or AST).

Return type:

Any