How skuldnorniern/cetana works
Main Components
A. Core Library Layer
• Tensor Operations Module
• Neural Network Module
• Automatic Differentiation Engine
• Serialization System
B. Backend Infrastructure
• CPU Backend
• CUDA Backend
• Metal (MPS) Backend
• Vulkan Backend
C. High-Level API Components
• Model Management
• Training Infrastructure
• Loss Functions
• Optimizers
[Applications/Examples Layer]
• ↑↓
[High-Level API Layer]
• ↑↓
[Core Library Layer]
• ↑↓
[Backend Abstraction Layer]
• ↑↓
[Compute Backends Layer]
Detailed Component Breakdown
a) Core Library Layer (src/):
• Loss functions (src/loss.rs) and optimizers (src/optimizer.rs) as supporting modules
b) Backend Infrastructure (src/backend/):
• Four parallel backend implementations:
• CPU (src/backend/cpu/)
• CUDA (src/backend/cuda/)
• MPS (src/backend/mps/)
• Vulkan (src/backend/vulkan/)
c) Shader/Kernel Components:
• Compute shader modules (shaders/) connected to respective backends
• CUDA kernels (cuda/kernels.cu) linked to the CUDA backend
Additional Elements
• Version/status indicators for implemented vs planned features
• External dependencies and integration points
Implementation Notes
• The modular nature of the backend system
• The separation between core tensor operations and neural network components
• The abstraction layer that allows multiple compute backends
• The relationship between high-level APIs and low-level operations
Recommendations
• Maintain consistency in component representation
• Version numbers or status indicators
• Brief descriptions for key components