High Performance Computing

Chapter 13
HPC for Artificial Intelligence and Emerging Workloads

Post Graduate Diploma in Data Science
High Performance Computing   •   Post Graduate

13. HPC for Artificial Intelligence and Emerging Workloads

Introduction and Context

Artificial intelligence has changed the workload profile of high performance computing. Traditional HPC was dominated by numerical simulation, scientific modelling, and tightly coupled parallel programs. Contemporary AI introduces a different but overlapping set of demands: very large datasets, billions of model parameters, repeated tensor operations, high-bandwidth memory access, distributed optimization, and increasingly stringent inference-latency requirements. Consequently, HPC is no longer only a means of accelerating scientific computation; it is also an infrastructure and systems discipline for building, training, deploying, and governing intelligent systems at scale.

The relationship is reciprocal. AI benefits from HPC processors, accelerators, high-speed interconnects, parallel file systems, and workload schedulers. At the same time, AI techniques are being applied to HPC itself—for example, to construct surrogate models, detect anomalies in simulations, optimize scientific workflows, and operate digital twins. The boundary between simulation, data analytics, and machine learning is therefore becoming less distinct.

This chapter examines scalable training and inference workflows, data, model and pipeline parallelism, distributed deep learning, large models, federated workloads, digital twins, and real-time analytics. The focus is not merely on making a program run faster. A successful HPC-AI system must balance performance, cost, accuracy, reliability, privacy, energy use, reproducibility, and operational complexity.

Learning Objectives

After studying this chapter, students should be able to:

1. Explain why AI workloads require HPC architectures and specialized execution models.

2. Distinguish data, model, pipeline, and hybrid parallelism.

3. Design a scalable distributed training and inference workflow.

4. Evaluate communication, memory, throughput, latency, and convergence trade-offs.

5. Explain the infrastructure requirements of large models, federated learning, digital twins, and real-time analytics.

6. Identify technical, organizational, ethical, security, and governance risks.

7. Recommend appropriate practices for efficient and reproducible HPC-AI deployments.

From Parallel Simulation to Parallel Intelligence

An AI training job repeatedly applies a model to batches of examples, calculates a loss, computes gradients, and updates parameters. The process appears regular, but its resource requirements vary greatly. Training may be compute-bound when matrix multiplications dominate, memory-bound when parameters or activations cannot remain in fast memory, communication-bound when devices exchange gradients, or input-bound when storage cannot supply data quickly enough.

A useful performance perspective is to treat end-to-end time as the sum of computation, communication, input and output, synchronization, and scheduling overhead. Increasing the number of accelerators does not guarantee proportional speedup. If a job spends a large fraction of its time waiting for all-reduce operations or reading poorly organized files, additional devices may increase cost without improving useful work.

AI systems also differ from many classical simulations in their tolerance for approximation. Reduced precision, compressed communication, sparsity, and approximate inference may produce large performance gains while preserving acceptable predictive quality. However, such choices must be validated against the application’s accuracy and safety requirements.

Important Concepts and Terminology

An accelerator is a processor optimized for operations such as vector arithmetic, tensor multiplication, or parallel data processing. A batch is a group of training examples processed together. An epoch is one complete pass through a training dataset. A parameter is a learned model value, whereas an activation is an intermediate value produced during a forward pass. A gradient is the derivative used to update parameters.

Distributed data parallelism replicates a model across devices and divides input batches among them. Model parallelism partitions model parameters or layers across devices. Pipeline parallelism divides a model into sequential stages and streams micro-batches through those stages. Collective communication refers to operations involving multiple processes, including broadcast, reduce, all-reduce, all-gather, and reduce-scatter.

Strong scaling measures how execution time changes when more resources are applied to a fixed problem. Weak scaling measures whether execution time remains stable as both problem size and resources increase. Throughput is the amount of work completed per unit time; latency is the time required to complete an individual request. Checkpointing periodically stores model state so that training can resume after failure.

A training step is one optimization update, while a micro-batch is a smaller unit used to fit computation into device memory. Mixed-precision training uses more than one numerical precision, commonly retaining selected operations or master parameters at higher precision. A digital twin is a computational representation of a physical system that is updated using observations from that system.

Parallelism Strategies for Deep Learning

Data Parallelism

In data parallelism, every worker holds a copy of the model, but each processes a different portion of a batch. After calculating gradients, workers synchronize them, usually through an all-reduce operation. Each replica then applies the same update and remains mathematically aligned with the others.

