# US 2017/0192752 A1 · Partial stochastic rounding that includes sticky and guard bits

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2017/0192752 A1
- Document ID: US20170192752A1
- Status: Published application
- Kind: A1
- Application number: 14/987,034
- Filed: 2016-01-04
- Published: 2017-07-06
- Earliest claimed: 2016-01-04
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Jonathan D. Bradbury; Steven R. Carlough; Brian R. Prasky; Eric M. Schwarz
- Web page: https://patentgrep.com/patent/US20170192752A1

## CPC

- G06F 7/588: {Random number generators, i.e. based on natural stochastic processes}
- G06F 7/499: Denomination or exception handling, e.g. rounding or overflow
- G06F 7/49947: {Rounding}
- G06F 7/49952: {Sticky bit}
- G06N 20/00: Machine learning
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- G06N: COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS

## Abstract

The disclosed herein related to a method for generating a partial stochastic rounding operation executed by a processor coupled to a memory. The method includes generating an intermediate result and causing a random number generator to generate a random number. The method also includes adding the random number to lower significant bits of the intermediate result to perturb any incrementing of most significant bits of the intermediate result to produce a resulting sum. The method also includes truncating the resulting sum into a final result. According to other embodiments, the above method can be implemented in a system or computer program product.

## Claims

### Claim 1

A method for generating a partial stochastic rounding operation executed by a processor coupled to a memory, comprising:
generating an intermediate result;
causing a random number generator to generate a random number;
adding the random number to lower significant bits of the intermediate result to perturb any incrementing of most significant bits of the intermediate result to produce a resulting sum; and
truncating the resulting sum into a final result.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
executing an instruction that causes at least two operands to generate the intermediate result; and
incrementing a state of a random number generator to correspond to the random number.

### Claim 3 (depends on 1)

The method of claim 1, wherein the intermediate result comprises guard bits followed by a sticky bit of all the remaining bits.

### Claim 4 (depends on 3)

The method of claim 3, wherein the sticky bit indicates whether a logical OR of all the remaining reduced bits is not equal to zero to indicate significance.

### Claim 5 (depends on 3)

The method of claim 3, wherein the intermediate result with the guard bits and the sticky bit are added to the random number and the final result is truncated.

### Claim 6 (depends on 1)

The method of claim 1, wherein the random number is an M bit random number, where M<N and N is a number of bits of one of the at least two operands that generate the intermediate result.

### Claim 7 (depends on 1)

The method of claim 1, wherein the generating of the intermediate result comprises multiplying a multiplicand by a multiplier, the product of which is the intermediate result.

### Claim 8 (depends on 1)

The method of claim 1, wherein the producing of the final result includes reducing the intermediate result by propagating upper bits of the bits of the intermediate result into the final result.

### Claim 9

A computer program product, the computer program product comprising a computer readable storage medium having program instructions for generating a partial stochastic rounding operation embodied therewith, the program instructions executable by a processor to cause the processor to perform:
generating an intermediate result;
causing a random number generator to generate a random number;
adding the random number to lower significant bits of the intermediate result to perturb any incrementing of most significant bits of the intermediate result to produce a resulting sum; and
truncating the resulting sum into a final result.

### Claim 10 (depends on 9)

The computer program product of claim 9, wherein the program instructions are further executable by the processor to cause:
executing an instruction that causes at least two operands to generate the intermediate result; and
incrementing a state of a random number generator to correspond to the random number.

### Claim 11 (depends on 9)

The computer program product of claim 9, wherein the intermediate result comprises guard bits followed by a sticky bit of all the remaining bits.

### Claim 12 (depends on 11)

The computer program product of claim 11, wherein the sticky bit indicates whether a logical OR of all the remaining reduced bits is not equal to zero to indicate significance.

### Claim 13 (depends on 11)

The computer program product of claim 11, wherein the intermediate result with the guard bits and the sticky bit are added to the random number and the final result is truncated.

### Claim 14 (depends on 9)

The computer program product of claim 9, wherein the random number is an M bit random number, where M<N and N is a number of bits of one of the at least two operands that generate the intermediate result.

### Claim 15 (depends on 9)

The computer program product of claim 9, wherein the generating of the intermediate result comprises multiplying a multiplicand by a multiplier, the product of which is the intermediate result.

### Claim 16 (depends on 9)

The computer program product of claim 9, wherein the producing of the final result includes reducing the intermediate result by propagating upper bits of the bits of the intermediate result into the final result.

### Claim 17

A system, comprising a processor and a memory storing program instructions for generating a partial stochastic rounding operation thereon, the program instructions executable by a processor to cause the system to perform:
generating an intermediate result;
causing a random number generator to generate a random number;
adding the random number to lower significant bits of the intermediate result to perturb any incrementing of most significant bits of the intermediate result to produce a resulting sum; and
truncating the resulting sum into a final result.

### Claim 18 (depends on 17)

The system of claim 17, wherein the program instructions are further executable by the processor to cause the system to perform:
executing an instruction that causes at least two operands to generate the intermediate result; and
incrementing a state of a random number generator to correspond to the random number.

### Claim 19 (depends on 17)

The system of claim 17, wherein the intermediate result comprises guard bits followed by a sticky bit of all the remaining bits.

### Claim 20 (depends on 19)

The system of claim 19, wherein the sticky bit indicates whether a logical OR of all the remaining reduced bits is not equal to zero to indicate significance.
