AI Glossary / AI and machine learning / Advanced
Single program / multiple data
Definition
Single program / multiple data, usually shortened to SPMD, is a way of organizing parallel computing in which several processors run the same program on different portions of data. The processors cooperate to complete a larger job.
What it means
A large calculation can take too long on one processor even when the instructions are straightforward. One response is to divide the data and give the same instructions to several workers. Each worker handles its assigned portion, then exchanges information when the calculation requires it.
The phrase describes how the work is organized. It does not mean that every processor handles identical records, follows every branch at the same moment, or produces the same intermediate answer. The program is shared; the local data and worker identity can differ.
In machine learning, this matters because training and prediction involve repeated operations over large collections of numbers. Dividing those operations across devices can make a job feasible within a deadline or available memory.
For a business reader, the useful question is whether extra computing capacity translates into useful throughput. Devices still spend time exchanging data, waiting and recovering from failures. Paying for four devices does not automatically buy four times the speed.
How it works
The system first decides how arrays or records will be divided. A portion held by one device is often called a shard. Each worker executes the program using its local portion, with coordination supplied by the computing framework.
Some steps are local. A worker might calculate predictions for its assigned records without consulting another worker. Other steps are collective: workers may need to add results together, exchange portions of an array or agree on an updated model.
Data-parallel training is one possible arrangement. Workers process different training examples and combine their contributions to an update. Other SPMD arrangements partition the model's arrays and computations differently. SPMD is broader than simply copying a whole model onto every device.
The arrangement works best when useful calculation outweighs coordination overhead. Uneven workloads, slow connections and repeated transfers can leave expensive processors idle. Performance therefore needs measurement on the actual workload.
Three practical examples
- Document processing: several workers run the same classification program on different sets of archived documents, then combine the results into one catalog.
- Model training: multiple devices process portions of a training workload and exchange the information needed to update a shared model consistently.
- Simulation: a planning team runs the same simulation logic for different assigned scenarios and aggregates the outputs for comparison.
Think of it this way
Think of a stocktake across a chain of shops. Every team follows the same counting procedure, but each counts a different location. Head office combines the returns and resolves shared questions about product codes.
The analogy has a limit. People can improvise when a delivery arrives halfway through counting. Computing workers require rules for coordination, incomplete work and repeated records. The shared procedure must cover those situations.
Worked example
Testing whether more workers are worth the cost
Suppose an archive contains 80,000 documents. In an invented timing exercise, one worker processes the complete archive in 80 minutes. Four workers receive 20,000 documents each.
If processing divided perfectly, the calculation would take 20 minutes. In this example, distributing files and combining results add eight minutes, so the measured elapsed time is 28 minutes. The speed-up is approximately 2.9 times, not four times.
If all four workers remain allocated throughout, the run consumes 112 worker-minutes, compared with 80 for the single-worker run. Finishing sooner and spending less are different objectives.
The manager can now make a concrete choice. A 30-minute deadline may justify the additional resource use. An overnight archive job may not. These teaching figures illustrate the comparison, not an expected performance benchmark.
Illustrative case study
A fictional distributor moves a product-matching workload to several computing devices. The team expects a dramatic improvement, but the job remains slow because every worker repeatedly loads the same large reference file over a congested connection.
The engineers measure time spent calculating and transferring data separately. They change how reference information is made available and rebalance the assigned records. The business evaluates the revised design using elapsed time, cost and matching quality.
The case illustrates why the program of work matters as much as the number of processors. SPMD creates a way to share the calculation; it does not remove the need to manage data movement.
Common misconceptions and mistakes
- More workers guarantee proportional speed. Communication, uneven work and serial steps limit the improvement.
- SPMD means identical execution at every instant. Workers run the same program but can operate on different data and take different branches.
- Parallel processing improves the model's judgment. It changes execution capacity; prediction quality still depends on the model, data and evaluation.
Business use
SPMD is mainly an infrastructure concept. It is useful when discussing large training jobs, high-volume inference or analytical workloads that exceed a single device's practical capacity.
Ask suppliers for measured completion time and total cost on a representative workload. Include data preparation and result collection in the comparison. A fast central calculation can still sit inside a slow end-to-end process.
People also ask
Is SPMD an AI model?
No. It is an execution pattern that can support AI and many other calculations.
Is it the same as SIMD?
No. SIMD refers to a single instruction operating on multiple data elements; SPMD describes multiple workers executing one program and allows more independent control flow.
Do business users need to configure it?
Usually the technical team or platform handles it. Buyers benefit from understanding its cost and performance implications.
Check your understanding
A four-worker run finishes in 28 minutes rather than the original 80, but uses 112 worker-minutes. Has it become both faster and cheaper?
Answer: It is faster in elapsed time. It has used more worker time, so a cost saving cannot be assumed. Actual pricing and the value of meeting the deadline must be considered.
Related terms
Learn next
Read batch and batch size, then examine one computing job's elapsed time and resource use. Compare the cost of faster completion with the business value of the deadline.
More in AI and machine learning
- Shrinkage - Shrinkage is the deliberate pulling of estimated values toward a center, typically toward zero or a group average, trading a little bias for a large...
- Similarity learning - Similarity learning trains a model to judge how alike or related two objects are for a particular task.
- Simultaneous autoregression - Simultaneous autoregression is a spatial statistics model where each location's value is predicted from the values of its neighboring locations at the same...
- Situated - In artificial intelligence, situated describes an agent whose behavior is embedded in and shaped by interaction with an environment.
- Situated approach (artificial intelligence) - The situated approach in artificial intelligence designs and studies agents through their ongoing interaction with an environment.
- Sketching - In similarity search and clustering, sketching uses compact summaries or preliminary groupings to reduce the number of expensive comparisons between items.
Sources
Google, Machine Learning Glossary, single program / multiple data: https://developers.google.com/machine-learning/glossary. Definition checked 12 October 2026. Examples and calculations are original teaching scenarios.
MathWorks, Run Single Programs on Multiple Data Sets: https://www.mathworks.com/help/parallel-computing/execute-simultaneously-on-multiple-data-sets.html. Checked 12 October 2026.
Previous: Single-pass in-memory indexing Next: Single source of truth