Diff Coverage

Diff: origin/master...HEAD, staged and unstaged changes

Source File Diff Coverage (%) Missing Lines
hyper_parallel/components/functional/gram_newton_schulz.py 98.7% 40
hyper_parallel/core/optimizer/__init__.py 100%  
hyper_parallel/core/optimizer/muon.py 92.3% 133
hyper_parallel/components/functional/gram_newton_schulz.py
36
37
38
39
40
41
42
43
44
        ) from error
    implementation = getattr(package, "GramNewtonSchulz", None)
    if not callable(implementation):
        raise ImportError("gram-newton-schulz must export a callable GramNewtonSchulz")
    return implementation


def _normalize_coefficients(coefficients: Sequence[Sequence[float]]) -> tuple[tuple[float, float, float], ...]:
    """Own an immutable, finite coefficient schedule independently of the caller."""
hyper_parallel/core/optimizer/muon.py
129
130
131
132
133
134
135
136
137
    if ns_variant == "custom":
        if ns_coefficients is None:
            raise ValueError("ns_coefficients must be provided when ns_variant='custom'")
        if steps > len(ns_coefficients):
            raise ValueError(
                f"ns_steps={steps} exceeds the {len(ns_coefficients)} provided coefficient groups"
            )
        return tuple(tuple(row) for row in ns_coefficients[:steps])
    raise ValueError(f"ns_variant must be 'legacy', 'asym5', or 'custom', got {ns_variant!r}")