Share to: share facebook share twitter share wa share telegram print page

Pipeline (computing)

In computing, a pipeline, also known as a data pipeline, is a set of data processing elements connected in series, where the output of one element is the input of the next one. The elements of a pipeline are often executed in parallel or in time-sliced fashion. Some amount of buffer storage is often inserted between elements.

Concept and motivation

Pipelining is a commonly used concept in everyday life. For example, in the assembly line of a car factory, each specific task—such as installing the engine, installing the hood, and installing the wheels—is often done by a separate work station. The stations carry out their tasks in parallel, each on a different car. Once a car has had one task performed, it moves to the next station. Variations in the time needed to complete the tasks can be accommodated by "buffering" (holding one or more cars in a space between the stations) and/or by "stalling" (temporarily halting the upstream stations), until the next station becomes available.

Suppose that assembling one car requires three tasks that take 20, 10, and 15 minutes, respectively. Then, if all three tasks were performed by a single station, the factory would output one car every 45 minutes. By using a pipeline of three stations, the factory would output the first car in 45 minutes, and then a new one every 20 minutes.

As this example shows, pipelining does not decrease the latency, that is, the total time for one item to go through the whole system. It does however increase the system's throughput, that is, the rate at which new items are processed after the first one.

In computing

In computing, a pipeline or data pipeline[1] is a set of data processing elements connected in series, where the output of one element is the input of the next one. The elements of a pipeline are often executed in parallel or in time-sliced fashion. Some amount of buffer storage is often inserted between elements.

Computer-related pipelines include:

Design considerations

Balancing the stages

Since the throughput of a pipeline cannot be better than that of its slowest element, the designer should try to divide the work and resources among the stages so that they all take the same time to complete their tasks. In the car assembly example above, if the three tasks took 15 minutes each, instead of 20, 10, and 15 minutes, the latency would still be 45 minutes, but a new car would then be finished every 15 minutes, instead of 20.

Buffering

Under ideal circumstances, if all processing elements are synchronized and take the same amount of time to process, then each item can be received by each element just as it is released by the previous one, in a single clock cycle. That way, the items will flow through the pipeline at a constant speed, like waves in a water channel. In such "wave pipelines",[2] no synchronization or buffering is needed between the stages, besides the storage needed for the data items.

More generally, buffering between the pipeline stages is necessary when the processing times are irregular, or when items may be created or destroyed along the pipeline. For example, in a graphics pipeline that processes triangles to be rendered on the screen, an element that checks the visibility of each triangle may discard the triangle if it is invisible, or may output two or more triangular pieces of the element if they are partly hidden. Buffering is also needed to accommodate irregularities in the rates at which the application feeds items to the first stage and consumes the output of the last one.

The buffer between two stages may be simply a hardware register with suitable synchronization and signalling logic between the two stages. When a stage A stores a data item in the register, it sends a "data available" signal to the next stage B. Once B has used that data, it responds with a "data received" signal to A. Stage A halts, waiting for this signal, before storing the next data item into the register. Stage B halts, waiting for the "data available" signal, if it is ready to process the next item but stage A has not provided it yet.

If the processing times of an element are variable, the whole pipeline may often have to stop, waiting for that element and all the previous ones to consume the items in their input buffers. The frequency of such pipeline stalls can be reduced by providing space for more than one item in the input buffer of that stage. Such a multiple-item buffer is usually implemented as a first-in, first-out queue. The upstream stage may still have to be halted when the queue gets full, but the frequency of those events will decrease as more buffer slots are provided. Queueing theory can tell the number of buffer slots needed, depending on the variability of the processing times and on the desired performance.

Nonlinear pipelines

If some stage takes (or may take) much longer than the others, and cannot be sped up, the designer can provide two or more processing elements to carry out that task in parallel, with a single input buffer and a single output buffer. As each element finishes processing its current data item, it delivers it to the common output buffer, and takes the next data item from the common input buffer. This concept of "non-linear" or "dynamic" pipeline is exemplified by shops or banks that have two or more cashiers serving clients from a single waiting queue.

Dependencies between items

In some applications, the processing of an item Y by a stage A may depend on the results or effect of processing a previous item X by some later stage B of the pipeline. In that case, stage A cannot correctly process item Y until item X has cleared stage B.

This situation occurs very often in instruction pipelines. For example, suppose that Y is an arithmetic instruction that reads the contents of a register that was supposed to have been modified by an earlier instruction X. Let A be the stage that fetches the instruction operands, and B be the stage that writes the result to the specified register. If stage A tries to process instruction Y before instruction X reaches stage B, the register may still contain the old value, and the effect of Y would be incorrect.

