Files
diodiogod 9f2166a297 refactor: Implement Tier 1 model loading improvements
Fix critical device handling issues that cause cache mismatches and unnecessary reloads:

1. Cache 'auto' device resolution (torch_device_resolver.py)
   - 'auto' device now cached after first resolution
   - Prevents cache key instability when device availability changes mid-session
   - Add reset_device_cache() for manual reset if needed
   - Fixes: GPU memory pressure causing unexpected CPU fallback

2. Fix device comparison in unified interface (unified_model_interface.py)
   - Resolve both target and wrapper device before comparison
   - Handle both string and torch.device object representations
   - Fixes: Device type mismatch causing models to stay on wrong device

3. Consolidate device resolution (base_node.py)
   - Replace duplicate resolve_device() with centralized torch_device_resolver
   - Now supports MPS (Apple Silicon), CUDA, XPU, and CPU consistently
   - Fixes: Missing MPS/XPU detection in base node

Impact:
- Eliminates unnecessary model reloads in long sessions
- Consistent device handling across all node types
- Better GPU memory management with stable cache keys
2025-11-13 22:06:41 -03:00
..