Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: Define XPU triggering capability #7142

Closed
wants to merge 1 commit into from
Closed

Conversation

shefty
Copy link
Member

@shefty shefty commented Oct 11, 2021

Many HPC and AI applications use GPUs or other accelerator devices
to perform computation work. FI_HMEM support allows a NIC
provider to send and receive data stored on a GPU. However,
the data transfer itself must still be initiated by the host
CPU. This introduces delays from the time the data is ready to
be transfered until the network transfer is initiated. Once
the GPU is done processing the data, it must signal the CPU
that the processing is complete, and then the CPU can request
the network transfer.

This patch introduces a new type of triggered operation, called
an XPU trigger. An XPU trigger works as follows:

  1. An endpoint is created with XPU triggering support. By
    default, all data transfers posted to the endpoint follow
    the XPU triggering model.

  2. The host CPU makes a data transfer call (e.g. fi_write)
    with the FI_TRIGGER flag set. The triggering event is
    FI_TRIGGER_XPU.

  3. A provider responds to the data transfer call by queuing
    the transfer, but will not initiate the transfer until a
    provider specified signal is set. The signal may be signaled
    by a device, such as a GPU or FPGA, referred to as an XPU.

  4. Once an XPU writes the signal, the provider will initiate
    the data transfer.

Details and restrictions are defined as part of the man
page updates.

Signed-off-by: Sean Hefty sean.hefty@intel.com

Many HPC and AI applications use GPUs or other accelerator devices
to perform computation work.  FI_HMEM support allows a NIC
provider to send and receive data stored on a GPU.  However,
the data transfer itself must still be initiated by the host
CPU.  This introduces delays from the time the data is ready to
be transfered until the network transfer is initiated.  Once
the GPU is done processing the data, it must signal the CPU
that the processing is complete, and then the CPU can request
the network transfer.

This patch introduces a new type of triggered operation, called
an XPU trigger.  An XPU trigger works as follows:

1. An endpoint is created with XPU triggering support.  By
default, all data transfers posted to the endpoint follow
the XPU triggering model.

2. The host CPU makes a data transfer call (e.g. fi_write)
with the FI_TRIGGER flag set.  The triggering event is
FI_TRIGGER_XPU.

3. A provider responds to the data transfer call by queuing
the transfer, but will not initiate the transfer until a
provider specified signal is set.  The signal may be signaled
by a device, such as a GPU or FPGA, referred to as an XPU.

4. Once an XPU writes the signal, the provider will initiate
the data transfer.

Details and restrictions are defined as part of the man
page updates.

Signed-off-by: Sean Hefty <sean.hefty@intel.com>
struct fi_trigger_var {
enum fi_datatype datatype;
int count;
void *addr;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to know what type of memory is backing this address? E.g. host memory vs NIC?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do providers have to provide fi_mem_write/fi_mem_read functions? To hide barrier/flush details.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No - the writes may occur from a GPU kernel.

be initiated for some reason, such as an error occurring before the
transfer can start, the triggered operation should
be canceled to release any allocated resources. If multiple variables are
specified, they must be updated in order.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should note that the caller must serialize writing triggers that correspond to different data transfers. All variables belonging to a single trigger must be written together and in order.

structures after returning from the data transfer call.

In order to support multiple provider implementations, users should trigger
data transfer operations in the same order that they are queued and should
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could provide as query output whether triggers may be processed out of order by the provider.

@@ -166,6 +166,7 @@ typedef struct fid *fid_t;
#define FI_COMMIT_COMPLETE (1ULL << 30)
#define FI_MATCH_COMPLETE (1ULL << 31)

#define FI_XPU (1ULL << 45)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be more precise? E.g. FI_XPU_TRIGGER

@shefty shefty closed this Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants