ML System Optimisation

ML System Optimisation #

ML System Optimisation studies how to make machine learning workloads faster, more scalable, more memory-efficient, and suitable for different hardware platforms.

The subject connects machine learning algorithms with the systems that train and deploy them: multi-core CPUs, GPUs, distributed clusters, cloud platforms, edge devices, and embedded systems.

ML system optimisation = model quality + computational efficiency + hardware awareness + scalability

The learning path begins with performance measurement and parallel computing, progresses through distributed machine learning and scale-out platforms, and concludes with model compression and resource-constrained deployment.


Big Picture #

flowchart TD
    A["Measure Performance"] --> B["Parallelise Work"]
    B --> C["Distribute Training"]
    C --> D["Scale Across Systems"]
    D --> E["Optimise Models"]
    E --> F["Deploy on Constrained Devices"]

    style A fill:#E1F5FE
    style B fill:#C8E6C9
    style C fill:#FFF9C4
    style D fill:#EDE7F6
    style E fill:#C8E6C9
    style F fill:#E1F5FE

Modular Structure #

1. Foundations #

  • Machine learning and deep learning workloads
  • Performance metrics
    • Time and space complexity
    • Running time
    • Throughput
    • Latency and response time
  • Performance scaling and tuning
  • Training versus deployment environments
  • Distributed, cloud, embedded, and mobile systems
  • Parallel and distributed algorithms
  • Speedup and Amdahl’s Law ☆
  • Scale-up versus scale-out
  • Data, task, and request parallelism
  • Parallel programming models
  • MapReduce pattern
  • Multi-core and GPGPU parallelism
  • SIMD versus MIMD execution
  • Memory hierarchy and bandwidth
  • CPU and GPU clusters
  • Data sharding
  • Parameter-server and all-reduce paradigms

2. Distributed ML Algorithms #

  • Problem decomposition
  • Parallelisation of machine learning algorithms
  • Ensemble methods and XGBoost
  • Distributed decision trees and random forests
  • Parallel support vector machines
  • Communication overhead
  • Distributed k-means
  • Distributed k-nearest neighbours
  • Gradient descent and stochastic gradient descent
  • Synchronous versus asynchronous SGD ☆
  • Hadoop and Spark
  • Distributed convolutional neural networks
  • Data, model, and pipeline parallelism ☆
  • Gradient checkpointing
  • Mixed-precision training

3. Scale-Out Systems #

  • ML platforms and frameworks
  • Parameter Server model ☆
  • TensorFlow distributed architecture
  • Distributed training strategies
  • Batch and micro-batch sizing
  • I/O and shuffling overhead
  • Decentralised SGD
  • Ring-based and tree-based all-reduce ☆
  • Asynchronous parallelism and parameter staleness
  • Local SGD
  • Locality-aware programs
  • Massive multithreading and GPGPUs
  • Model and pipeline parallelism
  • Micro-batch pipelining and pipeline bubbles
  • Large-scale neural-network training
  • GPU architecture and threading model
  • Parallel matrix operations
  • Federated learning
  • Non-IID data, privacy, and secure aggregation
  • Decentralised federated learning

4. Constrained Systems #

  • GPU implementation of convolutional neural networks
  • Model compression
  • Quantisation ☆
  • Network pruning ☆
  • Low-rank factorisation
  • Weight sharing and encoding
  • Knowledge distillation ☆
  • Edge intelligence
  • Reduced-precision arithmetic
  • Hardware support for efficient inference
  • Structured and unstructured pruning
  • Sparsity, FLOPs reduction, and accuracy loss
  • Deep compression pipeline
  • Small language models
  • TensorFlow Lite Micro
  • Hardware- and compiler-aware optimisation
  • Energy-aware algorithms
  • Accuracy, model size, throughput, latency, and energy trade-offs ☆

16-Topic Learning Path #

#TopicMain FocusModule
1ML and DL System PerformanceComplexity, running time, throughput, response time, scaling, tuning, training and deployment environmentsFoundations
2Parallel and Distributed AlgorithmsSystems performance, speedup, Amdahl’s Law, parallelism types, communication cost, scale-up and scale-outFoundations
3Parallel Programming ModelsMapReduce, task and request parallelism, multi-core and GPGPU execution, memory hierarchy, sharding, parameter server and all-reduceFoundations
4Parallelisation of ML AlgorithmsProblem decomposition, ensemble methods, XGBoost, k-means, distributed trees, random forests, and SVMDistributed ML Algorithms
5Communication-Aware Distributed MLCommunication overhead, distributed k-means, model parallelism, distributed k-NN, synchronous and asynchronous SGDDistributed ML Algorithms
6Clusters, Hadoop, and SparkCluster computing, MapReduce k-means, streaming variants, communication reduction, distributed CNNs, and mixed precisionDistributed ML Algorithms
7Distributed Training StrategiesData, model, and pipeline parallelism, gradient checkpointing, and mixed-precision trainingDistributed ML Algorithms
8ML Platforms and FrameworksParameter Server model, SGD, TensorFlow architecture, distributed strategies, batching, model compression, I/O, and shufflingScale-Out Systems
9Distributed Deep LearningDecentralised SGD, all-reduce, asynchronous parallelism, Hogwild!, parameter staleness, local SGD, and matrix multiplicationScale-Out Systems
10Locality and Large-Scale ParallelismLocality-aware programs, GPGPUs, model parallelism, pipeline scheduling, GPU clusters, and memory-efficient checkpointingScale-Out Systems
11GPU Architecture and Federated LearningGPU threading, parallel matrix operations, non-IID data, privacy, secure aggregation, and decentralised federated learningScale-Out Systems
12Model Compression FoundationsCNNs on GPUs, quantisation, pruning, low-rank factorisation, weight sharing, encoding, and knowledge distillationConstrained Systems
13Quantisation and Edge IntelligenceEdge case studies, quantisation methods, reduced-precision arithmetic, and hardware supportConstrained Systems
14Pruning and Deep CompressionStructured and unstructured pruning, sparsity metrics, FLOPs reduction, accuracy loss, and the deep compression pipelineConstrained Systems
15Optimisation Landscape and Small Language ModelsGeneric and platform-specific optimisation, frameworks, hardware, compilers, federated learning, and TensorFlow Lite MicroConstrained Systems
16Energy-Constrained MLAdapting algorithms for constrained devices and balancing accuracy, model size, throughput, response time, and energyConstrained Systems

Core Optimisation Trade-offs #

Optimisation GoalTypical BenefitPossible Cost
Reduce latencyFaster prediction or responseGreater hardware usage or lower batching efficiency
Increase throughputMore work completed per unit timeHigher latency for individual requests
Reduce model sizeLower storage and memory requirementsPossible loss of accuracy
Reduce communicationBetter distributed scalabilityStale updates or slower convergence
Use lower precisionFaster computation and lower memory useNumerical instability or accuracy loss
Increase parallelismFaster trainingCommunication, synchronisation, and scheduling overhead
Reduce energy useLonger battery life and lower operating costLower throughput or reduced model capacity

Optimisation is not simply about making a model faster. A useful solution balances speed, memory, scalability, accuracy, convergence stability, generalisation, and energy consumption.


Book References #

Primary References #

  1. John L. Hennessy and David A. Patterson, Computer Architecture: A Quantitative Approach, Sixth Edition, Morgan Kaufmann, 2017.
  2. Yuan Tang, Distributed Machine Learning Patterns, Manning, 2023.

Additional Reading Areas #

  • Distributed machine learning algorithms
  • Quantisation and model compression
  • Network pruning and deep compression
  • TensorFlow Lite programming
  • Evaluation of compression techniques

Key Takeaways #

  • Performance must be measured using appropriate metrics before it can be improved.
  • Parallelism can accelerate ML workloads, but communication and synchronisation limit speedup.
  • Distributed training requires careful choices among data, model, and pipeline parallelism.
  • Scale-out systems connect algorithms with clusters, distributed frameworks, GPUs, and federated architectures.
  • Compression techniques make models smaller and faster for edge and constrained devices.
  • Every optimisation involves trade-offs among performance, model quality, memory, scalability, and energy.

Home | Artificial Intelligence