Q-TensorFormer / src /__init__.py
Premchandyadav369
feat: sync real-world production modules and reasoning benchmarks
1df59a8
Raw History Blame Contribute Delete
5.2 kB
"""
Q-TensorFormer: Closed-Loop Information-to-Resource Adaptive Transformer.
Dynamically allocates model capacity, computation depth, attention complexity,
tensor rank, KV-cache precision, and memory residency according to the
information value of each token under real deployment constraints.
"""
from .config import (
ModelConfig, TrainingConfig, BudgetConfig, ExperimentConfig,
PRESETS, tiny_config, small_config, medium_config, production_config,
validate_model_config,
)
from .information_state import TokenInformationState
from .resource_allocator import (
InformationValueAllocator, AllocationBudget, AllocatorAction, PIDDualSubgradientController,
ConstrainedDecisionEngine, MarginalValueModel,
)
from .kv_cache import (
AdaptiveKVCache, KVPrecision, QuantizedKVTensor,
HierarchicalAdaptiveKVCache, KVResidencyTier, KVTransferStats,
)
from .counterfactual_learning import (
CounterfactualDatasetGenerator, PolicyBenchmarkEvaluator, CounterfactualRecord,
)
from .phase_aware_profiler import (
PhaseAwareProfiler, PhaseProfileResult,
)
from .matched_budget_analyzer import (
MatchedBudgetAnalyzer, MatchedBudgetComparison, ConstraintSatisfactionResult, ParetoHypervolumeResult,
)
from .quantum_backend import (
QuantumBackend, BackendType, compute_meyer_wallach_entanglement, compute_quantum_expressibility,
)
from .tensor_layers import TTLinear, TTFeedForward, factorize_dim
from .attention import MultiHeadAttention
from .blocks import HybridBlock
from .hardware_cost_model import (
HardwareCostModel, HardwareMeasurement, HardwareRooflineAnalyzer, RooflinePoint, KernelBreakdownProfiler,
)
from .models import QTensorFormer, DenseBaseline, create_model
from .validator import ScientificClaimValidator
from .tokenizer import QTensorFormerTokenizer
from .checkpoint import (
save_canonical_checkpoint,
load_canonical_checkpoint,
inspect_checkpoint_compatibility,
)
from .metrics import evaluate_model
from .training import LanguageModelTrainer, DistillationTrainer
# Frontier Research Extensions
from .speculative_decoding import ZeroSVDSpeculativeDecoder
from .semantic_kv_cache import SemanticAnchorKVCache
from .bandit_allocator import ContextualBanditAllocator
from .adaptive_vision import AdaptiveVisionProjector
from .dynamic_grid import DynamicGridController
from .theory import TheoreticalAnalyzer
# Systems & Enterprise Serving Extensions (NVIDIA Hopper/Blackwell/vLLM/TRT-LLM)
from .vllm_adapter import VLLMContinuousBatchingAdapter, QTensorFormerPagedAttentionMetadata
from .trt_llm_plugin import QTensorFormerTRTPlugin
from .roofline_analyzer import EnterpriseRooflineAnalyzer, DecodingRooflineProfile, HardwareRooflineSpec
# Real-World Production & Physical Hardware Governance Extensions
from .realworld_llm_converter import RealWorldLLMConverter
from .hardware_telemetry import LiveHardwareTelemetrySensor, HardwareTelemetrySnapshot
from .reasoning_benchmark import ReasoningComplexityAnalyzer, ReasoningBenchmarkResult, TokenComplexityRecord
# Hugging Face Integration
from .hf_model import QTensorFormerConfig, QTensorFormerForCausalLM
__version__ = "4.0.0"
__all__ = [
"QTensorFormer",
"DenseBaseline",
"create_model",
"ZeroSVDSpeculativeDecoder",
"SemanticAnchorKVCache",
"ContextualBanditAllocator",
"AdaptiveVisionProjector",
"DynamicGridController",
"TheoreticalAnalyzer",
"VLLMContinuousBatchingAdapter",
"QTensorFormerPagedAttentionMetadata",
"QTensorFormerTRTPlugin",
"EnterpriseRooflineAnalyzer",
"DecodingRooflineProfile",
"HardwareRooflineSpec",
"RealWorldLLMConverter",
"LiveHardwareTelemetrySensor",
"HardwareTelemetrySnapshot",
"ReasoningComplexityAnalyzer",
"ReasoningBenchmarkResult",
"TokenComplexityRecord",
"ModelConfig",
"TrainingConfig",
"BudgetConfig",
"ExperimentConfig",
"validate_model_config",
"TokenInformationState",
"InformationValueAllocator",
"AllocationBudget",
"AllocatorAction",
"PIDDualSubgradientController",
"ConstrainedDecisionEngine",
"MarginalValueModel",
"AdaptiveKVCache",
"HierarchicalAdaptiveKVCache",
"KVPrecision",
"KVResidencyTier",
"KVTransferStats",
"QuantizedKVTensor",
"CounterfactualDatasetGenerator",
"PolicyBenchmarkEvaluator",
"PhaseAwareProfiler",
"PhaseProfileResult",
"MatchedBudgetAnalyzer",
"MatchedBudgetComparison",
"ConstraintSatisfactionResult",
"ParetoHypervolumeResult",
"QuantumBackend",
"BackendType",
"compute_meyer_wallach_entanglement",
"compute_quantum_expressibility",
"TTLinear",
"TTFeedForward",
"factorize_dim",
"MultiHeadAttention",
"HybridBlock",
"HardwareCostModel",
"HardwareMeasurement",
"HardwareRooflineAnalyzer",
"RooflinePoint",
"KernelBreakdownProfiler",
"QTensorFormerConfig",
"QTensorFormerForCausalLM",
"ScientificClaimValidator",
"QTensorFormerTokenizer",
"save_canonical_checkpoint",
"load_canonical_checkpoint",
"inspect_checkpoint_compatibility",
"evaluate_model",
"LanguageModelTrainer",
"DistillationTrainer",
"__version__",
]