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 normalization for compatible EXAONE 4.5 configurations with trailing MTP-only layer_types entries.
  • Preserved strict validation for unexpected layer_types count mismatches.
  • Removed native subclassing and AutoConfig re-registration to preserve Hugging Face mappings.
  • Added a 60,000-device-memory skip marker for TestExaone4_5_33B.
  • Removed two obsolete L40S waiver entries for forced_chunked_prefill and full_budget.
  • The memory threshold is intentional because EXAONE 4.5 33B requires approximately 66 GB, while L40S provides approximately 44 GiB.
  • The broad class-level skip can also skip future tests added to TestExaone4_5_33B.

QA Engineer Review

  • Added test_exaone4_5_config_normalizes_trailing_mtp_layer_types.
  • Added test_exaone4_5_config_preserves_unexpected_layer_type_mismatch.
  • Updated TestExaone4_5_33B.test_auto_dtype with the device-memory skip marker.
  • Removed the corresponding L40S entries from tests/integration/test_lists/waives.txt.
  • The new unit tests are not listed in tests/integration/test_lists/test-db/ or tests/integration/test_lists/qa/.
  • The test changes provide direct unit coverage for normalization and validation behavior.
  • Verdict: needs follow-up because CBTS coverage data is unavailable.

@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

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

EXAONE 4.5 configuration handling normalizes compatible trailing MTP layer types before sub-configuration validation and preserves errors for mismatched structures. Multimodal accuracy tests now require sufficient device memory, with matching waiver entries removed.

Changes

EXAONE 4.5 MTP configuration

Layer / File(s) Summary
MTP layer normalization and configuration initialization
tensorrt_llm/_torch/models/modeling_exaone4_5.py
The fallback configuration path validates compatible trailing MTP layer types, logs a warning, and truncates them before creating the text sub-configuration.
Configuration validation and integration-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 layer-count errors. The EXAONE 4.5 accuracy test skips below 60,000 device-memory units, and two matching waiver entries are removed.

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

Possibly related PRs

Suggested reviewers: qijune, bowenfu, jieli-matrix

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The pull request has no author-provided description, so it does not explain the issue, solution, tests, or checklist status. Add a description that explains the issue and solution, lists test coverage, and addresses the required checklist items.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title identifies the EXAONE 4.5 33B memory fix and uses the required NVBugs and type format.
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.

Comment thread tensorrt_llm/_torch/models/modeling_exaone4_5.py Outdated
Comment thread tensorrt_llm/_torch/models/modeling_exaone4_5.py Outdated
Comment thread tests/unittest/_torch/modeling/test_modeling_exaone4_5.py
@yechank-nvidia
yechank-nvidia force-pushed the fix/exaone4-5-fp8-l40s branch from 85ff940 to 6c3d236 Compare August 4, 2026 09:28
@yechank-nvidia

Copy link
Copy Markdown
Collaborator Author

Hi @BowenFu, good catch on both points. I removed the native subclass and AutoConfig re-registration entirely. With the currently pinned Transformers 5.5.4, the fallback remains the live path and keeps the normalization narrowly scoped. If native exaone4_5 support becomes available after a dependency bump, we now use HF’s config and registration unchanged, preserving the AutoModel* mappings.

Also, EXAONE 4.5 33B requires approximately 66 GB of device memory, which exceeds the roughly 44 GiB available on an L40S. Skipping these QA cases on L40S is therefore intentional.

@yechank-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63726 [ run ] triggered by Bot. Commit: 6c3d236 Link to invocation

Signed-off-by: yechank <161688079+yechank-nvidia@users.noreply.github.com>
@yechank-nvidia
yechank-nvidia force-pushed the fix/exaone4-5-fp8-l40s branch from 6c3d236 to 18b0abd Compare August 4, 2026 09:45

@BowenFu BowenFu left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Thanks for the update. A couple of suggestions before merge:

  • Could we remove the native else: subclass and AutoConfig.register(..., exist_ok=True) path? The current commit still registers Exaone4_5Config over HF’s native Exaone4_5_Config, which may break AutoModel*.from_config/from_pretrained lookups on Transformers >=5.8. This also appears inconsistent with the latest comment saying that subclass and re-registration were removed.

  • Could we scope skip_less_device_memory(60000) to the two affected tests instead of the whole TestExaone4_5_33B class? That would avoid silently skipping future tests added to this class on lower-memory GPUs.

Approving based on the author’s confirmation that these points will be addressed.

Comment thread tensorrt_llm/_torch/models/modeling_exaone4_5.py Outdated
Comment thread tests/integration/defs/accuracy/test_llm_api_pytorch_multimodal.py Outdated

@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.

Actionable comments posted: 1

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

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

Use a parameterized type for text_config.

text_config: dict does not describe the mapping. Use dict[str, object], or a project-specific TypedDict if the schema is shared. This improves static checking for the values validated below.

Proposed annotation
-def _normalize_exaone4_5_mtp_layer_types(text_config: dict) -> None:
+def _normalize_exaone4_5_mtp_layer_types(text_config: dict[str, object]) -> None:
🤖 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` at line 41, Update the
text_config parameter annotation in _normalize_exaone4_5_mtp_layer_types from an
unparameterized dict to dict[str, object], or the project’s shared TypedDict if
one defines this schema, while preserving the function’s existing validation
behavior.

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.

Inline comments:
In `@tests/integration/defs/accuracy/test_llm_api_pytorch_multimodal.py`:
- Around line 134-135: Update the test-db L0 B200 CI configuration to include
both parameterized cases of TestExaone4_5_33B.test_auto_dtype, matching the
existing entries in llm_function_core.txt; preserve the test’s current
parameterization and ensure both cases run with LLM_MODELS_ROOT configured on
GPU-enabled CI.

---

Nitpick comments:
In `@tensorrt_llm/_torch/models/modeling_exaone4_5.py`:
- Line 41: Update the text_config parameter annotation in
_normalize_exaone4_5_mtp_layer_types from an unparameterized dict to dict[str,
object], or the project’s shared TypedDict if one defines this schema, while
preserving the function’s existing validation behavior.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: d5c0d4fa-8433-4b54-baf0-8763b87a7bbd

📥 Commits

Reviewing files that changed from the base of the PR and between 6c3d236 and 18b0abd.

📒 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 (1)
  • tests/unittest/_torch/modeling/test_modeling_exaone4_5.py

Comment thread tests/integration/defs/accuracy/test_llm_api_pytorch_multimodal.py
@yechank-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63740 [ run ] triggered by Bot. Commit: 18b0abd Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63726 [ run ] completed with state ABORTED. Commit: 6c3d236

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63740 [ run ] completed with state SUCCESS. Commit: 18b0abd
/LLM/main/L0_MergeRequest_PR pipeline #51691 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

@yechank-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63939 [ run ] triggered by Bot. Commit: 18b0abd Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63939 [ run ] completed with state SUCCESS. Commit: 18b0abd
/LLM/main/L0_MergeRequest_PR pipeline #51874 completed with status: 'SUCCESS'

CI Report

Link to invocation

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