How kli447/cs-598-fal-project works
Project Type and Purpose
• mLoRA is a machine learning fine-tuning framework. Its primary goal is to enable fast, concurrent training of multiple LoRA adapters over a shared base LLM.
• The framework supports various LoRA variants (QLoRA, LoRA+, VeRA, DoRA) as well as reinforcement learning alignment (DPO, CPO, CIT). It also includes an end-to-end training pipeline and service deployment capabilities.
• The presence of Dockerfiles, a CLI client (mlora_cli), server components (mlora/server), and multiple training scripts (mlora_train.py, mlora_pp_train.py) indicates the system has both standalone training components and service-oriented deployment options.
File Structure to Determine Architectural Components
• Top-Level Components:
• .github: Contains CI/CD workflows for code testing, formatting, and publishing.
• docs: Contains design documents and developer guides (e.g., design.md, develop_new_adapter.md) which can be referenced for internal module interactions.
• demo: Provides example configuration (YAML files) for various LoRA cases, reinforcement algorithms, and pipeline parallelism setups.
• mlora: This core piece is organized into submodules:
▸ backends (cpu, cuda, mps) – for hardware-abstracted computational backends.
▸ config – for configuration schema for adapters, tasks, and learning rate scheduling.
▸ executor – divided into context (for different training/inference scenarios), dispatcher (for task distribution including pipeline and backend dispatchers), pipeline modules (for message and transport among processing units), and actual task definitions.
▸ model – for managing model components, checkpoints, module definitions (adapter, attention, embedding, etc.), and tokenization.
▸ profiler – for performance metrics and tracing train/inference operations.
▸ prompter – for generating prompts from templates/data.
▸ server – which handles service deployment (adapter management, dataset management, file operations, task submission, etc.).
▸ utils – helper functions and command-line utilities.
• Additional modules such as mlora_cli, mlora_client.py, and multiple training entry scripts indicate interfaces for both manual and distributed training.
Key Architectural Patterns and Relationships
• Separation of Concerns: The source tree clearly separates configuration, execution, model loading, backend operations, and service interaction.
• Modular Executor Design: The executor is split into contexts (for training, inference, adapter-specific operations) and dispatchers (tasks are distributed based on hardware capabilities and pipeline parallelism).
• Client/Server Interaction: The existence of a dedicated CLI (mlora_cli) and server module (mlora/server) suggests that task submission and management are handled through a REST-like interface, supporting remote or even multi-node deployment.
• Pipeline Parallelism: With dedicated scripts (mlora_pp_train.py) and executor modules for pipeline communication, the system is designed to partition model layers or tasks across devices/nodes.
• Deployment Flexibility: Dockerfile and deployment scripts indicate that the system can be containerized, supporting both batch fine-tuning and continuous service operations.