Skip to content

[https://nvbugs/6327149][fix] Handle EXAONE 4.5 33B memory constraints - #16992

Open
yechank-nvidia wants to merge 1 commit into
NVIDIA:mainfrom
yechank-nvidia:fix/exaone4-5-fp8-l40s
Open

[https://nvbugs/6327149][fix] Handle EXAONE 4.5 33B memory constraints#16992
yechank-nvidia wants to merge 1 commit into
NVIDIA:mainfrom
yechank-nvidia:fix/exaone4-5-fp8-l40s

Conversation

@yechank-nvidia

@yechank-nvidia yechank-nvidia commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Dev Engineer Review

  • Added EXAONE 4.5 MTP layer-layout normalization for configs where the base decoder layer_types include extra trailing MTP-only entries, while keeping strict validation for unexpected layer_types count mismatches.
  • Implemented _normalize_exaone4_5_mtp_layer_types(text_config: dict) and wired it into both the local (HF import fallback) and native HF config paths via a defensive copy.deepcopy when text_config is provided as a dict; logs a warning and truncates only for the compatible _num_mtp_layers == num_nextn_predict_layers case.
  • Updated Exaone4_5Config to alias the native HF Exaone4_5_Config as _HfExaone4_5Config and wrap/extend it to apply the legacy FP8 MTP layout compatibility.
  • Test-related adjustment: inserted a @pytest.mark.skip_less_device_memory(60000) on TestExaone4_5_33B to address device memory constraints.
  • Test waiver updates: removed two SKIP entries in tests/integration/test_lists/waives.txt for TestExaone4_5_33B::test_auto_dtype[...] parameterizations forced_chunked_prefill and full_budget.

QA Engineer Review

  • Tests modified (code):

    • tests/unittest/_torch/modeling/test_modeling_exaone4_5.py
      • Added test_exaone4_5_config_normalizes_trailing_mtp_layer_types
      • Added test_exaone4_5_config_preserves_unexpected_layer_type_mismatch
    • tests/integration/defs/accuracy/test_llm_api_pytorch_multimodal.py
      • Added @pytest.mark.skip_less_device_memory(60000) immediately before TestExaone4_5_33B
  • Test-list / CI waiver modified:

    • tests/integration/test_lists/waives.txt
      • Removed SKIP waiver entries for TestExaone4_5_33B::test_auto_dtype[...] covering forced_chunked_prefill and full_budget under the full:L40S/accuracy/test_llm_api_pytorch_multimodal.py section.
  • Coverage in tests/integration/test_lists/:

    • The two new unit tests are not listed in tests/integration/test_lists/test-db/ or tests/integration/test_lists/qa/ (not referenced there).
    • The integration waiver removal affects CI/integration behavior for the EXAONE 4.5 33B L40S accuracy tests.
  • Verdict: needs follow-up.

@yechank-nvidia yechank-nvidia self-assigned this Jul 29, 2026
@yechank-nvidia
yechank-nvidia requested review from a team as code owners July 29, 2026 04:51
@yechank-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run

Signed-off-by: yechank <161688079+yechank-nvidia@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 85dcac5c-1818-4133-868c-9b97a1c5334e

📥 Commits

Reviewing files that changed from the base of the PR and between d600e86 and 85ff940.

📒 Files selected for processing (4)
  • tensorrt_llm/_torch/models/modeling_exaone4_5.py
  • tests/integration/defs/accuracy/test_llm_api_pytorch_multimodal.py
  • tests/integration/test_lists/waives.txt
  • tests/unittest/_torch/modeling/test_modeling_exaone4_5.py
💤 Files with no reviewable changes (1)
  • tests/integration/test_lists/waives.txt
🚧 Files skipped from review as they are similar to previous changes (3)
  • tests/integration/defs/accuracy/test_llm_api_pytorch_multimodal.py
  • tests/unittest/_torch/modeling/test_modeling_exaone4_5.py
  • tensorrt_llm/_torch/models/modeling_exaone4_5.py

Walkthrough

EXAONE 4.5 configuration handling now normalizes compatible trailing MTP layer types before validation, preserves errors for mismatched structures, and gates subsequent multimodal accuracy tests on available device memory.

Changes

EXAONE 4.5 MTP configuration

Layer / File(s) Summary
MTP layer normalization and config delegation
tensorrt_llm/_torch/models/modeling_exaone4_5.py
Compatible text configurations are deep-copied, normalized, warning-logged, and passed through the Hugging Face configuration path.
Configuration validation and test gating
tests/unittest/_torch/modeling/test_modeling_exaone4_5.py, tests/integration/defs/accuracy/test_llm_api_pytorch_multimodal.py, tests/integration/test_lists/waives.txt
Unit tests cover normalization and mismatch errors; multimodal accuracy tests skip below 60,000 device-memory units, and matching waiver entries are removed.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related PRs

Suggested reviewers: qijune, bowenfu

Sequence Diagram(s)

sequenceDiagram
  participant TextConfigInput
  participant Exaone4_5Config
  participant HuggingFaceConfig
  TextConfigInput->>Exaone4_5Config: pass text_config dictionary
  Exaone4_5Config->>Exaone4_5Config: normalize compatible trailing MTP layer_types
  Exaone4_5Config->>HuggingFaceConfig: initialize with normalized text_config
  HuggingFaceConfig-->>Exaone4_5Config: validate configuration or raise mismatch error
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No PR description was provided, so the required Description and Test Coverage sections are missing. Add the Description and Test Coverage sections, then complete the PR checklist items required by the template.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows the required ticket/type format and clearly summarizes the memory-constraint fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
tensorrt_llm/_torch/models/modeling_exaone4_5.py (1)

41-64: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Complete the new Python 3.10 type contracts.

Both new function signatures use incomplete or legacy annotations, contrary to the repository’s required typing style.

  • tensorrt_llm/_torch/models/modeling_exaone4_5.py#L41-L64: replace bare dict with a parameterized mutable mapping type.
  • tensorrt_llm/_torch/models/modeling_exaone4_5.py#L118-L131: use | unions, parameterized dictionaries, annotate **kwargs, and add -> None.

As per coding guidelines, “Annotate every function” and “prefer built-in generic types and |.”

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tensorrt_llm/_torch/models/modeling_exaone4_5.py` around lines 41 - 64,
Complete the Python 3.10 annotations in _normalize_exaone4_5_mtp_layer_types at
tensorrt_llm/_torch/models/modeling_exaone4_5.py:41-64 by replacing bare dict
with a parameterized mutable mapping type. Also update the function at
tensorrt_llm/_torch/models/modeling_exaone4_5.py:118-131 to use | unions,
parameterized dictionaries, an annotation for **kwargs, and -> None, following
the repository’s built-in generic typing style.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@tensorrt_llm/_torch/models/modeling_exaone4_5.py`:
- Around line 41-64: Complete the Python 3.10 annotations in
_normalize_exaone4_5_mtp_layer_types at
tensorrt_llm/_torch/models/modeling_exaone4_5.py:41-64 by replacing bare dict
with a parameterized mutable mapping type. Also update the function at
tensorrt_llm/_torch/models/modeling_exaone4_5.py:118-131 to use | unions,
parameterized dictionaries, an annotation for **kwargs, and -> None, following
the repository’s built-in generic typing style.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 98df765b-8b2e-4dee-8d5f-d3e35ca4fbef

📥 Commits

Reviewing files that changed from the base of the PR and between ebd197f and d600e86.

📒 Files selected for processing (3)
  • tensorrt_llm/_torch/models/modeling_exaone4_5.py
  • tests/integration/defs/accuracy/test_llm_api_pytorch_multimodal.py
  • tests/unittest/_torch/modeling/test_modeling_exaone4_5.py

@yechank-nvidia
yechank-nvidia force-pushed the fix/exaone4-5-fp8-l40s branch from d600e86 to 85ff940 Compare July 29, 2026 04:56
@yechank-nvidia
yechank-nvidia requested review from a team as code owners July 29, 2026 04:56
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62417 [ run ] triggered by Bot. Commit: 85ff940 Link to invocation

@yechank-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62420 [ run ] triggered by Bot. Commit: 85ff940 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62417 [ run ] completed with state ABORTED. Commit: 85ff940

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62420 [ run ] completed with state SUCCESS. Commit: 85ff940
/LLM/main/L0_MergeRequest_PR pipeline #50577 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@BowenFu

BowenFu commented Jul 29, 2026

Copy link
Copy Markdown

Holding on one thing in the new else: branch.

Today it's inert — requirements.txt pins transformers==5.5.4, which has no native exaone4_5, so the except ImportError fallback is the live path and the normalization there is correctly narrow (it needs _num_mtp_layers > 0, == num_nextn_predict_layers, and exactly num_hidden_layers + num_mtp_layers entries; the published 64/64 checkpoint is untouched).

The problem shows up whenever transformers is bumped to >=5.8. On that path you subclass HF's config as Exaone4_5Config and then AutoConfig.register(..., exist_ok=True), which replaces HF's own registration for model_type exaone4_5. HF's auto mappings are keyed on the config class name, and the subclass is named Exaone4_5Config while HF's is Exaone4_5_Config — so AutoModel*.from_config/from_pretrained on a config produced after our import raises KeyError('Exaone4_5Config'). Note main today calls no AutoConfig.register at all on the import-succeeded path, so this is new behavior that arrives silently with a dependency bump rather than with this PR.

Cheapest fixes: name the subclass Exaone4_5_Config to match, or skip the re-registration and apply the normalization where the config is loaded.

Separately, worth stating explicitly in the description: skip_less_device_memory(60000) doesn't make these two pass on L40S — it keeps them skipped, just via a marker instead of a waiver. That looks like the right call for a 33B model on 44 GiB, but as a class-level marker it will also silently skip any test added to TestExaone4_5_33B later on sub-60 GB GPUs.

return

logger.warning(
"EXAONE 4.5 config includes %d trailing MTP layer type(s); "

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: our logger isn't the python standard logger, so use f-strings instead of printf style formatting.

super().__init__(text_config=text_config, vision_config=vision_config, **kwargs)

AutoConfig.register(Exaone4_5Config.model_type, Exaone4_5Config, exist_ok=True)
else:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: is there a reason to have this in the else statement rather than in the try block? Usually else is useful if we don't want the code in that block to have the exception type(s) caught (in this case, ImportError).

@@ -1,12 +1,14 @@
# SPDX-FileCopyrightText: Copyright (c) 2022-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this file isn't scheduled to run anywhere, can you please add it to the CI test-db or QA test lists?

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.

5 participants