Legacy Content Organization: ✅ MIGRATION EXAMPLES ARCHIVED: Moved legacy migration examples to documentation archive - docs/archive/migration_examples/: Moved from root directory for better organization - Contains GPU acceleration migration examples from CUDA to abstraction layer - Educational/reference material for historical context and migration procedures ✅ LEGACY CONTENT IDENTIFIED: - GPU Acceleration Migration: From CUDA-specific to backend-agnostic abstraction layer - Migration Patterns: BEFORE/AFTER code examples showing evolution - Legacy Import Paths: high_performance_cuda_accelerator, fastapi_cuda_zk_api - Deprecated Classes: HighPerformanceCUDAZKAccelerator, ProductionCUDAZKAPI ✅ DOCUMENTATION ARCHIVE CONTENTS: - MIGRATION_CHECKLIST.md: Step-by-step migration procedures - basic_migration.py: Direct CUDA calls to abstraction layer examples - api_migration.py: FastAPI endpoint migration examples - config_migration.py: Configuration migration examples ✅ ROOT DIRECTORY CLEANUP: Removed legacy examples from production directory - migration_examples/ moved to docs/archive/migration_examples/ - Root directory now contains only active production components - Legacy migration examples preserved for historical reference DIRECTORY STRUCTURE IMPROVEMENT: 📁 docs/archive/migration_examples/: Historical migration documentation 🏗️ Root Directory: Clean production structure with only active components 📚 Documentation Archive: Legacy content properly organized for reference BENEFITS: ✅ Clean Production Directory: No legacy examples in root ✅ Historical Preservation: Migration examples preserved for reference ✅ Better Organization: Legacy content grouped in documentation archive ✅ Clear Separation: Active vs legacy content clearly distinguished RESULT: Successfully moved legacy migration examples to docs/archive/migration_examples/ subdirectory, cleaning up the root directory while preserving historical migration documentation for future reference.
39 lines
961 B
Python
Executable File
39 lines
961 B
Python
Executable File
#!/usr/bin/env python3
|
|
"""
|
|
Configuration Migration Example
|
|
|
|
Shows how to migrate configuration to use the new abstraction layer.
|
|
"""
|
|
|
|
# BEFORE (CUDA-specific config)
|
|
# cuda_config = {
|
|
# "lib_path": "./liboptimized_field_operations.so",
|
|
# "device_id": 0,
|
|
# "memory_limit": 8*1024*1024*1024
|
|
# }
|
|
|
|
# AFTER (Backend-agnostic config)
|
|
from gpu_acceleration import ZKOperationConfig, GPUAccelerationManager, ComputeBackend
|
|
|
|
# Configuration for any backend
|
|
config = ZKOperationConfig(
|
|
batch_size=2048,
|
|
use_gpu=True,
|
|
fallback_to_cpu=True,
|
|
timeout=60.0,
|
|
memory_limit=8*1024*1024*1024 # 8GB
|
|
)
|
|
|
|
# Create manager with specific backend
|
|
gpu = GPUAccelerationManager(backend=ComputeBackend.CUDA, config=config)
|
|
gpu.initialize()
|
|
|
|
# Or auto-detect with config
|
|
from gpu_acceleration import create_gpu_manager
|
|
gpu = create_gpu_manager(
|
|
backend="cuda", # or None for auto-detect
|
|
batch_size=2048,
|
|
fallback_to_cpu=True,
|
|
timeout=60.0
|
|
)
|