From 182dde0fdf465f8881fe56b0833820801e954e0a Mon Sep 17 00:00:00 2001 From: Joseph Magly <1159087+jmagly@users.noreply.github.com> Date: Fri, 21 Aug 2026 19:00:03 -0400 Subject: [PATCH] test: cover Mistral shared-expert memory estimate --- tests/test_mistral_architecture_contracts.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/test_mistral_architecture_contracts.py b/tests/test_mistral_architecture_contracts.py index 67821f4..264b3ab 100644 --- a/tests/test_mistral_architecture_contracts.py +++ b/tests/test_mistral_architecture_contracts.py @@ -5,6 +5,7 @@ from __future__ import annotations from types import SimpleNamespace import pytest +import torch import torch.nn as nn from obliteratus.architecture_profiles import ArchitectureClass, detect_architecture @@ -144,6 +145,14 @@ def test_composite_profile_uses_text_backbone_without_misclassifying_mistral3(): assert moe.total_params_b >= 100 +def test_composite_memory_estimate_counts_routed_and_shared_experts(): + config = _mistral3_config(_mistral4_text_config()) + + estimate_gb = loader._estimate_model_memory_gb(config, torch.bfloat16) + + assert 200 < estimate_gb < 300 + + def test_mistral_small_4_name_fallback_is_large_moe(): profile = detect_architecture("mistralai/Mistral-Small-4-119B-2603")