Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
b885c26
EXAONE-4.5 support
yechank-nvidia Mar 25, 2026
10f030e
address model_type issue
yechank-nvidia Mar 25, 2026
285ca1d
transformer 5.0.0 compatibility
yechank-nvidia Mar 25, 2026
88dd544
remove print
yechank-nvidia Mar 25, 2026
2f93d54
optimize Qwen2.5 Vision Encoder
yechank-nvidia Apr 2, 2026
e2bb136
add EXAONE-4.5 to the README.md
yechank-nvidia Apr 2, 2026
16bd516
add unittest
yechank-nvidia Apr 2, 2026
29c8c16
update PLACEHOLDERS
yechank-nvidia Apr 3, 2026
0de69a1
modify Qwen3-VL Vision Encoder
yechank-nvidia Apr 3, 2026
45aa566
refine test
yechank-nvidia Apr 6, 2026
e48e116
fix weight loading
yechank-nvidia Apr 7, 2026
c3c4951
[None][feat] Bring EXAONE 4.5 + VLM tests up to transformers 5.8
yechank-nvidia May 11, 2026
0589177
[None][doc] Add EXAONE 4.5 to multimodal support matrix
yechank-nvidia May 11, 2026
a38102b
[None][feat] Make EXAONE 4.5 config loading work on transformers 5.3
yechank-nvidia May 11, 2026
987ec30
[None][refactor] Prefer HF's Exaone4_5 config classes when available
yechank-nvidia May 11, 2026
8e11f7c
[None][refactor] Address EXAONE 4.5 PR review feedback
yechank-nvidia May 13, 2026
a99b949
[None][refactor] Drop redundant tie_word_embeddings overrides and inl…
yechank-nvidia May 13, 2026
cc861a2
[None][refactor] Address EXAONE 4.5 PR review feedback (round 2)
yechank-nvidia May 15, 2026
74d5417
[None][test] Extend EXAONE 4.5 unit test modality coverage
yechank-nvidia May 15, 2026
981b1e6
[None][fix] Mirror Qwen3-VL max_position_embeddings from text_config
yechank-nvidia May 19, 2026
30819ae
[None][refactor] Add NVIDIA copyright header to exaone4_5_weight_mapper
yechank-nvidia May 19, 2026
36d9309
[None][test] Order disable_fuse_rope scenario last in Qwen-VL test su…
yechank-nvidia May 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/source/models/supported-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Note: Support for other models may vary. Features marked "N/A" are not applicabl

