cutlass icon indicating copy to clipboard operation
cutlass copied to clipboard

Add print_svg for mma

Open reed-lau opened this issue 6 months ago • 2 comments

Cute provides a utility called print_latex for visualizing layouts, which can aid in designing layouts for GEMM problems. However, utilizing LaTeX is not straightforward due to several reasons:

  1. LaTeX files must be compiled into PDF format before they can be utilized.
  2. LaTeX tools are not commonly installed in many Linux environments, and the installation process can be resource-intensive, requiring significant disk space and numerous dependencies.
  3. While online LaTeX platforms(like overleaf) can assist in setting up the environment, they come with limitations, such as restrictions on compilation time.
  4. By default, LaTeX struggles to handle large graphs with numerous nodes efficiently, often resulting in errors such as "TeX capacity exceeded, sorry [main memory size=5000000]." This issue arises, for instance, when dealing with a 128x32x32 tiled mma.

SVG is a widely adopted file format that can be opened using popular web browsers. I have developed the print_svg function and tested it using Chrome version 127.0.6533.120 and Safari version 17.5. This function achieves the same visualization goals as LaTeX but without its associated challenges. I have attached several results for your reference.

16x8x16

16x16x16-permutation

32x32x32

128x32x32

reed-lau avatar Aug 21 '24 13:08 reed-lau