ml_switcheroo.importers.sass_reader =================================== .. py:module:: ml_switcheroo.importers.sass_reader .. autoapi-nested-parse:: 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 ------- .. autoapisummary:: ml_switcheroo.importers.sass_reader.SassHtmlParser ml_switcheroo.importers.sass_reader.SassSpecImporter Module Contents --------------- .. py:class:: SassHtmlParser Bases: :py:obj:`html.parser.HTMLParser` State-machine based HTML parser for extracting SASS Instruction tables. .. py:attribute:: in_table :value: False .. py:attribute:: in_tbody :value: False .. py:attribute:: in_row :value: False .. py:attribute:: in_cell :value: False .. py:attribute:: current_row_cells :type: List[str] :value: [] .. py:attribute:: extracted_ops :type: List[Tuple[str, str]] :value: [] .. py:attribute:: cell_buffer :value: '' .. py:method:: handle_starttag(tag: str, attrs: List[Tuple[str, Optional[str]]]) .. py:method:: handle_endtag(tag: str) .. py:method:: handle_data(data: str) .. py:class:: SassSpecImporter Facade for importing SASS specifications. .. py:method:: parse_file(html_path: pathlib.Path) -> Dict[str, Any] Parses an HTML file containing SASS documentation. :param html_path: Path to the .html file. :returns: Dictionary mapping Abstract Operations to SASS implementations.