Some checks failed
- New fusionagi/gpu/ module with TensorBackend protocol abstraction - TensorFlowBackend: GPU-accelerated ops with TensorCore mixed-precision - NumPyBackend: CPU fallback (always available, no extra deps) - Auto-selects best available backend at runtime - GPU-accelerated operations: - Cosine similarity matrix (batched, XLA-compiled) - Multi-head attention for consensus scoring - Batch hypothesis scoring on GPU - Semantic similarity search (pairwise, nearest-neighbor, deduplication) - New TensorFlowAdapter (fusionagi/adapters/): - LLMAdapter for local TF/Keras model inference - TensorCore mixed-precision support - GPU-accelerated embedding synthesis fallback - Reasoning pipeline integration: - gpu_scoring.py: drop-in GPU replacement for multi_path scoring - Super Big Brain: use_gpu config flag, GPU scoring when available - Memory integration: - gpu_search.py: GPU-accelerated semantic search for SemanticGraphMemory - Self-improvement integration: - gpu_training.py: gradient-based heuristic weight optimization - Reflective memory training loop with loss tracking - Dependencies: gpu extra (tensorflow>=2.16, numpy>=1.26) - 64 new tests (276 total), all passing - Architecture spec: docs/gpu_tensorcore_integration.md Co-Authored-By: Nakamoto, S <defi@defi-oracle.io>
57 lines
1.3 KiB
Python
57 lines
1.3 KiB
Python
"""GPU-accelerated tensor operations for FusionAGI.
|
|
|
|
Auto-selects the best available backend:
|
|
- TensorFlow with TensorCore/mixed-precision (when installed)
|
|
- NumPy CPU fallback (always available)
|
|
|
|
Install GPU support: pip install fusionagi[gpu]
|
|
"""
|
|
|
|
from fusionagi.gpu.backend import (
|
|
DeviceType,
|
|
NumPyBackend,
|
|
TensorBackend,
|
|
get_backend,
|
|
reset_backend,
|
|
)
|
|
from fusionagi.gpu.tensor_attention import (
|
|
attention_consensus,
|
|
cross_claim_attention,
|
|
)
|
|
from fusionagi.gpu.tensor_scoring import (
|
|
gpu_score_claims_against_reference,
|
|
gpu_score_hypotheses,
|
|
)
|
|
from fusionagi.gpu.tensor_similarity import (
|
|
deduplicate_claims,
|
|
nearest_neighbors,
|
|
pairwise_text_similarity,
|
|
)
|
|
from fusionagi.gpu.training import (
|
|
TrainingConfig,
|
|
TrainingResult,
|
|
optimize_heuristic_weights,
|
|
prepare_training_pairs,
|
|
run_gpu_training,
|
|
)
|
|
|
|
__all__ = [
|
|
"DeviceType",
|
|
"NumPyBackend",
|
|
"TensorBackend",
|
|
"get_backend",
|
|
"reset_backend",
|
|
"deduplicate_claims",
|
|
"nearest_neighbors",
|
|
"pairwise_text_similarity",
|
|
"attention_consensus",
|
|
"cross_claim_attention",
|
|
"gpu_score_claims_against_reference",
|
|
"gpu_score_hypotheses",
|
|
"TrainingConfig",
|
|
"TrainingResult",
|
|
"optimize_heuristic_weights",
|
|
"prepare_training_pairs",
|
|
"run_gpu_training",
|
|
]
|