How allenzyj/edge-computing-engine works
Main Components
• Computational Graph Core: This includes the key classes like ComputeGraph and ComputeNode, which manage the creation of nodes and orchestrate forward and backward propagation.
• Matrix Computation Modules: Include both the CPU-based matrix operations (such as reading CSV files, performing basic arithmetic, transposition, slicing, etc.) and CUDA-accelerated operations (e.g. Matrix_CU in the cuda_mat directory).
• CUDA Kernel Layer: Represent the CUDA kernels responsible for operations such as ReLU, Sigmoid, matrix multiplication (both forward and backward kernels), element-wise operations, and any helper kernels like negGradKernel.
• Automatic Differentiation (Autodiff): Modules in the autodiff directory provide support for differentiating matrix operations, fixed-point arithmetic (or the like), and likely involve classes and headers for computing gradients.
• CPU Miscellaneous Utilities: This includes helper files for CSV reading, broadcasting, and high-level APIs for operations like fully connected layers, activation functions, and loss computations.
• Build and Installation Tools: The install_diff directory (with its examples, Makefiles, and installation scripts) demonstrates how the engine is built, installed, and how sample applications are structured.
Relationships and Interactions
• Input Data Workflow: Start with the data input (whether via CSV file reading or through CUDA matrix initialization), as well as parameter initialization.
• Forward Propagation: Show how input flows into the ComputeGraph to generate intermediate outputs – e.g., passing through functionalities like matrix multiplication and activation functions (ReLU, Sigmoid).
• Testing & Examples: Include a node or a module representing the example executables (e.g., those in install_diff/bin, conv_test.cpp, etc.) which serve as validation for the engine’s core functionalities.
Architectural Patterns and Design Principles
• Modular Separation: Clearly distinguish between the GPU/CUDA modules and the CPU/autodiff modules. This separation helps in understanding dependencies and allows extensibility in GPU acceleration.
• Computational Graph Pattern: Emphasize that the core engine is built around creating and manipulating a computational graph where nodes represent operations (OP_INPUT, OP_ADD, OP_MATMUL, etc.) with explicit data flows.
• Build and Deployment Automation: The Makefiles and installation directories (install_diff, root/Makefile) illustrate a well-defined build process, which could be depicted as part of the “Deployment” or “Build” modules.
Relevant Technologies and Frameworks
• C++ (with C++11 or above) as the primary programming language.
• CUDA Toolkit and nvcc for GPU-accelerated operations.
• Standard build tools (Makefiles) and version control (Git, GitHub workflows).
• The integration of libraries for matrix operations and automatic differentiation.
Instructing the Principal Software Engineer
• Data Input & Preprocessing
• Computational Graph Core (includes ComputeGraph and ComputeNode)
• Matrix Computation Modules (CPU-based and CUDA-accelerated)
• CUDA Kernel Execution Layer
• Automatic Differentiation & Gradient Flow
• Testing, Examples, and Deployment Build Infrastructure
• Component with key technologies (e.g., “CUDA: matmulForwardKernel, reluForwardKernel,” “Autodiff Module: autodiff/graphs, nodes, etc.”) to provide context.
• Finally, provide detailed notes on how testing and build scripts integrate with the runtime architecture to ensure correctness and performance (link the CI/CD in the .github/workflows directory and build instructions in Makefiles).