How samkaufman/morello works
Main Components to Include:
Input Layer
• Neural Network Specifications ("Spec")
• Manual Scheduling Interface
• Command-line Interface
Core Compiler Components
• Synthesis Engine
• IR (Intermediate Representation) System
• Database System for Caching Optimization Decisions
• Scheduling System
• Code Generation Pipeline
Output Layer
• Generated C Implementation
• Performance Metrics
• Verification System
Component Organization
• Input sources at the top
• Processing layers in the middle
• Output generation at the bottom
b. Divide the core processing area into three main sections:
• Synthesis & Optimization (Left)
• IR & Scheduling (Middle)
• Code Generation (Right)
Key Relationships to Highlight
• Spec → Synthesis Engine → IR System
• Manual Scheduling → IR System
• IR System → Code Generation
• Optimization Database ↔ Synthesis Engine (bidirectional)
Specific Implementation Details
a. Target-specific components (based on /src/target/):
• x86 Backend
• ARM Backend
• Common CPU Operations
b. Code Generation Pipeline (based on /src/codegen/):
• C Code Generation
• Platform-specific Optimizations
• Header Generation
Additional Elements
• A feedback loop showing how the verification system validates the output
• Relationship between the synthesis database and the optimization process
• Where performance benchmarking occurs (based on /morello/benches/)
Specialized Features
• Memory management (/src/memorylimits.rs)
• Tensor operations (/src/tensorspec.rs)
• Tiling optimization (/src/tiling.rs)
• Pipeline scheduling (/src/scheduling.rs)
Performance Optimization
• Caching mechanism using the database
• How optimization decisions are stored and reused
Extensibility
• Extension points for new targets
• Plugin architecture for different backends