Skip to content

Looped layers (and drive-by transformer deslop) - #1265

Draft
odilf wants to merge 3 commits into
inkling-lalamo-configfrom
looped-transformer
Draft

odilf wants to merge 3 commits into
inkling-lalamo-configfrom
looped-transformer

Conversation

@odilf

@odilf odilf commented Nov 27, 2026

Copy link
Copy Markdown
Contributor

There was a bunch of sloppy code in transformer that become even bigger slop with looped transformers, so I took the liberty to try to tidy it up. Changes in this PR inclde:

  • looped transformer support
  • store cache vs readout steps up front (i.e., LayerSchedule)
  • use newtypes to avoid mental overhead and confusion between kinds of indices
  • resolve speculator shape at load so we know hidden layer indices (and any other relevant static info) up front instead of doing this whole rigamarole of passing and checking hidden layer indices on every decode
  • moved debug groups to caller for layers, since it's the caller who knows how to distinguish the layers.
  • hidden features is just an empty slice instead of None
  • gate final_hidden on speculator in stream.rs directly instead of in the end of Decoder::encode
  • removed config from DFlashTfmSpeculator

a small change in behavior, uzu now rejects if the hidden captured indices are not in order, which lalamo technically allows in speculators (it only checks range there). I don't think this is hit in practice.

@odilf
odilf added this pull request to stack #1266 November 27, 2026 17:48
@odilf odilf changed the title Looped transformer Looped layers (and drive by transformer deslop) Nov 27, 2026
@odilf odilf changed the title Looped layers (and drive by transformer deslop) Looped layers (and drive-by transformer deslop) Nov 28, 2026
@odilf
odilf force-pushed the looped-transformer branch 2 times, most recently from b1de46c to b0ba3b8 Compare November 30, 2026 14:29
@odilf
odilf force-pushed the looped-transformer branch from b0ba3b8 to 82d777a Compare December 1, 2026 18:39
@odilf
odilf force-pushed the looped-transformer branch from 82d777a to 3837a66 Compare December 1, 2026 19:15
@odilf

odilf commented Dec 1, 2026

Copy link
Copy Markdown
Contributor Author

merged with main, ngram embeddings are now on LayerSchedule too.

@odilf
odilf force-pushed the looped-transformer branch 3 times, most recently from 3e4df62 to 7e2044a Compare December 2, 2026 11:16
@odilf
odilf force-pushed the looped-transformer branch from 7e2044a to 2dfba96 Compare December 2, 2026 18:24
@odilf
odilf force-pushed the looped-transformer branch from 2dfba96 to 554d774 Compare December 2, 2026 22:42

This branch has not been deployed

No deployments
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