feat: Expand Eagle Speculator to Support Multiple Transformer Layer Types#49
Merged
feat: Expand Eagle Speculator to Support Multiple Transformer Layer Types#49
Conversation
Signed-off-by: Fynn Schmitt-Ulms <fschmitt@redhat.com>
…test_eagle_config.py Signed-off-by: Fynn Schmitt-Ulms <fschmitt@redhat.com>
…test_eagle_model.py Signed-off-by: Fynn Schmitt-Ulms <fschmitt@redhat.com>
Signed-off-by: Fynn Schmitt-Ulms <fschmitt@redhat.com>
…s model Signed-off-by: Fynn Schmitt-Ulms <fschmitt@redhat.com>
Signed-off-by: Fynn Schmitt-Ulms <fschmitt@redhat.com>
|
📦 Build Artifacts Available |
markurtz
reviewed
Jul 11, 2025
Signed-off-by: Fynn Schmitt-Ulms <fschmitt@redhat.com>
Collaborator
Author
|
Hi @markurtz, I implemented the changes requested. Let me know what you think |
shanjiaz
pushed a commit
that referenced
this pull request
Jul 14, 2025
…ypes (#49) Closes #44 Expands support for other decoder layer types (MistralDecoderLayer, Qwen3DecoderLayer, etc.) > # Tasks > * [x] Research and identify transformer layer classes within Hugging Face for each targeted architecture. > * [x] Update `EagleSpeculatorConfig` to include architecture type selection. This is handled using the existing `transformer_layer_architecture` field to specify the decoder layer class. The `transformer_layer_config` must also match the decoder layer type. i.e. to use `LlamaDecoderLayer` `transformer_layer_config` must be an instance of `LlamaConfig`, for `MistralDecoderLayer` it must be an instance of `MistralConfig`, etc. > * [x] Update `EagleSpeculator` to construct the selected transformer layer type correctly. We find the corresponding decoder layer class (and also layer norm class), using the config class to determine the model type / import path. This generalizes the approach so that we can use **any** decoder layer and config combination in the transformers library. > * [x] Update or create relevant tests in: > * `tests/unit/models/test_eagle_config.py` > * `tests/unit/models/test_eagle_model.py` Added explicit tests for the architectures listed in #44 (Llama, Mistral, Qwen, DeepSeek, Mistral, Gemma, Granite) > * [x] Ensure compatibility with `SpeculatorModelConfig.from_pretrained` and `SpeculatorModel.from_pretrained`. --------- Signed-off-by: Fynn Schmitt-Ulms <fschmitt@redhat.com>
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.
Closes #44
Expands support for other decoder layer types (MistralDecoderLayer, Qwen3DecoderLayer, etc.)
This is handled using the existing
transformer_layer_architecturefield to specify the decoder layer class.The
transformer_layer_configmust also match the decoder layer type. i.e. to useLlamaDecoderLayertransformer_layer_configmust be an instance ofLlamaConfig, forMistralDecoderLayerit must be an instance ofMistralConfig, etc.We find the corresponding decoder layer class (and also layer norm class), using the config class to determine the model type / import path. This generalizes the approach so that we can use any decoder layer and config combination in the transformers library.
Added explicit tests for the architectures listed in #44 (Llama, Mistral, Qwen, DeepSeek, Mistral, Gemma, Granite)