GPU Memory Profiling

August 16, 2026 · View on GitHub

This document records VRAM usage and performance benchmarks for the SenseNova-U1-8B-MoT model across different inference tasks. All tests are run with the --profile flag on a single NVIDIA H100 80G GPU.


Text-to-Image

Standard text-to-image inference without chain-of-thought.

python examples/t2i/inference.py \
    --model_path checkpoints/SenseNova-U1-8B-MoT \
    --prompt "Close portrait of an elderly woman by a farmhouse window, textured skin, gentle smile, warm natural light, emotional documentary look. The portrait should feel polished and natural, with sharp eyes, realistic skin texture, accurate facial anatomy, and premium lighting that keeps the face as the main focus." \
    --output_dir outputs/ \
    --cfg_scale 4.0 \
    --cfg_norm none \
    --timestep_shift 3.0 \
    --num_steps 50 \
    --profile
================================================================
Profile summary
================================================================
  config              : vram_mode=full, attn_backend=flash, dtype=bfloat16
  model load          :   88.857 s
  load peak memory    : allocated 32.77 GiB, reserved 33.10 GiB, cpu RSS 5.59 GiB
  generations         : 1 call(s), 1 image(s) total, 22.108 s wall
  avg per image       :   22.108 s
  image tokens        : patch_size=32, avg 4096 tok/image (4096)
  throughput          :   185.27 tok/s
  generation peak mem : allocated 34.83 GiB, reserved 35.82 GiB, cpu RSS 5.59 GiB
================================================================

Text-to-Image with Chain-of-Thought

Enables chain-of-thought reasoning (--think), where the model outputs its reasoning process before generating the image. Generation time and VRAM usage increase slightly.

python examples/t2i/inference.py \
    --model_path checkpoints/SenseNova-U1-8B-MoT \
    --prompt "Close portrait of an elderly woman by a farmhouse window, textured skin, gentle smile, warm natural light, emotional documentary look. The portrait should feel polished and natural, with sharp eyes, realistic skin texture, accurate facial anatomy, and premium lighting that keeps the face as the main focus." \
    --output_dir outputs/ \
    --cfg_scale 4.0 \
    --cfg_norm none \
    --timestep_shift 3.0 \
    --num_steps 50 \
    --profile \
    --think \
    --print_think
================================================================
Profile summary
================================================================
  config              : vram_mode=full, attn_backend=flash, dtype=bfloat16
  model load          :   82.060 s
  load peak memory    : allocated 32.77 GiB, reserved 33.10 GiB, cpu RSS 5.58 GiB
  generations         : 1 call(s), 1 image(s) total, 38.342 s wall
  avg per image       :   38.342 s
  image tokens        : patch_size=32, avg 4096 tok/image (4096)
  throughput          :   106.83 tok/s
  generation peak mem : allocated 35.02 GiB, reserved 35.94 GiB, cpu RSS 5.58 GiB
================================================================

Image Editing

Image editing requires both an input image and an editing instruction. Processing the additional input image results in higher peak VRAM usage compared to plain text-to-image.

python examples/editing/inference.py \
    --model_path checkpoints/SenseNova-U1-8B-MoT \
    --prompt "Change the man's coat to yellow." \
    --image examples/editing/data/images/1.webp \
    --cfg_scale 4.0 \
    --img_cfg_scale 1.0 \
    --cfg_norm none \
    --timestep_shift 3.0 \
    --num_steps 50 \
    --output output_edited.png \
    --profile \
    --compare
================================================================
Profile summary
================================================================
  config              : vram_mode=full, attn_backend=flash, dtype=bfloat16
  model load          :   80.541 s
  load peak memory    : allocated 32.77 GiB, reserved 33.10 GiB, cpu RSS 5.61 GiB
  generations         : 1 call(s), 1 image(s) total, 25.871 s wall
  avg per image       :   25.871 s
  image tokens        : patch_size=32, avg 4029 tok/image (4029)
  throughput          :   155.74 tok/s
  generation peak mem : allocated 39.50 GiB, reserved 41.32 GiB, cpu RSS 5.61 GiB
================================================================

Interleaved Text-Image Generation

Interleaved generation produces multiple images and corresponding text in a single inference call. Per-image token count is lower, but overall VRAM usage and wall time are substantially higher.

python examples/interleave/inference.py \
    --model_path checkpoints/SenseNova-U1-8B-MoT/ \
    --prompt "I want to learn how to cook tomato and egg stir-fry. Please give me a beginner-friendly illustrated tutorial." \
    --resolution "16:9" \
    --output_dir outputs/interleave/ \
    --stem demo \
    --profile
================================================================
Profile summary
================================================================
  config              : vram_mode=full, attn_backend=flash, dtype=bfloat16
  model load          :   74.821 s
  load peak memory    : allocated 32.77 GiB, reserved 33.10 GiB, cpu RSS 5.63 GiB
  generations         : 1 call(s), 6 image(s) total, 296.118 s wall
  avg per image       :   49.353 s
  image tokens        : patch_size=32, avg 2304 tok/image (2304)
  throughput          :    46.68 tok/s
  generation peak mem : allocated 49.22 GiB, reserved 69.18 GiB, cpu RSS 5.63 GiB
