Skip to navigation

nemo_automodel.components.models.inkling2.config

View as MarkdownOpen in Claude

Configuration for the inspected Inkling2 checkpoint and text reference.

Module Contents

Classes

NameDescription
Inkling2ConfigReleased image/text model configuration and optional source quantization.
Inkling2LegacyConfigCompatibility with the original download’s immutable configuration.
Inkling2QuantizationConfigExpert storage of a released checkpoint: NVFP4 for the first layers, MXFP8 after them.
Inkling2ReleasedQuantizationLabelquantization_config of a released config.json: the format name only.
Inkling2TextConfigText configuration; defaults follow the inspected checkpoint, not serving defaults.
Inkling2VisionConfigReleased image encoder dimensions, including the spatial merge projector.
_ParameterGroupOne hf_quant_config.json group; only the keys the loader reads.

Functions

NameDescription
_checked_quantization_config-
_is_released_label-
load_quantization_configRead the released hf_quant_config.json stored next to config.json.
resolve_quantization_configFill quantization_config from the checkpoint sidecar for a config loaded from a checkpoint.

Data

_EXPERT_PROJECTIONS

_EXPERT_WEIGHT

API

class nemo_automodel.components.models.inkling2.config.Inkling2Config(
text_config: nemo_automodel.components.models.inkling2.config.Inkling2TextConfig | dict[str, typing.Any] | None = None,
vision_config: nemo_automodel.components.models.inkling2.config.Inkling2VisionConfig | dict[str, typing.Any] | None = None,
mtp_config: dict[str, typing.Any] | None = None,
kwargs: typing.Any = {}
)

Bases: PretrainedConfig

Released image/text model configuration and optional source quantization.

model_type
= 'inkling2'
quantization_config
sub_configs
text_config
vision_config
nemo_automodel.components.models.inkling2.config.Inkling2Config.to_dict() -> dict[str, typing.Any]

Serialize both levels; a stripped source declaration is stripped from the text config too.

The shared floating export removes quantization_config from this configuration after dequantization. The text configuration carries the same declaration, and a reload would otherwise promote it back to the root and request packed tensors.

class nemo_automodel.components.models.inkling2.config.Inkling2LegacyConfig(
kwargs: typing.Any = {}
)

Bases: Inkling2Config

Compatibility with the original download’s immutable configuration.

model_type
= 'inkling2_mm_model'
class nemo_automodel.components.models.inkling2.config.Inkling2QuantizationConfig

Bases: typing.TypedDict

Expert storage of a released checkpoint: NVFP4 for the first layers, MXFP8 after them.

nvfp4_layer_count
int
quant_method
Literal['inkling2']
class nemo_automodel.components.models.inkling2.config.Inkling2ReleasedQuantizationLabel

Bases: typing.TypedDict

quantization_config of a released config.json: the format name only.

The expert layout is in hf_quant_config.json; building a model replaces this label with it.

quant_algo
Literal['NVFP4', 'MXFP8']
quant_method
Literal['modelopt']
class nemo_automodel.components.models.inkling2.config.Inkling2TextConfig(
hidden_size: int = 4608,
num_hidden_layers: int = 48,
vocab_size: int = 201024,
unpadded_vocab_size: int | None = None,
num_attention_heads: int = 48,
num_key_value_heads: int = 8,
head_dim: int = 128,
swa_num_attention_heads: int | None = None,
swa_num_key_value_heads: int | None = None,
swa_head_dim: int | None = None,
d_rel: int = 16,
rel_extent: int = 1024,
sliding_window_size: int = 1024,
local_layer_ids: list[int] | None = None,
max_position_embeddings: int = 1048576,
model_max_length: int | None = None,
log_scaling_n_floor: int = 8192,
log_scaling_alpha: float = 0.1,
rms_norm_eps: float = 1e-06,
qk_l2_clip_threshold: float = 22.627416997969522,
rel_l2_clip_threshold: float = 8.0,
sconv_kernel_size: int = 4,
n_layers_per_attn_res_block: int | None = None,
n_layers_per_attnres_block: int | None = None,
attn_res_normalize_values: bool = True,
pre_norm_pre_affine: bool = False,
final_norm_pre_affine: bool = False,
use_value_norm_no_gamma: bool = True,
q_bias: bool = False,
o_bias: bool = False,
n_routed_experts: int = 384,
num_experts_per_tok: int = 8,
n_shared_experts: int = 0,
intermediate_size: int = 2304,
mlp_gate_softcap: float = 4.0,
mlp_up_softcap: float = 25.0,
route_scale: float = 8.0,
use_gate_bias: bool = True,
final_logit_softcapping: float = 30.0,
initializer_range: float = 0.02,
tie_word_embeddings: bool = False,
kwargs: typing.Any = {}
)

Bases: PretrainedConfig

Text configuration; defaults follow the inspected checkpoint, not serving defaults.

attribute_map
base_config_key
= 'text_config'
local_layer_ids
max_position_embeddings
model_type
= 'inkling2_model'
n_layers_per_attn_res_block
quantization_config
swa_head_dim
= head_dim if swa_head_dim is None else swa_head_dim
swa_num_attention_heads
swa_num_key_value_heads
unpadded_vocab_size
class nemo_automodel.components.models.inkling2.config.Inkling2VisionConfig(
temporal_patch_size: int = 2,
native_patch_size: int = 20,
adapter_merge_size: int = 2,
projection_hidden_dim: int = 4096,
projector_bias: bool = False,
hidden_size: int = 1024,
num_hidden_layers: int = 23,
num_attention_heads: int = 16,
mlp_ratio: float = 4.0,
posemb_grid_size: int = 32,
layer_norm_eps: float = 1e-05,
kwargs: typing.Any = {}
)

Bases: PretrainedConfig

Released image encoder dimensions, including the spatial merge projector.

model_type
= 'inkling2_vision_model'
class nemo_automodel.components.models.inkling2.config._ParameterGroup

Bases: typing.TypedDict

One hf_quant_config.json group; only the keys the loader reads.

compute_dtype
str
tensors
list[str]
nemo_automodel.components.models.inkling2.config.load_quantization_config(
name_or_path: str,
num_hidden_layers: int,
revision: str | None = None

Read the released hf_quant_config.json stored next to config.json.

Parameters:

name_or_path
str

Local checkpoint directory or Hub repository id.

num_hidden_layers
int

Decoder depth the expert declaration must cover.

revision
str | NoneDefaults to None

Hub revision the weights are loaded from; None reads the repository’s default branch. Ignored for a local directory.

Returns: Inkling2QuantizationConfig | None

The expert storage layout, or None for a checkpoint without the sidecar,

nemo_automodel.components.models.inkling2.config.resolve_quantization_config(
revision: str | None = None
) -> None

Fill quantization_config from the checkpoint sidecar for a config loaded from a checkpoint.

Parameters:

config
Inkling2TextConfig | Inkling2Config

Text or image/text configuration; both levels receive the declaration. A released config.json label is replaced by the layout the sidecar declares.

revision
str | NoneDefaults to None

Resolved Hub revision of the checkpoint, so the sidecar comes from the same snapshot as the weights.

Raises:

  • ValueError: If config.json names a quantized format and the sidecar cannot be found.
nemo_automodel.components.models.inkling2.config._EXPERT_PROJECTIONS = ('w13_weight', 'w2_weight')
nemo_automodel.components.models.inkling2.config._EXPERT_WEIGHT = re.compile('model\\.llm\\.layers\\.(\\d+)\\.mlp\\.experts\\.(w13_weight|w2_weigh...