Hacker News new | ask | show | jobs
by loubbrad 11 days ago
If I understand you correctly, I think you are incorrect.

Looped transformers allow models to do more compute in the forward pass for the same total parameter budget (e.g., required VRAM to store the model). This doesn't inherently optimize the memory bandwidth bottleneck. A simple way to see this is that if we reuse a layer during the forward pass, we still need to fetch its weights from HBM again, which incurs additional memory bandwidth usage.

The main advantage is more computation for a fixed parameter count and model-weight VRAM footprint, not more computation for a fixed HBM bandwidth budget.

3 comments

Yes, you are right - the layers that are looped are far too large to stay in on-chip caches and must be reread for every loop pass.

Looping saves you memory capacity needs, not memory throughput needs.

One other advantage, since your layers are reused, you have a bigger pool of jobs you can collate onto a single execution of the layer. https://chatgpt.com/share/6b044c5b-5a68-83ea-a1e5-3345439ba9...

However actually benefiting from this can be tricky! loop-sgland project has considerable effort put to finding out how much to loop any given input, it's own subproblem in making use of this: https://kschwethelm.github.io/continuous-depth-batching/ https://github.com/kschwethelm/loop-sglang

It helps at high concurrency, but not at C=1