This approach is relatively simple and effective when the model fits on one device. Its principal limitation is communication: as the number of workers increases, gradient synchronization may consume a substantial portion of each step. Large global batches may also alter optimization behaviour. Learning-rate scaling, warm-up schedules, gradient accumulation, and careful validation are often required.

Synchronous training provides consistent updates but makes the whole job wait for the slowest worker. Asynchronous training reduces waiting but may use stale gradients and can complicate convergence. Synchronous approaches are generally easier to reproduce and reason about; asynchronous methods can be useful where hardware or network performance is heterogeneous.

Model Parallelism

Model parallelism assigns different portions of a model to different devices. It is necessary when the model, its optimizer states, and its activations exceed the memory of a single accelerator. A layer-wise arrangement is common: early layers execute on one device and later layers on another. Activations must cross device boundaries during the forward pass, while gradients travel in the reverse direction.

The partition should minimize communication and balance memory and computation. A poor partition leaves one device overloaded while others remain idle. Techniques such as activation checkpointing recompute selected intermediate values instead of storing all of them, reducing memory at the cost of additional computation.

Pipeline Parallelism

Pipeline parallelism divides a model into stages and sends micro-batches through the stages. Once the first stage has passed one micro-batch onward, it can begin processing the next. This improves device utilization compared with processing a complete batch through one stage at a time.

Pipeline scheduling creates a “bubble”: at the beginning and end of a pipeline, some stages have no work. More micro-batches can reduce the relative size of this bubble, but excessive micro-batching increases scheduling and activation-management overhead. Pipeline parallelism is particularly valuable for very deep or very large models, but it requires careful handling of dependencies and optimizer updates.

Hybrid Parallelism and Sharding

Large systems commonly combine data, model, and pipeline parallelism. A model may be sharded across several devices within a node, replicated across nodes for data parallelism, and divided into pipeline stages across groups of devices. Optimizer and parameter sharding can distribute not only training examples but also model states, reducing memory duplication.

The appropriate strategy depends on model size, batch size, interconnect topology, memory capacity, communication bandwidth, and the target objective. There is no universally optimal parallelization scheme. Profiling must guide the design.

A Scalable Distributed Training Workflow

A reliable workflow begins with data engineering. Training files should be stored in formats and layouts that support parallel reads. Excessively small files create metadata overhead, while very large unstructured files make shuffling and fault recovery difficult. Data should be partitioned, indexed, validated, and staged near compute resources where possible. The input pipeline should overlap decoding and transfer with accelerator computation.

The next stage is distributed initialization. Workers require a consistent model configuration, rank identity, communication group, random-seed policy, and dataset partitioning rule. Deterministic behaviour is difficult in heterogeneous distributed systems, but explicit seeds, recorded software versions, fixed preprocessing logic, and documented nondeterministic operations improve reproducibility.

During training, monitoring should cover more than loss and accuracy. Useful measures include accelerator utilization, memory consumption, communication time, input wait time, samples per second, time per step, scaling efficiency, and checkpoint duration. A model that achieves high device utilization but poor validation quality is not a successful system.

Fault tolerance is essential for long-running jobs. Checkpoints should include model parameters, optimizer state, scheduler state, random-number state, data position, and configuration metadata. Checkpoint frequency should reflect the cost of recomputation, storage bandwidth, and the expected failure rate. Incremental or asynchronous checkpointing can reduce pauses, but it must not compromise consistency.

Finally, training should be followed by evaluation and deployment preparation. The exact training environment, data version, model configuration, evaluation results, and known limitations should be recorded. This information supports scientific reproducibility, auditability, and later rollback.

Inference at Scale

Training optimizes a model; inference serves predictions. The performance objective may therefore change from maximum throughput to predictable latency, availability, or energy efficiency. Batch inference can process many requests together and maximize accelerator utilization. Online inference often requires small batches or single-request execution, making launch overhead and memory transfer more important.

Inference systems may use model parallelism for models that do not fit on one device, replication for high request volume, and pipeline execution for complex multi-stage services. A request scheduler can combine compatible requests into dynamic batches, but excessive waiting violates latency targets. Caching, quantization, pruning, compilation, and specialized kernels can reduce cost, provided that accuracy and fairness are assessed.

A production service should define service-level objectives such as latency percentiles, throughput, availability, and error rate. Average latency alone can hide unacceptable tail behaviour. Capacity planning should consider peak demand, model version changes, failure of individual nodes, and the cost of moving data into and out of accelerators.

Large Models and Foundation Workloads

Large language, vision, and multimodal models intensify memory and communication problems. The storage requirement is not limited to parameters. Training also requires gradients, optimizer states, temporary activations, metadata, and checkpoints. Parameter sharding, tensor parallelism, pipeline parallelism, activation recomputation, and lower-precision representations are therefore often combined.

