ml_switcheroo.importers.sass_reader

Importer for NVIDIA SASS Documentation (HTML).

This module parses the official NVIDIA CUDA Binary Utilities documentation (HTML format) to extract instruction set definitions. It targets tables listing Opcodes and Descriptions (e.g., Turing, Ampere sections).

It normalizes assembly mnemonics into the ML-Switcheroo Abstract Standard options where possible (e.g., “FP32 Add” -> “Add”).

Classes

SassHtmlParser

State-machine based HTML parser for extracting SASS Instruction tables.

SassSpecImporter

Facade for importing SASS specifications.

Module Contents

class ml_switcheroo.importers.sass_reader.SassHtmlParser

Bases: html.parser.HTMLParser

State-machine based HTML parser for extracting SASS Instruction tables.

in_table = False
in_tbody = False
in_row = False
in_cell = False
current_row_cells: List[str] = []
extracted_ops: List[Tuple[str, str]] = []
cell_buffer = ''
handle_starttag(tag: str, attrs: List[Tuple[str, str | None]])
handle_endtag(tag: str)
handle_data(data: str)
class ml_switcheroo.importers.sass_reader.SassSpecImporter

Facade for importing SASS specifications.

parse_file(html_path: pathlib.Path) Dict[str, Any]

Parses an HTML file containing SASS documentation.

Parameters:

html_path – Path to the .html file.

Returns:

Dictionary mapping Abstract Operations to SASS implementations.