Repository navigation
fix: unwrap llm_config decoder configurations in FPM onboarding #656
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
Arsene12358
merged 5 commits into
main
from
yimingl/aisim-2170-fpm-collector-and-intake-miss-the-mamba-state-of-nemotron-35
Nov 9, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
e5dd91b
fix: read llm_config decoders in the FPM collector and profile check
Arsene12358 00cecff
fix: read llm_config decoders in FPM config intake
Arsene12358 3bd920d
test: pin malformed wrapper architectures in the decoder key helper
Arsene12358 ddbf3d9
fix: keep the wrapper architecture when the decoder declares none
Arsene12358 1b9658e
test: expect the bundled Nemotron 3.5 Super VL configuration to read …
Arsene12358 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
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 |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| # SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """Choose the key of a checkpoint config that nests the text decoder. | ||
|
|
||
| FPM config intake, the FPM collector and the FPM profile check call this function, so all three read one decoder. | ||
| The module imports only the standard library. Config intake must stay usable in a process that does not import | ||
| aisimulate_core.sdk. The cold-process tests in tests/unit/test_support_topology.py and | ||
| tests/unit/test_onboard_topology.py check that. The one exception is a document that holds both text_config and a | ||
| nonempty llm_config: for that shape the function reads the registry from aisimulate_core.sdk.common. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from collections.abc import Mapping | ||
| from typing import Any | ||
|
|
||
|
|
||
| def decoder_config_key(document: Mapping[str, Any]) -> str | None: | ||
| """Return the key that nests the text decoder in a checkpoint config, or None for a flat config. | ||
|
|
||
| The candidates, in order, are the key that MULTIMODAL_TEXT_CONFIG_KEY registers for the wrapper's first | ||
| architecture, then text_config, then llm_config. The first candidate that the document holds wins. | ||
| text_config is held whenever the key is present, so a malformed one is still chosen and intake reports it. | ||
| llm_config is held only as a nonempty object, so a null, empty or non-object value leaves the config flat. | ||
| The function never raises. | ||
|
|
||
| The registry maps every wrapper to text_config or llm_config. It changes the answer only when the document holds | ||
| both keys and the wrapper maps to llm_config, so the registry is imported only in that case. | ||
| tests/unit/sdk/test_fpm_model_metadata.py checks that the registry holds no other key. | ||
| """ | ||
| text_held = "text_config" in document | ||
| llm_config = document.get("llm_config") | ||
| llm_held = isinstance(llm_config, dict) and bool(llm_config) | ||
|
Arsene12358 marked this conversation as resolved.
Resolved
|
||
| if text_held and llm_held: | ||
| from aisimulate_core.sdk.common import MULTIMODAL_TEXT_CONFIG_KEY | ||
|
|
||
| architectures = document.get("architectures") | ||
| wrapper = architectures[0] if isinstance(architectures, list) and architectures else None | ||
| if isinstance(wrapper, str) and MULTIMODAL_TEXT_CONFIG_KEY.get(wrapper) == "llm_config": | ||
| return "llm_config" | ||
| if text_held: | ||
| return "text_config" | ||
| return "llm_config" if llm_held else None | ||
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
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.