profiles#
Normalize named MIP profiles and compile their aggregate constraints.
Classes
One absolute value or teacher-relative ratio. |
|
One total-prefix or typed-prefix depth scenario. |
|
Retention and ranking policy for homogeneous Cartesian candidates. |
|
One concrete run/variant/matrix/objective solve. |
|
One independent additive objective solve. |
|
One normalized aggregate constraint, optionally bound to a workload. |
|
Backend-neutral MIP solution-pool controls. |
Functions
Resolve percentages and produce direct additive MIP constraints. |
|
Validate and compile public |
- class BoundValue#
Bases:
objectOne absolute value or teacher-relative ratio.
- __init__(value, relative=False)#
- Parameters:
value (float)
relative (bool)
- Return type:
None
- relative: bool = False#
- value: float#
- class DepthSelection#
Bases:
objectOne total-prefix or typed-prefix depth scenario.
- __init__(counts)#
- Parameters:
counts (tuple[tuple[str, int], ...])
- Return type:
None
- as_dict()#
- Return type:
dict[str, int]
- counts: tuple[tuple[str, int], ...]#
- property slug: str#
- property total: int#
- classmethod total_prefix(count)#
- Parameters:
count (int)
- Return type:
- class HomogeneousPolicy#
Bases:
objectRetention and ranking policy for homogeneous Cartesian candidates.
- __init__(enabled=False, keep=-1, rank_by='objective', constraint_weights=())#
- Parameters:
enabled (bool)
keep (int)
rank_by (str)
constraint_weights (tuple[tuple[str, float], ...])
- Return type:
None
- constraint_weights: tuple[tuple[str, float], ...] = ()#
- enabled: bool = False#
- keep: int = -1#
- property num_solutions: int#
- rank_by: str = 'objective'#
- class MIPProfile#
Bases:
objectOne concrete run/variant/matrix/objective solve.
- __init__(profile_id, run_id, variant_id, objective, solver, homogeneous, constraints, workloads, depths, depth_selections, embedding_widths, axes_default, axis_options)#
- Parameters:
profile_id (str)
run_id (str)
variant_id (str)
objective (ObjectiveSpec)
solver (SolverOptions)
homogeneous (HomogeneousPolicy)
constraints (tuple[ProfileConstraint, ...])
workloads (dict[str, dict[str, Any]])
depths (tuple[int, ...])
depth_selections (tuple[DepthSelection, ...])
embedding_widths (tuple[int, ...])
axes_default (str)
axis_options (dict[str, Any])
- Return type:
None
- axes_default: str#
- axis_options: dict[str, Any]#
- property base_profile_id: str#
Compatibility label used by existing MIP artifact reports.
- constraints: tuple[ProfileConstraint, ...]#
- depth_selections: tuple[DepthSelection, ...]#
- depths: tuple[int, ...]#
- embedding_widths: tuple[int, ...]#
- homogeneous: HomogeneousPolicy#
- property num_homogeneous_solutions: int#
- objective: ObjectiveSpec#
- profile_id: str#
- property required_workloads: tuple[str, ...]#
- run_id: str#
- solver: SolverOptions#
- variant_id: str#
- workloads: dict[str, dict[str, Any]]#
- class ObjectiveSpec#
Bases:
objectOne independent additive objective solve.
- __init__(metric, direction)#
- Parameters:
metric (str)
direction (str)
- Return type:
None
- property bigger_is_better: bool#
- direction: str#
- metric: str#
- class ProfileConstraint#
Bases:
objectOne normalized aggregate constraint, optionally bound to a workload.
- __init__(metric, stat_name, workload, minimum, maximum)#
- Parameters:
metric (str)
stat_name (str)
workload (str | None)
minimum (BoundValue | None)
maximum (BoundValue | None)
- Return type:
None
- maximum: BoundValue | None#
- metric: str#
- minimum: BoundValue | None#
- stat_name: str#
- workload: str | None#
- class SolverOptions#
Bases:
objectBackend-neutral MIP solution-pool controls.
- __init__(backend='pulp', num_solutions=1, min_hamming_distance=1, max_seconds_per_solution=60.0)#
- Parameters:
backend (str)
num_solutions (int)
min_hamming_distance (int)
max_seconds_per_solution (float | None)
- Return type:
None
- backend: str = 'pulp'#
- max_seconds_per_solution: float | None = 60.0#
- min_hamming_distance: int = 1#
- num_solutions: int = 1#
- compile_profile_constraints(profile, *, teacher_totals)#
Resolve percentages and produce direct additive MIP constraints.
- Parameters:
profile (MIPProfile)
teacher_totals (Mapping[str | None, Mapping[str, float]])
- Return type:
dict[str, float | tuple[float | None, float | None]]
- normalize_mip_profiles(mip_cfg, *, available_depths, available_embeddings, available_depth_counts=None, depth_granularity='subblock')#
Validate and compile public
mip.runsinto concrete solve specs.- Parameters:
mip_cfg (Mapping[str, Any])
available_depths (Iterable[int])
available_embeddings (Iterable[int])
available_depth_counts (Mapping[str, int] | None)
depth_granularity (str)
- Return type:
tuple[MIPProfile, …]