US10402196B2 - Multi-dimensional sliding window operation for a vector processor, including dividing a filter into a plurality of patterns for selecting data elements from a plurality of input registers and performing calculations in parallel using groups of the data elements and coefficients - Google Patents
Multi-dimensional sliding window operation for a vector processor, including dividing a filter into a plurality of patterns for selecting data elements from a plurality of input registers and performing calculations in parallel using groups of the data elements and coefficients Download PDFInfo
- Publication number
- US10402196B2 US10402196B2 US14/708,767 US201514708767A US10402196B2 US 10402196 B2 US10402196 B2 US 10402196B2 US 201514708767 A US201514708767 A US 201514708767A US 10402196 B2 US10402196 B2 US 10402196B2
- Authority
- US
- United States
- Prior art keywords
- data elements
- pattern
- input
- coefficients
- patterns
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active, expires
Links
- 239000013598 vector Substances 0.000 title claims abstract description 76
- 238000004364 calculation method Methods 0.000 title claims description 14
- 230000015654 memory Effects 0.000 claims description 45
- 238000000034 method Methods 0.000 claims description 27
- 238000012545 processing Methods 0.000 description 14
- 238000001914 filtration Methods 0.000 description 10
- 238000013461 design Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 238000006073 displacement reaction Methods 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 230000001413 cellular effect Effects 0.000 description 2
- 238000013527 convolutional neural network Methods 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000006403 short-term memory Effects 0.000 description 2
- 238000012546 transfer Methods 0.000 description 2
- 230000009471 action Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 230000015572 biosynthetic process Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 230000003247 decreasing effect Effects 0.000 description 1
- XDDAORKBJWWYJS-UHFFFAOYSA-N glyphosate Chemical compound OC(=O)CNCP(O)(O)=O XDDAORKBJWWYJS-UHFFFAOYSA-N 0.000 description 1
- 230000007787 long-term memory Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000003786 synthesis reaction Methods 0.000 description 1
Images
Classifications
-
- 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/3001—Arithmetic instructions
-
- 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/30018—Bit or string instructions
-
- 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/30032—Movement instructions, e.g. MOVE, SHIFT, ROTATE, SHUFFLE
-
- 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/30098—Register arrangements
- G06F9/3012—Organisation of register space, e.g. banked or distributed register file
- G06F9/3013—Organisation of register space, e.g. banked or distributed register file according to data content, e.g. floating-point registers, address registers
-
- 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/34—Addressing or accessing the instruction operand or the result ; Formation of operand address; Addressing modes
- G06F9/345—Addressing or accessing the instruction operand or the result ; Formation of operand address; Addressing modes of multiple operands or results
Definitions
- the present invention relates generally to the field of vector processor architecture, and more particularly, to a multi-dimensional sliding window instruction implementation for vector processor architecture.
- Sliding window operations are widely used in image processing. Some relevant algorithms that make use of sliding window operations include Harris Corner Detector, two-dimensional (2D) correlation, 2D convolution, Gaussian Filter, Kanade-Lucas-Tomasi (KLT) feature tracker, Nagao Matsuyama filter, algorithms that require the sum of absolute differences and Sobel Filter. For most sliding window operations, processing high resolution images is computationally intensive.
- Vector processors typically include a plurality of vector registers designed to be used as input and/or output registers for a variety of vector type instructions.
- Vector processors typically enable performing operations between corresponding data elements of e.g., two input registers in parallel, thus providing increased efficiency through parallelism.
- vector processors may significantly increase the speed of image processing of high resolution images.
- a logic circuit in a processor may include a plurality of input registers, each for storing an input vector containing data elements; a coefficient register for storing a coefficient vector containing N coefficients; an output register for storing a result vector; and an arithmetic unit configured to: receive a pattern for selecting N data elements from the plurality of input registers; select a plurality of groups of N data elements from the plurality of input registers in parallel, wherein each group is selected in accordance with the pattern, and wherein each group is shifted with respect to a previous selected group; perform an arithmetic operation between each of the selected groups and the coefficients in parallel; and store results of the arithmetic operations in the output register.
- the logic circuit may be configured to receive the pattern, the input vectors and the coefficients from a dedicated instruction.
- a system may include: a program memory; a processor configured to receive from the program memory an instruction to execute a configurable sliding window operation, the instruction may include a coefficient vector containing N coefficients, a plurality of input vectors containing data elements, and a pattern for selecting N data elements from the plurality of input vectors, the processor may include: a plurality of input registers, each for storing an input vector; a coefficient register for storing the coefficient vector; an output register for storing a result vector; and an arithmetic unit configured to execute the instruction by: receiving the pattern; selecting a plurality of groups of N data elements from the plurality of input vectors in parallel, wherein each group is selected in accordance with the pattern, and wherein each group is shifted with respect to a previous selected group; performing an arithmetic operation between each of the selected groups and the coefficients in parallel; and storing results of the arithmetic operations in the output register and/or returning the results of the a
- the arithmetic unit may include a plurality of blocks, wherein each block is adapted to perform the arithmetic operation between one of the selected groups and the coefficients, wherein each block may include: N multipliers configured to multiply each one of the N data elements by a corresponding coefficient; N adders configured to sum results of the multipliers; and an additional adder configured to add a stored result of the arithmetic operation with the sum.
- N may be 4 or larger.
- the arithmetic operation may include multiplication, absolute difference and subtraction.
- a method for performing sliding window operation by a processor which may include: (a) obtaining a pattern for selecting N data elements from a plurality of input vectors stored in a plurality of input registers; (b) selecting a plurality of groups of N data elements from the plurality of input registers in parallel, wherein each group is selected in accordance with the pattern, and wherein each group is shifted with respect to each other; (c) performing an arithmetic operation between each of the selected groups and a plurality of coefficients in parallel; and (d) storing the results of the arithmetic operations in an output register.
- the method may include: dividing a two dimensional filter into a plurality of patterns; and repeating steps a-d for each of the patterns.
- null coefficients of the filter are substantially not included in the patterns.
- the method may include: dividing a multi-dimensional filter into a plurality of patterns; and repeating steps a-d for each of the patterns.
- null coefficients of the filter are substantially not included in the patterns.
- performing the arithmetic operation may include: multiplying each one of the N data elements by a corresponding coefficient; summing results of the multiplication; and adding a stored result of the arithmetic operation to the sum.
- the method may include: receiving a dedicated instruction, the instruction providing the pattern, the input vectors and the coefficients.
- FIG. 1 is a schematic block diagram of a hardware unit in a processing system for performing a sliding window operation according to embodiments of the present invention
- FIG. 2A depicts an exemplary frame helpful in understanding embodiments of the present invention
- FIGS. 2B-2G depict possible patterns implemented in embodiments of the present invention.
- FIGS. 3A-3C depict respective groups for an exemplary bit mask “11100010” according to embodiments of the present invention.
- FIG. 4A depicts an exemplary two-dimensional (2D) 5*5 filter implemented with fixed single-row sliding window operations of four consecutive data elements according to embodiments of the present invention
- FIG. 4B depicts an exemplary 2D 5*5 filter implemented with configurable sliding window operations using a variety of patterns according to embodiments of the present invention
- FIG. 5A depicts an exemplary Sparse filter
- FIG. 5B depicts an implementation of the Sparse filter of FIG. 5A with fixed single-row sliding window operations of four (4) consecutive data elements according to embodiments of the present invention
- FIG. 5C depicts an implementation of the Sparse filter of FIG. 5A with configurable sliding window operations using a plurality of patterns according to embodiments of the present invention
- FIG. 6 is schematic illustration of an exemplary device according to embodiments of the invention.
- FIG. 7 is a flowchart diagram illustrating a method for performing a configurable sliding window operation in a vector processor in accordance with embodiments of the present invention.
- FIG. 8 is a flowchart diagram illustrating a method for performing filter operation using the configurable sliding window operation in accordance with embodiments of the present invention.
- Embodiments of the present invention provide a method for performing a configurable sliding window operation by a logic circuit of a vector processor.
- Embodiments of the present invention may provide enhanced parallelism and efficient hardware utilization.
- Performing a sliding-window operation according to embodiments of the present invention may enable efficient data reuse since the same vectors may be accessed multiple times. This may lead to reduced memory accesses and lower power consumption.
- Kernels that contain overlapping input data elements may utilize the sliding-window operation to increase performance.
- a configurable sliding-window operation may provide flexibility that may enable efficient implementation of any required one-dimensional (1D), 2D or higher dimension filters.
- Exemplary algorithms that may use the configurable sliding window operation include Harris Corner Detector, 2D correlation, 2D convolution, Gaussian Filter, Kanade-Lucas-Tomasi (KLT) feature tracker, Nagao Matsuyama filter, algorithms that require the sum of absolute differences, Sobel Filter, etc.
- vector may refer to a 1D array of data items.
- a sliding window operation may refer to a performing an operation on a selection or a “window” of data elements of a data set and moving, shifting or sliding the window across the data elements of a data set, each time performing the operation on the selected data.
- the movement of the window may be virtual, or a data construct.
- a sliding window operation may include sliding the window across an array of data elements, at a raster scan.
- a cycle of the sliding window operation includes sliding the window and performing the operation substantially across the entire data set.
- a configurable sliding window operation may refer to performing a sliding window operation in which the selection of data elements is not fixed, and may be configured or controlled by a user.
- data elements may be selected according to a pattern, as disclosed herein. According to some embodiments, the pattern may be provided as an input parameter of a dedicated and configurable sliding window instruction.
- Embodiments of the present invention may be utilized for filtering uncompressed image data.
- each data element may have a value uniquely associated with a single pixel in an image or video frame.
- a data element may refer to a single pixel value or pixel component value (for example, a YUV or RGB color model value) in a single image frame.
- Embodiments of the present invention are not limited to image processing and data elements may represent any desired quantity.
- FIG. 1 is a schematic block diagram of a hardware unit in a processing system for performing a sliding window operation according to embodiments of the present invention.
- An exemplary hardware unit 100 may include input registers 110 , a coefficient register 120 , an arithmetic unit 130 and an output register 140 .
- Each one of the blocks in FIG. 1 e.g., input registers 110 , coefficient register 120 , arithmetic unit 130 and output register 140 may be logic circuits and/or memories, interconnected and configured to, e.g., include combinational and sequential logic capable of or designed to, perform the operations described herein.
- the division into functional blocks is made for clarity of explanation.
- Hardware unit 100 may be a part of a processor or a vector processor (for example, processor 610 depicted in FIG. 6 )
- Input registers 110 may receive input data from a memory unit (e.g., an internal memory or external memory shown in FIG. 6 ).
- the input data may be arranged, for example, as up to K input vectors, each including up to L data elements.
- the input vectors may represent pixels of an image or any other data.
- Coefficient register 120 may store coefficient elements as a vector C containing up to N coefficients, C 0 , C 1 . . . C N-1 .
- the coefficient elements may be, for example, coefficients of a filter, of a convolution or of part of a filter or convolution.
- Arithmetic unit 130 may include a plurality of multipliers and adders and/or other hardware and logic circuits designed and configured to perform an arithmetic operation and to produce or output the results of the operation, e.g., a configurable sliding window operation, as will be described herein.
- Output register 140 may receive output results from arithmetic unit 130 , for example as a vector containing up to M results ACC 0 , ACC 1 . . . ACC M-1 . Results of the arithmetic operations may be saved or stored in output register 140 .
- K, L, M and N are integers larger than 1.
- Each data element in input registers 110 , coefficient register 120 and output register 140 may include a data element of any desirable size or format, e.g., a single bit, byte, word, long word, integer, etc., as may be necessary to meet specific design requirements.
- Arithmetic unit 130 may be configured to obtain a mask, also referred to as pattern, for example, pattern 150 for selecting groups of up to N data elements in a specific spatial pattern from input registers 110 .
- Arithmetic unit 130 may be configured to receive or select, in parallel, a plurality of selected groups, each including N data elements from input registers 110 .
- Each group may be selected in accordance with pattern 150 such that each group is shifted with respect to a previous group, for example, by a step of one data element or more, for example, in a raster scan.
- shifted groups may relate to groups in which all corresponding data elements of the two groups are displaced by a constant value with respect to each other.
- Arithmetic unit 130 may be configured or adapted to perform, in parallel, an arithmetic operation between data elements of each of the selected groups and the coefficients from coefficient register 120 and to store results of the arithmetic operations in output register 140 .
- arithmetic unit 130 may be configured to obtain results stored in output register 140 as input for a subsequent calculation. For example, the results of the arithmetic operation may be added to the result values of a previous operation stored in output register 140 .
- Pattern 150 may define a relative location or displacement of the N data elements with respect to a starting point in input registers 110 .
- pattern 150 may be provided to arithmetic unit 130 in the form of a bit mask containing, for example, “1”s in the selected vector element locations to be processed, with relation to a known frame, and “0”s in other locations.
- frame 210 may include a total of eight data elements marked X 0 -X 7 .
- Bits X 0 -X 3 may correspond with four consecutive data elements of a first input vector with indexes that depend on the location of the window, while bits X 4 -X 7 may correspond with four consecutive data elements, with the same indexes, of a second input vector.
- Exemplary patterns 220 , 222 , 224 , 226 , 228 , 230 may each include a number of one or more data elements (between 1 and 8), indicating which data elements are included in the pattern.
- bits X 0 -X 7 in the bit mask may indicate if the corresponding data element is included in the pattern or not. For example, a value of “1” may indicate that the corresponding data element is included in the pattern and a value of “0” may indicate that the corresponding data element is not included in the pattern.
- pattern 220 may be represented by bit mask “10000000”
- pattern 222 may be represented by bit mask “00101110”
- pattern 224 may be represented by bit mask “11100010”
- pattern 226 may be represented by bit mask “11001100”
- pattern 228 may be represented by bit mask “11110000”
- pattern 230 may be represented by bit mask “11100100”.
- Other frames and patterns may be defined, as well as other forms of providing the pattern to arithmetic unit 130 .
- the frame may include other number of data elements, taken from other number of input vectors.
- arithmetic unit 130 may include a plurality of computational units or blocks 132 , for example, up to M blocks 132 .
- Each block may be adapted to or configured to, e.g., include combinational and sequential logic capable of or designed to, perform the arithmetic operation between one of the selected groups and the coefficients from coefficient register 120 .
- the number of blocks 132 may equal the number of results saved in output register 140 .
- Arithmetic unit 130 may be configured to, e.g., include combinational and sequential logic capable of or designed to, receive the pattern for selecting N data elements from the plurality of input registers, select and receive, in parallel, a plurality of groups, each including up to N data elements from input registers 110 , and each is selected in accordance with pattern 150 and shifted with respect to or relative to a previous selected group, for example, shifted by a step of one data element or more.
- arithmetic unit 130 may include sixteen (16) blocks 132 for processing sixteen (16) groups of four (4) data elements.
- arithmetic unit 130 may include thirty two (32) blocks 132 for processing thirty two (32) groups of two (2) data elements.
- Arithmetic unit 130 may include other numbers of blocks for processing other group sizes, as supported by the specific capabilities of arithmetic unit 130 .
- FIGS. 3A-3C depicting three one data element shifted groups for example bit mask “11100010” (corresponding to pattern 224 of FIG. 2D , defined relatively to frame 210 ), according to embodiments of the present invention.
- three one data element shifted groups may be three of the groups selected by arithmetic unit 130 as described herein.
- the data elements selected for the first group, marked 310 in FIG. 3A would be P(0,0), P(0,1), P(0,2) and P(1,2).
- a third one data element shifted group, marked 330 in FIG. 3C would be P(0,2), P(0,3), P(0,4) and P(1,3), and so on in a raster scan. It should be noted that near the edges of input registers 110 , where there are not enough data elements for a pattern, padding may be used as known in the art.
- a total of up to M groups may be selected in parallel.
- Arithmetic unit 130 may perform the arithmetic operation between data elements of each one of the selected groups and the coefficients from coefficient register 120 , and optionally add the result to a result value stored in output register 140 . While the example depicted in FIGS. 3A-3C shows three one data element shifted groups, the selected groups may be shifted by more than one data element, or in other directions.
- Examples for arithmetic operations may include any combination of multiplication, addition, absolute difference and subtraction, or any other mathematical or logical operation or a combination of operations. Examples for arithmetic operations are given below.
- the letters a, b, c, and d represent the relative displacement of each data element P with respect to the starting point of the group.
- Data elements P may be selected from any one of input vectors 110 according to the bit mask, for example pattern 150 .
- each block 132 of arithmetic unit 130 may include N multipliers configured to multiply each one of the N data elements by a corresponding coefficient, N adders configured to sum results of the multipliers, and an additional adder configured to add a stored result of the arithmetic operation with the sum. It should be noted that while it is desirable to use all N multipliers and adders of arithmetic unit 130 , in some cases a group may include less than N data elements. In this case not all multipliers and adders of arithmetic unit 130 may be used.
- embodiments of the present invention were demonstrated with relation to a 2D vector array, this is not limiting. It should be readily understood that embodiments of the present invention may receive three-dimensional (3D) or higher dimensional arrays as input and 3D or higher dimensional patterns, for example, to perform higher dimensional filtering. According to embodiments of the invention, the input vectors and pattern may represent a dataset of any desired dimension.
- bit mask may be eliminated and arithmetic unit 130 may select data elements for the plurality of groups according to a predetermined pattern, for example, N consecutive data elements of a single input vector may be selected.
- a predetermined pattern for example, N consecutive data elements of a single input vector may be selected.
- Arithmetic unit 130 may include sufficient hardware to support parallel processing of M groups (M being the number of output data elements in output register), each group having N data elements (N being the number of coefficients in the coefficient register). If a row of a filter includes N or a multiplication of N coefficients, then in each cycle M groups of N data elements may be selected and processed utilizing all available hardware.
- a row of the filter includes a number of coefficients that is not a multiplication of N, then at some point, M groups of less than N data elements may be selected and processed utilizing only a part of the available hardware. Similar problems may occur in cases were some of the filter coefficients are null (e.g., equal zero), for example in Sparse filters, as will be discussed herein.
- FIG. 4A depicting an exemplary two-dimensional (2D) 5*5 filter implemented with fixed single-row sliding window operations of four consecutive data elements
- FIG. 4B depicting an exemplary 2D 5*5 filter implemented with configurable sliding window operations using a variety of patterns (e.g, patterns 228 , 220 , 222 , 224 and 226 depicted in FIGS. 2F, 2B, 2C, 2D and 2E , respectively), according to embodiments of the present invention.
- Each rectangle represents a cycle of a sliding window operation that may be performed on the entire dataset, as described herein.
- ten (10) cycles of the sliding window operation are required.
- cycles 432 , 434 , 436 , 438 , 440 , 442 , four (4) filter coefficients and four (4) data elements are analyzed. Only in a single cycle, e.g. cycle 430 , a single data element is being analyzed. Thus, in all cycles except cycle 430 all available hardware is being utilized. Thus, the calculation includes only 7 cycles of the sliding window operation and is faster than the option presented in FIG. 4A .
- Hardware utilization efficiency may be calculated as the relation between the theoretical minimal required number of multipliers for implementing a filter, e.g., derived from the size of the filter, and the total number of occupied multipliers (including multipliers that are not utilized) required for performing the filter.
- the increase in utilization efficiency of the configurable sliding window in comparison to fixed single-row sliding window may be calculated as follows. Assume a 2D filter in which:
- the 5 ⁇ 5 filter example presented in FIGS. 4A and 4B received hardware utilization efficiency of about 89% for the configurable sliding window and about 62% utilization for the single-row fixed sliding window.
- the configurable sliding window in this example achieves about 43% performance increase.
- FIG. 5A depicting an exemplary Sparse filter.
- FIG. 5B depicting an implementation of the Sparse filter of FIG. 5A with fixed single-row sliding window operations of four (4) consecutive data elements
- FIG. 5C depicting an implementation of the Sparse filter of FIG. 5A with configurable sliding window operations using a plurality of patterns, according to embodiments of the present invention.
- Sparse filters are defined as filters that contain some coefficients that are null, e.g., equal to zero.
- Convolutional Neural Networks (CNN) algorithms and their derivatives make frequent use of sparse filters. 2D Sparse convolution in different sizes from 5 ⁇ 5 to 15 ⁇ 15 constitutes more than 90% of the cycles for these algorithms.
- CNN Convolutional Neural Networks
- the patterned boxes represent non-zero filter coefficients 510 and empty boxes represent null coefficients 512 of the exemplary Sparse filter.
- the Sparse filter presented in FIG. 5A includes 11 non-zero coefficients 510 , illustrated as patterned boxes and 14 null coefficients, illustrated as empty boxes.
- five (5) sliding window cycles for example, cycles 520 , 522 , 524 , 526 and 528 may be required to perform the filtering. It can be seen that some of the coefficients, however, are null and therefore do not contribute to the calculation, decreasing hardware utilization. In this example, multiplier utilization equals about 55%.
- a device 600 may include a computer device, video or image capture or playback device, cellular device, or any other digital device such as a cellular telephone, personal digital assistant (PDA), video game console, etc.
- Device 600 may include any device capable of executing a series of instructions, for example to process multi-dimensional data, such as, video, image, or audio data.
- Device 600 may include an input device 660 for providing multi-dimensional data and other input, and an output device 670 (for example, a monitor, projector, screen, printer, speakers, or display) for displaying multi-dimensional data such as video, image or audio data on a user interface according to a sequence of instructions executed by processor 610 .
- Processor 610 may include or may be a vector processor, a central processing unit (CPU), a digital signal processor (DSP), a microprocessor, a controller, a chip, a microchip, a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC) or any other integrated circuit (IC), or any other suitable multi-purpose or specific processor or controller.
- CPU central processing unit
- DSP digital signal processor
- FPGA field-programmable gate array
- ASIC application-specific integrated circuit
- IC integrated circuit
- Device 600 may include an external memory unit 620 and an internal memory unit 630 .
- Internal memory unit 630 may be a memory unit directly accessible to or internal to (physically attached or stored within) processor 610 .
- Internal memory unit 630 may be a short-term memory unit
- external memory unit 620 may be a long-term and/or short-term memory unit.
- Internal memory unit 630 and external memory unit 620 may include, for example, random access memory (RAM), dynamic RAM (DRAM), flash memory, cache memory, volatile memory, non-volatile memory or other suitable memory units or storage units.
- Internal memory unit 630 and external memory unit 620 may be implemented as separate (for example, “off-chip”) or integrated (for example, “on-chip”) memory units.
- internal memory unit 630 may include a tightly-coupled memory (TCM), a buffer, or a cache, such as, an L-1 cache or an L-2 cache. Other or additional memory architectures may be used.
- TCM tightly-coupled memory
- buffer such as, an
- Processor 610 may include an execution unit 640 .
- Execution unit 640 may include, for example, one or more arithmetic units 130 .
- Processor 610 may request, retrieve, and process data from external memory unit 620 and/or internal memory unit 630 , and may control, in general, the pipeline flow of operations or instructions executed on the data.
- Processor 610 may receive an instruction, for example, from a program memory (for example, in external memory unit 620 or internal memory 630 ) to filter a multi-dimensional data array.
- the instruction may filter or perform other operation on an image by sliding a window of coefficients of a filter over a multi-dimensional data array representing, for example, pixel values of a region of an image.
- processor 610 may receive an instruction to execute the sliding window operation described herein.
- Processor 610 may include a plurality of individually addressable memory units, referred to as vector registers 650 , for storing the multi-dimensional data.
- Vector registers 650 including, for example, vector registers such as input registers 110 , coefficient register 120 and output register 140 , may be internal to processor 610 and either internal/integrated with internal memory unit 630 or external/separate from internal memory unit 530 .
- Processor 610 may transfer the data elements to a memory relatively more internal or accessible to the processor 610 , for example, from external memory unit 620 to an internal memory unit 630 (such as a TCM), or from internal memory unit 630 to vector registers 650 .
- processor 610 may transfer an array of data elements to a plurality of vector registers 650 , e.g., input registers 110 , wherein each vector register may store a single row or part of a single row of the data array.
- dedicated instructions may be used by a processor to execute the sliding window operation and the configurable sliding window operation described herein.
- the dedicated instructions may provide as inputs the input vectors containing sequential data elements, the coefficients vector and the pattern, for example, as a bit mask.
- the instruction may return the results in the output register.
- Other instructions and input parameters may be used Implementing the configurable sliding window operation described herein as an instruction may provide a new level of flexibility for the user.
- the user may not only define the input vectors for a filtering operation, but also the vector or vectors elements that will be chosen for the sliding window operation.
- the user may use the configurable sliding window operation as a building block for efficiently implementing filters of diverse shapes and sizes.
- processor 610 may be configured to receive, for example, from a program memory (e.g., in external memory unit 620 or internal memory 630 ), an instruction to execute a configurable sliding window operation according to embodiments of the present invention.
- the instruction may include a coefficient vector containing N coefficients, a plurality of input vectors containing data elements, and a pattern for selecting N data elements from the plurality of input vectors.
- Processor 610 may store the input vectors in a plurality of input registers 110 and the coefficient vector in coefficient register 120 .
- Arithmetic unit 130 may configured to execute the instruction by receiving the pattern from the instruction, selecting a plurality of groups of N data elements from the plurality of input registers 110 in parallel and in accordance with the pattern, while each group is shifted with respect to a previous selected group, performing an arithmetic operation between each of the selected groups and the coefficients in parallel, and storing results of the arithmetic operations in output register 140 .
- the instruction may return the results of the arithmetic operations as an output vector.
- FIG. 7 is a flowchart diagram illustrating a method for performing a configurable sliding window operation in a processor, in accordance with embodiments of the present invention.
- the method for performing configurable sliding window operation may be performed by any suitable processor, for example, processor 610 depicted in FIG. 6 .
- the method for performing configurable sliding window operation may be initiated by a dedicated command or instruction.
- a pattern for selecting data elements for example, N data elements
- the pattern may define relative location or displacement of the N data elements with respect to a starting point in the processed input vectors.
- a plurality of groups of data elements may be selected in parallel from the plurality of input registers.
- each group is selected in accordance with the pattern, and each group is shifted with respect to each other, for example, shifted by one data element or more in a raster scan.
- an arithmetic operation may be performed in parallel between each of the selected groups and a plurality of coefficients.
- the arithmetic operation may include multiplication, addition, absolute difference and subtraction, or any other mathematical or logical operation or a combination of operations.
- performing the arithmetic operation may include, for each group: multiplying each one of the data elements of a group by a corresponding coefficient, summing the results of the multiplication and adding a stored result of the arithmetic operation to the sum.
- the results of the arithmetic operations may be stored in an output register.
- FIG. 8 is a flowchart diagram illustrating a method for performing filter operation using the configurable sliding window operation in accordance with embodiments of the present invention.
- the method for performing filter operation using the configurable sliding window operation may be performed by any suitable processor, for example, processor 610 depicted in FIG. 6 .
- the method for performing filter operation using the configurable sliding window operation may be implemented as a series of commands, each for performing a configurable sliding window operation as described herein.
- a multi-dimensional filter may be divided into a plurality of patterns.
- the multi-dimensional filter may be a two-dimensional (2D) filter.
- null coefficients of the filter may substantially not be included in the patterns.
- the configurable sliding window operation may be performed for each of the patterns.
- Embodiments of the invention may be implemented on an integrated circuit (IC), for example, by constructing arithmetic unit 130 , input registers 110 , coefficient register 120 and output register 140 , as well as other components of FIGS. 1 and 6 in an integrated chip or as a part of an chip, such as application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), a central processing unit (CPU), a digital signal processor (DSP), a microprocessor, a controller, a chip, a microchip, etc.
- ASIC application-specific integrated circuit
- FPGA field-programmable gate array
- CPU central processing unit
- DSP digital signal processor
- microprocessor a controller, a chip, a microchip, etc.
- some units e.g., arithmetic unit 130 , input registers 110 , coefficient register 120 and output register 140 , as well as the other components of FIG. 1 , may be implemented in a hardware description language (HDL) design, written in VHSIC hardware description language (VHDL), VERILOG®, or any other hardware description language.
- the HDL design may be synthesized using any synthesis engine such as SYNOPSYS® Design Compiler 2000.05 (DC00), BUILDGATES® available from, inter alia, Cadence Design Systems, Inc.
- An ASIC or other integrated circuit may be fabricated using the HDL design.
- the HDL design may be synthesized into a logic level representation, and then reduced to a physical device using compilation, layout and fabrication techniques, as known in the art.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- Computational Mathematics (AREA)
- Mathematical Physics (AREA)
- Complex Calculations (AREA)
- Image Processing (AREA)
Abstract
Description
ACC i +=C 0 *P i(a) +C 1 *P i(b) +C 2 *P i(c) + . . . +C N-1 *P i(d) (equation 1)
where i is an index of the group number i=0, 1, . . . , M-1, which may indicate both the starting point of each group within
ACC i +=C 0 *P (0,i+0) +C 1 *P (0,i+2) +C 3 *P (1,i+2) (equation 2)
ACC i +=C 0 *P (i+0) +C 1 *P (i+1) +C 2 *P (i+2) + . . . +C N-1 *P (i+N−1) (equation 3)
For example, for N=4
ACC i +=C 0 *P (i+0) +C 1 *P (i+1) +C 2 *P (i+2) +C 3 *P (i+3) (equation 4)
-
- Filter width (number of elements in a row): W
- Filter height (number of rows): H
- Processed elements per instruction: N (e.g., each
block 132 ofarithmetic unit 130 may include N multipliers).
The utilization efficiency of the configurable sliding window may equal:
Where, ┌ ┐ represents the roundup operation. The utilization efficiency of a fixed single-row sliding window may equal:
Claims (17)
Priority Applications (3)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US14/708,767 US10402196B2 (en) | 2015-05-11 | 2015-05-11 | Multi-dimensional sliding window operation for a vector processor, including dividing a filter into a plurality of patterns for selecting data elements from a plurality of input registers and performing calculations in parallel using groups of the data elements and coefficients |
CA2929403A CA2929403C (en) | 2015-05-11 | 2016-05-06 | Multi-dimensional sliding window operation for a vector processor |
EP16168805.6A EP3093757B1 (en) | 2015-05-11 | 2016-05-09 | Multi-dimensional sliding window operation for a vector processor |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US14/708,767 US10402196B2 (en) | 2015-05-11 | 2015-05-11 | Multi-dimensional sliding window operation for a vector processor, including dividing a filter into a plurality of patterns for selecting data elements from a plurality of input registers and performing calculations in parallel using groups of the data elements and coefficients |
Publications (2)
Publication Number | Publication Date |
---|---|
US20160335082A1 US20160335082A1 (en) | 2016-11-17 |
US10402196B2 true US10402196B2 (en) | 2019-09-03 |
Family
ID=55967097
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US14/708,767 Active 2035-11-20 US10402196B2 (en) | 2015-05-11 | 2015-05-11 | Multi-dimensional sliding window operation for a vector processor, including dividing a filter into a plurality of patterns for selecting data elements from a plurality of input registers and performing calculations in parallel using groups of the data elements and coefficients |
Country Status (3)
Country | Link |
---|---|
US (1) | US10402196B2 (en) |
EP (1) | EP3093757B1 (en) |
CA (1) | CA2929403C (en) |
Families Citing this family (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10331445B2 (en) * | 2017-05-24 | 2019-06-25 | Microsoft Technology Licensing, Llc | Multifunction vector processor circuits |
US11803377B2 (en) * | 2017-09-08 | 2023-10-31 | Oracle International Corporation | Efficient direct convolution using SIMD instructions |
JP2019074967A (en) * | 2017-10-17 | 2019-05-16 | キヤノン株式会社 | Filter processor and method for controlling the same |
US11403727B2 (en) | 2020-01-28 | 2022-08-02 | Nxp Usa, Inc. | System and method for convolving an image |
US11500680B2 (en) * | 2020-04-24 | 2022-11-15 | Alibaba Group Holding Limited | Systolic array-friendly data placement and control based on masked write |
US11586442B2 (en) | 2020-08-06 | 2023-02-21 | Nxp Usa, Inc. | System and method for convolving image with sparse kernels |
CN116778532B (en) * | 2023-08-24 | 2023-11-07 | 汶上义桥煤矿有限责任公司 | Underground coal mine personnel target tracking method |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5696954A (en) | 1993-11-30 | 1997-12-09 | Texas Instruments Incorporated | Three input arithmetic logic unit with shifting means at one input forming a sum/difference of two inputs logically anded with a third input logically ored with the sum/difference logically anded with an inverse of the third input |
US20020135586A1 (en) * | 2001-01-18 | 2002-09-26 | Lightsurf Technologies, Inc. | Programmable sliding window for image processing |
US20060034368A1 (en) * | 2002-01-07 | 2006-02-16 | Jason Klivington | Generation and use of masks in MPEG video encoding to indicate non-zero entries in transformed macroblocks |
US7694078B2 (en) | 2004-04-22 | 2010-04-06 | Silicon Hive B.V. | Data processing apparatus that provides parallel access to multi-dimensional array of data values |
US20110072236A1 (en) * | 2009-09-20 | 2011-03-24 | Mimar Tibet | Method for efficient and parallel color space conversion in a programmable processor |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
EP3537289B1 (en) * | 2008-03-10 | 2021-04-21 | Mobileye Vision Technologies Ltd. | Enhanced look-up table signal processing |
-
2015
- 2015-05-11 US US14/708,767 patent/US10402196B2/en active Active
-
2016
- 2016-05-06 CA CA2929403A patent/CA2929403C/en active Active
- 2016-05-09 EP EP16168805.6A patent/EP3093757B1/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5696954A (en) | 1993-11-30 | 1997-12-09 | Texas Instruments Incorporated | Three input arithmetic logic unit with shifting means at one input forming a sum/difference of two inputs logically anded with a third input logically ored with the sum/difference logically anded with an inverse of the third input |
US20020135586A1 (en) * | 2001-01-18 | 2002-09-26 | Lightsurf Technologies, Inc. | Programmable sliding window for image processing |
US20060034368A1 (en) * | 2002-01-07 | 2006-02-16 | Jason Klivington | Generation and use of masks in MPEG video encoding to indicate non-zero entries in transformed macroblocks |
US7694078B2 (en) | 2004-04-22 | 2010-04-06 | Silicon Hive B.V. | Data processing apparatus that provides parallel access to multi-dimensional array of data values |
US20110072236A1 (en) * | 2009-09-20 | 2011-03-24 | Mimar Tibet | Method for efficient and parallel color space conversion in a programmable processor |
Non-Patent Citations (3)
Title |
---|
European Search Report of European Application No. EP 16 16 8805 dated Oct. 31, 2016. |
Moore et al., "Adaptable Two-Dimension Sliding Windows on NVIDIA GPUs with Runtime Compilation", IEEE, Symposium on Application Accelerators in High-Performance Computing (SAAHPC), pp. 103-112, Jul. 19-21, 2011. |
Office Action of Application No. EP16168805.6 dated Oct. 25, 2018. |
Also Published As
Publication number | Publication date |
---|---|
EP3093757B1 (en) | 2019-07-24 |
EP3093757A2 (en) | 2016-11-16 |
EP3093757A3 (en) | 2016-11-30 |
CA2929403A1 (en) | 2016-11-11 |
US20160335082A1 (en) | 2016-11-17 |
CA2929403C (en) | 2020-09-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10402196B2 (en) | Multi-dimensional sliding window operation for a vector processor, including dividing a filter into a plurality of patterns for selecting data elements from a plurality of input registers and performing calculations in parallel using groups of the data elements and coefficients | |
US11886536B2 (en) | Methods and systems for implementing a convolution transpose layer of a neural network | |
US11003985B2 (en) | Convolutional neural network system and operation method thereof | |
US11100386B2 (en) | Buffer addressing for a convolutional neural network | |
TWI767190B (en) | Block operations for an image processor having a two-dimensional execution lane array and a two-dimensional shift register | |
US20180046906A1 (en) | Sparse convolutional neural network accelerator | |
JP2019109895A (en) | Method and electronic device for performing convolution calculations in neutral network | |
CN108629406B (en) | Arithmetic device for convolutional neural network | |
US11170469B2 (en) | Image transformation for machine learning | |
US11164032B2 (en) | Method of performing data processing operation | |
EP3217289A2 (en) | System and method for preventing cache contention | |
Huang et al. | A novel interpolation chip for real-time multimedia applications | |
US20210089610A1 (en) | Memory device and method | |
KR20200095300A (en) | Method and apparatus for processing convolution operation of neural network | |
WO2022160704A1 (en) | Image processing method and apparatus, computer device and storage medium | |
CN109416743B (en) | Three-dimensional convolution device for identifying human actions | |
US11915338B2 (en) | Loading apparatus and method for convolution with stride or dilation of 2 | |
CN116090518A (en) | Feature map processing method and device based on systolic operation array and storage medium | |
US10789072B2 (en) | Parallel processor for calculating operand and result addresses as a function of a position of a field of action and predetermined positions of processing elements in non-homogeneous address zones within a topology | |
US20210272232A1 (en) | Filter Independent L1 Mapping Of Convolution Data Into General Purpose Register | |
US20240160692A1 (en) | Implementing a scatter function on a neural network accelerator | |
US9569218B2 (en) | Decomposing operations in more than one dimension into one dimensional point operations | |
JP2024004400A (en) | Data processor and method thereof | |
Gil et al. | Accelerating a modified Gaussian pyramid with a customized processor |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
AS | Assignment |
Owner name: CEVA D.S.P. LTD., ISRAEL Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:SADEH, RONI M.;DVORETZKI, NOAM;REEL/FRAME:037018/0381 Effective date: 20151104 |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: DOCKETED NEW CASE - READY FOR EXAMINATION |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: ALLOWED -- NOTICE OF ALLOWANCE NOT YET MAILED |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: AWAITING TC RESP, ISSUE FEE PAYMENT VERIFIED |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: PUBLICATIONS -- ISSUE FEE PAYMENT VERIFIED |
|
STCF | Information on status: patent grant |
Free format text: PATENTED CASE |
|
MAFP | Maintenance fee payment |
Free format text: PAYMENT OF MAINTENANCE FEE, 4TH YEAR, LARGE ENTITY (ORIGINAL EVENT CODE: M1551); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY Year of fee payment: 4 |