ml_switcheroo.compiler.frontends.rdna.analysis

RDNA Instruction Analyzer.

This module implements heuristics to extract high-level semantic parameters (like Loop Bounds, Kernel Sizes) by analyzing the raw RDNA instructions within a basic block.

It enables the “Lifting” process to recover parameters like kernel_size=3 from s_cmp_lt_i32 sX, 3 instructions inside a loop structure.

Classes

RdnaAnalyzer

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

Module Contents

class ml_switcheroo.compiler.frontends.rdna.analysis.RdnaAnalyzer[source]

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

static analyze_block(kind: str, instructions: List[ml_switcheroo.compiler.frontends.rdna.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., {“k”: 3}).

Return type:

Dict[str, Any]