Skip to main content

MeltyGUI

Low latency tensor visualization for PyTorch.

MeltyGUI is an open source data visualization toolkit for PyTorch, designed to render massive tensors in-place on the GPU at an interactive framerate. The purpose of this project is to make PyTorch code easier to understand and faster to debug. Along with its core tensor rendering components, MeltyGUI is bundled with a Blender inspired UI framework designed to make interacting with high dimensional tensors feel fast and intuitive.

MeltyGUI is capable of rendering tensors exceeding 64GB in size. The primary challenge with visualizing data this large is moving it around. MeltyGUI skips the data movement entirely, and ray-marches tensors directly from CUDA memory.

Image

Getting started

MeltyGUI is not yet published to PyPI. For now, install from a checkout using the setup guide.

Linux x86-64 uses Python 3.11, 3.12 or 3.13 and OpenGL 4.3. The UI and editor also run on Apple Silicon macOS with Python 3.12, OpenGL 4.1 and Retina rendering. CUDA tensor rendering requires PyTorch, an NVIDIA GPU, a CUDA toolkit, and MeltyGUI's GL-enabled CUDA binding. The native bindings install as prebuilt wheels on those targets; elsewhere installers compile them, see when no wheel matches. CUDA rendering is unavailable on macOS.

Visualize a tensor

Create a small volume on the GPU and tag draw_voxels as an OS window with glfw_window:

import torch
import meltygui

axis = torch.linspace(-1.5, 1.5, 40, device="cuda:0")
x, y, z = torch.meshgrid(axis, axis, axis, indexing="ij")
volume = torch.exp(-4 * ((torch.sqrt(x * x + y * y) - 0.85) ** 2 + z * z))

meltygui.glfw_window(
    meltygui.draw_voxels, name="Torus", value=volume, width=850, height=700
)

Save this as tensor_demo.py and run it with the Python from your configured environment:

.venv/bin/python tensor_demo.py

glfw_window turns a view into a native window: name is the window title, width / height its content size, value the view's input, and every other keyword argument goes to the view. The window loop starts automatically after the module finishes defining its windows. The CUDA renderer reads the volume on its own GPU and transfers the rendered 2D image for display.

To compose several views in one window, decorate your own function instead. It runs each frame, so create the tensor outside it to avoid reallocating the volume on every frame:

@meltygui.glfw_window(name="CUDA tensor", width=850, height=700)
def draw_frame():
    # Interactive widget, rendered in a loop. This function will be called wheneven
    # the rendered image is invalidated
    meltygui.draw_voxels(volume, name="Torus", width=800, height=630)

draw_voxels chooses CUDA for CUDA tensors and OpenGL for CPU tensors, NumPy arrays and GL textures. Select a renderer explicitly with the framework's view_func override (or call either renderer directly):

meltygui.draw_voxels(volume, view_func=meltygui.draw_voxels_opengl)
meltygui.draw_voxels(volume, view_func=meltygui.draw_voxels_cuda)

draw_voxels_opengl accepts tensors directly, including CUDA tensors; it slices and uploads the displayed volume to a GL texture. draw_voxels_cuda requires a CUDA tensor and reads it in place. Both expose the same camera, mapping and shading controls. Backend selection no longer uses the obsolete cuda_march parameter.

See the tensor and live-code example for a tensor viewer alongside an editable function view.

Build an app

Use the bundled UI framework to add controls, editors, and additional windows. Building an app covers persistent view state, render functions, and window lifecycle.

For framework design, feature ownership and render-function patterns, see Contributing. Development covers setup, checks and packaging; Architecture gaps tracks the remaining migration work.

License

MeltyGUI is licensed under Apache 2.0. Bundled third-party code and assets retain their own licenses. The separate commercial IDE is not part of this distribution.

Metadata

Release files for meltygui 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for meltygui 0.1.3
File Size Uploaded
meltygui-0.1.3.tar.gz 6.1 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for meltygui 0.1.3
File Interpreter ABI Platform
meltygui-0.1.3-py3-none-any.whl Python 3 none any Details

Total release size: 12.1 MB

Release files / meltygui-0.1.3.tar.gz

Download URL meltygui-0.1.3.tar.gz
Size 6.1 MB
Tags Source
SHA-256 checksum
How to use checksums
964fdbde26cbecdc33d784da45188f050b1cf3c413ef3b9f1a11b7c337ffee78
BLAKE2b-256 checksum
How to use checksums
30d2c29829cf9609ecee9e58334b6c5e9078e5215f5ad480aaab61268a5c8085
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / meltygui-0.1.3-py3-none-any.whl

Download URL meltygui-0.1.3-py3-none-any.whl
Size 6.0 MB
Tags Python 3
SHA-256 checksum
How to use checksums
ebf3c79a9038580d5e419abe024d75ad4873928c48e257543eee3b53d790b4b0
BLAKE2b-256 checksum
How to use checksums
50d0622690ffab7a351c394f09d19b4497f03712437c603c9322bd0e17d3bed4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files

0.1.2

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page