Skip to content

Run Qwen3-Coder-Next on 8Gb VRAM [DO NOT MERGE] - #562

Open
nalexand wants to merge 17 commits into
QwenLM:mainfrom
nalexand:main
Open

Run Qwen3-Coder-Next on 8Gb VRAM [DO NOT MERGE]#562
nalexand wants to merge 17 commits into
QwenLM:mainfrom
nalexand:main

Conversation

@nalexand

Copy link
Copy Markdown

No description provided.

@nalexand

nalexand commented Feb 12, 2026

Copy link
Copy Markdown
Author

I am running large llms on my 8Gb laptop 3070ti. I have optimized: LTX-2, Wan2.2, HeartMula, ACE-STEP 1.5.

And now i abble to run 80b parameters model Qwen3-Coder-Next !!!

Instruction here: https://github.com/nalexand/Qwen3-Coder-OPTIMIZED

It is FP8 quant 80Gb in size, it is impossible to fit it on 8Gb VRAM + 32Gb RAM.

So first i tried offloading to disk with device="auto" using accelerate and i got 1 token per 255 second :(.

Than i found that most of large tensors is mlp experts and all other fit in 4.6Gb VRAM so i build custom lazy loading for experts with 2 layers caching VRAM + pinned RAM and got up to 85% cache hit rate and speed up to 1.2t/s it`s 300x speedup.

I wonder what speed will be on 4090 or 5090 desktop..

self.max_gpu_cache = 18 # TODO: calculate based on free ram and context window size
self.max_ram_cache = 100 # TODO: calculate based on available pinable memory or use unpinned (slow)

Tune this two parameters for your RAM/VRAM (each 18 it is about 3GB). For 5090 max_gpu_cache = 120 and it is >85% !! cache hit rate. Who can check speed?

Best for loading speed: PCE 5.0 Raid 0 up to 30Gb/s NVME SSD.

Available pinable ram (usualy 1/2 RAM) with DMA - much faster than RAM.

Hope 5090 will give > 20 t/s.. (i don`t have FP8 capable GPU so all calculations now in bfp16, TODO: find 4090 or 5090 and optimize for FP8)

Same lazy load and caching strategy with full controll on vram/ram usage can be used for all MoE models!!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant