Skip to content

BUG: DiffusionGemma 26B-A4B exhibits Initialization Memory Saturation / Leak in Unsloth Studio #6304

Closed as duplicate

Description

@Naw3

Hello Unsloth Team,

I am encountering a major memory management failure when attempting to load the diffusiongemma 26b a4b model within the Unsloth Studio interface. The issue is not solely present during inference, but manifests immediately during the model loading phase.

This behavior strongly suggests a critical memory leak or an excessive allocation of internal structures during the initialization of the diffusion pipeline.

Environment:

Unsloth Studio Version: v0.1.464-beta
Package Version: 2026.6.7
Operating System: Windows 11 pro
Hardware: RTX 4060, 32Gb (2x16) RAM, Ryzen 5 7600
Affected Model: diffusiongemma-26B-A4B-it-Q4_K_M.gguf
Steps to Reproduce (The bug pathway):

Open Unsloth Studio.
Load specifically the diffusiongemma-26B-A4B-it-Q4_K_M.gguf model.
Wait for the full loading process to complete (which takes approximately 2 minutes).
Observation: Using Task manager, the RAM and VRAM progressively reach 100% capacity.
Current Behavior (What is happening):

RAM instantly jumps from Windows Baseline to 32GB/32GB.
The loading process takes an excessively long time and results in a memory saturation signal.
The system seem to utilize NVMe swap during loading, but doesnt really seem to use it during inference, but it is running around 3 tokens per second.

Expected Behavior (What should happen):

The model should load and utilize a memory footprint consistent with its size (approx. 18GB, as per the documentation), while leaving sufficient headroom for the OS and background tasks.
Comparison Note (Proof of specificity): I have tested the non-diffusion model (standard gemma-4-26B-A4B-it-UD-Q4_K_M.gguf). For an identical content length (4k), this model loads and executes without memory saturation leaving at least 10go free, proving that the defect is specifically tied to the diffusion model.

Thank you in advance for your help in resolving this critical issue!

Image

Activity

  1. Naw3 commented on Jun 17, 2026

    @Naw3
    Author

    Update on this:

    I finally found the root cause of the performance drop on limited VRAM setups (like an RTX 4060 8GB).

    The custom llama.cpp backend ignores standard flags. Instead of doing a proper hybrid CPU + RAM offload where the CPU computes its own layers, the backend lets the model overflow entirely into Shared System Memory (RAM mapped via PCIe).

    Because of this, the CPU computing power is not used at all, and the GPU wastes its time waiting for layers to transfer over the PCIe bus, destroying the token throughput. The backend needs to strictly respect physical VRAM limits and enforce true host-side CPU execution instead of relying on the driver's shared memory fallback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions