Accelerating LSTM-based music generation using distributed multi-GPU training
This project implements an LSTM model for music generation with distributed training capabilities across multiple GPU servers. By leveraging distributed computing techniques, we achieve significant improvements in training efficiency and generation performance. We in our case used two GPU servers for implementation.
- LSTM-based architecture for musical sequence generation
- Distributed training across multiple GPU servers
- Customizable sequence length for varied musical outputs
- MIDI file parsing and preprocessing pipeline
- Real-time music generation capabilities
Parsing MIDI files Preprocessing Training in Music Notes
using Music21 → MIDI files with → distributed → Generation
library identification of environment on
I/O sequence length multiple servers
Currently, the model is trained on a collection of random compositions in MIDI format. Other potential datasets include:
- JSB Chorales
- VGMidi
- ComMU
For standard datasets related to music generation, visit: Music Generation Datasets
- Simple LSTM network for generating musical notes
- Capable of generating different notes based on variations in input sequence length
- The architecture can be extended to more complex models for improved training and generation quality
- Music21: Library for parsing and generating musical notes
- TensorFlow: Framework for building the model and implementing distributed training
- midi2audio: Tool for generating audible music by reading MIDI files
- Primarily uses
MultiWorkerMirroredStrategy
from TensorFlow - Other strategies available at: TensorFlow Distributed Training
- Training methodology:
- Train the model on a specific server with particular parameters (sequence length, iterations, data volume)
- Save the model state
- Switch to another server to continue training
- Compare convergence and training speed across servers
- Successfully implemented distributed training across two QMUL servers (Dorchester and Bath)
- Evaluated metrics are consistent with expected performance improvements
- Analysis confirms significant gains in training efficiency
- Implement alternative strategies for distributed training
- Develop better visualization methods for analysis
- Identify and measure additional performance metrics
- Explore more complex model architectures for improved generation quality
# Clone the repository
git clone https://github.com/username/lstm-music-generation.git
cd lstm-music-generation
# Create and activate a virtual environment (optional but recommended)
python -m venv venv
source venv/bin/activate # On Windows, use: venv\Scripts\activate
# For midi2audio functionality
# On Ubuntu/Debian:
apt-get install fluidsynth
# On macOS:
brew install fluidsynth
# On Windows:
# Download and install FluidSynth from http://www.fluidsynth.org/
- Run the Python scripts to get the results
- Dr. Ahmed M. A. Sayed, Queen Mary University of London
- Sayed Systems Group @ QMUL [https://sayed-sys-lab.github.io/]
- Queen Mary University of London for providing computing resources (Dorchester and Bath servers)
- Music21 developed by MIT
- TensorFlow team for distributed training capabilities