Patents
US 12,561,114 B2#155998252 Most CitedActiveUnited States (USPTO)Utility

Parallel processing of a Softmax operation by dividing an input vector into a plurality of fragments

0Forward Citations (#155998252 Global)
0.0/yrCitation Velocity (#155998252 Global)
0.00Citation PageRank (#155998252 Global)
7Prior Art Cited
6Claims (3 Indep. · 3 Dep.)
8Drawings / Sheets

Abstract

A computer comprising a plurality of processing units, each processing unit having an execution unit and access to computer memory which stores code executable by the execution unit and input values of an input vector to be processed by the code, the code, when executed, configured to access the computer memory to obtain multiple pairs of input values of the input vector, determine a maximum or corrected maximum input value of each pair as a maximum result element, determine and store in a computer memory a maximum or corrected maximum result of each pair of maximum result elements as an approximation to the natural log of the sum of the exponents of the input values and access the computer memory to obtain each input value and apply it to the maximum or corrected maximum result to generate each output value of a Softmax output vector.

Interactive Citation Constellation Global Citation Ranking

Interactive SVG Citation Constellation renders in Rust/WebAssembly. Prior art cited: 7 · Forward citations: 0.

Claims (6 — 3 Independent, 3 Dependent)

  1. Claim 1Independent Claim

    A computer-implemented method of executing a neural network by processing an input vector comprising a plurality of input values, the method implemented in a hardware processor comprising a plurality of processing units on a single chip, each processing unit comprising an execution unit and having access to computer memory, wherein each processing unit is associated with and has access to its own computer memory which is not shared by others of the processing units, wherein the computer memory of each processing unit stores code executable by the execution unit of that processing unit, wherein the input vector is divided into a plurality of fragments, wherein there are no dependencies among any of the plurality of fragments, and wherein each processing unit further comprises a respective plurality of registers, the method comprising: storing in each computer memory a respective fragment of the input vector; the execution units operating in parallel wherein each execution unit accesses its own computer memory in a selecting step to obtain input values from its fragment of the input vector; and computing, using the hardware processor, an activation function of the input vector to generate an output vector, the output vector comprising a plurality of output values, wherein the computing the activation function of the input vector to generate the output vector comprises: each execution unit selecting, in the selecting step, from the input values of its fragment a largest value, wherein the largest value is determined by reading successive pairs of input values of its fragment into the respective plurality of registers and recursively determining a maximum value of pairs of values stored in the registers, wherein the largest value is determined to be an approximation of a natural logarithm of a sum of an exponential of each of the input values; sharing the largest value from the input values of each fragment with the other processing units and obtaining a maximum result value based on the largest value of all fragments and storing the maximum result value in the computer memory of each processing unit; the execution units operating in parallel wherein each execution unit accesses its computer memory in a computing step to obtain each input value of its fragment and the maximum result value; and computing each output value for the output vector, wherein computing each output value for the output vector comprises subtracting the maximum result value from each respective input value of the respective fragment to generate a respective output value of the respective fragment based on a natural logarithm of the activation function and combining the respective output values of all the fragments to generate the output vector, wherein the neural network comprises a layer, and wherein the input vector is an input to the layer and the output vector is an output of the layer.

  2. Claim 2Depends on #1

    The computer-implemented method as claimed in claim 1, wherein computing each output value comprises: exponentiating the each respective input value.

  3. Claim 3Depends on #1

    The computer-implemented method as claimed in claim 1, which comprises a compute phase and an exchange phase wherein the execution units operate in parallel in the compute phase and wherein the step of sharing is performed in the exchange phase.

  4. Claim 4Independent Claim

    A computer program embodied on non-transitory computer-readable storage, the program comprising code configured so as when run on a hardware processor comprising a plurality of processing units on a single chip, each processing unit comprising an execution unit and having access to computer memory, wherein each processing unit is associated with and has access to its own computer memory which is not shared by others of the processing units, wherein the computer memory of each processing unit stores the code executable by the execution unit of that processing unit, wherein an input vector is divided into a plurality of fragments, wherein there are no dependencies among any of the plurality of fragments, and wherein each processing unit further comprises a respective plurality of registers, the hardware processor performs a method of executing a neural network by processing the input vector comprising a plurality of input values by performing operations including: storing in each computer memory a respective fragment of the input vector; the execution units operating in parallel wherein each execution unit accesses its own computer memory in a selecting step to obtain input values from its fragment of the input vector; computing an activation function of the input vector to generate an output vector, the output vector comprising one or more output values, wherein the computing the activation function of the input vector to generate the output vector comprises: each execution unit selecting, in the selecting step, from the input values of its fragment a largest value, wherein the largest value is determined by reading successive pairs of input values of its fragment into the respective plurality of registers and recursively determining a maximum value of pairs of values stored in the registers, wherein the largest value is determined to be an approximation of a natural logarithm of a sum of an exponential of each of the input values; sharing the largest value from the input values of each fragment with the other processing units and obtaining a maximum result value based on the largest value of all fragments and storing the maximum result value in the computer memory of each processing unit; the execution units operating in parallel wherein each execution unit accesses its computer memory in a computing step to obtain each input value of its fragment and the maximum result value; and computing each output value for the output vector, the computing comprising subtracting the maximum result value from each respective input value of the respective fragment to generate a respective output value of the respective fragment based on a natural logarithm of the activation function and combining the respective output values of all the fragments to generate the output vector, wherein the neural network comprises a layer, and wherein the input vector is an input to the layer and the output vector is an output of the layer.

  5. Claim 5Independent Claim

    A computer configured to execute a neural network comprising a layer, the computer comprising: a plurality of processing units, each processing unit comprising an execution unit and having access to computer memory, wherein each processing unit is associated with and has access to its own computer memory which is not shared by others of the processing units, wherein the computer memory stores code executable by the execution unit and input values of an input vector to be processed by the code, wherein the input vector is divided into a plurality of fragments, wherein there are no dependencies among any of the plurality of fragments, and wherein each processing unit further comprises a respective plurality of registers, wherein the computer memory of each processing unit stores a set of input values of the input vector constituting a respective fragment of the plurality of fragments, and wherein the code, when executed, is configured to cause the processing units to operate in parallel wherein each processing unit is configured to: process its fragment by accessing its associated computer memory to obtain multiple pairs of the input values of its fragment of the input vector and reading the multiple pairs into the respective plurality of registers; recursively determine a maximum or a corrected maximum input value of each pair stored in the registers as a maximum result element of its fragment; store in the computer memory a maximum or a corrected maximum result of the maximum result element of the multiple pairs as an approximation to a natural log of a sum of exponents of the input values of its fragment, share its maximum or corrected maximum result with other processing units which are configured to process other fragments of the input vector to generate respective other maximum or corrected maximum results, the code configured to cause each processing unit to combine its maximum or corrected maximum result with the respective other maximum or corrected maximum results received from the other processing units to generate a maximum or corrected maximum result of the input vector; and access its computer memory to obtain each input value of its fragment and apply each input value to the maximum or the corrected maximum result of the input vector to generate each output value of an output fragment of a Softmax output vector, wherein the input vector is an input to the layer of the neural network, and wherein the output vector comprises the output fragments and is an output of the layer.

  6. Claim 6Depends on #5

    The computer as claimed in claim 5 wherein the corrected maximum result is determined as max(x,y)+log(1+ e − |x-y|) where x, y are the input values.

Technical Overview & Description

CROSS-REFERENCE TO RELATED APPLICATIONS The present application claims priority to United Kingdom Patent Application No. 2010681.1, filed on Jul. 10, 2020, the disclosure of which is hereby incorporated by reference herein in its entirety. FIELD The present application relates to machine learning computers. The disclosure relates to apparatus and methods for implementing a Softmax activation function, particularly but not exclusively for implementing a Softmax activation function within a machine learning/artificial intelligence computer. BACKGROUND Machine learning computers are being constantly improved. They need to address issues of handling vast quantities of data in the form of large vectors or tensors (arrays of input or output values) and to be able to efficiently carry out computational operations on such data at high speeds. These issues are often addressed by introducing parallelism. Parallelism in computing takes different forms. Program fragments may be organised to execute concurrently (where they overlap in time but may share execution resources) or in parallel where they execute on different resources possibly at the same time. Parallelism in computing can be achieved in a number of ways, such as by means of an array of multiple interconnected processor tiles, or a multi-threaded processing unit, or indeed a multi-tile array in which each tile comprises a multi-threaded processing unit. FIG. 1 a illustrates an example application of parallelism in the form of machine intelligence. As will be familiar to a person skilled in the art of machine intelligence, machine intelligence begins with a learning stage where the machine intelligence algorithm learns a knowledge model. The model may be represented as a graph 60 of interconnected nodes 102 and links 104 . Nodes and links may be referred to as vertices and edges. Each node 102 in the graph has one or more input edges and one or more output edges, wherein some of the input edges of some of the nodes 10

Cited By — Indexed Forward Citations (0 of 0 total)

No indexed citing patents in this generation yet. Ingest USPTO/PatentsView bulk citation tables via patents-ingest to expand the local forward citation graph.

Non-Patent Literature (10)

  • Hennessy, John L., et al. Computer Architecture: A Quantitative Approach, 2003, Elsevier Science
  • &
  • Technology, 3rd Edition, pp. 609-611. Retrieved from ProQuest Ebook Central (2014). (Year: 2014).
  • P. Blanchard, D. J. Higham, and N. J. Higham,
  • ‘
  • Accurate Computation of the Log-Sum-Exp and Softmax Functions
  • ’
  • , arXiv, 2019. ( Year: 2019).
  • P. Blanchard, D. J. Higham, and N. J. Higham, logsumexp-softmax-tests, 2019. Retrieved from https://github.com/higham/logsumexp-softmax-tests. (Year: 2019).
  • N.a., Definition of MATLAB's log(x), 2019, MathWorks. Snapshot from WayBack Machine on Feb. 21, 2019. (Year: 2019).