Instruction for masking randomly selected values in a source vector for neural network processing
AssigneeGraphcore Limited
InventorsStephen Felix, Simon Christian Knowles, Godfrey Da Costa
Life of this patent
Estimating the term…
Abstract
The present invention relates to an execution unit for executing a computer program comprising a sequence of instructions, which include a masking instruction. The execution unit is configured to execute the masking instruction which, when executed by the execution unit, masks randomly selected values from a source operand of n values and retains other original values from the source operand to generate a result which includes original values from the source operand and symbols in place of the selected values.
Claims19
An execution unit for executing a computer program, the execution unit comprising:
- a pseudo random number generator implemented in hardware;
- wherein the execution unit is configured to execute a masking instruction which, when executed by the execution unit, masks randomly selected first values from a source operand of n values and retains other original values from the source operand to generate a result which includes original values from the source operand and symbols in the respective original locations of the selected first values, wherein the masking instruction includes a probability field defining a probability value for masking values of the source operand;
- and
- wherein the pseudo random number generator is configured to output a first randomised bit string from which random bit sequences are derived for randomly selecting the first values to be masked, wherein the first randomised bit string output from the pseudo random number generator comprises m bits, wherein the execution unit is configured to:
- in response to instigation of the masking instruction, obtain the first randomised bit string output by the pseudo random number generator;
- divide the first randomised bit string obtained from the pseudo random number generator into p sequences;
- and
- compare each of the p sequences with the probability value to generate a weighted probability indicator for selecting the first values to be masked.
A method of executing, by an execution unit, a computer program comprising a sequence of instructions, the sequence including a masking instruction, the method comprising:
- responsive to execution of the masking instruction, randomly selecting first values from a source operand of n values and retaining other original values from the source operand to generate a result which includes original values from the source operand and symbols in the respective original locations of the selected first values, wherein the masking instruction includes a probability field defining a probability value for masking values of the source operand, wherein the randomly selecting the first values includes:
- in response to instigation of the masking instruction, obtaining a randomised bit string output comprising m bits from a pseudo random number generator implemented in hardware in the execution unit;
- dividing the randomised bit string obtained from the pseudo random number generator into p sequences and comparing each of the p sequences with the probability value to generate a weighted probability indicator for selecting the first values to be masked.
A computer program comprising a sequence of computer readable instructions stored on non-transitory media, the sequence including a masking instruction which, when executed by an execution unit, causes the execution unit to perform a method comprising:
- randomly selecting first values to mask from a source operand of n values and retaining other original values from the source operand to generate a result which includes original values from the source operand and symbols in the respective original locations of the selected first values, wherein the masking instruction includes a probability field defining a probability value for masking values of the source operand;
- wherein the randomly selecting the first values includes:
- in response to instigation of the masking instruction, obtaining a randomised bit string output comprising m bits from a pseudo random number generator implemented in hardware in the execution unit;
- dividing the randomised bit string obtained from the pseudo random number generator into p sequences;
- and
- comparing each of the p sequences with the probability value to generate a weighted probability indicator for selecting the first values to be masked.
A method of executing, in an execution unit, a computer program comprising a sequence of instructions, the sequence including a masking instruction, the method comprising:
- responsive to execution of the masking instruction, randomly selecting a first value from a source operand of n values and retaining an original value from the source operand to generate a result which includes the original value from the source operand and a symbol in the original location of the first value, wherein the masking instruction includes a probability field defining a probability value for masking values of the source operand;
- and
- wherein randomly selecting the first value includes:
- in response to instigation of the masking instruction, obtaining a randomised bit string output comprising m bits from a pseudo random number generator implemented in hardware in the execution unit;
- dividing the randomised bit string obtained from the pseudo random number generator into p sequences;
- and
- comparing each of the p sequences with the probability value to generate a weighted probability indicator for selecting the first value.
Dependencies are inferred from the claim text.