Premchan369/Q-TensorFormer
2185
1"""2Q-TensorFormer: Closed-Loop Information-to-Resource Adaptive Transformer.3 4Dynamically allocates model capacity, computation depth, attention complexity,5tensor rank, KV-cache precision, and memory residency according to the6information value of each token under real deployment constraints.7"""8 9from .config import (10 ModelConfig, TrainingConfig, BudgetConfig, ExperimentConfig,11 PRESETS, tiny_config, small_config, medium_config, production_config,12 validate_model_config,13)14from .information_state import TokenInformationState15from .resource_allocator import (16 InformationValueAllocator, AllocationBudget, AllocatorAction, PIDDualSubgradientController,17 ConstrainedDecisionEngine, MarginalValueModel,18)19from .kv_cache import (20 AdaptiveKVCache, KVPrecision, QuantizedKVTensor,21 HierarchicalAdaptiveKVCache, KVResidencyTier, KVTransferStats,22)23from .counterfactual_learning import (24 CounterfactualDatasetGenerator, PolicyBenchmarkEvaluator, CounterfactualRecord,25)26from .phase_aware_profiler import (27 PhaseAwareProfiler, PhaseProfileResult,28)29from .matched_budget_analyzer import (30 MatchedBudgetAnalyzer, MatchedBudgetComparison, ConstraintSatisfactionResult, ParetoHypervolumeResult,31)32from .quantum_backend import (33 QuantumBackend, BackendType, compute_meyer_wallach_entanglement, compute_quantum_expressibility,34)35from .tensor_layers import TTLinear, TTFeedForward, factorize_dim36from .attention import MultiHeadAttention37from .blocks import HybridBlock38from .hardware_cost_model import (39 HardwareCostModel, HardwareMeasurement, HardwareRooflineAnalyzer, RooflinePoint, KernelBreakdownProfiler,40)41from .models import QTensorFormer, DenseBaseline, create_model42from .validator import ScientificClaimValidator43 44# Hugging Face Integration45from .hf_model import QTensorFormerConfig, QTensorFormerForCausalLM46 47__version__ = "4.0.0"48 49__all__ = [50 "QTensorFormer",51 "DenseBaseline",52 "create_model",53 "ModelConfig",54 "TrainingConfig",55 "BudgetConfig",56 "ExperimentConfig",57 "TokenInformationState",58 "InformationValueAllocator",59 "AllocationBudget",60 "AllocatorAction",61 "PIDDualSubgradientController",62 "ConstrainedDecisionEngine",63 "MarginalValueModel",64 "AdaptiveKVCache",65 "HierarchicalAdaptiveKVCache",66 "KVPrecision",67 "KVResidencyTier",68 "KVTransferStats",69 "QuantizedKVTensor",70 "CounterfactualDatasetGenerator",71 "PolicyBenchmarkEvaluator",72 "PhaseAwareProfiler",73 "PhaseProfileResult",74 "MatchedBudgetAnalyzer",75 "MatchedBudgetComparison",76 "ConstraintSatisfactionResult",77 "ParetoHypervolumeResult",78 "QuantumBackend",79 "BackendType",80 "compute_meyer_wallach_entanglement",81 "compute_quantum_expressibility",82 "TTLinear",83 "TTFeedForward",84 "factorize_dim",85 "MultiHeadAttention",86 "HybridBlock",87 "HardwareCostModel",88 "HardwareMeasurement",89 "HardwareRooflineAnalyzer",90 "RooflinePoint",91 "KernelBreakdownProfiler",92 "QTensorFormerConfig",93 "QTensorFormerForCausalLM",94 "ScientificClaimValidator",95 "__version__",96]97 98 