Large-model training is also a systems problem. High-bandwidth links within a node and low-latency networking between nodes affect collective operations. Parallel file systems or object-storage gateways must support sustained data and checkpoint traffic. Schedulers need placement policies that keep tightly communicating devices close together, while containerized environments must provide compatible drivers and libraries.

Inference introduces a different constraint: the generation of one token may depend on the previous token. Key-value caches accelerate repeated attention computation but consume memory. Serving many users requires a balance among sequence length, concurrency, batching, cache management, and response latency. Compression and quantization can make deployment feasible on smaller systems, though validation is mandatory.

Federated and Privacy-Sensitive Workloads

Federated learning trains a shared model across data held by separate organizations or devices. Participants send model updates rather than raw data. A coordinating service aggregates updates, often using a method such as federated averaging. This architecture can reduce direct data movement, but it does not automatically guarantee privacy.

Federated workloads are affected by non-independent and non-identically distributed data, intermittent connectivity, unequal device capabilities, and participant dropout. Communication may dominate computation. Secure aggregation can prevent the coordinator from inspecting an individual update, while differential privacy can limit information leakage by adding carefully calibrated noise. Both mechanisms may reduce accuracy or increase systems complexity.

Governance must define who may participate, how updates are authenticated, how poisoned contributions are detected, how consent is obtained, and how model outputs are audited. Federated learning is therefore both a distributed systems problem and an institutional trust problem.

Digital Twins and Real-Time Analytics

A digital twin combines a computational model with observations from a physical asset or process. Sensors, historical data, simulation models, and machine-learning components may operate together. Examples include monitoring industrial equipment, optimizing energy systems, managing transport networks, and supporting predictive maintenance.

The architecture usually contains an ingestion layer, stream-processing services, storage for historical and current states, simulation or inference engines, and visualization or control interfaces. HPC may be used to execute high-fidelity simulations, generate training data, or run ensembles of possible futures. Edge resources may perform immediate filtering or anomaly detection, while centralized systems perform expensive analysis.

Real-time analytics imposes deadlines. A technically accurate result delivered after the decision window may have little value. Systems must therefore measure end-to-end latency from data capture to action, not merely model execution time. Sensor errors, missing data, clock drift, concept drift, and communication outages require explicit handling. Where automated actions affect safety-critical systems, human override and fail-safe behaviour are essential.

Illustrative Case Study: Distributed Predictive Maintenance for a Wind Farm

Background

Consider a fictional wind-energy company operating turbines across several remote locations. Each turbine produces high-frequency vibration, temperature, electrical, and weather data. The company wants to predict gearbox failure early enough to schedule maintenance and avoid unplanned downtime.

Situation and Problem

Raw sensor streams are too large and irregular to transfer continuously to a central HPC facility. Individual sites also have different weather patterns and operating histories. A centrally trained model performs well on large sites but poorly on smaller sites, and transmitting all raw data raises connectivity and governance concerns.

Analysis

The workload combines real-time analytics, distributed learning, and digital-twin simulation. Edge devices can detect simple anomalies and extract features. Site-level systems can train local models using recent data. A central cluster can aggregate model updates, run high-fidelity simulations, and evaluate a global model. The design must address non-identical data, intermittent links, model drift, and the cost of false alarms.

Approach and Strategy

The company adopts a hybrid architecture. Edge devices perform filtering, compression, and immediate threshold-based alerts. Site clusters maintain local histories and train a shared model using federated rounds. Secure aggregation prevents the central service from viewing an individual site’s update. The central HPC system uses distributed data parallelism for global evaluation and runs simulations to generate additional failure scenarios.

Model updates are accepted only after authentication and quality checks. Checkpoints are versioned with data windows, feature definitions, code versions, and evaluation results. A streaming service compares predictions with later maintenance outcomes and triggers retraining when performance falls below a defined threshold. Operators receive explanations and confidence estimates rather than unqualified automated instructions.

Outcome

The illustrative system reduces raw-data transfer and permits each site to retain sensitive operational records. Its principal benefit is not simply faster computation; it is the combination of local responsiveness, centralized learning, simulation-based testing, and traceable governance. The company must still monitor false negatives, communication failures, changing turbine designs, and potential attacks on the update process.

Learning Points

The case demonstrates that emerging HPC workloads are composed of multiple execution environments. Edge computing handles immediacy, site infrastructure handles local data and resilience, and centralized HPC handles expensive aggregation and simulation. Parallelism alone does not solve the problem; data ownership, latency, reliability, and operational decision-making must shape the architecture.

