Skip to content

Commit

Permalink
core: Introduce new atomic datatypes and operation
Browse files Browse the repository at this point in the history
Add 16-bit and 8-bit floating point datatypes that are often used for
machine learning and AI applications.

Add atomic diff operation.

Signed-off-by: Jianxin Xiong <[email protected]>
  • Loading branch information
j-xiong committed Aug 3, 2024
1 parent 431bec3 commit d3a71f8
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/rdma/fi_domain.h
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ enum fi_datatype {
FI_LONG_DOUBLE_COMPLEX,
FI_INT128,
FI_UINT128,
FI_FLOAT16,
FI_BFLOAT16,
FI_FLOAT8_E4M3,
FI_FLOAT8_E5M2,

/* Collective datatypes */
FI_VOID = FI_COLLECTIVE_OFFSET,
Expand All @@ -251,6 +255,7 @@ enum fi_op {
FI_CSWAP_GE,
FI_CSWAP_GT,
FI_MSWAP,
FI_DIFF,

/* Collective datatypes */
FI_NOOP = FI_COLLECTIVE_OFFSET,
Expand Down
19 changes: 19 additions & 0 deletions man/fi_atomic.3.md
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,18 @@ provider implementation constraints.
a complex number and the second representing the imaginary
portion.
*FI_FLOAT16*
: 16-bit half precision floating point value (IEEE 754-2008).
*FI_BFLOAT16*
: 16-bit brain floating point value (IEEE 754-2008).
*FI_FLOAT8_E4M3*
: 8-bit floating point value with 4-bit exponent and 3-bit mantissa.
*FI_FLOAT8_E5M2*
: 8-bit floating point value with 5-bit exponent and 2-bit mantissa.
## Atomic Operations
The following atomic operations are defined. An atomic operation
Expand Down Expand Up @@ -377,6 +389,13 @@ if (compare[i] > addr[i])
addr[i] = (buf[i] & compare[i]) | (addr[i] & ~compare[i])
```

*FI_DIFF*
: Calculate the difference

```c
addr[i] = addr[i] - buf[i]
```

## Base Atomic Functions

The base atomic functions -- fi_atomic, fi_atomicv,
Expand Down

0 comments on commit d3a71f8

Please sign in to comment.