In order to handle such conflicts correctly, the pipeline must be provided with extra circuitry or logic that detects them and takes the appropriate action. Strategies for doing so include:

  • Stalling: Every affected stage, such as A, is halted until the dependency is resolved—that is, until the required information is available and/or the required state has been achieved.
  • Reordering items: Instead of stalling, stage A may put item Y aside and look for any subsequent item Z in its input stream that does not have any dependencies pending with any earlier item. In instruction pipelines, this technique is called out-of-order execution.
  • Guess and backtrack: One important example of item-to-item dependency is the handling of a conditional branch instruction X by an instruction pipeline. The first stage A of the pipeline, that fetches the next instruction Y to be executed, cannot perform its task until X has fetched its operand and determined whether the branch is to be taken or not. That may take many clock cycles, since the operand of X may in turn depend on previous instructions that fetch data from main memory.
Rather than halt while waiting for X to be finished, stage A may guess whether the branch will be taken or not, and fetch the next instruction Y based on that guess. If the guess later turns out to be incorrect (hopefully rarely), the system would have to backtrack and resume with the correct choice. Namely, all the changes that were made to the machine's state by stage A and subsequent stages based on that guess would have to be undone, the instructions following X already in the pipeline would have to be flushed, and stage A would have to restart with the correct instruction pointer. This branch prediction strategy is a special case of speculative execution.

Typical software implementations

To be effectively implemented, data pipelines need a CPU scheduling strategy to dispatch work to the available CPU cores, and the usage of data structures on which the pipeline stages will operate on. For example, UNIX derivatives may pipeline commands connecting various processes' standard IO, using the pipes implemented by the operating system. Some operating systems[example needed] may provide UNIX-like syntax to string several program runs in a pipeline, but implement the latter as simple serial execution, rather than true pipelining—namely, by waiting for each program to finish before starting the next one.[citation needed]

Lower level approaches may rely on the threads provided by the operating system to schedule work on the stages: both thread pool-based implementations or on a one-thread-per-stage are viable, and exist.[3]

Other strategies relying on cooperative multitasking exist, that do not need multiple threads of execution and hence additional CPU cores, such as using a round-robin scheduler with a coroutine-based framework. In this context, each stage may be instantiated with its own coroutine, yielding control back to the scheduler after finishing its round task. This approach may need careful control over the process' stages to avoid them abuse their time slice.

Costs and drawbacks

A pipelined system typically requires more resources (circuit elements, processing units, computer memory, etc.) than one that executes one batch at a time, because its stages cannot share those resources, and because buffering and additional synchronization logic may be needed between the elements.

Moreover, the transfer of items between separate processing elements may increase the latency, especially for long pipelines.

The additional complexity cost of pipelining may be considerable if there are dependencies between the processing of different items, especially if a guess-and-backtrack strategy is used to handle them. Indeed, the cost of implementing that strategy for complex instruction sets has motivated some radical proposals to simplify computer architecture, such as RISC and VLIW. Compilers also have been burdened with the task of rearranging the machine instructions so as to improve the performance of instruction pipelines.

New technologies

It's true that in recent years the demands on applications and their underlying hardware have been significant. For example, building pipelines with single node applications that trawl through the data row by row is no longer feasible with the volume and variety of big data. However, with the advent of data analytics engines such as Hadoop, or more recently Apache Spark, it's been possible to distribute large datasets across multiple processing nodes, allowing applications to reach heights of efficiency several hundred times greater than was thought possible before. The effect of this today is that even a mid-level PC using distributed processing in this fashion can handle the building and running of big data pipelines.[4]

See also

References

  1. ^ Data Pipeline Development Archived 2018-05-24 at the Wayback Machine Published by Dativa, retrieved 24 May, 2018
  2. ^ O. Hauck; Sorin A. Huss; M. Garg (1999). "Two-phase asynchronous wave-pipelines and their application to a 2D-DCT". Proceedings. Fifth International Symposium on Advanced Research in Asynchronous Circuits and Systems. pp. 219–228. doi:10.1109/ASYNC.1999.761536. ISBN 0-7695-0031-5. S2CID 206515615.
  3. ^ "MTDP". GitHub. September 2022.
  4. ^ What is a Data Pipeline? Published by Data Pipelines, retrieved 11 March 2021

Bibliography

Read other articles:

هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (مايو 2013) في مجال الأعمال، يشير مصطلح منصة السحب إلى أي إطار عمل يقيس القدرة على جذب الأشخاص والموارد وفق الحاجة وعلى أساس الاستجابة لمشهد الفرص والتحديات سريع التغير ...

У Вікіпедії є статті про інші значення цього терміна: Операція. Операція — відображення, що ставить у відповідність одному або декільком елементам множини (аргументам) інший элемент (значення). Термін «операція» як правило застосовується до арифметичних або логічних д

تحتاج هذه المقالة إلى الاستشهاد بمصادر إضافية لتحسين وثوقيتها. فضلاً ساهم في تطوير هذه المقالة بإضافة استشهادات من مصادر موثوقة. من الممكن التشكيك بالمعلومات غير المنسوبة إلى مصدر وإزالتها. علم الانسان السياسي مفاهيم أساسية الوضع والمرتبة Ascribed status حالة مكتسبة حالة اجتما...

For the use of this term in other countries, see Statutory city (disambiguation). EisenstadtGrazInnsbruckKlagenfurt am WörtherseeKrems an der DonauLinzRustSalzburgSt. PöltenSteyrVillachWaidhofenan derYbbsWelsWienWienerNeustadtclass=notpageimage| Statutory cities in Austria This article is part of a series on thePolitics of Austria Law Constitution (B-VG) Taxation State Treaty Human rights Neutrality Supreme organs Executive President (list) Alexander Van der Bellen Chancellor (list) Karl Ne...

US federal law Competition law Basic concepts History of competition law Monopoly and oligopoly Coercive monopoly Natural monopoly Barriers to entry Herfindahl–Hirschman Index Market concentration Market power SSNIP test Relevant market Merger control Anti-competitive practices Monopolization Collusion Formation of cartels Price fixing (cases) Bid rigging Tacit collusion Product bundling and tying Refusal to deal Group boycott Essential facilities Exclusive dealing Dividing territories Pred...

City in Idaho, United StatesJerome, IdahoCityLocation of Jerome in Jerome County, Idaho.Jerome, IdahoLocation in the United StatesCoordinates: 42°43′29″N 114°31′3″W / 42.72472°N 114.51750°W / 42.72472; -114.51750CountryUnited StatesStateIdahoCountyJeromeGovernment • MayorDavid Davis[1][2]Area[3] • Total5.58 sq mi (14.45 km2) • Land5.58 sq mi (14.44 km2) • W...

German automotive part supplier This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources in this article. Unsourced material may be challenged and removed.Find sources: Hella company – news · newspapers · books · scholar ...

Perangko peringatan 100 tahun Kartini. Kumpulan surat-suratnya yang berjudul Habis Gelap Terbitlah Terang diterjemahkan 100 tahun lalu pada tahun 1922 oleh Armijn Pane. Bagian dari seri tentangBudaya Indonesia Sejarah Sejarah menurut provinsi Bangsa Daftar suku bangsa Daftar suku bangsa menurut provinsi Bahasa Bahasa Indonesia Tradisi Etiket di Indonesia Busana nasional Indonesia Mitologi dan cerita rakyat Mitologi Cerita rakyat Hidangan Hari raya Festival Hari libur nasional Agama Islam Kekr...

يفتقر محتوى هذه المقالة إلى الاستشهاد بمصادر. فضلاً، ساهم في تطوير هذه المقالة من خلال إضافة مصادر موثوق بها. أي معلومات غير موثقة يمكن التشكيك بها وإزالتها. (ديسمبر 2018) الدوري الإسباني الدرجة الثانية الموسم 2001–2002 البلد إسبانيا  المنظم الاتحاد الملكي الإسباني لكرة القد...

Bear MountainNorth aspectHighest pointElevation12,987 ft (3,958 m)[1]Prominence547 ft (167 m)[1]Parent peakV 7 (13,043 ft)[2]Isolation1.29 mi (2.08 km)[2]Coordinates37°47′40″N 107°43′58″W / 37.7945769°N 107.7328083°W / 37.7945769; -107.7328083[3]GeographyBear MountainLocation in ColoradoShow map of ColoradoBear MountainBear Mountain (the United States)Show map of the United States Lo...

El método por agotamiento[1]​ es un procedimiento geométrico de aproximación a un resultado, con el cual el grado de precisión aumenta en la medida en que avanza el cálculo. Fue creado por Eudoxo de Cnido, reconocido por su teoría de las proporciones y teoremas sobre ella. También se conoce como: método por agotamiento,[2]​ método de exhausción[3]​ o método de exhaución.[4]​ Historia Método por agotamiento para hallar el área del círculo, la longitud de ...

