Halide icon indicating copy to clipboard operation
Halide copied to clipboard

Improve StmtToHtml output

Open dsharletg opened this issue 4 years ago • 10 comments

We currently generate pretty bad HTML output:

  • It's huge. I'm looking at a 10MB html file right now. The stmt file for the same pipeline is a few hundred KB.
  • It brings chrome to its knees. Expanding/collapsing a node is slow and clunky.

I think there are ways to generate similar syntax highlighted and collapsible/expandable HTML that is far less bloated and easier for the browser to handle, but I only know enough HTML to be dangerous.

dsharletg avatar Feb 18 '21 04:02 dsharletg

Is the HTML output regularly used? (Honest question; I never use it but I guess you must do so otherwise you wouldn't have noticed)

steven-johnson avatar Feb 18 '21 17:02 steven-johnson

I tend to not use it because it's not very good, I think due in large part to these issues. I just tried using it because I really needed it to understand a large piece of IR, and that's when I filed this issue.

dsharletg avatar Feb 18 '21 17:02 dsharletg

I use it for grokking large pipelines too, and it's really annoying how large and slow it is. I think a talented js person could make it substantially better.

abadams avatar Feb 18 '21 18:02 abadams

Tagging as a good candidate for a contributor project

steven-johnson avatar Feb 18 '21 18:02 steven-johnson

I used it a lot when I was learning how Halide compilation works. Indeed it is less useful for larger pipelines.

BachiLi avatar Feb 18 '21 22:02 BachiLi

https://github.com/halide/Halide/wiki/%5BGSoC-2021%5D-A-(Better)-Interactive-Viewer-for-Halide-Pseudocode

abadams avatar Feb 19 '21 17:02 abadams

I just had an idea: maybe we could tweak the stmt syntax to make it more C-like (e.g. emit produce/consume as comments, make allocate a function call/return value, etc.), and then one could just tell a text editor to treat .stmt as .c.

Maybe just those things would make it close enough. Things like lets would be a problem but maybe not enough to break syntax highlighting so much it isn't useful.

dsharletg avatar Feb 19 '21 17:02 dsharletg

iirc, Fredo's class also recommends using it to understand Halide a bit, and students complained about it.

Also might be worth it to make a syntax highlighter that works on different IDEs for .stmt files?

rootjalex avatar Feb 25 '21 14:02 rootjalex

Also might be worth it to make a syntax highlighter that works on different IDEs for .stmt files?

This is very easy and a good idea.

alexreinking avatar Oct 01 '22 16:10 alexreinking

I just switched to latest Halide, and the HTML output has gotten these new features with the assembly, and this weird middle column. While the idea looks interesting with the three panes, this is EXTREMELY slow. Loading the page takes longer than compiling the pipeline.

Is the HTML output regularly used? (Honest question; I never use it but I guess you must do so otherwise you wouldn't have noticed)

I use the HTML statement file all the time. Can we produce the old simple version of the HMTL statement file?

mcourteaux avatar Jul 25 '23 18:07 mcourteaux