| Model Architecture/Feature | Overlap Scheduler | CUDA Graph | Chunked Prefill | Torch Sampler | TLLM C++ Sampler | KV Cache Reuse | Logits Post Processor | EPD Disaggregated Serving | Modality |
| ------------------------------------ | ----------------- | ---------- | --------------- | ------------- | ---------------- | -------------- | --------------------- | ------------------------- | --------- |
| `Exaone4_5_ForConditionalGeneration` | Yes | Yes | Yes | Yes | Yes | Yes | Yes | No | L + I + V |
| `Gemma3ForConditionalGeneration` | Yes | Yes | N/A | Yes | Yes | N/A | Yes | No | L + I |
| `Gemma4ForConditionalGeneration` | Untested | Yes | No | Yes | Untested | No | Untested | No | L + I + A [^9] |
| `HCXVisionForCausalLM` | Yes | Yes | No | Yes | Yes | Yes | Yes | No | L + I |
Expand Down
33 changes: 31 additions & 2 deletions examples/models/core/exaone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ This document shows how to build and run [EXAONE](https://huggingface.co/LGAI-EX
- [EXAONE-3.0](#exaone-30)
- [EXAONE-Deep](#exaone-deep)
- [EXAONE-4.0](#exaone-40)
- [EXAONE-4.5](#exaone-45)
- [K-EXAONE](#k-exaone)
- [PyTorch flow](#pytorch-flow)
- [Running EXAONE-4.0](#running-exaone-40)
- [Running EXAONE-4.5](#running-exaone-45)
- [Running K-EXAONE](#running-k-exaone)
- [MoE Backend Options](#moe-backend-options)
- [PyTorch flow Quantization](#pytorch-flow-quantization)
Expand Down Expand Up @@ -45,6 +47,7 @@ This document shows how to build and run [EXAONE](https://huggingface.co/LGAI-EX
* FP16
* BF16
* Tensor Parallel (TP)
* Multimodal (EXAONE-4.5 only)
* Expert Parallel (EP) (K-EXAONE only)
* Attention Data Parallel (ADP) (K-EXAONE only)
* Disaggregated Serving
Expand All @@ -59,7 +62,7 @@ This document shows how to build and run [EXAONE](https://huggingface.co/LGAI-EX

**Note:**
- **EXAONE-3.0** & **EXAONE-Deep** are supported using the [TRT Flow](#trt-flow).
- **EXAONE-4.0** & **K-EXAONE** are supported using the [PyTorch flow](#pytorch-flow).
- **EXAONE-4.0**, **EXAONE-4.5**, & **K-EXAONE** are supported using the [PyTorch flow](#pytorch-flow).

Please refer to the corresponding sections below for usage instructions and examples for each model.

Expand Down Expand Up @@ -90,6 +93,17 @@ export HF_MODEL_DIR=hf_models/exaone4
git clone https://huggingface.co/LGAI-EXAONE/EXAONE-4.0-32B $HF_MODEL_DIR
```

### EXAONE-4.5

EXAONE-4.5 is a multimodal model. It is supported only via the [PyTorch flow](#pytorch-flow).

Download the HuggingFace checkpoint for your EXAONE-4.5 variant from the [LGAI-EXAONE](https://huggingface.co/LGAI-EXAONE) organization. The example below uses `EXAONE-4.5-33B`; replace it with the variant you want to run.

```bash
export HF_MODEL_DIR=hf_models/exaone4_5
huggingface-cli download LGAI-EXAONE/EXAONE-4.5-33B --local-dir $HF_MODEL_DIR
```

### K-EXAONE

K-EXAONE is a Mixture of Experts (MoE) model based on the EXAONE architecture. It features a hybrid architecture with both dense and MoE layers, sliding window attention, and supports FP8 and NVFP4 quantization for efficient inference.
Expand All @@ -98,7 +112,7 @@ Download the HuggingFace checkpoints of the K-EXAONE model:

```bash
export HF_MODEL_DIR=hf_models/kexaone
git clone https://huggingface.co/LGAI-EXAONE/K-EXAONE-236B-A23B $HF_MODEL_DIR
huggingface-cli download LGAI-EXAONE/K-EXAONE-236B-A23B --local-dir $HF_MODEL_DIR
```

## PyTorch flow
Expand All @@ -117,6 +131,21 @@ The output will be like:
[2] Prompt: 'The future of AI is', Generated text: ' not just about technology but also about how we choose to use it. We must ensure that AI is developed and deployed in a way that benefits all of humanity, not just a select few. This means prioritizing ethical considerations, transparency, and accountability in AI development. It also means involving diverse stakeholders in the conversation about AI'
```

### Running EXAONE-4.5

To quickly run EXAONE-4.5 models, you can use [examples/llm-api/quickstart_multimodal.py](../../../llm-api/quickstart_multimodal.py):

```bash
python ../../../llm-api/quickstart_multimodal.py --model_dir $HF_MODEL_DIR
```

The output will be like:
```bash
[0] Prompt: 'Describe the natural environment in the image.', Generated text: 'Okay, the user asked me to describe the natural environment in the image. But wait, there's no image provided here. Hmm, that's a problem. How can I describe something I can't see?\n\nFirst, I need to check if there's any image attached. The user mentioned "the image," but in the current context, there's no image data. Maybe they forgot'
[1] Prompt: 'Describe the object and the weather condition in the image.', Generated text: 'Okay, the user asked me to describe the object and the weather condition in the image. But wait, there's no image provided here. Hmm, that's a problem. How can I describe something I can't see?\n\nFirst, I need to check if there's any image attached. The user mentioned "the image," but in the current context, there's no image data. Maybe'
[2] Prompt: 'Describe the traffic condition on the road in the image.', Generated text: 'Okay, the user is asking me to describe the traffic condition on the road in the image. But wait, there's a problem here—I don't actually see any image. The user mentioned "the image," but in this text-based interface, there's no visual content provided. \n\nHmm, I need to handle this carefully. The user might have forgotten to attach the image or assumed I could see it'
```

### Running K-EXAONE

K-EXAONE is a Mixture of Experts model that benefits from multiple parallelism strategies. You can run it with tensor parallelism (TP), expert parallelism (EP), and attention data parallelism (ADP):
Expand Down
10 changes: 8 additions & 2 deletions tensorrt_llm/_torch/model_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -608,8 +608,14 @@ def cached_file(path_or_repo_id, file_name):
return None

# Some checkpoints lack torch_dtype, populate with dtype
pretrained_config.torch_dtype = getattr(pretrained_config, 'dtype',
None)
dtype = getattr(pretrained_config, 'dtype', None)
# For composite VLM configs the dtype lives inside ``text_config``
# because the top-level config has no ``dtype`` field.
if dtype is None:
text_config = getattr(pretrained_config, 'text_config', None)
if text_config is not None:
dtype = getattr(text_config, 'dtype', None)
pretrained_config.torch_dtype = dtype

# Prior to transformers 5, composite configs (e.g. Qwen2_5_VLConfig) delegated attribute
# lookups to their text sub-config, so accesses like `config.vocab_size` /
Expand Down
2 changes: 2 additions & 0 deletions tensorrt_llm/_torch/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
from .modeling_cohere2 import Cohere2ForCausalLM
from .modeling_deepseekv3 import DeepseekV3ForCausalLM
from .modeling_exaone4 import Exaone4ForCausalLM
from .modeling_exaone4_5 import Exaone4_5_ForConditionalGeneration
from .modeling_exaone_moe import ExaoneMoeForCausalLM
from .modeling_gemma3 import Gemma3ForCausalLM
from .modeling_gemma3vl import Gemma3VLM
Expand Down Expand Up @@ -54,6 +55,7 @@
"CLIPVisionModel",
"DeepseekV3ForCausalLM",
"Exaone4ForCausalLM",
"Exaone4_5_ForConditionalGeneration",
"ExaoneMoeForCausalLM",
"Gemma3ForCausalLM",
"Gemma3VLM",
Expand Down
Comment thread
yechank-nvidia marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# 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 tensorrt_llm._torch.models.checkpoints.base_weight_loader import ConsumableWeightsDict
from tensorrt_llm._torch.models.checkpoints.hf.weight_mapper import HfWeightMapper
from tensorrt_llm._torch.models.modeling_utils import register_mapper


@register_mapper("HF", "Exaone4_5_ForConditionalGeneration")
class Exaone4_5HfWeightMapper(HfWeightMapper):
def preprocess_weights(self, weights: dict):
"""Rename HF checkpoint prefixes; supports plain dict and ConsumableWeightsDict."""
is_consumable = isinstance(weights, ConsumableWeightsDict)
renamed = {}
for key, value in weights.items():
if key.startswith("model.visual."):
new_key = key.replace("model.visual.", "visual.")
renamed[new_key] = value
elif key.startswith("model.language_model."):
new_key = key.replace("model.language_model.", "model.")
renamed[new_key] = value
else:
renamed[key] = value
if is_consumable:
return ConsumableWeightsDict(renamed)
return renamed
Loading
Loading