Repository navigation
Block compile: find decoder layers structurally and wrap mixed stacks per class - #14397
Merged
Merged
Conversation
…r class Decoder layer lists were only found when every element was one class named *DecoderLayer, so hybrid stacks (jamba, olmo_hybrid, mllama text) and layers named *Block / *Layer (gpt2, gpt_neox, t5 decoder) never got the per-block compile. Lists of GradientCheckpointingLayer subclasses held next to a token embedding, outside vision / audio towers, are now found too and wrapped per class. Lists the old rule found are unchanged. Mamba-style SSM layers in the newly found lists stay eager unless UNSLOTH_BLOCK_COMPILE_SSM=1, decided per layer. Shared layers count once, instances of a wrapped class outside the lists keep the stock forward, and the dynamo recompile limit covers every layer kind.
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The per-decoder-layer compile (#10744) only found ModuleLists whose elements were one class named
*DecoderLayer, so hybrid stacks and layers named*Block/*Layernever got it.GradientCheckpointingLayersubclasses (mixed classes allowed) held next to a token embedding, outside vision / audio towers; without that base class, one class endingDecoderLayer/Block/Layer. Each class is wrapped once; the decision is per instance.UNSLOTH_BLOCK_COMPILE_SSM=1opts in.Tests
tests/test_block_compile_discovery.py(meta-device models from default configs, toy stacks): 18 of 23 fail on main, 24 pass here on torch 2.10, 2.13, 2.14 and transformers 4.57.6 / 5.17.Not covered