File size: 2,271 Bytes
71bf490
6e408ce
 
 
71bf490
6e408ce
 
 
 
 
 
 
 
b473633
 
 
71bf490
 
 
 
 
6e408ce
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b473633
 
 
 
 
71bf490
 
 
 
 
 
6e408ce
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
"""Chimera 5.3 — CPU-first causal LM with ternary 1.58-bit weights."""

from .config import load_config, scale_config, tiny_config

__version__ = "5.3.0"

__all__ = [
    "load_config", "scale_config", "tiny_config",
    "Chimera51ForCausalLM", "Chimera51Block", "expand_layer_pattern",
    "BitLinear", "RMSNorm", "pack_ternary", "unpack_ternary",
    "ternarize_weight", "_quantize_weights_ternary", "apply_2_4_sparsity_",
    "enable_native_kernel", "native_kernel_available",
    "ChimeraTokenizer",
    "SelfEvolutionEngine", "SemanticMemory", "InPlaceTTT",
    "EpisodicCaseMemory", "MetaGuidelineBank", "SelfFeedback",
    "LoopDepthClassifier",
    # v5.3 — Hyper paradigms
    "GrowLengthDataset", "GrowLengthScheduler",
    "apply_reservoir_freezing", "SparseMeZOOptimizer",
    "precompute_ternary_cache", "pack_documents",
    "ProgressiveUnfreezer", "cosine_lr",
]


# Lazy public surface — keeps ``import chimera`` cheap (no torch import until
# the user actually touches a model class).
def __getattr__(name):
    if name in {"Chimera51ForCausalLM", "Chimera51Block", "expand_layer_pattern"}:
        from .model import Chimera51ForCausalLM, Chimera51Block, expand_layer_pattern
        return locals()[name]
    if name in {"BitLinear", "RMSNorm", "pack_ternary", "unpack_ternary",
                "ternarize_weight", "_quantize_weights_ternary",
                "apply_2_4_sparsity_", "enable_native_kernel",
                "native_kernel_available"}:
        from . import quantization as _q
        return getattr(_q, name)
    if name == "ChimeraTokenizer":
        from .tokenizer import ChimeraTokenizer
        return ChimeraTokenizer
    if name in {"SelfEvolutionEngine", "SemanticMemory", "InPlaceTTT",
                "EpisodicCaseMemory", "MetaGuidelineBank", "SelfFeedback",
                "LoopDepthClassifier"}:
        from . import evolution as _evo
        return getattr(_evo, name)
    if name in {"GrowLengthDataset", "GrowLengthScheduler",
                "apply_reservoir_freezing", "SparseMeZOOptimizer",
                "precompute_ternary_cache", "pack_documents",
                "ProgressiveUnfreezer", "cosine_lr"}:
        from . import hyper as _hyp
        return getattr(_hyp, name)
    raise AttributeError(name)