ml_switcheroo.frameworks.stablehlo¶

StableHLO Framework Adapter.

Provides metadata and hooks for the MLIR/StableHLO stack. This adapter acts as a metadata container for the Compiler Registry, identifying StableHLO as a target language and providing static definitions.

Classes¶

StableHloAdapter

Adapter for StableHLO.

Module Contents¶

class ml_switcheroo.frameworks.stablehlo.StableHloAdapter[source]¶

Bases: ml_switcheroo.frameworks.base.FrameworkAdapter

Adapter for StableHLO.

display_name: str = 'StableHLO (MLIR)'¶
inherits_from: str | None = None¶
ui_priority: int = 95¶
property search_modules: List[str]¶
property unsafe_submodules: Set[str]¶
property import_alias: Tuple[str, str]¶
property import_namespaces: Dict[str, ml_switcheroo.frameworks.base.ImportConfig]¶
property discovery_heuristics: Dict[str, List[str]]¶
property test_config: Dict[str, str]¶
property harness_imports: List[str]¶
get_harness_init_code() → str[source]¶
get_to_numpy_code() → str[source]¶
property supported_tiers: List[ml_switcheroo.enums.SemanticTier]¶
property declared_magic_args: List[str]¶
property structural_traits: ml_switcheroo.semantics.schema.StructuralTraits¶
property plugin_traits: ml_switcheroo.semantics.schema.PluginTraits¶
property definitions: Dict[str, ml_switcheroo.frameworks.base.StandardMap]¶
property specifications: Dict[str, ml_switcheroo.semantics.schema.OperationDef]¶
property rng_seed_methods: List[str]¶
collect_api(category: ml_switcheroo.frameworks.base.StandardCategory) → List[ml_switcheroo.core.ghost.GhostRef][source]¶
get_device_syntax(device_type: str, device_index: str | None = None) → str[source]¶
get_device_check_syntax() → str[source]¶
get_rng_split_syntax(rng_var: str, key_var: str) → str[source]¶
get_serialization_imports() → List[str][source]¶
get_serialization_syntax(op: str, file_arg: str, object_arg: str | None = None) → str[source]¶
get_weight_conversion_imports() → List[str][source]¶
get_weight_load_code(path_var: str) → str[source]¶
get_tensor_to_numpy_expr(tensor_var: str) → str[source]¶
get_weight_save_code(state_var: str, path_var: str) → str[source]¶
apply_wiring(snapshot: Dict[str, Any]) → None[source]¶
get_doc_url(api_name: str) → str | None[source]¶
convert(data: Any) → Any[source]¶
get_tiered_examples() → Dict[str, str][source]¶