Repository navigation
[None][feat] Add Laguna model support (Poolside Laguna-XS.2) #13559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
9289d06
Rebase and squash of Laguna development commits
dcampora ab779ce
fix: Changes to work without overlay and with new transformers
DomBrown 62de961
fix: CI test paths and rope un-needed changes
DomBrown 76100a0
test: update CI yaml files
DomBrown fb7bb37
fix: apply fix from Poolside
DomBrown 53f9983
test: Add additional test coverage
DomBrown 378cb80
fix: Another patch from Poolside
DomBrown bb720c6
Respond to reviewer comments
DomBrown c7b44f1
Update QA lists per reviewer comment
DomBrown File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,27 +1,33 @@ | ||
| from tensorrt_llm._torch.configs.deepseek_v3 import DeepseekV3Config | ||
| from tensorrt_llm._torch.configs.laguna import LagunaConfig | ||
|
|
||
|
|
||
| def _register_custom_configs_with_transformers() -> None: | ||
| # Make AutoConfig.from_pretrained / AutoTokenizer.from_pretrained accept | ||
| # model_types that TRT-LLM understands but upstream transformers does not | ||
| # (DeepSeek-V3.2 and Kimi K2 both ship config.json with these model_types | ||
| # and rely on TRT-LLM's local DeepseekV3Config workaround). | ||
| # (DeepSeek-V3.2, Kimi K2, and Laguna ship config.json with these | ||
| # model_types and rely on TRT-LLM's local config workarounds). | ||
| # | ||
| # Without this, transformers 5.5.x falls back to a bare PreTrainedConfig | ||
| # that lacks attributes like `max_position_embeddings`, and | ||
| # AutoTokenizer.from_pretrained then raises AttributeError before any | ||
| # tokenizer can be constructed. Bypass AutoConfig.register's model_type | ||
| # consistency check (DeepseekV3Config.model_type is "deepseek_v3") by | ||
| # writing into the underlying mapping directly. | ||
| # consistency check for aliases (for example, DeepseekV3Config.model_type | ||
| # is "deepseek_v3") by writing into the underlying mapping directly. | ||
| from transformers.models.auto.configuration_auto import CONFIG_MAPPING | ||
|
|
||
| for model_type in ("deepseek_v32", "kimi_k2"): | ||
| custom_configs = { | ||
| "deepseek_v32": DeepseekV3Config, | ||
| "kimi_k2": DeepseekV3Config, | ||
| "laguna": LagunaConfig, | ||
| } | ||
| for model_type, config_class in custom_configs.items(): | ||
| if model_type in CONFIG_MAPPING: | ||
| continue | ||
| CONFIG_MAPPING.register(model_type, DeepseekV3Config, exist_ok=True) | ||
| CONFIG_MAPPING.register(model_type, config_class, exist_ok=True) | ||
|
|
||
|
|
||
| _register_custom_configs_with_transformers() | ||
| del _register_custom_configs_with_transformers | ||
|
|
||
| __all__ = ["DeepseekV3Config"] | ||
| __all__ = ["DeepseekV3Config", "LagunaConfig"] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
|
|
||
| from transformers.configuration_utils import PretrainedConfig | ||
|
|
||
|
|
||
| # This is a workaround until we use a version of transformers that supports | ||
| # Laguna. Namely: v5.7.0 or higher. | ||
| class LagunaConfig(PretrainedConfig): | ||
| model_type = "laguna" | ||
| keys_to_ignore_at_inference = ["past_key_values"] | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.