Repository navigation
Description
Note: Please do not remove the questions. Answer beside them.
- Did you update? - No, because I just installed it on windows 20 minutes ago, and the update command is the same as the install command.
ColaborKaggleor local / cloud - Local, windows install.- Number GPUs used, use
nvidia-smi- Only have 1 GPU. 5090. - Which notebook? Please link! - N/A
- Which Unsloth version, TRL version, transformers version, PyTorch version?
Unsloth = 2026.7.5
Transformers = pre-installing transformers 5.3.0 for newer model support...
transformers 5.3.0 pre-installed
pre-installing transformers 5.5.0 for Gemma 4 support...
transformers 5.5.0 pre-installed
pre-installing transformers 5.10.2 for Gemma 4 Unified support...
transformers 5.10.2 pre-installed
PyTorch: 2.10.0+cu130
CUDA: 13.0
CUDA available: True
- Which trainer?
SFTTrainer,GRPOTraineretc - N/A
I'm just using unsloth for chat at the moment, testing existing models I have. It seems to be significantly faster than llama.cpp, giving me significant performance gains (not sure why yet, I wonder if there's some setting happening I could replicate on llama.cpp).
However, while the tok/s results are great, the issue is how laggy the webUI is.
Simply typing in the text box is slow/laggy. Each word I type doesn't appear in the box until I'm already halfway through typing the next word.
It's also visible during actual inference, as letters/words don't appear as they are generated one at a time, but instead the inference will stop updating for a second and then an entire chunk of text will spawn in.
Edit:
If I do a full restart (which also means updating, cos I used the install command again), and then start a new chat window, then typing in text works fine. Happens at normal speed. The text being generated also appears at the speed I would expect - at first.
But after a few lines it slows down and begins to lag, and any further prompts in that chat are very laggy. So it seems to be some kind of memory bug I would assume.
I have tested on chrome as well as edge, identical behaviour.
System is currently sitting at about 30gb of unused memory out of 64 so it's not a memory issue on my end. Could be a browser issue of course, but as llama.cpp and other frontends I have tried all use the same browser, and none of those have this issue, it seems more likely the issue is with unsloth-studios handling of whatever is causing the lag.
Edit 2:
I've realised that my standard test I've been doing for all llm frontends etc has been to "write a html flappy bird game with no dependencies" because it's a standard easy coding task so I can get consistent speed tests.
However on unsloth studio, this also spawns a canvas box, with a working version of the code in it you can open up. Which is great. But this seems like it might be the cause of the lag.
Activity
Lyxot commentedon Jul 28, 2026
Can you check VRAM usage?
StudioNirin commentedon Jul 28, 2026
Vram usage is high, around 30gb on a 5090, but its the same as when I do other prompts (or the same prompts on llama.cpp) and the issue doesnt happen then.
Its a bug involving the html canvas tool that pops up it seems
shimmyshimmer commentedon Jul 28, 2026
Thanks for the video and the log, both were the key to tracking this down.
Your instinct that it was the canvas turned out to be a red herring, but the thing you spotted in the video was exactly right: reasoning text streams fluidly, code does not. That is the whole bug.
While a code fence is still streaming, our Shiki plugin gets called on every animation frame with the entire block and re-tokenizes it from scratch. So the work per frame grows with the size of the block. Instrumenting one generation:
That is 5.5MB of tokenizing to render a 13.5KB block. A CPU profile put about half the renderer main thread inside the syntax tokenizer. Plain prose has no tokenizer, which is why the thinking section stayed smooth.
The canvas is not involved. A Python block of the same size stalls identically, and a canvas panel sitting open with the game running costs nothing measurable (the preview iframe runs out of process, so it cannot starve the tab). "write a html flappy bird game" is just a prompt that reliably produces a big code block very fast, and your snake run was worse because your 5090 was pushing 230 tok/s so the block got large much sooner.
Your "CPU barely at 7%" observation also fits. That is one saturated renderer thread on a many core CPU, not an idle machine.
Fix is in #7537. Reproducing your setup by replaying a stream at 230 tok/s, dropped frames over a generation went from 460 to 63, and frame pacing stays at a steady 16.7ms instead of collapsing into lumps.
Two related things I found while measuring, which are separate and not fixed by that PR:
If you can, please try the branch in #7537 and confirm it matches what you see on Windows. I verified on macOS, and your report is the only data point on a 5090 so far.
StudioNirin commentedon Jul 28, 2026
Im just about to get some sleep so ill try and give it a try later today and ill report back 😀
shimmyshimmer commentedon Jul 28, 2026
Oop it's not in unsloth main yet and we havent merged yet but feel free to download those specific PRs :)
shimmyshimmer commentedon Jul 29, 2026
@StudioNirin new release today ish - hopefully when the new release comes out it will be fixed :)