Diff Coverage

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

Source File Diff Coverage (%) Missing Lines
hyper_parallel/components/modules/attention/compressed_sparse_attention2/compressed_sparse_attention2.py 100%  
hyper_parallel/components/modules/attention/compressed_sparse_attention2/compressor.py 100%  
hyper_parallel/components/modules/attention/compressed_sparse_attention2/indexer.py 100%  
hyper_parallel/components/modules/attention/grouped_query_attention/grouped_query_attention.py 100%  
hyper_parallel/components/modules/attention/multi_latent_attention/multi_latent_attention.py 100%  
hyper_parallel/components/modules/engram/__init__.py 100%  
hyper_parallel/components/modules/engram/engram.py 96.5% 41,48,70
hyper_parallel/components/modules/engram/engram_family.py 100%  
hyper_parallel/components/modules/engram/host_engram.py 100%  
hyper_parallel/components/modules/mhc/__init__.py 100%  
hyper_parallel/components/modules/router_family.py 100%  
hyper_parallel/components/modules/shared_expert_family.py 100%  
hyper_parallel/components/modules/engram/engram.py
37
38
39
40
41
42
43
44
45
        """Reuse a source Engram module's parameters and hash mapping."""
        super().__init__()
        del module_fqn, context
        if (module is None) == (config is None):
            raise ValueError("provide exactly one of config or module")
        if config is not None:
            self._init_from_config(config)
            return
        required = ("hash_mapping", "embed", "wkv", "q_weight", "k_weight")
44
45
46
47
48
49
50
51
52
            return
        required = ("hash_mapping", "embed", "wkv", "q_weight", "k_weight")
        missing = [name for name in required if not hasattr(module, name)]
        if missing:
            raise TypeError(f"Engram source is missing required attributes: {missing}")
        self.hash_mapping = module.hash_mapping
        self.embed = module.embed
        self.wkv = module.wkv
        self.q_weight = module.q_weight
66
67
68
69
70
71
72
73
74
            value = getattr(config, name)
            if isinstance(value, bool) or not isinstance(value, int) or value <= 0:
                raise ValueError(f"{name} must be a positive integer")
        if isinstance(config.layer_id, bool) or not isinstance(config.layer_id, int):
            raise ValueError("layer_id must be an integer")
        for name in ("eps", "clamp_value"):
            value = getattr(config, name)
            if isinstance(value, bool) or not isinstance(value, (int, float)) or not isfinite(value) or value <= 0:
                raise ValueError(f"{name} must be finite and positive")