How lucid-official/lucid works
Lucid is an Apple-Silicon deep-learning framework: Python tensors and neural-network modules run through a custom C++ engine with distinct CPU and GPU backends. The documented training path builds a model, computes a loss, evaluates it, runs reverse-mode backward, and steps an optimizer. The graph also preserves the model zoo, compilation, and Core ML export. Relationships are based on README architecture/workflow statements and the supplied source index; unsampled implementation details are not inferred.
Main entry points: module.py NN Modules · TensorImpl.h Tensor State · ops C++ Operations · tensor.py Tensor Wrapper
Components 18
Python API
- Lucid API
lucid/__init__.py - Tensor Wrapper
lucid/_tensor/tensor.py - NN Modules
lucid/nn/module.py - Parameters
lucid/nn/parameter.py - Op Dispatch
lucid/_dispatch.py - Op Adapters
lucid/_ops/_adapters.py - Type Promotion
lucid/_promotion.py
Tensor Engine
- Tensor State
lucid/_C/core/TensorImpl.h - Tensor Storage
lucid/_C/core/Storage.h - Autograd Engine
lucid/_C/autograd/Engine.cpp - C++ Operations
lucid/_C/ops
Compute Backends
- CPU Backend
lucid/_C/backend/cpu - GPU Backend
lucid/_C/backend/gpu
Training Features
- Optimizers
lucid/_C/optim/Optimizer.cpp - Model Zoo
lucid/models
Compile and Export
- Graph Compilation
lucid/compile - Core ML Export
lucid/coreml/_build.py
Other components
- Framework User
Connections 19
- Framework User → Lucid API: uses
README.md - Lucid API → Tensor Wrapper: exposes
lucid/__init__.py - Tensor Wrapper → Op Dispatch: dispatches ops
lucid/_tensor/tensor.py - Op Dispatch → Type Promotion: uses promotion
lucid/_dispatch.py - Op Adapters → Tensor State: calls engine
lucid/_ops/_adapters.py - NN Modules → Parameters: owns state
lucid/nn/parameter.py - NN Modules → Tensor Wrapper: computes with
README.md - Tensor State → Tensor Storage: holds storage
lucid/_C/core/TensorImpl.h - Tensor State → Autograd Engine: tracks gradients
README.md - Autograd Engine → C++ Operations: backpropagates ops
lucid/_C/autograd/Engine.cpp - C++ Operations → CPU Backend: runs on CPU
README.md - C++ Operations → GPU Backend: runs on GPU
README.md - Framework User → NN Modules: builds model
README.md - NN Modules → Autograd Engine: backward pass
README.md - NN Modules → Optimizers: steps parameters
README.md - Framework User → Model Zoo: selects model
README.md - NN Modules → Graph Compilation: may compile
README.md - Framework User → Core ML Export: exports model
README.md - Graph Compilation → Core ML Export: may target