Stadium in Jamshedpur, India This article includes a list of general references, but it lacks sufficient corresponding inline citations. Please help to improve this article by introducing more precise citations. (February 2019) (Learn how and when to remove this template message) JRD Tata Sports Complex StadiumThe FurnacePanoramic view of the stadiumFull nameJRD Tata Sports ComplexLocationJamshedpur, JharkhandOwnerTata SteelOperatorJamshedpur FCCapacity24,424 (for ISL games)Field size105 m ×...

This article includes a list of general references, but it lacks sufficient corresponding inline citations. Please help to improve this article by introducing more precise citations. (April 2011) (Learn how and when to remove this template message) Bilateral relationsBrazil–Russia relations Brazil Russia Russian President Vladimir Putin and the President of Brazil Lula in 2005 Brazil–Russia (Russian: Российско-бразильские отношения or Бразильско-ро...

Type of market in finance for used goods This article is about the financial term. For the merchandising concept, see Aftermarket (merchandise). Part of a series onFinancial markets Public market Exchange · Securities Bond market Bond valuation Corporate bond Fixed income Government bond High-yield debt Municipal bond Securitization Stock market Common stock Preferred stock Registered share Stock Stock certificate Stock exchange Other markets Derivatives (Credit derivativeFutures exchan...

Jonchery-sur-Vesle La halte ferroviaire. Localisation Pays France Commune Jonchery-sur-Vesle Adresse Les Marais51140 Jonchery-sur-Vesle Coordonnées géographiques 49° 17′ 25″ nord, 3° 49′ 10″ est Gestion et exploitation Propriétaire SNCF Exploitant SNCF Code UIC 87171314 Site Internet La gare de Jonchery-sur-Vesle, sur le site de la SNCF Services TER Grand Est Caractéristiques Ligne(s) Soissons à Givet Voies 2 Quais 2 Transit annuel 76 262 ...

Association football match Football match2000 AFC Asian Cup FinalThe Camille Chamoun Sports City Stadium (pictured in 2018) hosted the finalEvent2000 AFC Asian Cup Japan Saudi Arabia 1 0 Date20 October 2000 (2000-10-20)VenueCamille Chamoun Sports City Stadium, BeirutMan of the MatchYoshikatsu Kawaguchi (Japan)[1]RefereeAli Bujsaim (United Arab Emirates)Attendance49,500[1]WeatherPartly cloudy21 °C (70 °F)68% humidity[2]← 1996 2004 →...

Indian model and actress Kanchan AwasthiKanchan Awasthi in 2022BornLucknow, Uttar Pradesh, IndiaOccupation(s)Model, actressWebsitekanchanawasthi.com Kanchan Awasthi[1] is an Indian model and actress. She has appeared in the Indian television show Amma and Hindi movies including, Manto Remix, Bhootwali Love Story[2] Gunwali Dulhaniya, and Fraud Saiyaan.[3] She is appointed brand ambessdor for Avon cycles[4][5][6] Movies Year(s) Title Character 20...

American politician Alejandra Campoverdiformer White House Deputy Director of Hispanic MediaIn office2009–2012PresidentBarack Obama Personal detailsBornAlejandra Campoverdi (1979-09-20) September 20, 1979 (age 44)Los Angeles, California, U.S.EducationUniversity of Southern California (BA)Harvard University (MPP)Websitealejandracampoverdi.com Alejandra Campoverdi (born September 20, 1979) is an American women’s health advocate, best-selling author, and former White House aide.[1&#...

You can help expand this article with text translated from the corresponding article in French. (March 2009) Click [show] for important translation instructions. View a machine-translated version of the French article. Machine translation, like DeepL or Google Translate, is a useful starting point for translations, but translators must revise errors as necessary and confirm that the translation is accurate, rather than simply copy-pasting machine-translated text into the English Wikipedi...

Governorate of the Russian Empire Tomsk GovernorateТомская губерния (Russian)Governorate of Russian empire1804–1925 Coat of arms Tomsk Governate within the Russian EmpireCapitalTomskArea • 1897847,328 km2 (327,155 sq mi)Population • 1897 1 927 679• 1906 2,412,700 HistoryHistory • Established 1804• Disestablished 1925 Preceded by Succeeded by Tobolsk Governorate Siberian Krai Altai Governorate Novonikolayevs...

Kembali kehalaman sebelumnya