Skip to content
| Marketplace
Sign in
Visual Studio Code>Programming Languages>HLO PrettierNew to Visual Studio Code? Get it now.
HLO Prettier

HLO Prettier

Onion Kim

|
6 installs
| (0) | Free
Syntax highlighting and configurable document formatting for XLA HLO text files.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

HLO Prettier

Readable XLA HLO, right inside Visual Studio Code.

HLO Prettier combines theme-friendly syntax highlighting with configurable document formatting for .hlo files and common XLA/JAX text dumps.

XLA is an open-source compiler that optimizes machine learning models for CPUs, GPUs, and other accelerators. HLO is its internal representation, progressively optimized and transformed by HLO passes.

HLO syntax highlighting

Highlights

  • Highlights modules, computations, shapes, primitive types, identifiers, attributes, literals, strings, and comments.
  • Formats indentation, horizontal spacing, instruction attributes, and spacing between computations.
  • Supports Format Document, format on save, spaces, and tabs.
  • Preserves strings, comments, and metadata that you choose not to format.
  • Handles incomplete HLO without getting in your way.

Format HLO

Open the Command Palette and run Format Document, or use your usual VS Code formatting shortcut. Select HLO Prettier if VS Code asks you to choose a formatter.

HLO formatting demo

For automatic formatting, add this to your VS Code settings.json:

{
  "[hlo]": {
    "editor.defaultFormatter": "5yearsKim.hlo-prettier",
    "editor.formatOnSave": true,
    "editor.insertSpaces": true,
    "editor.tabSize": 2
  },
  "hloPrettier.printWidth": 120,
  "hloPrettier.attributeWrapping": "auto",
  "hloPrettier.formatMetadata": false,
  "hloPrettier.blankLinesBetweenComputations": 1
}

Settings

Setting Default What it controls
hloPrettier.printWidth 120 Line width used by automatic attribute wrapping
hloPrettier.attributeWrapping "auto" Attribute wrapping: auto, preserve, or onePerLine
hloPrettier.formatMetadata false Whether metadata internals are formatted
hloPrettier.blankLinesBetweenComputations 1 Blank lines between top-level computations (0–2)

Indentation follows VS Code's editor.insertSpaces and editor.tabSize settings for HLO files.

Recognized files

HLO Prettier recognizes .hlo files and these common dump patterns without taking over every .txt file:

*module_*.before_*.txt
*module_*.after_*.txt
*module_*_after_optimizations.txt

These patterns cover pre-optimization HLO, intermediate pass dumps such as module_0000.jit_stage.0001.sharding-removal.after_shardy-xla.before_control-dep-rewriter.txt, and CPU/GPU post-optimization HLO. They allow timestamp prefixes and module sequence numbers of any length. Diagnostic text reports such as buffer assignments and memory usage reports are not HLO and are not matched.

JAX also exports .mlir files; those use MLIR syntax rather than HLO syntax.

For another filename, select HLO using VS Code's language-mode picker.

License

Apache License 2.0

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
  • Your Privacy Choices
  • Consumer Health Privacy
© 2026 Microsoft