mirror of
https://github.com/elder-plinius/OBLITERATUS.git
synced 2026-08-30 06:30:37 +02:00
fix(surgery): guard unvalidated Qwen hybrid layouts
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import os
|
||||
import uuid
|
||||
|
||||
import pytest
|
||||
@@ -17,6 +18,7 @@ MODEL = "hf-internal-testing/tiny-random-gpt2"
|
||||
REVISION = "71034c5d8bde858ff824298bdedc65515b97d2b9"
|
||||
MISTRAL4_MODEL = "mistralai/Mistral-Small-4-119B-2603"
|
||||
MISTRAL4_REVISION = "a11f36bebf709121056b1dbcc943d1c6afbe494d"
|
||||
QWEN38_MODEL = "Qwen/Qwen3.8-27B"
|
||||
|
||||
|
||||
def test_pinned_tiny_model_download_inference_and_offline_cache(monkeypatch):
|
||||
@@ -71,3 +73,26 @@ def test_pinned_mistral4_config_resolves_composite_contract_without_remote_code(
|
||||
assert profile.model_type == "mistral4"
|
||||
assert profile.arch_class is ArchitectureClass.LARGE_MOE
|
||||
assert (profile.num_experts, profile.num_active_experts) == (128, 4)
|
||||
|
||||
|
||||
@pytest.mark.gpu
|
||||
def test_qwen38_bf16_pristine_baseline_blocks_unvalidated_surgery(tmp_path):
|
||||
"""Operator-gated 27B regression: healthy stock model, zero modified weights."""
|
||||
if os.environ.get("OBLITERATUS_QWEN38_E2E") != "1":
|
||||
pytest.skip("set OBLITERATUS_QWEN38_E2E=1 on a >=80 GiB GPU runner")
|
||||
|
||||
from obliteratus.abliterate import AbliterationPipeline, PipelineValidationError
|
||||
|
||||
pipeline = AbliterationPipeline(
|
||||
QWEN38_MODEL,
|
||||
output_dir=str(tmp_path / "qwen38-output"),
|
||||
dtype="bfloat16",
|
||||
quantization=None,
|
||||
)
|
||||
pipeline._summon()
|
||||
pipeline._capture_stock_baseline()
|
||||
assert pipeline._stock_baseline["perplexity"] > 0
|
||||
assert pipeline._stock_baseline["coherence"] > 0
|
||||
with pytest.raises(PipelineValidationError, match="no validated projection allowlist"):
|
||||
pipeline._validate_architecture_surgery_support()
|
||||
assert pipeline._excise_modified_count is None
|
||||
|
||||
Reference in New Issue
Block a user