Challenges, Risks, and Common Mistakes

A common mistake is to scale out before profiling. If the bottleneck is data decoding or storage, more accelerators will not improve performance. Another mistake is to report hardware utilization without measuring useful throughput, convergence, or prediction quality. Oversized batches may improve nominal throughput while harming generalization or increasing time to a target accuracy.

Communication bottlenecks arise from inefficient collective operations, poor device placement, oversubscribed networks, and unnecessary synchronization. Memory failures may result from optimizer states and activations rather than parameters alone. Faults in long-running jobs are inevitable at scale; systems without restart procedures and verified checkpoints are operationally fragile.

AI workloads also face data and model risks. Training data may contain bias, confidential information, licensing restrictions, or malicious content. Models may leak memorized information, amplify unequal performance, or be manipulated through adversarial inputs. Federated systems can suffer from poisoning, Sybil participation, and update leakage. Digital twins can create false confidence when the physical model is poorly calibrated.

Energy and sustainability are additional concerns. Efficient data pipelines, workload-aware scheduling, lower precision, model reuse, and carbon-conscious placement can reduce environmental impact. Efficiency should be measured across the complete workflow, including data preparation, experimentation, checkpointing, and inference—not only accelerator arithmetic.

Governance, Ethics, and Professional Practice

Responsible HPC-AI practice requires clear ownership of data, models, infrastructure, and decisions. Data-protection obligations may restrict collection, retention, cross-border transfer, and secondary use. Access controls, encryption, identity management, vulnerability patching, and audit logs are necessary components of the platform rather than optional additions.

Model documentation should describe intended use, training data characteristics, evaluation populations, limitations, known failure modes, and monitoring procedures. Reproducibility requires preserving configurations and provenance, but privacy requirements may prevent retaining identifiable data. These objectives must be reconciled through minimization, controlled access, anonymization where appropriate, and documented retention policies.

Human accountability remains important when AI informs medical, financial, industrial, public-sector, or safety-related decisions. A technically efficient system is not professionally acceptable if users cannot understand its scope, challenge its outputs, or recover from failure.

Current Developments and Best Practices

Emerging systems increasingly combine CPUs, GPUs, specialized AI accelerators, high-bandwidth memory, smart networking, and disaggregated storage. Compiler technologies and graph optimizers can fuse operations and generate hardware-specific kernels. Training and serving are also becoming more integrated through reusable model repositories, automated evaluation, and infrastructure-as-code.

Practical best practices include:

  • Profile computation, memory, communication, and I/O before selecting a parallelization strategy.
  • Match parallelism to model size, batch size, topology, and latency requirements.
  • Use mixed precision and compression only with systematic accuracy and stability tests.
  • Design data layouts and input pipelines for parallel access.
  • Treat checkpointing, restart, monitoring, and provenance as first-class workflow components.
  • Evaluate scaling by time to a target quality, not by speedup alone.
  • Separate experimental, staging, and production environments.
  • Test failures, stragglers, node loss, stale data, and network partitioning.
  • Apply privacy, security, fairness, and access controls throughout the lifecycle.
  • Measure energy, cost, and environmental impact alongside performance.

Chapter Summary

HPC for AI combines parallel computation, high-bandwidth data movement, specialized hardware, distributed software, and operational governance. Data parallelism is effective when a model fits on each device; model and pipeline parallelism address memory and depth constraints; hybrid sharding is required for many large models. Scalable workflows depend on efficient data access, communication-aware placement, fault-tolerant checkpointing, profiling, reproducibility, and quality-based evaluation.

Inference emphasizes latency, availability, and predictable service behaviour rather than only training throughput. Federated learning distributes computation while raising issues of privacy, heterogeneity, and trust. Digital twins and real-time analytics combine simulation, streaming, edge processing, and centralized HPC under strict timing requirements. Across all workloads, technical performance must be evaluated together with accuracy, cost, energy, security, ethics, and governance.

Key Terms

Accelerator: A processor designed to execute highly parallel operations efficiently.

All-reduce: A collective operation that combines values from all workers and distributes the result to every worker.

Activation: An intermediate value produced during a neural network forward pass.

Checkpoint: A stored snapshot of model and training state used for recovery or continuation.

Data parallelism: Replicating a model while distributing different data batches among workers.

Digital twin: A computational representation of a physical system connected to its observed state.

Federated learning: Collaborative model training in which data remains at participating sites.

Inference: Using a trained model to produce predictions or decisions.

Latency: The elapsed time required to complete a request or operation.

Model parallelism: Dividing model parameters or layers across multiple devices.

