vramsuite 0.5.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. vramsuite-0.5.0/.gitignore +31 -0
  2. vramsuite-0.5.0/CHANGELOG.md +67 -0
  3. vramsuite-0.5.0/LICENSE +21 -0
  4. vramsuite-0.5.0/PKG-INFO +273 -0
  5. vramsuite-0.5.0/README.md +243 -0
  6. vramsuite-0.5.0/docs/README.md +51 -0
  7. vramsuite-0.5.0/docs/bundle.md +58 -0
  8. vramsuite-0.5.0/docs/device-profile.md +187 -0
  9. vramsuite-0.5.0/docs/estimate.md +264 -0
  10. vramsuite-0.5.0/docs/model-inspection.md +137 -0
  11. vramsuite-0.5.0/docs/native-backends.md +115 -0
  12. vramsuite-0.5.0/docs/probe-and-risk.md +194 -0
  13. vramsuite-0.5.0/docs/process-tracking.md +150 -0
  14. vramsuite-0.5.0/docs/profiles.md +120 -0
  15. vramsuite-0.5.0/docs/releasing.md +48 -0
  16. vramsuite-0.5.0/docs/transfer.md +133 -0
  17. vramsuite-0.5.0/docs/vramcard.md +250 -0
  18. vramsuite-0.5.0/docs/workflow-analysis.md +122 -0
  19. vramsuite-0.5.0/pyproject.toml +67 -0
  20. vramsuite-0.5.0/tests/test_advise.py +41 -0
  21. vramsuite-0.5.0/tests/test_bundle.py +42 -0
  22. vramsuite-0.5.0/tests/test_estimate.py +28 -0
  23. vramsuite-0.5.0/tests/test_leaks.py +24 -0
  24. vramsuite-0.5.0/tests/test_minifloat.py +17 -0
  25. vramsuite-0.5.0/tests/test_model_inspect.py +66 -0
  26. vramsuite-0.5.0/tests/test_nvml_optional.py +32 -0
  27. vramsuite-0.5.0/tests/test_processes.py +33 -0
  28. vramsuite-0.5.0/tests/test_profile.py +70 -0
  29. vramsuite-0.5.0/tests/test_transfer.py +10 -0
  30. vramsuite-0.5.0/tests/test_validate.py +52 -0
  31. vramsuite-0.5.0/tests/test_vramcard_gpu_selection.py +55 -0
  32. vramsuite-0.5.0/tests/test_workflow.py +75 -0
  33. vramsuite-0.5.0/vramsuite/__init__.py +18 -0
  34. vramsuite-0.5.0/vramsuite/__main__.py +59 -0
  35. vramsuite-0.5.0/vramsuite/backends/__init__.py +0 -0
  36. vramsuite-0.5.0/vramsuite/backends/cublas.py +281 -0
  37. vramsuite-0.5.0/vramsuite/backends/cublaslt/__init__.py +44 -0
  38. vramsuite-0.5.0/vramsuite/backends/cublaslt/descriptors.py +243 -0
  39. vramsuite-0.5.0/vramsuite/backends/cublaslt/enums.py +52 -0
  40. vramsuite-0.5.0/vramsuite/backends/cublaslt/errors.py +29 -0
  41. vramsuite-0.5.0/vramsuite/backends/cublaslt/heuristics.py +139 -0
  42. vramsuite-0.5.0/vramsuite/backends/cublaslt/layouts.py +159 -0
  43. vramsuite-0.5.0/vramsuite/backends/cublaslt/matmul.py +69 -0
  44. vramsuite-0.5.0/vramsuite/backends/cublaslt/runtime.py +296 -0
  45. vramsuite-0.5.0/vramsuite/backends/cublaslt/workspace.py +41 -0
  46. vramsuite-0.5.0/vramsuite/backends/cuda.py +511 -0
  47. vramsuite-0.5.0/vramsuite/backends/cuda_driver.py +267 -0
  48. vramsuite-0.5.0/vramsuite/backends/native_loader.py +153 -0
  49. vramsuite-0.5.0/vramsuite/backends/nvml.py +504 -0
  50. vramsuite-0.5.0/vramsuite/backends/windows_gpu.py +206 -0
  51. vramsuite-0.5.0/vramsuite/cli/__init__.py +0 -0
  52. vramsuite-0.5.0/vramsuite/cli/main.py +591 -0
  53. vramsuite-0.5.0/vramsuite/compute/__init__.py +0 -0
  54. vramsuite-0.5.0/vramsuite/compute/compute_math.py +142 -0
  55. vramsuite-0.5.0/vramsuite/compute/cublaslt_math.py +327 -0
  56. vramsuite-0.5.0/vramsuite/compute/minifloat.py +115 -0
  57. vramsuite-0.5.0/vramsuite/compute/validation.py +13 -0
  58. vramsuite-0.5.0/vramsuite/core/__init__.py +0 -0
  59. vramsuite-0.5.0/vramsuite/core/advise.py +160 -0
  60. vramsuite-0.5.0/vramsuite/core/bundle.py +103 -0
  61. vramsuite-0.5.0/vramsuite/core/comfy.py +79 -0
  62. vramsuite-0.5.0/vramsuite/core/compare.py +162 -0
  63. vramsuite-0.5.0/vramsuite/core/doctor.py +140 -0
  64. vramsuite-0.5.0/vramsuite/core/estimate.py +176 -0
  65. vramsuite-0.5.0/vramsuite/core/fingerprint.py +95 -0
  66. vramsuite-0.5.0/vramsuite/core/model_inspect.py +135 -0
  67. vramsuite-0.5.0/vramsuite/core/probe.py +180 -0
  68. vramsuite-0.5.0/vramsuite/core/processes.py +190 -0
  69. vramsuite-0.5.0/vramsuite/core/profile.py +197 -0
  70. vramsuite-0.5.0/vramsuite/core/reports.py +618 -0
  71. vramsuite-0.5.0/vramsuite/core/risk.py +127 -0
  72. vramsuite-0.5.0/vramsuite/core/runtime.py +102 -0
  73. vramsuite-0.5.0/vramsuite/core/transfer.py +160 -0
  74. vramsuite-0.5.0/vramsuite/core/validate.py +141 -0
  75. vramsuite-0.5.0/vramsuite/core/vramcard.py +282 -0
  76. vramsuite-0.5.0/vramsuite/core/workflow.py +298 -0
