WO2015052485A1 - A data processing apparatus and method for controlling performance of speculative vector operations - Google Patents
A data processing apparatus and method for controlling performance of speculative vector operations Download PDFInfo
- Publication number
- WO2015052485A1 WO2015052485A1 PCT/GB2014/052508 GB2014052508W WO2015052485A1 WO 2015052485 A1 WO2015052485 A1 WO 2015052485A1 GB 2014052508 W GB2014052508 W GB 2014052508W WO 2015052485 A1 WO2015052485 A1 WO 2015052485A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- speculation
- vector
- speculative
- operations
- data processing
- Prior art date
Links
- 239000013598 vector Substances 0.000 title claims abstract description 461
- 238000012545 processing Methods 0.000 title claims abstract description 150
- 238000000034 method Methods 0.000 title claims abstract description 57
- 230000009467 reduction Effects 0.000 claims abstract description 134
- 238000005265 energy consumption Methods 0.000 claims abstract description 16
- 238000001514 detection method Methods 0.000 claims abstract description 15
- 230000003116 impacting effect Effects 0.000 claims description 8
- 230000004044 response Effects 0.000 claims description 5
- 239000000872 buffer Substances 0.000 claims description 4
- 238000004590 computer program Methods 0.000 claims description 4
- 238000011156 evaluation Methods 0.000 claims description 4
- 238000013519 translation Methods 0.000 claims description 3
- 230000008569 process Effects 0.000 description 41
- 238000010586 diagram Methods 0.000 description 11
- 238000012360 testing method Methods 0.000 description 10
- 238000013459 approach Methods 0.000 description 9
- 230000002411 adverse Effects 0.000 description 7
- 230000006399 behavior Effects 0.000 description 6
- 230000001419 dependent effect Effects 0.000 description 6
- 230000000694 effects Effects 0.000 description 5
- 230000008901 benefit Effects 0.000 description 4
- 238000004458 analytical method Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 238000011946 reduction process Methods 0.000 description 2
- 230000003044 adaptive effect Effects 0.000 description 1
- 238000007792 addition Methods 0.000 description 1
- 230000007423 decrease Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 230000000873 masking effect Effects 0.000 description 1
- 230000000246 remedial effect Effects 0.000 description 1
- 230000003362 replicative effect Effects 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
- 238000009966 trimming Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F15/00—Digital computers in general; Data processing equipment in general
- G06F15/76—Architectures of general purpose stored program computers
- G06F15/78—Architectures of general purpose stored program computers comprising a single central processing unit
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/30007—Arrangements for executing specific machine instructions to perform operations on data operands
- G06F9/30036—Instructions to perform operations on packed data, e.g. vector, tile or matrix operations
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/30007—Arrangements for executing specific machine instructions to perform operations on data operands
- G06F9/30036—Instructions to perform operations on packed data, e.g. vector, tile or matrix operations
- G06F9/30038—Instructions to perform operations on packed data, e.g. vector, tile or matrix operations using a mask
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/3004—Arrangements for executing specific machine instructions to perform operations on memory
- G06F9/30043—LOAD or STORE instructions; Clear instruction
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/3005—Arrangements for executing specific machine instructions to perform operations for flow control
- G06F9/30065—Loop control instructions; iterative instructions, e.g. LOOP, REPEAT
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
- G06F9/3836—Instruction issuing, e.g. dynamic instruction scheduling or out of order instruction execution
- G06F9/3842—Speculative instruction execution
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
- G06F9/3885—Concurrent instruction execution, e.g. pipeline or look ahead using a plurality of independent parallel functional units
- G06F9/3887—Concurrent instruction execution, e.g. pipeline or look ahead using a plurality of independent parallel functional units controlled by a single instruction for multiple data lanes [SIMD]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/38—Concurrent instruction execution, e.g. pipeline or look ahead
- G06F9/3885—Concurrent instruction execution, e.g. pipeline or look ahead using a plurality of independent parallel functional units
- G06F9/3887—Concurrent instruction execution, e.g. pipeline or look ahead using a plurality of independent parallel functional units controlled by a single instruction for multiple data lanes [SIMD]
- G06F9/38873—Iterative single instructions for multiple data lanes [SIMD]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
Definitions
- the present invention relates to a data processing apparatus and method for controlling performance of speculative vector operations.
- One known technique for improving performance of a data processing apparatus is to provide circuitry to support execution of vector operations.
- Vector operations are performed on at least one vector operand, where each vector operand comprises a plurality of vector elements. Performance of the vector operation then involves applying an operation repetitively across the various vector elements within the vector operand(s).
- each vector register within a vector register bank may store a vector operand comprising a plurality of vector elements.
- vector processing circuitry (often referred to as SIMD (Single Instruction Multiple Data) processing circuitry) which can perform the required operation in parallel on the various vector elements within the vector operands.
- SIMD Single Instruction Multiple Data
- scalar processing circuitry can still be used to implement the vector operation, but in this instance the vector operation is implemented by iterative execution of an operation through the scalar processing circuitry, with each iteration operating on different vector elements of the vector operands.
- the above process allows speculative vector processing to be performed, whilst ensuring correct operation by masking out architectural events at the commit point.
- the present invention provides a data processing apparatus comprising: processing circuitry configured to perform a sequence of speculative vector operations on vector operands, each vector operand comprising a plurality of vector elements; speculation control circuitry configured to maintain a speculation width indication indicating the number of vector elements of each vector operand to be subjected to said speculative vector operations, the speculation width indication being initialised to an initial value prior to performance of said sequence of speculative vector operations; said processing circuitry being configured to generate progress indications during performance of said sequence of speculative vector operations; the speculation control circuitry being further configured to detect, with reference to the progress indications and speculation reduction criteria, presence of a speculation reduction condition, the speculation reduction condition being a condition indicating that a reduction in the speculation width indication is expected to improve at least one performance characteristic of the data processing apparatus relative to continued operation without the reduction in the speculation width indication; the speculation control circuitry being further responsive to detection of said speculation reduction condition to reduce the speculation width indication.
- the processing circuitry By configuring the processing circuitry to generate progress indications during performance of the sequence of speculative vector operations, this allows the speculation control circuitry to assess those progress indications against speculation reduction criteria (which may be fixed criteria, or may be criteria stored for access by the speculation control circuitry and reconfigurable) in order to determine situations where the current speculation width appears to be having a significant adverse effect on a chosen performance characteristic of the data processing apparatus (for example throughput or energy consumption). On detection of such a situation, the speculative control circuitry is then configured to reduce the speculation width indication to thereby reduce the number of vector elements of each vector operand to be subjected to the speculative vector operations.
- speculation reduction criteria which may be fixed criteria, or may be criteria stored for access by the speculation control circuitry and reconfigurable
- the progress indications will typically be arranged so as to allow the speculation control circuitry to identify any vector element positions where performance of the speculative vector operations is adversely affecting the performance characteristic.
- each progress indication may specifically identify the vector element position to which the progress indication relates.
- the speculation reduction criteria may identify an expected latency to be associated with such a cache miss event, or may directly identify that occurrence of such an event indicates a speculation reduction condition. Whilst speculative vector processing could still correctly continue to be performed at the currently specified speculation width, this could significantly affect performance due to the latency introduced by the cache miss, and by reducing the speculation width at this point to exclude element position x and higher, this latency can be avoided.
- sequence of vector operations could be repeated if desired, to seek to perform the vector operations in respect of the omitted vector elements, and it may be that due to the time at which that sequence of vector operations is repeated, the same latency issues do not arise (for example by that time the required data element may be present in the cache and a cache miss may hence not arise).
- At least one performance characteristic of the data processing apparatus can be improved whilst performing speculative vector operations, by seeking to avoid situations where performance of the speculative vector operations at a particular speculation width will have an undue adverse impact on that chosen performance characteristic.
- the progress indications can take a variety of forms.
- the progress indications are indicative of throughput impacting events occurring within the processing circuitry during performance of the speculative vector operations.
- the progress indications may be indicative of energy consumption impacting events occurring within the processing circuitry during performance of the speculative vector operations.
- the impacting events indicated by the progress indications are events that are having a negative impact on the performance characteristic, in one embodiment the impacting events may also identify events that are having a positive impact on the performance characteristic, for example particular operations that are being performed more quickly, or consuming less energy, than expected.
- the events that trigger the generation of the progress indications can take a variety of forms.
- at least some of the progress indications are issued in response to micro-architectural events occurring within the processing circuitry during performance of the speculative vector operations.
- a feature, component or behaviour of a processor can be considered to be "micro-architectural" if it only affects the quality of an implementation (e.g. causes a processor to use more or less time or energy to run a program) but not the correctness of an implementation (i.e. whether it correctly implements the instruction set architecture).
- modern processors use branch predictors to accelerate branches, caches to accelerate memory reads, write buffers to accelerate memory writes, translation lookaside buffers to accelerate page table lookups, and pipelines to accelerate execution of sequences of instructions.
- features, components or behaviour of a processor that affect the correctness of an implementation, such features, components or behaviour being considered to be "architectural".
- modern processors use page tables and page fault exceptions to implement virtual memory, interrupts to support context switching, and arithmetic exceptions to handle arithmetic error conditions such as "divide by zero”.
- Architectural features, components or behaviour give rise to architectural events that typically affect program execution, for example by causing additional instructions to be executed.
- micro-architectural features, components or behaviour give rise to micro-architectural events which affect the behaviour of the microarchitecture, but do not have any effect at the architectural level. They may for example cause the program to run a little slower than otherwise, but do not affect program execution.
- the speculation width indication can take a variety of forms.
- the speculation width indication can be specified by a mask or by the contents of one or more registers identifying particular element positions, for example a start element position and/or an end element position.
- the speculation width indication indicates not only the number of vector elements of each vector operand to be subjected to the speculative vector operations, but further identifies a first vector element of each vector operand to be subjected to said speculative vector operations.
- the speculation width indication does identify the number of vector elements of each vector operand to be subjected to said speculative vector operations as being a specified number of sequential vector elements starting from said first vector element.
- the processing circuitry is configured to execute a vector loop of instructions, the vector loop including instructions defining said sequence of vector operations and at least one evaluation instruction executed at a commit point within the vector loop following performance of said sequence of vector operations, execution of said at least one evaluation instruction causing a required vector width to be determined.
- the speculation control circuitry is responsive to determination of the required vector width to determine with reference to a current value of the speculation width indication whether performance of said sequence of vector operations resulted in an over- speculation or an under-speculation, and in the event of said under-speculation to set a repeat flag to cause a further iteration of said vector loop of instructions to be executed.
- the speculation width can be varied as desired during performance of the speculative vector operations, with subsequent iterations of the sequence of speculative vector operations being performed as required to ensure that the vector operations are ultimately performed for all of the required vector elements.
- the speculation control circuitry upon a further iteration of the vector loop of instructions, is configured to initialise the speculation width indication to a modified initial value having regard to the number of vector elements processed during the preceding iteration of the vector loop of instructions.
- the vector loop includes one or more non- speculative instructions to be executed after the commit point, the speculation control circuitry further being configured to set a mask value to identify the number of vector elements of each vector operand to be subjected to the non- speculative operations defined by said one or more non- speculative instructions.
- this mask in the event of under- speculation this mask will be set to identify the value of the speculation width that existed at the commit point, whereas in the event of over- speculation the mask will be set to identify the required vector width as determined at the commit point.
- the data processing apparatus includes a vector register bank configured to store the vector operands for access by the processing circuitry, and the processing circuitry includes data access circuitry configured to perform vector access operations in order to move vector operands between the vector register bank and a memory system including at least one level of cache storage.
- the data access circuitry may be configured to issue as progress indications information relating to cache misses occurring during performance of the vector access operations. Such cache misses can give rise to significant latency, and accordingly can provide useful information when deciding whether to reduce speculation width.
- the data processing apparatus further comprises a translation lookaside buffer (TLB) referenced by the data access circuitry during performance of the vector access operations, the data access circuitry further being configured to issue as progress indications information relating to TLB misses occurring during performance of the vector access operations.
- TLB misses can also give rise to significant latency, since in that event it may be necessary to perform a "page table walk" process in order to retrieve from memory the required page table information for storage within the TLB, and hence indications of TLB misses can also provide useful information when deciding whether to reduce speculation width.
- progress indications relate to the activities of the data access circuitry
- other components of the processing circuitry may also be arranged to provide progress indications to the speculation control circuitry.
- progress indications may also be issued by other components within the system, for example scalar circuitry that is configured to perform scalar operations, since it may be that the speculative vector operations being performed have a performance impact on those other components within the system. For example, if a speculative loop contains a large number of operations (whether vector or scalar), then those operations will have to be repeated if the speculation width is reduced by too much. Tracking the number of scalar and vector operations performed allows this potential repetition cost to influence the decision to reduce speculation width.
- the data processing circuitry is responsive to a reduction in the speculation width indication to alter the number of vector elements of each vector operand subjected to selected vector operations occurring in said sequence starting with the vector operation whose progress indications resulted in detection of the speculation reduction condition that caused the speculation width indication to be reduced.
- the selected vector operations include the vector operation whose progress indication resulted in the speculation width reduction, and all subsequent vector operations in the sequence.
- this approach can be extended to additionally alter the number of vector elements of each vector operand subjected to non-completed vector operations occurring in the sequence before the vector operation whose progress indications resulted in detection of the speculation reduction condition that caused the speculation width indication to be reduced.
- this allows retrospective trimming of the number of vector elements subjected to previously issued vector operations that are still in progress at the time the speculation width indication is reduced. This can hence reduce energy consumption that may otherwise be consumed in completing those previously issued speculative vector operations.
- the data processing apparatus further comprises control circuitry configured to be responsive to reduction in the speculation width indication to reduce power consumption within one or more components of the processing circuitry.
- control circuitry employs at least one of clock gating and power gating to reduce power consumption within said one or more components.
- clock gating a mechanism that is used, certain components within the processing circuitry can have their clock signal removed in order to prevent them consuming power in the performance of speculative vector operations on element positions now outside of the amended speculation width.
- power gating could instead be used to remove the power supply from the relevant components.
- the control circuitry can be configured to continually receive an indication of the current speculation width, or alternatively can be configured merely to receive an indication when the speculation width has changed.
- the initial value for the speculation width indication, and the speculation reduction criteria can be specified.
- at least one of the initial value to which the speculation width indication is initialised, and the speculation reduction criteria is specified by an instruction to be executed by the data processing apparatus.
- the instruction may be one of the instructions executed by the processing circuitry, or indeed may be a particular instruction executed by the speculation control circuitry, for example an instruction to initiate speculation.
- at least one of the initial value to which the speculation width indication is initialised, and the speculation reduction criteria is predetermined.
- the data processing apparatus may further comprise prediction circuitry configured to maintain history data relating to speculation width values used at a commit point for sequences of speculative vector operations previously performed by the processing circuitry.
- the prediction circuitry may then be configured, for a current sequence of speculative vector operations to be performed by the processing circuitry, to determine with reference to the history data the initial value to which the speculation width indication is to be set prior to performance of the current sequence of speculative vector operations.
- the prediction circuitry may maintain history data relating to speculation reduction criteria used for previous sequences of speculative vector operations, and then determine with reference to that history data the speculation reduction criteria to be used for the current sequence of speculative vector operations.
- the sequence of speculative vector operations can be identified in a variety of ways.
- the instruction set may include non- speculative and speculative versions of certain vector instructions, so that particular instructions can be explicitly identified as being speculative.
- the data processing apparatus may be configured to enter and exit a speculative mode of operation, with all instructions encountered within the speculative mode of operation being executed speculatively.
- the speculation control circuitry is responsive to execution of a start speculation instruction to trigger the speculative mode of operation, and the processing circuitry is configured to perform the speculative vector operations in response to instructions executed during said speculative mode of operation.
- the speculation control circuitry is further responsive to execution of a commit instruction to terminate the speculative mode of operation.
- the speculation control circuitry is responsive to the speculation reduction condition to modify the speculation width indication to indicate that at least one vector element of each vector operand is to be subjected to the speculative vector operations.
- the speculation reduction criteria may specify directly one or more criteria that, if met, indicate the presence of the speculation reduction condition
- the speculation reduction criteria may comprise performance tolerance information that is maintained by the speculation control circuitry, with the speculation control circuitry being configured to adjust the performance tolerance information having regard to the progress indications generated during performance of the sequence of speculative vector operations.
- the performance tolerance information can be considered as providing an indication of available slack in how the performance characteristic is impacted during processing of the speculative vector operations, with that slack indication then being adjusted dependent on the progress indications received.
- the progress indications may only indicate events having a negative impact on the chosen performance characteristic, and accordingly the slack indication will only be adjusted in one direction.
- the progress indications may indicate events having both negative impacts and positive impacts, and in such embodiments the slack indication may be adjusted in both directions.
- the performance tolerance information (slack indication) is adjusted, the speculation control circuitry can then be configured to detect the speculation reduction condition if the performance tolerance information reaches a trigger point.
- the speculation control circuitry references the performance tolerance information when determining an amount by which the speculation width indication is to be reduced. This enables the amount of speculation width reduction to be dynamically managed having regards to the extent to which the performance tolerance has been exceeded.
- an amount by which the speculation width indication is to be reduced on detection of the speculation reduction condition may be predetermined. This may be predetermined by identifying a preset number of element positions by which the speculation width is to be reduced, or may be predetermined by identifying a particular rule to be used when determining how to adjust the speculation width.
- the present invention provides a method of controlling performance of speculative vector operations comprising: performing a sequence of speculative vector operations on vector operands, each vector operand comprising a plurality of vector elements; maintaining a speculation width indication indicating the number of vector elements of each vector operand to be subjected to said speculative vector operations, the speculation width indication being initialised to an initial value prior to performance of said sequence of speculative vector operations; generating progress indications during performance of said sequence of speculative vector operations; detecting, with reference to the progress indications and speculation reduction criteria, presence of a speculation reduction condition, the speculation reduction condition being a condition indicating that a reduction in the speculation width indication is expected to improve at least one performance characteristic of the data processing apparatus relative to continued operation without the reduction in the speculation width indication; and on detection of said speculation reduction condition, reducing the speculation width indication.
- the present invention provides a computer program product storing in a non-transitory form a computer program for controlling a computer to provide a virtual machine execution environment for program instructions corresponding to a data processing apparatus in accordance with the first aspect of the present invention.
- the present invention provides a data processing apparatus comprising: processing means for performing a sequence of speculative vector operations on vector operands, each vector operand comprising a plurality of vector elements; speculation control means for maintaining a speculation width indication indicating the number of vector elements of each vector operand to be subjected to said speculative vector operations, the speculation width indication being initialised to an initial value prior to performance of said sequence of speculative vector operations; said processing means for generating progress indications during performance of said sequence of speculative vector operations; the speculation control means for detecting, with reference to the progress indications and speculation reduction criteria, presence of a speculation reduction condition, the speculation reduction condition being a condition indicating that a reduction in the speculation width indication is expected to improve at least one performance characteristic of the data processing apparatus relative to continued operation without the reduction in the speculation width indication; the speculation control means for responding to detection of said speculation reduction condition by reducing the speculation width indication.
- FIG. 1 is a block diagram of a data processing apparatus in accordance with one embodiment
- Figures 2A to 2C schematically illustrate various control registers provided within the speculation control circuitry of Figure 1 in accordance with one embodiment
- Figure 3 schematically illustrates a loop of scalar instructions which can be vectorised using the techniques of the described embodiments;
- Figures 4 and 5 schematically illustrate a sequence of vector instructions used to vectorise the scalar loop of figure 3 in accordance with one embodiment
- Figure 6 is a flow diagram schematically illustrating how the speculation width is reduced in accordance with one embodiment during performance of a sequence of speculative vector operations
- Figure 7 is a flow diagram illustrating the steps performed when starting speculation in accordance with one embodiment
- Figure 8 is a flow diagram illustrating the steps undertaken during a commit process in accordance with one embodiment
- Figure 9 is a flow diagram illustrating the steps performed at a conditional exit stage during performance of a sequence of vector operations in accordance with one embodiment
- Figures 10A and 10B schematically illustrate how operation of pending speculative vector operations may be altered following a reduction in speculation width, in accordance with certain embodiments
- Figures 11A and 11B schematically illustrate how operation of pending speculative vector operations may be altered following a reduction in speculation width, in accordance with further embodiments;
- Figures 12A and 12B schematically illustrate the difference in performance that can be realised when using the techniques of the described embodiments ( Figure 12B) when compared with performance of speculative vector operations without the techniques of the described embodiments ( Figure 12A);
- Figure 13 is a flow diagram illustrating how the speculation width may be adjusted in embodiments where the reduction criteria includes performance tolerance information in the form of a slack indication, in accordance with one embodiment
- Figures 14 A and 14 B schematically illustrate how the slack indication may vary when adopting the approach of Figure 13, in accordance with two embodiments; and Figure 15 schematically illustrates a virtual machine implementation of the data processing apparatus in accordance with one embodiment.
- Figure 1 shows a portion of a data processing apparatus 5 according to an embodiment. It only shows the vector processing portion and there may also be a scalar processing circuitry, a scalar load/store unit and a scalar register bank, such that both vector and scalar instructions can be decoded and executed.
- An instruction queue 10 is provided holding instructions to be executed, these instructions being routed to decode circuitry 20 which is arranged to decode the instructions and send control signals to the appropriate circuits within the apparatus of Figure 1.
- the decode circuitry 20 will issue control signals to the relevant vector processing units 35 within the vector processing circuitry 30, which will then perform the required vector processing operations with reference to one or more vector source operands stored within the vector register bank 40.
- the results of those operations are also stored back to the vector register bank 40 as one or more vector destination operands.
- the vector processing units can take a variety of forms, for example one or more arithmetic logic units (ALUs), a floating point unit (FPU), etc.
- ALUs arithmetic logic units
- FPU floating point unit
- the memory system may include a hierarchical cache structure consisting of a level 1 cache 72, a level 2 cache 74, and potentially further cache levels, located between the vector register bank and main memory 76.
- the load/store unit 50 will load at least one vector operand from the memory system into the vector register bank 40. Similarly, if the vector data access instruction is a vector store instruction, the load/store unit 50 will store at least one vector operand from the vector register bank 40 out to the memory system.
- the processing circuitry 30 can be arranged to perform a sequence of speculative vector operations, with speculation control circuitry 60 being provided to maintain a speculation width indication indicating the number of vector elements of each vector operand to be subjected to the speculative vector operations.
- the speculation control circuitry has a number of control registers 65, in one embodiment the state of those control registers identifying when speculative operations are to be performed, and also identifying a current speculation width, that control information being passed over path 82 to the vector processing circuitry 30.
- the sequence of instructions stored in the instruction queue 10 will include a start speculation instruction, which when decoded by the decode circuitry 20 will cause control signals to be issued to the speculation control circuitry 60 to initiate a speculation mode of operation.
- the speculation control circuitry 60 will be responsive to such control signals to set a speculating flag within the control registers 65 to identify that the speculation mode is now active. This information will then be routed to the vector circuitry 30 via the path 82, and any subsequent operations to be executed by the vector processing circuitry 30 in accordance with the control signals received from the decode circuitry 20 will then be performed in a speculative manner, until such time as the speculation mode of operation exits.
- the speculation mode is exited via a commit instruction which, when decoded by the decode circuitry 20, causes control signals to be sent to the speculation control circuitry 60 causing the control circuitry to clear the speculating flag.
- both speculative and non- speculative versions of at least a subset of the instructions in the instruction set may be provided, so that individual instructions within the sequence can be executed speculatively.
- a speculation width indication is passed over path 82 from the control registers 65 within the speculation control circuitry 60, to identify the number of vector elements of each vector operand to be subjected to those speculative vectors operations.
- the speculation width indication will be initialised to an initial value, which may for example in one embodiment be the entire vector width of an operand. Hence, purely by way of example, if a vector operand contains 16 vector elements, the initial value of the speculation width indication could be set to 16.
- the processing circuitry 30 is arranged to issue progress indications over path 80 to the speculation control circuitry 60.
- the progress indications provide information about the progress of the various operations being executed by the vector processing circuitry. Whilst the progress indications can be issued in a variety of ways, in one embodiment a number of events within the vector processing circuitry cause the progress indications to be output. In one embodiment, these progress indications will be indicative of throughput impacting events and/or energy consumption impacting events. In one embodiment, these events are events of the type that have a negative impact on either throughput or energy consumption. However, in an alternative embodiment, such as will be described later with reference to Figure 13, these events can also include events that have a positive impact on throughput or energy consumption.
- the type of events that give rise to such progress indications can take a variety of forms, but in one embodiment the events are micro-architectural events occurring within the processing circuitry 30 during performance of the speculative vector operations. As discussed earlier, such micro-architectural events only affect the quality of the implementation, for example by causing the processing circuitry to use more or less time or energy when running the program containing the instructions being executed, but the correctness of the implementation is not affected. Hence, the presence of the micro-architectural events themselves does not present any requirement for the operation of the circuitry to be changed.
- the speculation control circuitry uses the progress indications in order to determine situations where a reduction in the speculation width is likely to improve at least one performance characteristic of the data processing apparatus relative to continued operation without such a reduction in the speculation width taking place.
- the speculation control circuitry 60 has access to reduction criteria 70, which may be fixed, or alternatively may be configurable, for example via execution of an instruction within the instruction stream.
- reduction criteria 70 may be specified.
- the speculation reduction criteria may identify expected latency and/or energy consumption to be associated with certain events reported via the progress indications, with the speculation control circuitry 60 keeping a tally of the latency and/or energy consumption related with the events received over time, and detecting a speculation reduction condition when a certain trigger point is reached.
- the reduction criteria 70 may directly identify certain events which, when they arise, indicate the presence of the speculation reduction condition.
- the speculation control circuitry 60 On detecting a speculation reduction condition, through analysis of the progress indications received over path 80 against the reduction criteria 70, the speculation control circuitry 60 is configured to reduce the speculation width, at which point the content of the control registers 65 is updated to identify that reduced speculation width, causing the new speculation width to be forwarded over path 82 to the vector processing circuitry 30. This will cause the vector processing circuitry 30 to reduce the number of vector elements subjected to the ongoing vector processing operations. In particular, at least the vector operations being performed after the operation that produced the progress indication resulting in the speculation width reduction will typically be performed on a reduced number of vector elements. In one embodiment, assuming the operation that gave rise to the progress indication that caused the speculation width reduction to take place is still in progress, then the reduced speculation width can also be applied to that operation.
- the speculation width reduction can also affect any vector operations still in progress at the time the reduction takes place, even if those operations were issued prior to the operation that gave rise to the progress indication that caused the speculation width to be reduced.
- speculation control circuitry can then reduce the speculation width in order to seek to avoid that impact. Any vector elements excluded from the speculative operations as a result of that speculation width reduction can then be made the subject of a subsequent iteration of the speculative vector operations if it is subsequently decided that the required vector element width is greater than the reduced speculation width.
- clock/power gating circuitry 92 may optionally be provided, and arranged to receive via path 90 an indication of the current speculation width. Based on the current speculation width information, the clock/power gating circuitry can alter the clock or power supplied to various components within the vector processing circuitry 30. For example, if as a result of the reduction in speculation width, it is determined that certain components within the processing circuitry do not need to perform any operations for one or more clock cycles, then the clock signal may be removed from those components to reduce the power consumed by those components. If those components are not required for a longer period, then it may be appropriate to place them in a low power mode of operation, by removing or reducing the voltage supply for those components in situations where the apparatus supports dynamic voltage scaling techniques.
- any of the components within the vector processing circuitry may be arranged to produce progress indications over path 80.
- LSU vector load/store unit
- the LSU detects a cache miss within either the level 1 cache 72 or the level 2 cache 74 associated with a particular vector element position when performing a vector load or store operation, it can send a progress indication over path 80 identifying in which cache level the miss has been detected, and the element position for which the cache miss occurs.
- the speculation control circuitry can then use that information, in association with the reduction criteria 70, to determine whether to reduce the speculation width.
- the reduction criteria could for example identify that any level 2 cache miss (which typically incurs a significant latency) should result in the speculation width being reduced to exclude the vector element position giving rise to the level 2 cache miss.
- the reduction criteria 70 may effectively provide different criteria for different element positions. For example, as the element position within the vector increases, this represents a higher degree of speculation, and hence whilst cache misses associated with high element positions may immediately cause the speculation width to be reduced, cache misses associated with lower element positions need not cause the speculation width to be reduced.
- data processing systems use virtual addresses when accessing memory, and a TLB storage 55 is used to convert those virtual addresses into physical addresses for accessing the memory system.
- the TLB storage 55 has a number of entries identifying specific virtual addresses, information used to convert each virtual address into a physical address, and also certain permission attribute information, such as whether that address relates to a cacheable or bufferable area of memory.
- the LSU will hence issue a virtual address to the TLB storage, and if a hit is detected within the TLB storage for that virtual address, the required physical address and permission attribute information can immediately be returned to the LSU.
- the TLB storage will typically need to perform a page table walk process in order to retrieve a page table from the memory system containing the required information to enable the virtual address to be translated into a physical address and to provide the associated permission attributes.
- the TLB storage 55 will access the level 1 cache 72 and lower levels of the memory hierarchy as required in order to retrieve the required page table information. In the event that cache misses occurring during that process, this can again be reported to the speculation control circuitry as progress indications over path 80, and used by the speculation control circuitry in order to determine whether to reduce the speculation width.
- both the initial value to which the speculation width indication is initialised, and the speculation reduction criteria can be predetermined. However, alternatively they can be specified by at least one of the instructions executed by the data processing apparatus.
- the start speculation instruction may identify the initial speculation width to be set within the control registers 65. It may also identify certain speculation reduction criteria to be used by the speculation control circuitry 60 when assessing whether to reduce the speculation width during performance of the speculative vector operations.
- speculation prediction circuitry 85 may be provided which is used to maintain history data relating to speculation width values and/or speculation reduction criteria used for previous sequences of speculative vector operations.
- the history data may identify the final speculation width value present at the commit point during execution of previous sequences of speculative vector operations.
- the prediction circuitry can then be arranged to receive a program counter value associated with an instruction that is initiating speculation, and based thereon to reference the history data in order to determine an initial value to use for the speculation width indication, having regards to any previous sequences of speculative vector operations initiated from that program counter value, and to determine, if required, the speculation reduction criteria to be used.
- the history data will be stored within a history storage 87 accessible to the speculation prediction circuitry 85.
- the speculation control circuitry 60 can also receive progress indications from elsewhere within the system, for example from scalar processing circuitry.
- the control register 65 can take a variety of forms, and Figure 2A illustrates a number of parameters that can be stored within the control registers. Firstly, a speculation width value 100 is maintained, and in one embodiment this can take a value between one and sixteen, indicating that the number of vector elements of each vector operand to be subjected to the speculative vector operations may vary between one and sixteen vector elements (in one embodiment 16 vector elements representing the full width of the vector operands).
- control registers 65 also include a speculating flag 105, which is set to indicate whether speculation is turned on or not. When speculation is off, the vector operations are performed none speculatively. However, when speculation is turned on, the vector operations are performed speculatively.
- Speculation width indication 100 can be specified in a variety of ways.
- the control registers 65 include both a first element position register 110 and a speculation width register 115.
- the first element position register 110 identifies the first vector element position to be subjected to the vector processing operation, whilst the speculation width register 115 then identifies the final vector element position, the speculation width within the vector operand 120 then being indicated by the difference between the contents of these two registers.
- the first element position register points to the first vector element within the vector 120, and the speculation width register 115 may, for example, point to the last vector element, hence specifying the entire vector width.
- the speculation width register contents may be reduced to identify a reduced speculation width. If at the time a commit point is reached, the speculation width has been reduced below the required number of vector elements determined at the commit point, then a subsequent iteration of the vector operations can be performed, and this time the first element position register 110 will be set to identify the first required vector element that has not been processed via the previous iteration of the speculative vector operations. The speculation width register 115 will then be set to identify the required speculation width for the subsequent iteration.
- a mask register 130 may be provided to identify the speculation width indication.
- the mask may contain a bit for each element position within the vector operand 120, with those bits being set to zero or one to identify the speculation width.
- the speculation width will be specified by a series of logic one values contained within the mask, with the contents of that mask being updated during performance of the operations as the speculation width is reduced, by certain of those logic one values being converted into logic zero values to identify the reduced speculation width. It will be appreciated that in alternative embodiments, the meanings ascribed to logic one and logic zero values within the mask may be reversed.
- FIG. 3 schematically illustrates a scalar loop that can be vectorised using the earlier described embodiment.
- This loop of scalar instructions includes a series of instructions, some of which occur prior to a condition test being performed to determine whether to exit the loop, and some of which occur after that condition test.
- the loop goes through three complete iterations 200, 205, 210, and then the condition test is evaluated as indicating that the loop should end at point 220 part way through the fourth iteration 215. It is often the case that the condition test is such that the number of iterations required is not known, and hence whilst in the example the loop terminates part way through the fourth iteration, it might in other instances not terminate until many more iterations have been performed, or indeed may terminate earlier.
- each scalar instruction is replaced by a vector instruction, where the specified vector operand comprises a plurality of vector elements, each vector element relating to a different iteration. Since it is not known which iteration the scalar loop will exit on, the loop cannot be vectorised by specifying vector operands having a specific number of vector elements. Instead, as shown in Figure 4, for the equivalent vector instructions to the scalar instructions that occurred prior to the condition test, a speculation width is used to speculate as to the number of vector elements required.
- this speculation width will initially be set to a selected value such as 16, and accordingly in that example performance of each of these vector instructions will initially be replicating the performance of the equivalent scalar instruction 16 times (i.e. one time across each of 16 separate iterations). If the current speculation width gives rise to progress indications being generated which cause a speculation reduction condition to be detected, then as discussed earlier the speculation width will be reduced, whilst ensuring that at least one vector element from each vector operand continues to be processed.
- condition test When the condition test is subsequently evaluated, it can then be determined how many vector elements are required. For example, it may be evaluated that the equivalent scalar loop would have ended on the third iteration, and hence the required speculation width was three. Assuming the speculation width is still larger than three, then all of the required vector elements will have been processed. However, if the current speculation width is less than the number of iterations indicated by the condition test, then it will be required subsequently to perform at least one further iteration of the sequence of vector operations to process the remaining vector elements that are required.
- Figure 5 illustrates a vector loop for a situation where specific speculate and commit instructions are used. The speculate instruction is used to turn on speculation, and hence set the speculation flag 105.
- a series of instructions are executed speculatively with the speculation width 100 being used to identify the number of vector elements in each vector operand.
- the speculation width may be reduced during performance of the vector operations dependent on detection of the speculation reduction condition.
- one or more instructions will be executed to determine the appropriate width to commit, and thereafter a separate commit instruction will be executed to cause speculation to be turned off.
- a series of non- speculative instructions will be executed, and as discussed earlier a mask or length value can be used in association with those instructions to set the vector element width appropriately having regards to the determination made prior to the commit point.
- a branch instruction can then be used in order to determine whether the loop should be repeated, or the loop should exit.
- Figure 6 is a flow diagram illustrating the speculation width reduction process performed in accordance with one embodiment.
- the speculation control circuitry awaits receipt of a progress indication, and if it is determined at step 300 that a progress indication has not been received, and is determined at step 305 that speculation has not been terminated, for example since the speculation flag is still asserted within the control registers 65, then the process waits at step 300 until a progress indication has been received. If speculation is terminated, the process proceeds from step 305 to 310, where the process ends.
- the speculation control circuitry 60 Upon receipt of a progress indication, the speculation control circuitry 60 analyses the progress indication with reference to the speculation reduction criteria 70, at step 315, and thereafter determines at step 320 whether the speculation reduction condition has been detected. If not, the process returns to step 300. However, if the speculation reduction condition is detected, then at step 325 the speculation control circuitry determines the degree of speculation reduction required. This may be a predetermined amount, causing the speculation control circuitry to reduce the speculation width by that predetermined amount, or instead may be predetermined in terms of a rule to be applied, for example, setting the new speculation width such that the most significant element position is one to the left of the identified element position giving rise to the progress indication, thereby excluding that identified element position from the revised speculation width.
- the degree of speculation reduction may be determined having regards to the speculation reduction criteria itself.
- An example of such an approach will be described later with reference to Figure 13, where the reduction criteria maintains a slack value giving an indication of available slack in how the performance characteristic is impacted during processing of the speculative vector operations, and the amount of speculation width reduction is dynamically managed having regards to the extent to which the slack is exceeded.
- the speculation width is reduced at step 330, whereafter the process returns to step 300.
- this information is passed over path 82 to the vector processing circuitry 30, and causes the number of vector elements processed during performance of any outstanding speculative operations to be reduced.
- Figure 7 is a flow diagram illustrating a process performed when starting speculation. While speculation may be started in a variety of ways, in one embodiment an explicit start speculation instruction is provided, which when decoded by the decode circuitry 20 causes appropriate control signals to be issued to the speculation control circuitry 60.
- the initial speculation width is determined and set by setting the appropriate control register(s) 65. As discussed previously, the initial speculation width may be predetermined, may be identified within the control information forwarded from the decode circuitry, or indeed an initial speculation width may be provided by the speculation prediction circuitry 85.
- a speculation mode is optionally turned on at step 345, dependent on whether the apparatus is using an explicit speculation mode or not.
- Figure 8 is a flow diagram illustrating a commit process performed once the series of speculative operations within the vector loop of Figure 5 have been performed and prior to performance of any non- speculative operations.
- One or more instructions may be executed in order to perform the steps illustrated in Figure 8.
- a condition test is performed to determine the required vector width, i.e. the required number of vector elements to be processed.
- the current speculation width is read, and then at step 360 the current speculation width is compared with the required vector width.
- step 365 it is then determined whether the speculative vector operations have resulted in under speculation. This will be the case if the speculation width has been reduced to a point where it was less than the required vector width at the time the commit point was reached. Otherwise, if the current speculation width is larger than the required vector width, the process will have over speculated.
- step 385 a repeat flag is cleared, indicating that no further iteration of the vector loop is required.
- a mask is set for the non- speculative instructions to identify the required vector width, at step 390. This will enable the vector loop to have vectorised the equivalent scalar loop without requiring another iteration.
- a repeat flag is set to invoke a subsequent iteration of the vector loop.
- a mask is set at step 375 for the non- speculative instructions to identify the current speculation width.
- both the speculative vector operations and non- speculative operations will have processed the same number of vector elements.
- the vector loop can then be repeated one or more times to handle the remaining vector elements within the required vector width.
- speculation mode is turned off at step 380, in embodiments where a specific speculation mode is used. This will ensure that the following instructions within the vector loop are performed non- speculatively.
- Figure 9 illustrates a conditional exit process that is performed typically by a branch instruction, such as that shown in Figure 5, following execution of the series of speculative instructions and non- speculative instructions.
- step 400 it is determined whether the repeat flag is set. If it is, then the process returns to the start speculation point at the beginning of the vector loop at step 405, whereas otherwise the process ends at step 410.
- Figure 10A is a diagram schematically illustrating how the processing of speculative vector operations changes when the speculation width is reduced.
- a speculate instruction is executed to turn on speculation mode and set the speculation width to a specified amount, in this example 16 vector elements.
- the components within the vector processing circuitry are able to process two vector elements from each source operand during a single cycle, and accordingly the component executing the vector operation VOP1 420 will take 8 cycles to complete all of the required operations.
- VOP1 and VOP2 (VOP2 in this example being a vector load), such that the performance of VOP2 begins one cycle after the performance of VOP1 begins.
- the LSU 50 when the LSU 50 is processing the vector load, it detects a micro-architectural event in association with vector element 9 (i.e. the vector element at element position 10) and issues a progress indication identifying the event and the element position, as indicated by the reference numeral 430 in Figure 10A.
- a micro-architectural event may for example be a cache miss occurring when seeking to load vector element 9, and in this example it is assumed that when assessing that progress indication against the reduction criteria 70 the speculation control circuitry 60 decides to reduce the speculation width to a width of nine elements, thereby excluding vector element 9 (which as mentioned earlier is at element position 10).
- the vector operation VOP3 illustrates an example of a vector operation that has begun to be processed prior to the issuance of the progress indication and the associated speculation width reduction, but which is still in progress at the time the speculation width is reduced.
- the component performing VOP3 can be arranged to cull processing of any of the vector elements at element position 10 or higher, in response to the reduction in the speculation width.
- clock gating and/or power gating techniques can be used to reduce the energy consumption of the component performing VOP3, based on the reduced speculation width.
- the vector operation VOP4 is illustrative of a vector operation which is only initiated after the speculation width reduction has been made, and in this example, as shown by the reference numeral 440, it will be known at the outset that (subject to no further speculation width reduction) that vector operation needs to be performed in relation to the first nine vector elements.
- the vector operation VOP4 440 is another vector load operation, and that that vector load cannot begin to be performed until the earlier vector load VOP2 has completed.
- Figure 10B illustrates an alternative embodiment where the adjustment in the speculation width not only affects the future vector operations, but also earlier vector operations.
- this can cause the component performing VOP2 (i.e. the vector operation that gave rise to the speculation reduction) to also terminate processing of one or more subsequent iterations, in this case the two iterations relating to the last four vector elements.
- the process can be used to retrospectively trim the operation of vector operations that have been issued even before VOP2.
- the final iteration of VOP1 is also terminated based on the reduced speculation width.
- clock and power gating techniques can be used to reduce the energy consumption of the components performing these operations.
- Another benefit that can be realised is to increase performance, since components will be available to process other operations more quickly. For example, considering VOP4, the LSU 50 will terminate performance of VOP2 two cycles earlier, and accordingly VOP4 can start two cycles earlier in the example of Figure 10B when compared with the example of Figure 10A.
- Figures 11A and 11B illustrate further examples of how the speculation reduction triggers a modification in the performance of subsequent operations.
- the components performing VOP1 and VOP2 are able to process eight vector elements from each source vector operand in each iteration, and accordingly the originally specified 16 vector elements can be processed in two cycles. If a speculation reduction trigger occurs at point 465 when executing VOP1 460 then this can be used to clock gate (or indeed power gate) certain of the components handling VOP2 (as indicated by the reference numeral 475), in particular for those components processing element positions on or above the element position 465 that gave rise to the speculation reduction.
- Figure 12A illustrates how a micro-architectural event such a level 2 cache miss can introduce significant latency when performing speculative vector operations.
- a speculative instruction is executed at point 500 setting an initial speculation width of 16.
- a vector load instruction 510 is then executed, but in this instance a level 2 cache miss arises when seeking to load vector element 6 (i.e. the data element at vector element position 7).
- This introduces in this example 200 cycles of latency before the vector load operation is able to load vector element 6, and the remaining vector elements.
- This has a knock-on effect on the following two vector operations VOP1 515 and VOP2 520, due to a data dependency between those various vector operations.
- Another cycle is then consumed at point 525, when the commit process is performed, the speculation width still being 16 at this point. As can be seen, this results in a total of 212 cycles to perform the required vector operations, which is an average of 13.25 cycles per vector element.
- Figure 12B in contrast shows the situation when the adaptive speculation width approach of the described embodiments as used. Whilst at step 500, the speculation width is again initially set to 16, when the level 2 cache miss is detected in relation to data element 6 (element position 7) of the vector load operation 530, this causes the speculation control circuitry 60 to dynamically reduce the speculation width to 6 after a short delay (due to the time taken to assess the progress indication against the reduction criteria and determine the reduction to be made). As a result of the reduced speculation width, VOP1 535 and VOP2 540 only process the first six element positions, and accordingly as soon as the first six elements of VOP2 have been performed then the commit process can be performed at point 525, based on the current speculation width of 6. As a result, the process takes seven cycles in order to process six elements, which is an average of 1.167 cycles per vector element.
- the speculation reduction criteria may specify directly the one or more criteria that, if met, indicate the presence of the speculation reduction condition
- the speculation reduction criteria may comprise performance tolerance information that is maintained by the speculation control circuitry, and adjusted having regards to the progress indications generated during performance of the sequence of speculative vector operations.
- Figure 13 is a flow diagram illustrating performance of the speculation reduction process in accordance with one such embodiment, where the performance tolerance information takes the form of a slack indication providing an indication of the available slack in how the performance characteristic is impacted during processing of the speculative vector operations.
- the speculation width is set to an initial value at the start of speculation, and at step 605 the parameter "slack" is set to some specified budget value.
- This value may be provided by the instruction that starts speculation, may be preset, or may be provided in other ways, for example from the speculation prediction circuitry 85 in embodiments incorporating such prediction circuitry.
- step 610 it is determined whether a progress indication has been received, and if not it is then determined at step 615 whether speculation has been terminated. If it has, then the process ends at step 620, but otherwise the process returns to step 610.
- a progress indication When a progress indication is received, it is determined whether that progress indication indicates a negative impact on the performance characteristic or a positive impact.
- the processing circuitry 30 may provide progress indications not only relating to events having a negative impact on the performance characteristic, but also relating to certain events having a positive impact, for example indicating that certain operations have been performed more quickly than expected.
- the slack value is increased at step 630 by an amount indicated by the progress indication, whereafter the process returns to step 610.
- a parameter "cost" is evaluated at step 635, this being indicative of the performance cost associated with that negative indication.
- the slack value is adjusted by subtracting the cost value from the current slack value.
- an internal parameter is set by subtracting from the current speculation width a value determined as a function of the current slack value.
- the function can be set in a variety of ways, but in one example it will cause a larger amount to be deducted from the speculation width the larger negative the slack value is.
- step 665 it is detected whether the parameter SW is less than 1. If it is, then
- SW is set equal to 1 at step 670 before the process proceeds to step 675, whereas otherwise the process proceeds directly to step 675 from step 665.
- the purpose of steps 665, 670 is to ensure that the internal parameter SW is never reduced below 1, in order to ensure that the current iteration of the vector loop will always produce some positive progress.
- the speculation width will be set equal to SW, and accordingly will be set to a value of 1 or greater, prior to the process returning to step 610.
- Step 675 and 680 are optional, and at step 675 an internal parameter "reduction" is determined by subtracting the internal parameter SW from the current speculation width (i.e. the speculation width prior to adjustment at step 685). Thereafter, at step 680 the slack value is increased by the determined "reduction” value. The speculation width is then reduced at step 685.
- the optional steps 675, 680 it will hence be seen that whenever the speculation width is reduced, the slack value is adjusted positively dependent upon the amount that the speculation width is reduced.
- Figures 14A and 14B schematically illustrate how the slack value may vary when performing the process of Figure 13.
- step 630 is performed.
- the slack value initially increases following some positive indications received over path 80.
- a negative indication causes a first drop in the slack value, and then a second negative indication causes the slack value to drop to a negative value at points 688.
- the speculation width is reduced, and the slack value is adjusted positively by the amount of the reduction.
- Continued positive progress indications as indicated by the slopes 689 cause the slack value to increase further, but again after two negative progress indications, the slack value returns negative at point 690. This again causes the speculation width to be reduced, and optionally the slack value to be increased based on the reduction in the speculation width. Positive progress indications then cause the slack value to follow the line 691.
- the amount by which the slack value is adjusted positively on receipt of positive indications is dependent on the speculation width.
- the higher the speculation width the greater the overall effect of the positive indications, and accordingly the slopes 687 have a steeper gradient than the slopes 689, and similarly the slopes 689 have a steeper gradient than the slope 691.
- Figure 14B illustrates an example where no positive progress indications are received, and accordingly the slack value starts at an initial budget value, and then decreases in steps as each negative indication is received. Each time there is a drop in the slack value after the slack value becomes negative, the speculation width is reduced.
- Figure 15 illustrates a virtual machine implementation that may be used.
- At least one performance characteristic of the data processing apparatus (such as throughput or energy consumption) can be improved whilst performing speculative vector operations, by seeking to avoid situations where performance of the speculative vector operations at a particular speculation width will have an undue adverse impact on that chosen performance characteristic.
- the speculation width can be dynamically adjusted in order to seek to avoid doing time consuming or energy hungry work that may not be needed, hence saving time and energy.
- the speculation width is never reduced below one element.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Computer Hardware Design (AREA)
- Advance Control (AREA)
- Complex Calculations (AREA)
- Executing Machine-Instructions (AREA)
Abstract
Description
Claims
Priority Applications (5)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2016519799A JP6546584B2 (en) | 2013-10-09 | 2014-08-14 | Data processing apparatus and method for controlling the execution of speculative vector operations |
KR1020167011068A KR102271992B1 (en) | 2013-10-09 | 2014-08-14 | A data processing apparatus and method for controlling performance of speculative vector operations |
EP14753139.6A EP3039532B1 (en) | 2013-10-09 | 2014-08-14 | A data processing apparatus and method for controlling performance of speculative vector operations |
CN201480054729.5A CN105612494B (en) | 2013-10-09 | 2014-08-14 | For controlling the data processing equipment and method that speculate vector operation efficiency |
IL244408A IL244408B (en) | 2013-10-09 | 2016-03-03 | A data processing apparatus and method for controlling performance of speculative vector operations |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
GB1317876.9 | 2013-10-09 | ||
GB1317876.9A GB2519108A (en) | 2013-10-09 | 2013-10-09 | A data processing apparatus and method for controlling performance of speculative vector operations |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2015052485A1 true WO2015052485A1 (en) | 2015-04-16 |
Family
ID=49630436
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/GB2014/052508 WO2015052485A1 (en) | 2013-10-09 | 2014-08-14 | A data processing apparatus and method for controlling performance of speculative vector operations |
Country Status (9)
Country | Link |
---|---|
US (1) | US10261789B2 (en) |
EP (1) | EP3039532B1 (en) |
JP (1) | JP6546584B2 (en) |
KR (1) | KR102271992B1 (en) |
CN (1) | CN105612494B (en) |
GB (1) | GB2519108A (en) |
IL (1) | IL244408B (en) |
TW (1) | TWI649693B (en) |
WO (1) | WO2015052485A1 (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017185404A1 (en) * | 2016-04-26 | 2017-11-02 | 北京中科寒武纪科技有限公司 | Apparatus and method for performing vector logical operation |
Families Citing this family (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB2539433B8 (en) | 2015-06-16 | 2018-02-21 | Advanced Risc Mach Ltd | Protected exception handling |
GB2539429B (en) | 2015-06-16 | 2017-09-06 | Advanced Risc Mach Ltd | Address translation |
GB2539428B (en) | 2015-06-16 | 2020-09-09 | Advanced Risc Mach Ltd | Data processing apparatus and method with ownership table |
GB2540942B (en) * | 2015-07-31 | 2019-01-23 | Advanced Risc Mach Ltd | Contingent load suppression |
GB2548602B (en) * | 2016-03-23 | 2019-10-23 | Advanced Risc Mach Ltd | Program loop control |
CN107315716B (en) * | 2016-04-26 | 2020-08-07 | 中科寒武纪科技股份有限公司 | Device and method for executing vector outer product operation |
US10108581B1 (en) * | 2017-04-03 | 2018-10-23 | Google Llc | Vector reduction processor |
US11372804B2 (en) * | 2018-05-16 | 2022-06-28 | Qualcomm Incorporated | System and method of loading and replication of sub-vector values |
GB2580426B (en) * | 2019-01-11 | 2021-06-30 | Advanced Risc Mach Ltd | Controlling use of data determined by a resolve-pending speculative operation |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013095608A1 (en) * | 2011-12-23 | 2013-06-27 | Intel Corporation | Apparatus and method for vectorization with speculation support |
Family Cites Families (29)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2765411B2 (en) * | 1992-11-30 | 1998-06-18 | 株式会社日立製作所 | Virtual computer system |
US6915395B1 (en) * | 2000-05-03 | 2005-07-05 | Sun Microsystems, Inc. | Active address content addressable memory |
AU2002338616A1 (en) | 2001-02-06 | 2002-10-28 | Victor Demjanenko | Vector processor architecture and methods performed therein |
CN1142484C (en) * | 2001-11-28 | 2004-03-17 | 中国人民解放军国防科学技术大学 | Vector processing method of microprocessor |
US20040123081A1 (en) * | 2002-12-20 | 2004-06-24 | Allan Knies | Mechanism to increase performance of control speculation |
US20040215941A1 (en) | 2003-04-24 | 2004-10-28 | Sun Microsystems, Inc. | Method and system to handle register window fill and spill |
US7149946B2 (en) | 2003-06-13 | 2006-12-12 | Microsoft Corporation | Systems and methods for enhanced stored data verification utilizing pageable pool memory |
US7149851B1 (en) | 2003-08-21 | 2006-12-12 | Transmeta Corporation | Method and system for conservatively managing store capacity available to a processor issuing stores |
US7500087B2 (en) | 2004-03-09 | 2009-03-03 | Intel Corporation | Synchronization of parallel processes using speculative execution of synchronization instructions |
US7395419B1 (en) | 2004-04-23 | 2008-07-01 | Apple Inc. | Macroscalar processor architecture |
US7961636B1 (en) * | 2004-05-27 | 2011-06-14 | Cisco Technology, Inc. | Vectorized software packet forwarding |
US20060259737A1 (en) * | 2005-05-10 | 2006-11-16 | Telairity Semiconductor, Inc. | Vector processor with special purpose registers and high speed memory access |
US7739456B1 (en) | 2007-03-06 | 2010-06-15 | Oracle America, Inc. | Method and apparatus for supporting very large transactions |
US8078847B2 (en) * | 2007-05-14 | 2011-12-13 | Apple Inc. | Detecting memory-hazard conflicts during vector processing |
US8019977B2 (en) | 2007-05-14 | 2011-09-13 | Apple Inc. | Generating predicate values during vector processing |
US8019976B2 (en) | 2007-05-14 | 2011-09-13 | Apple, Inc. | Memory-hazard detection and avoidance instructions for vector processing |
US8060728B2 (en) | 2007-05-14 | 2011-11-15 | Apple Inc. | Generating stop indicators during vector processing |
US8739141B2 (en) | 2008-05-19 | 2014-05-27 | Oracle America, Inc. | Parallelizing non-countable loops with hardware transactional memory |
US8291202B2 (en) * | 2008-08-08 | 2012-10-16 | Qualcomm Incorporated | Apparatus and methods for speculative interrupt vector prefetching |
US20110264892A1 (en) * | 2008-10-14 | 2011-10-27 | National University Corporation NARA Institute of Science and Technology | Data processing device |
US8572341B2 (en) | 2009-09-15 | 2013-10-29 | International Business Machines Corporation | Overflow handling of speculative store buffers |
JP5491113B2 (en) * | 2009-09-18 | 2014-05-14 | エヌイーシーコンピュータテクノ株式会社 | Vector processing apparatus, vector processing method, and program |
JP5573134B2 (en) * | 2009-12-04 | 2014-08-20 | 日本電気株式会社 | Vector computer and instruction control method for vector computer |
US8887171B2 (en) | 2009-12-28 | 2014-11-11 | Intel Corporation | Mechanisms to avoid inefficient core hopping and provide hardware assisted low-power state selection |
US9552206B2 (en) | 2010-11-18 | 2017-01-24 | Texas Instruments Incorporated | Integrated circuit with control node circuitry and processing circuitry |
TWI636362B (en) | 2011-06-24 | 2018-09-21 | 林正浩 | High-performance cache system and method |
US9268569B2 (en) * | 2012-02-24 | 2016-02-23 | Apple Inc. | Branch misprediction behavior suppression on zero predicate branch mispredict |
US9116686B2 (en) * | 2012-04-02 | 2015-08-25 | Apple Inc. | Selective suppression of branch prediction in vector partitioning loops until dependency vector is available for predicate generating instruction |
US9501276B2 (en) | 2012-12-31 | 2016-11-22 | Intel Corporation | Instructions and logic to vectorize conditional loops |
-
2013
- 2013-10-09 GB GB1317876.9A patent/GB2519108A/en not_active Withdrawn
-
2014
- 2014-08-14 EP EP14753139.6A patent/EP3039532B1/en active Active
- 2014-08-14 WO PCT/GB2014/052508 patent/WO2015052485A1/en active Application Filing
- 2014-08-14 CN CN201480054729.5A patent/CN105612494B/en active Active
- 2014-08-14 KR KR1020167011068A patent/KR102271992B1/en active IP Right Grant
- 2014-08-14 JP JP2016519799A patent/JP6546584B2/en active Active
- 2014-08-18 US US14/461,664 patent/US10261789B2/en active Active
- 2014-09-03 TW TW103130434A patent/TWI649693B/en active
-
2016
- 2016-03-03 IL IL244408A patent/IL244408B/en active IP Right Grant
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013095608A1 (en) * | 2011-12-23 | 2013-06-27 | Intel Corporation | Apparatus and method for vectorization with speculation support |
Non-Patent Citations (1)
Title |
---|
KUMAR RAKESH ET AL: "Dynamic Selective Devectorization for Efficient Power Gating of SIMD Units in a HW/SW Co-Designed Environment", 2013 25TH INTERNATIONAL SYMPOSIUM ON COMPUTER ARCHITECTURE AND HIGH PERFORMANCE COMPUTING, IEEE, 23 October 2013 (2013-10-23), pages 81 - 88, XP032545352, DOI: 10.1109/SBAC-PAD.2013.10 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2017185404A1 (en) * | 2016-04-26 | 2017-11-02 | 北京中科寒武纪科技有限公司 | Apparatus and method for performing vector logical operation |
US11126429B2 (en) | 2016-04-26 | 2021-09-21 | Cambricon Technologies Corporation Limited | Apparatus and methods for bitwise vector operations |
Also Published As
Publication number | Publication date |
---|---|
KR20160065145A (en) | 2016-06-08 |
TWI649693B (en) | 2019-02-01 |
IL244408B (en) | 2020-03-31 |
JP2016536665A (en) | 2016-11-24 |
US20150100755A1 (en) | 2015-04-09 |
CN105612494B (en) | 2019-07-12 |
GB201317876D0 (en) | 2013-11-20 |
EP3039532A1 (en) | 2016-07-06 |
US10261789B2 (en) | 2019-04-16 |
KR102271992B1 (en) | 2021-07-05 |
GB2519108A (en) | 2015-04-15 |
IL244408A0 (en) | 2016-04-21 |
JP6546584B2 (en) | 2019-07-17 |
TW201514850A (en) | 2015-04-16 |
CN105612494A (en) | 2016-05-25 |
EP3039532B1 (en) | 2020-11-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3039532B1 (en) | A data processing apparatus and method for controlling performance of speculative vector operations | |
JP5137948B2 (en) | Storage of local and global branch prediction information | |
JP5172942B2 (en) | Method for reducing power consumption by processor, processor, and information processing system | |
US6665776B2 (en) | Apparatus and method for speculative prefetching after data cache misses | |
US6907520B2 (en) | Threshold-based load address prediction and new thread identification in a multithreaded microprocessor | |
US7471574B2 (en) | Branch target buffer and method of use | |
US20100095151A1 (en) | Processor Apparatus for Executing Instructions with Local Slack Prediction of Instructions and Processing Method Therefor | |
US9483438B2 (en) | Apparatus and method for controlling the number of vector elements written to a data store while performing speculative vector write operations | |
US10073789B2 (en) | Method for load instruction speculation past older store instructions | |
GB2563116B (en) | Apparatus and method for determining a recovery point from which to resume instruction execution following handling of unexpected change in instruction flow | |
US6735687B1 (en) | Multithreaded microprocessor with asymmetrical central processing units | |
US9098295B2 (en) | Predicting a result for an actual instruction when processing vector instructions | |
US8924693B2 (en) | Predicting a result for a predicate-generating instruction when processing vector instructions | |
JP2020119504A (en) | Branch predictor | |
KR102379886B1 (en) | Vector instruction processing | |
Qadri et al. | Energy-efficient data prefetch buffering for low-end embedded processors | |
GB2416412A (en) | Branch target buffer memory array with an associated word line and gating circuit, the circuit storing a word line gating value | |
CN112395000A (en) | Data preloading method and instruction processing device | |
JP5474926B2 (en) | Electric power retirement |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 14753139 Country of ref document: EP Kind code of ref document: A1 |
|
WWE | Wipo information: entry into national phase |
Ref document number: 244408 Country of ref document: IL |
|
REEP | Request for entry into the european phase |
Ref document number: 2014753139 Country of ref document: EP |
|
WWE | Wipo information: entry into national phase |
Ref document number: 2014753139 Country of ref document: EP |
|
ENP | Entry into the national phase |
Ref document number: 2016519799 Country of ref document: JP Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
ENP | Entry into the national phase |
Ref document number: 20167011068 Country of ref document: KR Kind code of ref document: A |