qbcompiler.configs.models.MoeConfig Class Reference

qbcompiler.configs.models.MoeConfig Class Reference#

Mobilint SDK qb Compiler: qbcompiler.configs.models.MoeConfig Class Reference
Mobilint SDK qb Compiler v1.2
MCS002-EN
qbcompiler.configs.models.MoeConfig Class Reference

Sparse MoE expert-selection configuration (calibration only) More...

Inheritance diagram for qbcompiler.configs.models.MoeConfig:

Public Member Functions

"MoeConfig" with_updates (self, **kwargs)
 Return a copy with updated fields.

Static Public Attributes

 model_config
List selection_mode_list
int selection_mode = Field(default=0, alias="selectionMode")
float score_threshold

Detailed Description

Sparse MoE expert-selection configuration (calibration only)

Controls which experts are calibrated inside SparseMoe modules. selectionMode is a calibration-only knob: it picks which experts collect statistics (and, for TopK, on which tokens). It does NOT change inference routing — the forward path always routes the router's top-K experts regardless of this setting. scoreThreshold is only used when selectionMode is Threshold.

Parameters
selection_modeint. Expert selection mode index (calibration only; inference is always top-K):
0: TopK - Calibrate only the router's top-K experts per token (matches inference routing).
1: All - Calibrate every expert on the full sequence.
2: Threshold - Calibrate all experts whose routing score exceeds scoreThreshold.
score_thresholdfloat. Routing score threshold used when selectionMode is Threshold (calibration only)

Definition at line 1092 of file models.py.

Member Function Documentation

◆ with_updates()

"MoeConfig" qbcompiler.configs.models.MoeConfig.with_updates ( self,
** kwargs )

Return a copy with updated fields.

Definition at line 1126 of file models.py.

Member Data Documentation

◆ model_config

qbcompiler.configs.models.MoeConfig.model_config
static
Initial value:
= ConfigDict(
populate_by_name=True,
extra="forbid",
)

Definition at line 1109 of file models.py.

◆ selection_mode_list

List qbcompiler.configs.models.MoeConfig.selection_mode_list
static
Initial value:
= Field(
default=["TopK", "All", "Threshold"], alias="selectionModeList"
)

Definition at line 1114 of file models.py.

◆ selection_mode

int qbcompiler.configs.models.MoeConfig.selection_mode = Field(default=0, alias="selectionMode")
static

Definition at line 1117 of file models.py.

◆ score_threshold

float qbcompiler.configs.models.MoeConfig.score_threshold
static
Initial value:
= Field(
default=0.0,
alias="scoreThreshold",
description="Routing score threshold used when selectionMode is Threshold (calibration only)",
ge=0,
)

Definition at line 1119 of file models.py.


The documentation for this class was generated from the following file: