AI Glossary / Data engineering and architecture / Intermediate
Butterfly network
Definition
A butterfly network is a structured interconnection network that routes information through a sequence of stages using a repeating pattern of straight and crossing links. It is studied in parallel computing and communication because its regular structure supports short, systematic routes between inputs and outputs.
What it means
The name refers to the crossing pattern in a network diagram. It does not refer to a neural network that learns from examples, although related structured communication patterns can appear inside computing systems used for AI.
There are several butterfly variants. This entry uses the standard directed, layered binary butterfly: with N equal to a power of two, it has N positions at each of log2(N) plus one levels. Inputs occupy the first level and outputs the last. Adjacent levels are connected by straight links and links that change one selected address bit.
Other descriptions may count switches or stages differently, or use wrap-around and expanded forms. Performance and fault-tolerance claims must identify the particular topology rather than attach automatically to every network called a butterfly.
How it works
Label each position with a binary address. At each transition to the next level, routing fixes one address bit to match the destination. A straight link preserves that bit; a crossing link changes it. After every destination bit has been handled, the route reaches the required output.
For the stated layered topology, there is a unique directed input-to-output route. Its number of links grows logarithmically with the number of inputs. That describes path length, not necessarily elapsed delivery time.
Several packets may require the same link during overlapping intervals. Queues, scheduling and flow control determine how they proceed. The topology alone does not guarantee that all requested connections can be used simultaneously without contention. Research on butterfly routing therefore examines traffic patterns and queueing assumptions as well as graph structure.
Three practical examples
- A parallel-computing researcher models how processors exchange packets through a regular multistage interconnection.
- A hardware design team compares link count, routing simplicity and contention against an alternative switching fabric.
- An algorithm student traces bit-by-bit routes to understand why a short individual path does not guarantee high throughput for every traffic pattern.
Think of it this way
Think of a sorting center with several successive routing decisions. At each stage, one part of a destination code determines which onward path a parcel takes. After the final decision, the code points to the intended exit.
The analogy explains staged selection, but not unlimited carrying capacity. Several parcels can need the same passage at once. Real networks must resolve those conflicts, and different butterfly variants can add routes or other mechanisms beyond the basic arrangement described here.
Worked example
Take an eight-input layered butterfly. Each address has three bits, so a route crosses three transitions, moving through four levels. Number the bits from left to right for this example.
A packet starts at input 010 and targets output 101. The first transition sets the leftmost bit to 1, reaching position 110 at level one. The second sets the middle bit to 0, reaching 100 at level two. The third sets the rightmost bit to 1, reaching output 101.
Now consider two packets: one from 000 to 000 and another from 100 to 001. Both can reach position 000 at level one. Both then need its straight link to position 000 at level two, even though their final outputs differ. If that link carries only one packet per time slot, one must wait. This original example separates reachability from contention-free simultaneous delivery.
Illustrative case study
Illustrative case study: A fictional accelerator research team evaluates a small butterfly interconnection for moving intermediate data. Its first test sends isolated packets and finds that every route uses the expected number of stages. The team initially considers that sufficient evidence of good performance.
A second test introduces simultaneous traffic that converges on shared links. Queueing increases, so the team adds representative traffic patterns, queue occupancy and throughput measurements to its evaluation. It also documents whether the implemented network is the simple layered form or an extended variant.
This invented case illustrates the difference between a topology property and a workload result. It gives no measured accelerator performance and does not imply that butterfly designs are unsuitable whenever contention exists.
Common misconceptions and mistakes
- Confusing the network topology with an AI learning architecture.
- Treating logarithmic path length as a guarantee of logarithmic elapsed time under arbitrary traffic.
- Assuming distinct destinations prevent shared intermediate links.
- Transferring resilience claims from a wrap-around or multipath variant to a basic layered network.
- Comparing node or stage counts without checking the definitions used by each source.
Business use
For businesses, this term is most relevant when assessing specialist computing infrastructure or understanding an algorithm's communication assumptions. The useful questions are concrete: what traffic must the system carry, where can routes contend and which failures must it tolerate?
A topology diagram cannot answer those questions alone. Ask for workload-appropriate measurements and a clear description of buffering, routing and failure handling. For an AI accelerator, connect communication performance to the actual model workload rather than assuming a regular network pattern will benefit every computation. Software mapping and data movement can change the effective result substantially.
People also ask
Does every butterfly network have only one possible route?
No. The unique-route statement here applies to the specified directed layered topology. Other variants require separate analysis.
Can packets going to different outputs still interfere?
Yes. Their routes may share intermediate links or switching resources.
Is a butterfly network the same as a butterfly operation in an FFT?
No. They are related in structural imagery and some computational layouts, but one names an interconnection topology and the other a computation pattern.
Check your understanding
The eight-input example has three links on each route. Does that prove every group of packets arrives after exactly three time slots?
Answer: No. Contention, queueing and implementation timing can add delays. The three-link property describes route length under the chosen topology.
Related terms
- Hypercube (communication pattern)
- Fast Fourier transform
- Interconnection network
- Multistage network
- Packet routing
- Network topology
- Contention
- Flow control
- Queueing
- Hypercube
Learn next
Draw the eight-address, four-level example and trace two routes with different destinations. Mark their shared links, then distinguish a path-length calculation from a packet-scheduling problem.
More in Data engineering and architecture
- Burst buffer - A burst buffer is a fast intermediate storage layer that temporarily absorbs intensive input or output activity before data moves to or from longer-term...
- Business analytics - Business analytics is the use of data, analytical methods and business context to understand performance and support decisions.
- Business rule management system - A business rule management system, or BRMS, is software for defining, organizing, testing, deploying and maintaining the rules used to make operational...
- Cache coherence - Cache coherence is the coordination that keeps cached copies of shared memory locations consistent with the system's rules for reads and writes.
- Cache-only memory architecture - Cache-only memory architecture, or COMA, is a shared-memory multiprocessor organization in which each node's main-memory capacity acts as a large cache of...
- Cache stampede - A cache stampede occurs when many requests encounter the same missing or expired cached value and independently try to fetch or recompute it.
Sources
Primary sources: Maggs and Sitaraman, Simple Algorithms for Routing on Butterfly Networks with Bounded Queues, topology and routing definitions: https://groups.cs.umass.edu/wp-content/uploads/sites/3/2019/12/Simple-algorithms-for-routing-on-butterfly-networks-with-bounded-queues.pdf ; Platt and Romero, research on a distinct wrap-around butterfly variant: https://arxiv.org/abs/1704.02426 . Relevant definition and routing passages of the first paper and the second paper's abstract reviewed. Address traces and accelerator case are original illustrations.
Previous: Business rules engine Next: Byte-pair encoding