@@ -0,0 +1,31 @@
1
+ .venv/
2
+ **/.venv/
3
+
4
+ .vs/
5
+ .vscode/
6
+
7
+ __pycache__/
8
+ **/__pycache__/
9
+ *.pyc
10
+ *.pyo
11
+ *.pyd
12
+
13
+ .pytest_cache/
14
+ .ruff_cache/
15
+ .mypy_cache/
16
+
17
+ dist/
18
+ build/
19
+ *.egg-info/
20
+
21
+ *.log
22
+
23
+ .vramsuit/
24
+ system.vramcard.json
25
+ probe_result.json
26
+ doctor_report.json
27
+ workflow_profile.json
28
+ *.vramcard.json
29
+ .vramsuite/
30
+ # Workflow profiles from `vramsuite profile`
31
+ profiles/
@@ -0,0 +1,67 @@
1
+ # Changelog
2
+
3
+ All notable changes to VRAM Suite. Versions follow [Semantic Versioning](https://semver.org/); while in 0.x, minor versions may change the CLI and file formats.
4
+
5
+ ## [0.5.0] - 2026-11-02
6
+
7
+ The first public release: installable from PyPI and as a Windows exe.
8
+
9
+ ### Added
10
+
11
+ - `pip install vramsuite`. Only the NVIDIA driver is needed: no PyTorch, no CUDA Toolkit.
12
+ - `pip install "vramsuite[compute]"` installs cuBLAS / cuBLASLt from NVIDIA's wheels for `doctor --compute-check`.
13
+ - `vramsuite.exe` for Windows, built by GitHub Actions. Double-clicking it runs `doctor` and waits for Enter.
14
+ - `vramsuite bundle` writes an anonymized zip to share: the card, its validation, workflow profiles and a manifest. GPU UUID and the Python path are removed; the home folder, user name and IP addresses are masked.
15
+ - `vramsuite --version`, and `python -m vramsuite`.
16
+
17
+ ### Changed
18
+
19
+ - `pydantic` is no longer a dependency; the runtime dependencies are `typer` and `rich`.
20
+ - README links and images use absolute URLs, so they also work on PyPI.
21
+
22
+ ## [0.4.0] - 2026-11-02
23
+
24
+ ### Added
25
+
26
+ - Suggestions with numbers at the end of `estimate --workflow`:
27
+ - an FP8 text encoder found in the models folder, with the MB it saves
28
+ - the largest resolution or frame count that fits
29
+ - the offloading cost over the steps the samplers actually run
30
+ - the cost of reloading models between stages, with a RAM check
31
+ - Confidence of the estimate (`high`, `medium` or `low`), based on where the activations came from.
32
+ - Native system RAM reading (`GlobalMemoryStatusEx`, `/proc/meminfo`).
33
+
34
+ ### Changed
35
+
36
+ - `estimate_comfy_workflow` moved to `vramsuite.core.comfy`, so imports between modules only go one way.
37
+
38
+ ## [0.3.0] - 2026-11-02
39
+
40
+ ### Added
41
+
42
+ - `vramsuite profile` records the peak VRAM and run time of real ComfyUI runs, passively: it reads ComfyUI's queue and history and samples VRAM per process. Profiles are saved per `config_hash`.
43
+ - `estimate --workflow` uses a matching profile for the activations automatically.
44
+
45
+ ## [0.2.0] - 2026-11-02
46
+
47
+ ### Added
48
+
49
+ - `vramsuite analyze-workflow` for a ComfyUI workflow file or a folder of them:
50
+ - models, resolution, frames, batch, steps and sampler
51
+ - `graph_hash` and `config_hash`
52
+ - risky patterns: 16-bit text encoders, untiled VAE decode of video, missing models
53
+ - CUDA driver API backend (`nvcuda.dll` / `libcuda.so`). The probe, the transfer benchmark and device attributes no longer need the CUDA Toolkit.
54
+ - A Capabilities table in `doctor`.
55
+
56
+ ## [0.1.0] - 2026-11-02
57
+
58
+ ### Added
59
+
60
+ - `doctor`: the native GPU profile and the `.vramcard` file.
61
+ - `doctor --probe`, with OOM risk.
62
+ - `doctor --compute-check`: cuBLAS / cuBLASLt FP32 and FP8 checks.
63
+ - `inspect`: exact weight sizes from `.safetensors` headers.
64
+ - `processes`: VRAM per process, observed from outside.
65
+ - `transfer`: real PCIe bandwidth, pinned and pageable.
66
+ - `estimate`: does it fit, and what offloading costs per step. It works for a list of models or a ComfyUI workflow.
67
+ - `compare` and `validate` for `.vramcard` files.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 k1n0F
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,273 @@
1
+ Metadata-Version: 2.5
2
+ Name: vramsuite
3
+ Version: 0.5.0
4
+ Summary: Native GPU memory diagnostics for local AI: will a model or ComfyUI workflow fit in VRAM, and what does offloading cost
5
+ Project-URL: Homepage, https://github.com/k1n0F/vramsuite
6
+ Project-URL: Documentation, https://github.com/k1n0F/vramsuite/tree/main/docs
7
+ Project-URL: Issues, https://github.com/k1n0F/vramsuite/issues
8
+ Project-URL: Releases, https://github.com/k1n0F/vramsuite/releases
9
+ Author: k1n0F
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: comfyui,cuda,diagnostics,gpu,nvml,out-of-memory,vram
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Environment :: Console
15
+ Classifier: Environment :: GPU :: NVIDIA CUDA
16
+ Classifier: Intended Audience :: Developers
17
+ Classifier: Intended Audience :: Science/Research
18
+ Classifier: Operating System :: Microsoft :: Windows
19
+ Classifier: Operating System :: POSIX :: Linux
20
+ Classifier: Programming Language :: Python :: 3
21
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
22
+ Classifier: Topic :: System :: Hardware
23
+ Requires-Python: >=3.10
24
+ Requires-Dist: rich>=13
25
+ Requires-Dist: typer>=0.12
26
+ Provides-Extra: compute
27
+ Requires-Dist: nvidia-cublas>=13; extra == 'compute'
28
+ Requires-Dist: nvidia-cuda-runtime>=13; extra == 'compute'
29
+ Description-Content-Type: text/markdown
30
+
31
+ <p align="center">
32
+ <img src="https://raw.githubusercontent.com/k1n0F/vramsuite/main/assets/banner-wide.png" alt="VRAM Suite" width="720">
33
+ </p>
34
+
35
+ <p align="center">
36
+ <b>Native GPU memory diagnostics for local AI.</b><br>
37
+ Know whether your workflow fits in VRAM before it crashes with out-of-memory.
38
+ </p>
39
+
40
+ <p align="center">
41
+ <img src="https://img.shields.io/badge/python-3.10%2B-3776AB?logo=python&logoColor=white" alt="Python 3.10+">
42
+ <img src="https://img.shields.io/badge/license-MIT-green" alt="MIT license">
43
+ <img src="https://img.shields.io/badge/status-alpha-orange" alt="alpha">
44
+ <img src="https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20WSL2-lightgrey" alt="Windows, Linux, WSL2">
45
+ <img src="https://img.shields.io/badge/CUDA-native%20ctypes-76B900?logo=nvidia&logoColor=white" alt="Native CUDA">
46
+ <img src="https://img.shields.io/badge/PyTorch-not%20required-EE4C2C?logo=pytorch&logoColor=white" alt="PyTorch not required">
47
+ </p>
48
+
49
+ ---
50
+
51
+ VRAM Suite talks to NVIDIA libraries directly (NVML, CUDA driver and runtime, cuBLAS, cuBLASLt) and shows what is really happening with GPU memory: what the card is, who holds VRAM, how big a model is, and how fast weights move over PCIe.
52
+
53
+ ## Install
54
+
55
+ ```bash
56
+ pip install vramsuite
57
+ vramsuite doctor
58
+ ```
59
+
60
+ Only the NVIDIA driver is needed: no PyTorch, no CUDA Toolkit. The cuBLAS / cuBLASLt compute checks (`doctor --compute-check`) need cuBLAS, from the CUDA Toolkit or from NVIDIA's wheels:
61
+
62
+ ```bash
63
+ pip install "vramsuite[compute]"
64
+ ```
65
+
66
+ **No Python?** Download `vramsuite.exe` (Windows) from [Releases](https://github.com/k1n0F/vramsuite/releases) and run `vramsuite.exe doctor` in a terminal, or double-click it.
67
+
68
+ **From source:**
69
+
70
+ ```bash
71
+ git clone https://github.com/k1n0F/vramsuite
72
+ cd vramsuite
73
+ uv sync
74
+ uv run vramsuite doctor
75
+ ```
76
+
77
+ <p align="center">
78
+ <img src="https://raw.githubusercontent.com/k1n0F/vramsuite/main/assets/doctor.svg" alt="vramsuite doctor output" width="760">
79
+ </p>
80
+
81
+ ## Commands
82
+
83
+ | Command | What it does | Docs |
84
+ |---|---|---|
85
+ | `vramsuite doctor` | GPU profile, driver memory, `.vramcard` file | [Device profile](https://github.com/k1n0F/vramsuite/blob/main/docs/device-profile.md) |
86
+ | `vramsuite doctor --compute-check` | cuBLAS / cuBLASLt FP32 and FP8 GEMM correctness | [Compute check](https://github.com/k1n0F/vramsuite/blob/main/docs/device-profile.md#compute-check) |
87
+ | `vramsuite doctor --probe --estimate-mb N` | Safe allocatable budget and OOM risk | [Probe and risk](https://github.com/k1n0F/vramsuite/blob/main/docs/probe-and-risk.md) |
88
+ | `vramsuite inspect <model>` | Exact weight sizes per dtype from `.safetensors` headers | [Model inspection](https://github.com/k1n0F/vramsuite/blob/main/docs/model-inspection.md) |
89
+ | `vramsuite processes [--watch S]` | VRAM per process, with peaks | [Process tracking](https://github.com/k1n0F/vramsuite/blob/main/docs/process-tracking.md) |
90
+ | `vramsuite transfer` | Real RAM <-> VRAM bandwidth over PCIe | [Transfer benchmark](https://github.com/k1n0F/vramsuite/blob/main/docs/transfer.md) |
91
+ | `vramsuite estimate <models>` | Will models fit in VRAM, and what offloading the rest costs per step | [Memory estimate](https://github.com/k1n0F/vramsuite/blob/main/docs/estimate.md) |
92
+ | `vramsuite estimate --workflow <file.json>` | The same for a ComfyUI workflow, with suggestions: FP8 encoder, size that fits, offload and reload cost | [Memory estimate](https://github.com/k1n0F/vramsuite/blob/main/docs/estimate.md#comfyui-workflows) |
93
+ | `vramsuite profile` | Records peak VRAM and run time of the next ComfyUI prompts; `estimate` uses them | [Workflow profiles](https://github.com/k1n0F/vramsuite/blob/main/docs/profiles.md) |
94
+ | `vramsuite analyze-workflow <file or folder>` | Models, resolution / frames / steps, config hash and risky patterns of ComfyUI workflows | [Workflow analysis](https://github.com/k1n0F/vramsuite/blob/main/docs/workflow-analysis.md) |
95
+ | `vramsuite compare a b` | Diff of two `.vramcard` profiles | [`.vramcard` format](https://github.com/k1n0F/vramsuite/blob/main/docs/vramcard.md) |
96
+ | `vramsuite validate card.json` | Structure and sanity check of a `.vramcard` (exit code 1 if invalid) | [`.vramcard` format](https://github.com/k1n0F/vramsuite/blob/main/docs/vramcard.md#validating-a-card) |
97
+ | `vramsuite bundle` | Anonymized zip of the card, its validation and workflow profiles, to share | [Bundle](https://github.com/k1n0F/vramsuite/blob/main/docs/bundle.md) |
98
+
99
+ Every command supports `--json`. Full documentation: [docs/](https://github.com/k1n0F/vramsuite/blob/main/docs/README.md).
100
+
101
+ ## Why native
102
+
103
+ - **No PyTorch, no Triton.** A diagnostic tool should not load gigabytes of framework and its own CUDA libraries just to read how much memory is free. PyTorch is only detected from package metadata.
104
+ - **No DLL conflicts.** Importing torch makes Windows bind cuBLAS to torch's copy of cuBLASLt by name. VRAM Suite never imports it, so its numbers are not affected by a second CUDA stack.
105
+ - **Observes from outside.** ComfyUI, games and browsers are measured through OS and driver counters; nothing has to run inside them.
106
+ - **Explicit and bounded.** Nothing heavy runs by default, every allocation is released, and a value that cannot be read is reported with a reason instead of disappearing.
107
+
108
+ More: [Native backends](https://github.com/k1n0F/vramsuite/blob/main/docs/native-backends.md).
109
+
110
+ ## See it work
111
+
112
+ **Who holds VRAM right now** — `vramsuite processes`
113
+
114
+ <p align="center">
115
+ <img src="https://raw.githubusercontent.com/k1n0F/vramsuite/main/assets/processes.svg" alt="vramsuite processes output" width="760">
116
+ </p>
117
+
118
+ **How big a model really is** — `vramsuite inspect` on a WAN 2.2 14B NVFP4 checkpoint: FP8 and packed FP4 weights, read from the header in milliseconds
119
+
120
+ <p align="center">
121
+ <img src="https://raw.githubusercontent.com/k1n0F/vramsuite/main/assets/inspect.svg" alt="vramsuite inspect output" width="760">
122
+ </p>
123
+
124
+ **What offloading costs** — `vramsuite transfer`
125
+
126
+ <p align="center">
127
+ <img src="https://raw.githubusercontent.com/k1n0F/vramsuite/main/assets/transfer.svg" alt="vramsuite transfer output" width="760">
128
+ </p>
129
+
130
+ ## Real numbers
131
+
132
+ Measured on an RTX 5080 in a slot that runs at PCIe Gen5 x8:
133
+
134
+ | | Bandwidth | Time per GB |
135
+ |---|---:|---:|
136
+ | VRAM (device to device) | ~800 GB/s | 1.2 ms |
137
+ | PCIe, pinned memory | 28.5 GB/s | 35 ms |
138
+ | PCIe, pageable memory | ~19 GB/s | ~52 ms |
139
+
140
+ VRAM is about 30 times faster than the link to system RAM. That gap is why a model that does not fit in VRAM slows down so much when its weights are offloaded, and why VRAM Suite measures both.
141
+
142
+ ## Architecture
143
+
144
+ ```mermaid
145
+ flowchart LR
146
+ CLI["CLI<br/>vramsuite ..."] --> CORE
147
+ API["Python API<br/>import vramsuite"] --> CORE
148
+
149
+ subgraph CORE["core"]
150
+ direction TB
151
+ doctor["doctor / vramcard"]
152
+ inspect["model_inspect"]
153
+ processes["processes"]
154
+ transfer["transfer"]
155
+ estimate["estimate"]
156
+ workflow["workflow (ComfyUI)"]
157
+ probe["probe / risk"]
158
+ end
159
+
160
+ subgraph BACKENDS["backends (ctypes)"]
161
+ direction TB
162
+ nvml["nvml"]
163
+ driver["cuda driver"]
164
+ cuda["cuda runtime"]
165
+ blas["cublas / cublaslt"]
166
+ win["windows_gpu"]
167
+ end
168
+
169
+ CORE --> BACKENDS
170
+ nvml --> NV["nvml.dll / libnvidia-ml.so"]
171
+ driver --> DRV["nvcuda.dll / libcuda.so"]
172
+ cuda --> RT["cudart"]
173
+ blas --> BL["cuBLAS / cuBLASLt"]
174
+ win --> OS["pdh / gdi32 / ntdll"]
175
+ ```
176
+
177
+ ```text
178
+ vramsuite/
179
+ __init__.py Public Python API
180
+ cli/main.py CLI entrypoint
181
+ core/
182
+ doctor.py Structured diagnostics API (+ native compute checks)
183
+ fingerprint.py Runtime, NVML, CUDA runtime, cuBLAS, torch-metadata fingerprint
184
+ vramcard.py .vramcard creation, GPU matching (NVML <-> CUDA by PCI)
185
+ probe.py Bounded allocation probe (cuMemAlloc)
186
+ risk.py Basic OOM risk estimation
187
+ model_inspect.py .safetensors header reader (exact weight sizes)
188
+ processes.py Per-process VRAM usage and peaks
189
+ transfer.py Host <-> device bandwidth benchmark
190
+ estimate.py Workflow memory estimate and offloading cost
191
+ workflow.py ComfyUI workflow JSON -> models, settings, hashes, warnings -> estimate
192
+ profile.py Passive ComfyUI run capture: peak VRAM + run time per config hash
193
+ advise.py Suggestions with numbers for a workflow estimate
194
+ comfy.py Workflow file -> analysis + profile + estimate + suggestions
195
+ bundle.py Anonymized zip of card, validation and profiles
196
+ compare.py .vramcard comparison
197
+ reports.py Rich terminal report rendering
198
+ runtime.py OS/Python/WSL/container detection
199
+ backends/
200
+ native_loader.py DLL/.so discovery (CUDA Toolkit first, venv fallback)
201
+ nvml.py NVML: memory, device details, PCIe, clocks, power, processes
202
+ cuda.py CUDA runtime: memory, device attributes, malloc/memcpy, pinned memory
203
+ cuda_driver.py CUDA driver API: probe and transfers with only the NVIDIA driver installed
204
+ cublas.py cuBLAS handle and SGEMM
205
+ cublaslt/ cuBLASLt descriptors, heuristics, matmul
206
+ windows_gpu.py Windows PDH GPU counters, LUID -> PCI, process info
207
+ compute/
208
+ compute_math.py cuBLAS SGEMM sanity check
209
+ cublaslt_math.py cuBLASLt FP32 / FP8 GEMM checks
210
+ minifloat.py Pure-Python FP8 / FP4 encode/decode
211
+ ```
212
+
213
+ ## Python API
214
+
215
+ ```python
216
+ import vramsuite
217
+
218
+ result = vramsuite.run_doctor(with_compute_check=True)
219
+ print(result["gpu"])
220
+ print(result["memory"])
221
+
222
+ card = vramsuite.create_vramcard()
223
+ vramsuite.save_vramcard("system.vramcard.json", card=card)
224
+ ```
225
+
226
+ ```python
227
+ from vramsuite.core.model_inspect import inspect_model
228
+ from vramsuite.core.processes import watch_gpu_processes
229
+ from vramsuite.core.transfer import run_transfer_benchmark
230
+
231
+ print(inspect_model("model.safetensors")["total_mb"])
232
+ print(watch_gpu_processes(seconds=30)["processes"][:3])
233
+ print(run_transfer_benchmark()["results"])
234
+ ```
235
+
236
+ ## Roadmap
237
+
238
+ - [x] Native CUDA runtime, cuBLAS and cuBLASLt backends (no PyTorch)
239
+ - [x] CUDA driver API backend: probe and transfers without the CUDA Toolkit
240
+ - [x] Device profile in `.vramcard`, NVML <-> CUDA matching by PCI address
241
+ - [x] Compute check layer (cuBLAS / cuBLASLt FP32, FP8)
242
+ - [x] Model file inspection from `.safetensors` headers
243
+ - [x] Per-process VRAM tracking (Windows PDH / Linux NVML)
244
+ - [x] Host <-> device transfer benchmark
245
+ - [x] Workflow memory estimation: weights + activations + offloading cost vs the device profile
246
+ - [x] ComfyUI workflow analysis
247
+ - [x] Profile validation and schema checks
248
+ - [x] Offline workflow analysis: settings, graph / config hashes, risky patterns (v0.2)
249
+ - [x] Workflow profiles: real peak VRAM and run time from ComfyUI, used by estimate (v0.3)
250
+ - [x] Suggestions with numbers: FP8 variants on disk, largest size that fits, offload and reload cost (v0.4)
251
+ - [x] PyPI package with a `[compute]` extra, Windows exe on GitHub Releases, anonymized bundle (v0.5)
252
+
253
+ Out of scope (separate kernel project): custom attention kernels, FP4 block-scaled GEMM, kernel autotuning.
254
+
255
+ ## Tested on
256
+
257
+ | | |
258
+ |---|---|
259
+ | GPU | NVIDIA GeForce RTX 5080 (Blackwell, sm_120, 16 GB) |
260
+ | Driver | 617.14, CUDA driver 13.4 |
261
+ | CUDA Toolkit | 13.0 (only needed for `doctor --compute-check`) |
262
+ | OS | Windows 11 (WDDM), WSL2 |
263
+ | Python | 3.12 via `uv` |
264
+
265
+ Other NVIDIA GPUs should work; FP8 compute checks need Ada (sm_89) or newer.
266
+
267
+ ## Status
268
+
269
+ Alpha (v0.5). The CLI, `.vramcard` format and Python API can still change between versions.
270
+
271
+ ## License
272
+
273
+ [MIT](https://github.com/k1n0F/vramsuite/blob/main/LICENSE) © k1n0F
@@ -0,0 +1,243 @@
1
+ <p align="center">
2
+ <img src="https://raw.githubusercontent.com/k1n0F/vramsuite/main/assets/banner-wide.png" alt="VRAM Suite" width="720">
3
+ </p>
4
+
5
+ <p align="center">
6
+ <b>Native GPU memory diagnostics for local AI.</b><br>
7
+ Know whether your workflow fits in VRAM before it crashes with out-of-memory.
8
+ </p>
9
+
10
+ <p align="center">
11
+ <img src="https://img.shields.io/badge/python-3.10%2B-3776AB?logo=python&logoColor=white" alt="Python 3.10+">
12
+ <img src="https://img.shields.io/badge/license-MIT-green" alt="MIT license">
13
+ <img src="https://img.shields.io/badge/status-alpha-orange" alt="alpha">
14
+ <img src="https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20WSL2-lightgrey" alt="Windows, Linux, WSL2">
15
+ <img src="https://img.shields.io/badge/CUDA-native%20ctypes-76B900?logo=nvidia&logoColor=white" alt="Native CUDA">
16
+ <img src="https://img.shields.io/badge/PyTorch-not%20required-EE4C2C?logo=pytorch&logoColor=white" alt="PyTorch not required">
17
+ </p>
18
+
19
+ ---
20
+
21
+ VRAM Suite talks to NVIDIA libraries directly (NVML, CUDA driver and runtime, cuBLAS, cuBLASLt) and shows what is really happening with GPU memory: what the card is, who holds VRAM, how big a model is, and how fast weights move over PCIe.
22
+
23
+ ## Install
24
+
25
+ ```bash
26
+ pip install vramsuite
27
+ vramsuite doctor
28
+ ```
29
+
30
+ Only the NVIDIA driver is needed: no PyTorch, no CUDA Toolkit. The cuBLAS / cuBLASLt compute checks (`doctor --compute-check`) need cuBLAS, from the CUDA Toolkit or from NVIDIA's wheels:
31
+
32
+ ```bash
33
+ pip install "vramsuite[compute]"
34
+ ```
35
+
36
+ **No Python?** Download `vramsuite.exe` (Windows) from [Releases](https://github.com/k1n0F/vramsuite/releases) and run `vramsuite.exe doctor` in a terminal, or double-click it.
37
+
38
+ **From source:**
39
+
40
+ ```bash
41
+ git clone https://github.com/k1n0F/vramsuite
42
+ cd vramsuite
43
+ uv sync
44
+ uv run vramsuite doctor
45
+ ```
46
+
47
+ <p align="center">
48
+ <img src="https://raw.githubusercontent.com/k1n0F/vramsuite/main/assets/doctor.svg" alt="vramsuite doctor output" width="760">
49
+ </p>
50
+
51
+ ## Commands
52
+
53
+ | Command | What it does | Docs |
54
+ |---|---|---|
55
+ | `vramsuite doctor` | GPU profile, driver memory, `.vramcard` file | [Device profile](https://github.com/k1n0F/vramsuite/blob/main/docs/device-profile.md) |
56
+ | `vramsuite doctor --compute-check` | cuBLAS / cuBLASLt FP32 and FP8 GEMM correctness | [Compute check](https://github.com/k1n0F/vramsuite/blob/main/docs/device-profile.md#compute-check) |
57
+ | `vramsuite doctor --probe --estimate-mb N` | Safe allocatable budget and OOM risk | [Probe and risk](https://github.com/k1n0F/vramsuite/blob/main/docs/probe-and-risk.md) |
58
+ | `vramsuite inspect <model>` | Exact weight sizes per dtype from `.safetensors` headers | [Model inspection](https://github.com/k1n0F/vramsuite/blob/main/docs/model-inspection.md) |
59
+ | `vramsuite processes [--watch S]` | VRAM per process, with peaks | [Process tracking](https://github.com/k1n0F/vramsuite/blob/main/docs/process-tracking.md) |
60
+ | `vramsuite transfer` | Real RAM <-> VRAM bandwidth over PCIe | [Transfer benchmark](https://github.com/k1n0F/vramsuite/blob/main/docs/transfer.md) |
61
+ | `vramsuite estimate <models>` | Will models fit in VRAM, and what offloading the rest costs per step | [Memory estimate](https://github.com/k1n0F/vramsuite/blob/main/docs/estimate.md) |
62
+ | `vramsuite estimate --workflow <file.json>` | The same for a ComfyUI workflow, with suggestions: FP8 encoder, size that fits, offload and reload cost | [Memory estimate](https://github.com/k1n0F/vramsuite/blob/main/docs/estimate.md#comfyui-workflows) |
63
+ | `vramsuite profile` | Records peak VRAM and run time of the next ComfyUI prompts; `estimate` uses them | [Workflow profiles](https://github.com/k1n0F/vramsuite/blob/main/docs/profiles.md) |
64
+ | `vramsuite analyze-workflow <file or folder>` | Models, resolution / frames / steps, config hash and risky patterns of ComfyUI workflows | [Workflow analysis](https://github.com/k1n0F/vramsuite/blob/main/docs/workflow-analysis.md) |
65
+ | `vramsuite compare a b` | Diff of two `.vramcard` profiles | [`.vramcard` format](https://github.com/k1n0F/vramsuite/blob/main/docs/vramcard.md) |
66
+ | `vramsuite validate card.json` | Structure and sanity check of a `.vramcard` (exit code 1 if invalid) | [`.vramcard` format](https://github.com/k1n0F/vramsuite/blob/main/docs/vramcard.md#validating-a-card) |
67
+ | `vramsuite bundle` | Anonymized zip of the card, its validation and workflow profiles, to share | [Bundle](https://github.com/k1n0F/vramsuite/blob/main/docs/bundle.md) |
68
+
69
+ Every command supports `--json`. Full documentation: [docs/](https://github.com/k1n0F/vramsuite/blob/main/docs/README.md).
70
+
71
+ ## Why native
72
+
73
+ - **No PyTorch, no Triton.** A diagnostic tool should not load gigabytes of framework and its own CUDA libraries just to read how much memory is free. PyTorch is only detected from package metadata.
74
+ - **No DLL conflicts.** Importing torch makes Windows bind cuBLAS to torch's copy of cuBLASLt by name. VRAM Suite never imports it, so its numbers are not affected by a second CUDA stack.
75
+ - **Observes from outside.** ComfyUI, games and browsers are measured through OS and driver counters; nothing has to run inside them.
76
+ - **Explicit and bounded.** Nothing heavy runs by default, every allocation is released, and a value that cannot be read is reported with a reason instead of disappearing.
77
+
78
+ More: [Native backends](https://github.com/k1n0F/vramsuite/blob/main/docs/native-backends.md).
79
+
80
+ ## See it work
81
+
82
+ **Who holds VRAM right now** — `vramsuite processes`
83
+
84
+ <p align="center">
85
+ <img src="https://raw.githubusercontent.com/k1n0F/vramsuite/main/assets/processes.svg" alt="vramsuite processes output" width="760">
86
+ </p>
87
+
88
+ **How big a model really is** — `vramsuite inspect` on a WAN 2.2 14B NVFP4 checkpoint: FP8 and packed FP4 weights, read from the header in milliseconds
89
+
90
+ <p align="center">
91
+ <img src="https://raw.githubusercontent.com/k1n0F/vramsuite/main/assets/inspect.svg" alt="vramsuite inspect output" width="760">
92
+ </p>
93
+
94
+ **What offloading costs** — `vramsuite transfer`
95
+
96
+ <p align="center">
97
+ <img src="https://raw.githubusercontent.com/k1n0F/vramsuite/main/assets/transfer.svg" alt="vramsuite transfer output" width="760">
98
+ </p>
99
+
100
+ ## Real numbers
101
+
102
+ Measured on an RTX 5080 in a slot that runs at PCIe Gen5 x8:
103
+
104
+ | | Bandwidth | Time per GB |
105
+ |---|---:|---:|
106
+ | VRAM (device to device) | ~800 GB/s | 1.2 ms |
107
+ | PCIe, pinned memory | 28.5 GB/s | 35 ms |
108
+ | PCIe, pageable memory | ~19 GB/s | ~52 ms |
109
+
110
+ VRAM is about 30 times faster than the link to system RAM. That gap is why a model that does not fit in VRAM slows down so much when its weights are offloaded, and why VRAM Suite measures both.
111
+
112
+ ## Architecture
113
+
114
+ ```mermaid
115
+ flowchart LR
116
+ CLI["CLI<br/>vramsuite ..."] --> CORE
117
+ API["Python API<br/>import vramsuite"] --> CORE
118
+
119
+ subgraph CORE["core"]
120
+ direction TB
121
+ doctor["doctor / vramcard"]
122
+ inspect["model_inspect"]
123
+ processes["processes"]
124
+ transfer["transfer"]
125
+ estimate["estimate"]
126
+ workflow["workflow (ComfyUI)"]
127
+ probe["probe / risk"]
128
+ end
129
+
130
+ subgraph BACKENDS["backends (ctypes)"]
131
+ direction TB
132
+ nvml["nvml"]
133
+ driver["cuda driver"]
134
+ cuda["cuda runtime"]
135
+ blas["cublas / cublaslt"]
136
+ win["windows_gpu"]
137
+ end
138
+
139
+ CORE --> BACKENDS
140
+ nvml --> NV["nvml.dll / libnvidia-ml.so"]
141
+ driver --> DRV["nvcuda.dll / libcuda.so"]
142
+ cuda --> RT["cudart"]
143
+ blas --> BL["cuBLAS / cuBLASLt"]
144
+ win --> OS["pdh / gdi32 / ntdll"]
145
+ ```
146
+
147
+ ```text
148
+ vramsuite/
149
+ __init__.py Public Python API
150
+ cli/main.py CLI entrypoint
151
+ core/
152
+ doctor.py Structured diagnostics API (+ native compute checks)
153
+ fingerprint.py Runtime, NVML, CUDA runtime, cuBLAS, torch-metadata fingerprint
154
+ vramcard.py .vramcard creation, GPU matching (NVML <-> CUDA by PCI)
155
+ probe.py Bounded allocation probe (cuMemAlloc)
156
+ risk.py Basic OOM risk estimation
157
+ model_inspect.py .safetensors header reader (exact weight sizes)
158
+ processes.py Per-process VRAM usage and peaks
159
+ transfer.py Host <-> device bandwidth benchmark
160
+ estimate.py Workflow memory estimate and offloading cost
161
+ workflow.py ComfyUI workflow JSON -> models, settings, hashes, warnings -> estimate
162
+ profile.py Passive ComfyUI run capture: peak VRAM + run time per config hash
163
+ advise.py Suggestions with numbers for a workflow estimate
164
+ comfy.py Workflow file -> analysis + profile + estimate + suggestions
165
+ bundle.py Anonymized zip of card, validation and profiles
166
+ compare.py .vramcard comparison
167
+ reports.py Rich terminal report rendering
168
+ runtime.py OS/Python/WSL/container detection
169
+ backends/
170
+ native_loader.py DLL/.so discovery (CUDA Toolkit first, venv fallback)
171
+ nvml.py NVML: memory, device details, PCIe, clocks, power, processes
172
+ cuda.py CUDA runtime: memory, device attributes, malloc/memcpy, pinned memory
173
+ cuda_driver.py CUDA driver API: probe and transfers with only the NVIDIA driver installed
174
+ cublas.py cuBLAS handle and SGEMM
175
+ cublaslt/ cuBLASLt descriptors, heuristics, matmul
176
+ windows_gpu.py Windows PDH GPU counters, LUID -> PCI, process info
177
+ compute/
178
+ compute_math.py cuBLAS SGEMM sanity check
179
+ cublaslt_math.py cuBLASLt FP32 / FP8 GEMM checks
180
+ minifloat.py Pure-Python FP8 / FP4 encode/decode
181
+ ```
182
+
183
+ ## Python API
184
+
185
+ ```python
186
+ import vramsuite
187
+
188
+ result = vramsuite.run_doctor(with_compute_check=True)
189
+ print(result["gpu"])
190
+ print(result["memory"])
191
+
192
+ card = vramsuite.create_vramcard()
193
+ vramsuite.save_vramcard("system.vramcard.json", card=card)
194
+ ```
195
+
196
+ ```python
197
+ from vramsuite.core.model_inspect import inspect_model
198
+ from vramsuite.core.processes import watch_gpu_processes
199
+ from vramsuite.core.transfer import run_transfer_benchmark
200
+
201
+ print(inspect_model("model.safetensors")["total_mb"])
202
+ print(watch_gpu_processes(seconds=30)["processes"][:3])
203
+ print(run_transfer_benchmark()["results"])
204
+ ```
205
+
206
+ ## Roadmap
207
+
208
+ - [x] Native CUDA runtime, cuBLAS and cuBLASLt backends (no PyTorch)
209
+ - [x] CUDA driver API backend: probe and transfers without the CUDA Toolkit
210
+ - [x] Device profile in `.vramcard`, NVML <-> CUDA matching by PCI address
211
+ - [x] Compute check layer (cuBLAS / cuBLASLt FP32, FP8)
212
+ - [x] Model file inspection from `.safetensors` headers
213
+ - [x] Per-process VRAM tracking (Windows PDH / Linux NVML)
214
+ - [x] Host <-> device transfer benchmark
215
+ - [x] Workflow memory estimation: weights + activations + offloading cost vs the device profile
216
+ - [x] ComfyUI workflow analysis
217
+ - [x] Profile validation and schema checks
218
+ - [x] Offline workflow analysis: settings, graph / config hashes, risky patterns (v0.2)
219
+ - [x] Workflow profiles: real peak VRAM and run time from ComfyUI, used by estimate (v0.3)
220
+ - [x] Suggestions with numbers: FP8 variants on disk, largest size that fits, offload and reload cost (v0.4)
221
+ - [x] PyPI package with a `[compute]` extra, Windows exe on GitHub Releases, anonymized bundle (v0.5)
222
+
223
+ Out of scope (separate kernel project): custom attention kernels, FP4 block-scaled GEMM, kernel autotuning.
224
+
225
+ ## Tested on
226
+
227
+ | | |
228
+ |---|---|
229
+ | GPU | NVIDIA GeForce RTX 5080 (Blackwell, sm_120, 16 GB) |
230
+ | Driver | 617.14, CUDA driver 13.4 |
231
+ | CUDA Toolkit | 13.0 (only needed for `doctor --compute-check`) |
232
+ | OS | Windows 11 (WDDM), WSL2 |
233
+ | Python | 3.12 via `uv` |
234
+
235
+ Other NVIDIA GPUs should work; FP8 compute checks need Ada (sm_89) or newer.
236
+
237
+ ## Status
238
+
239
+ Alpha (v0.5). The CLI, `.vramcard` format and Python API can still change between versions.
240
+
241
+ ## License
242
+
243
+ [MIT](https://github.com/k1n0F/vramsuite/blob/main/LICENSE) © k1n0F