ml_switcheroo.compiler.frontends.sass.analysis

SASS Instruction Analyzer.

This module implements heuristics to extract high-level semantic parameters (like Loop Bounds, Kernel Sizes, etc.) by analyzing the raw SASS instructions AST generated by the parser.

Classes

SassAnalyzer

Analyzes sequences of SASS instructions to reverse-engineer high-level parameters.

Module Contents

class ml_switcheroo.compiler.frontends.sass.analysis.SassAnalyzer[source]

Analyzes sequences of SASS instructions to reverse-engineer high-level parameters.

static analyze_block(kind: str, instructions: List[ml_switcheroo.compiler.frontends.sass.nodes.Instruction]) Dict[str, Any][source]

Extracts metadata from a block of instructions based on the operation kind.

Parameters:
  • kind (str) – The operation type (e.g. “Conv2d”, “Linear”).

  • instructions (List[Instruction]) – The assembly lines inside the block.

Returns:

Extracted parameters (e.g., {“kernel_size”: 3}).

Return type:

Dict[str, Any]