================================================================

Task Comparison Summary

TaskLoad Peak VRAM (GiB)Gen Peak VRAM (GiB)CPU RSS (GiB)Avg Time (s)Throughput (tok/s)
t2i32.77 / 33.1034.83 / 35.825.5922.108185.27
t2i-think32.77 / 33.1035.02 / 35.945.5838.342106.83
editing32.77 / 33.1039.50 / 41.325.6125.871155.74
interleave32.77 / 33.1049.22 / 69.185.6349.35346.68

VRAM columns are formatted as allocated / reserved. CPU RSS is the peak RSS during the generation phase.

Low-VRAM Inference

VRAM Budget Cap (--max_memory)

The --max_memory parameter caps the GPU VRAM budget to simulate consumer-grade GPUs with varying VRAM capacities, covering 32 GB (e.g. RTX 5090), 24 GB (e.g. RTX 4090), 16 GB (e.g. RTX 4080), 12 GB (e.g. RTX 4070), and 8 GB (e.g. RTX 4060). Model layers exceeding the VRAM budget are automatically offloaded to CPU memory, so CPU RSS rises significantly as the GPU budget decreases.

It is recommended to set max_memory slightly below the GPU's physical VRAM (e.g. use 26GiB28GiB for a 32 GB card) to leave enough headroom and avoid OOM errors during inference.

python examples/t2i/inference.py \
    --model_path checkpoints/SenseNova-U1-8B-MoT \
    --prompt "..." \
    --output_dir outputs/ \
    --cfg_scale 4.0 \
    --cfg_norm none \
    --timestep_shift 3.0 \
    --num_steps 50 \
    --device_map auto \
    --max_memory "0=<N>GiB,cpu=80GiB" \
    --profile
GPU BudgetTarget GPULoad Peak VRAM (GiB)Gen Peak VRAM (GiB)Load CPU RSS (GiB)Gen CPU RSS (GiB)Avg Time (s)Throughput (tok/s)
27 GiBRTX 5090 (32 GB)25.71 / 25.7127.76 / 28.315.6210.2787.69246.71
20 GiBRTX 4090 (24 GB)18.52 / 18.5220.58 / 21.125.5919.50174.96123.41
13 GiBRTX 4080 (16 GB)11.33 / 11.3413.39 / 13.935.6224.12250.75716.33
9 GiBRTX 4070 (12 GB)7.74 / 7.749.79 / 10.335.5528.76290.03914.12
7 GiBRTX 4060 (8 GB)5.58 / 5.597.64 / 8.185.5628.76316.32312.95

VRAM columns are formatted as allocated / reserved. As the GPU budget decreases, model layers are progressively offloaded to CPU, causing CPU RSS to rise and inference throughput to drop.

VRAM Optimization Mode (--vram_mode)

The --vram_mode parameter selects the VRAM optimization strategy, trading off inference speed against VRAM footprint.

python examples/t2i/inference.py \
    --model_path checkpoints/SenseNova-U1-8B-MoT \
    --prompt "..." \
    --output_dir outputs/ \
    --cfg_scale 4.0 \
    --cfg_norm none \
    --timestep_shift 3.0 \
    --num_steps 50 \
    --vram_mode <full|fast|balanced|low> \
    --attn_backend sdpa \
    --profile

Text-to-Image

--vram_modeStrategyLoad Peak VRAM (GiB)Gen Peak VRAM (GiB)Load CPU RSS (GiB)Gen CPU RSS (GiB)Avg Time (s)Throughput (tok/s)
fullEntire model resident on GPU, no offload (default, fastest)32.70 / 33.0234.79 / 35.725.565.5620.894196.04
fastAsync prefetch with generation layers retained within memory budget19.68 / 20.410.9142.1422.851179.25
balancedAsync prefetch (H2D overlapped with compute), greatly reduced VRAM5.68 / 9.340.9142.1631.456130.21
lowSynchronous CPU↔GPU swap per layer, minimum GPU VRAM, slowest4.96 / 5.530.9142.2151.53579.48

Image Editing

--vram_modeGen Peak VRAM (GiB)Avg Time (s)Throughput (tok/s)
full35.28 / 35.7921.475190.74
fast20.18 / 20.7523.372175.25
balanced6.16 / 9.6631.439130.28
low5.44 / 5.8052.29178.33

Tests use SenseNova-U1-8B-MoT, BF16, SDPA, 2048×2048 output, 50 steps, batch size 1, and seed 42 on a single NVIDIA H100 80 GB. Text-to-image uses cfg_scale=4.0; image editing uses cfg_scale=4.0 and img_cfg_scale=1.0. Results are steady-state measurements after one pinned-memory/CUDA warm-up. VRAM columns are formatted as allocated / reserved; — indicates no GPU allocation during lazy model loading. Outputs from all four modes are pixel-identical for each task.