chore: add remaining test stubs and script placeholders
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9b07961619
commit
393dd0d5a7
9
scripts/bench_mlx.py
Normal file
9
scripts/bench_mlx.py
Normal file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Benchmark MLX inference on Apple Silicon.
|
||||
|
||||
Reports latency, throughput, and memory usage.
|
||||
|
||||
Usage:
|
||||
uv run python scripts/bench_mlx.py
|
||||
"""
|
||||
# TODO: Phase 5 — implement after full pipeline works
|
||||
9
scripts/compare_reference.py
Normal file
9
scripts/compare_reference.py
Normal file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Compare MLX outputs against PyTorch reference fixtures.
|
||||
|
||||
Reports max abs error and mean abs error per tensor.
|
||||
|
||||
Usage:
|
||||
uv run python scripts/compare_reference.py
|
||||
"""
|
||||
# TODO: Phase 2+ — implement after reference fixtures exist
|
||||
0
tests/__init__.py
Normal file
0
tests/__init__.py
Normal file
23
tests/test_conversion.py
Normal file
23
tests/test_conversion.py
Normal file
@ -0,0 +1,23 @@
|
||||
"""Tests: weight conversion PyTorch → MLX (Phase 3).
|
||||
|
||||
Validates key mapping, shape transforms, and round-trip integrity.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.skip(reason="Phase 3: converter not yet implemented")
|
||||
|
||||
|
||||
def test_key_mapping_complete() -> None:
|
||||
"""Every PyTorch key maps to an MLX key with no orphans."""
|
||||
...
|
||||
|
||||
|
||||
def test_conv_weight_transpose() -> None:
|
||||
"""Conv weights correctly transposed from NCHW → NHWC."""
|
||||
...
|
||||
|
||||
|
||||
def test_first_conv_4ch_preserved() -> None:
|
||||
"""Patched 4-channel first conv preserved during conversion."""
|
||||
...
|
||||
19
tests/test_decoder_parity.py
Normal file
19
tests/test_decoder_parity.py
Normal file
@ -0,0 +1,19 @@
|
||||
"""Parity tests: MLX decoder heads vs PyTorch reference (Phase 2).
|
||||
|
||||
Uses saved backbone features → runs MLX decoder → compares
|
||||
against saved PyTorch coarse predictions.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.skip(reason="Phase 2: MLX decoder not yet implemented")
|
||||
|
||||
|
||||
def test_alpha_decoder_parity() -> None:
|
||||
"""MLX alpha decoder matches PyTorch within tolerance."""
|
||||
...
|
||||
|
||||
|
||||
def test_fg_decoder_parity() -> None:
|
||||
"""MLX foreground decoder matches PyTorch within tolerance."""
|
||||
...
|
||||
12
tests/test_import.py
Normal file
12
tests/test_import.py
Normal file
@ -0,0 +1,12 @@
|
||||
"""Smoke test: verify package imports succeed."""
|
||||
|
||||
|
||||
def test_package_imports() -> None:
|
||||
import corridorkey_mlx
|
||||
import corridorkey_mlx.convert
|
||||
import corridorkey_mlx.inference
|
||||
import corridorkey_mlx.io
|
||||
import corridorkey_mlx.model
|
||||
import corridorkey_mlx.utils
|
||||
|
||||
assert corridorkey_mlx.__version__ == "0.1.0"
|
||||
19
tests/test_refiner_parity.py
Normal file
19
tests/test_refiner_parity.py
Normal file
@ -0,0 +1,19 @@
|
||||
"""Parity tests: MLX refiner vs PyTorch reference (Phase 2).
|
||||
|
||||
Uses saved coarse predictions + RGB → runs MLX refiner →
|
||||
compares against saved PyTorch final outputs.
|
||||
"""
|
||||
|
||||
import pytest
|
||||
|
||||
pytestmark = pytest.mark.skip(reason="Phase 2: MLX refiner not yet implemented")
|
||||
|
||||
|
||||
def test_refiner_delta_parity() -> None:
|
||||
"""MLX refiner delta logits match PyTorch within tolerance."""
|
||||
...
|
||||
|
||||
|
||||
def test_refiner_final_output_parity() -> None:
|
||||
"""MLX final alpha and fg match PyTorch within tolerance."""
|
||||
...
|
||||
Loading…
Reference in New Issue
Block a user