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.

The current setup targets Linux x86-64 with Python 3.11, 3.12 or 3.13 and a working OpenGL 4.3 context. CUDA tensor rendering also 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.

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.0

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.0
File Size Uploaded
meltygui-0.1.0.tar.gz 5.8 MB Details

Built distribution (wheel)

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

Total release size: 11.6 MB

Release files / meltygui-0.1.0.tar.gz

Download URL meltygui-0.1.0.tar.gz
Size 5.8 MB
Tags Source
SHA-256 checksum
How to use checksums
047ed3419dbb27e2e390aa0a29a79b03c045339ef25bd65bffcc5ca7045cd16f
BLAKE2b-256 checksum
How to use checksums
63800fd45a442946e6f53040dc6cbbe5ff191f48ac1e7804fdeb182587c655e0
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.0-py3-none-any.whl

Download URL meltygui-0.1.0-py3-none-any.whl
Size 5.8 MB
Tags Python 3
SHA-256 checksum
How to use checksums
2498cc959899142d9fa94d2837c3943b564d50e3eebe0c40350d24b25f37e6ae
BLAKE2b-256 checksum
How to use checksums
110e13ee9f156bf4780b2d79ededa047fb1d8c06965bdcff9755c1585e86e78c
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

0.1.2

2 release files

This release

0.1.0 This release

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