Mixed precision: Using multiple numerical precisions within a computation.

Pipeline parallelism: Dividing a model into stages and streaming micro-batches through them.

Quantization: Representing values with reduced numerical precision to reduce cost or memory.

Scalability: The ability of a system to handle increased resources or workload effectively.

Strong scaling: Speedup obtained by applying more resources to a fixed problem.

Throughput: The quantity of useful work completed per unit time.

Training step: One optimization update based on computed gradients.

Micro-batch: A small batch used to manage memory or pipeline execution.

Review Questions

Short Answer Questions

1. Why can adding more accelerators fail to produce proportional training speedup?

2. Distinguish throughput from latency in an inference service.

3. What problem does activation checkpointing address?

4. Why is federated learning not, by itself, a complete privacy solution?

5. What is the role of a digital twin in real-time analytics?

Long Answer Questions

1. Explain data, model, pipeline, and hybrid parallelism, including the situations in which each is appropriate.

2. Describe the design of a fault-tolerant distributed deep-learning workflow from data preparation through evaluation.

3. Analyze the infrastructure requirements of large-model training and inference.

4. Discuss the technical and governance challenges of federated learning.

5. Explain how HPC, edge computing, streaming systems, and simulation can be combined in a digital-twin architecture.

Analytical / Application Questions

1. A training job has 90% accelerator utilization but spends 35% of its time waiting for gradient synchronization. What measurements and architectural changes would you investigate?

2. Design a parallel inference strategy for a model that exceeds one accelerator’s memory but must meet strict tail-latency requirements.

3. A federated industrial-monitoring system shows declining accuracy at one site after a new machine is installed. Propose a diagnostic, retraining, and governance response.

22. Multiple Choice Questions with Answers

Question 1

A distributed training job replicates the model on every accelerator and assigns different mini-batches to the replicas. Which strategy is being used?

A. Pipeline parallelism

B. Data parallelism

C. Model parallelism

D. Asynchronous inference

Correct Answer: B. Data parallelism

Question 2

Why may adding accelerators fail to improve the performance of a deep-learning job?

A. The model becomes more accurate automatically

B. Communication or input/output may dominate computation

C. Checkpoints eliminate all synchronization

D. More accelerators always reduce memory capacity

Correct Answer: B. Communication or input/output may dominate computation

Question 3

Which technique reduces memory usage by recomputing selected intermediate values during backpropagation?

A. Activation checkpointing

B. Dynamic batching

C. Secure aggregation

D. Data replication

Correct Answer: A. Activation checkpointing

Question 4

A model is divided into sequential stages and micro-batches are streamed through those stages. This is an example of:

A. Data parallelism

B. Pipeline parallelism

C. Federated averaging

D. Strong scaling

Correct Answer: B. Pipeline parallelism

Question 5

Which metric is most directly concerned with the time taken to answer an individual online request?

A. Throughput

B. Epoch count

C. Latency

D. Parameter count

Correct Answer: C. Latency

Question 6

In federated learning, what is a principal reason that model updates require additional protection?

A. Updates can potentially reveal information about local training data

B. Updates cannot be transmitted over networks

C. All participants necessarily have identical data

D. Centralized storage is always prohibited

Correct Answer: A. Updates can potentially reveal information about local training data

Question 7

A real-time digital-twin system produces highly accurate predictions several hours after an operational decision is required. What is the primary systems problem?

A. Insufficient model depth

B. Excessive end-to-end latency

C. Excessive parameter sharing

D. Weak strong scaling

Correct Answer: B. Excessive end-to-end latency

Question 8

Which practice most directly improves the ability to resume a failed long-running training job?

A. Removing all metadata from outputs

B. Increasing model size

C. Maintaining consistent, verified checkpoints

D. Disabling monitoring

Correct Answer: C. Maintaining consistent, verified checkpoints

Question 9

Why can a very large global batch require changes to the optimization procedure?

A. It changes the numerical representation of all parameters to text

B. It can alter convergence behaviour and may require learning-rate adjustments

C. It prevents any form of parallelism

D. It automatically removes communication costs

Correct Answer: B. It can alter convergence behaviour and may require learning-rate adjustments

Question 10

Which design best reflects a hybrid HPC-edge architecture for industrial monitoring?

A. Send all raw sensor data to a central system and perform no local processing

B. Use edge processing for immediate filtering and centralized HPC for aggregation and simulation

C. Run all simulation only on personal devices

D. Avoid model updates after deployment

Correct Answer: B. Use edge processing for immediate filtering and centralized HPC for aggregation and simulation

High Performance Computing
Chapter 13 of 15