Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ PJRT runtime libraries, each shipped with the exact C ABI headers it was built
against. Headers are vendored in-tree; the libraries are fetched on demand.

<!-- headers:begin -->
PJRT C ABI headers from [OpenXLA](https://github.com/openxla/xla) at [`91888df6`](https://github.com/openxla/xla/commit/91888df6ce85102c30220e41d952065925e10886) — API version `0.115`.
PJRT C ABI headers from [OpenXLA](https://github.com/openxla/xla) at [`7e262d69`](https://github.com/openxla/xla/commit/7e262d6983bedb0b8040946c3ee98094bef599b1) — API version `0.116`.
<!-- headers:end -->

The repository holds `xla/` (headers), `devices/` (fetched runtimes), `fetch.sh`,
Expand Down
5 changes: 5 additions & 0 deletions xla/pjrt/c/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# PJRT C API changelog

## 0.116

* Added `custom_options` and `num_custom_options` fields to
`PJRT_ExecuteOptions`.

## 0.115

* Deprecated ``PJRT_Triton_Extension``.
Expand Down
12 changes: 9 additions & 3 deletions xla/pjrt/c/pjrt_c_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ PJRT_DEFINE_STRUCT_TRAITS(PJRT_Extension_Base, next);
// Changes include:
// * Adding a new field to the PJRT_Api or argument structs
// * Renaming a method or argument (doesn't affect ABI)
#define PJRT_API_MINOR 115
#define PJRT_API_MINOR 116

// The plugin should set the major_version and minor_version of
// PJRT_Api.pjrt_api_version to be the `PJRT_API_MAJOR` and `PJRT_API_MINOR` in
Expand Down Expand Up @@ -2045,8 +2045,14 @@ struct PJRT_ExecuteOptions {
// replicas and partitions, so this is a flat span. Must outlive execution.
PJRT_HloOutputCallbackInfo* hlo_output_callbacks;
size_t num_hlo_output_callbacks;
};
PJRT_DEFINE_STRUCT_TRAITS(PJRT_ExecuteOptions, num_hlo_output_callbacks);
// Per-execution custom options passed to the runtime (see
// `xla::ExecuteOptions::custom_options`). The list is owned by the caller and
// is only valid for the duration of the C API call. The plugin must copy the
// values if it needs to store them.
const PJRT_NamedValue* custom_options;
size_t num_custom_options;
};
PJRT_DEFINE_STRUCT_TRAITS(PJRT_ExecuteOptions, num_custom_options);

struct PJRT_LoadedExecutable_Execute_Args {
size_t struct_size;
Expand Down
5 changes: 4 additions & 1 deletion xla/pjrt/c/pjrt_c_api_megascale_extension.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,12 @@ typedef PJRT_Error* PJRT_Megascale_CreateMultiSliceConfig(
struct PJRT_Megascale_ClientContext_Initialize_Args {
size_t struct_size;
PJRT_Megascale_ClientContext* client_context;
bool has_incarnation_id;
uint64_t incarnation_id;
};
PJRT_DEFINE_STRUCT_TRAITS(PJRT_Megascale_ClientContext_Initialize_Args,
client_context);
incarnation_id);

typedef PJRT_Error* PJRT_Megascale_ClientContext_Initialize(
PJRT_Megascale_ClientContext_Initialize_Args* args);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,13 @@ extern "C" {
// CrossHostSendBuffers and CrossHostReceiveBuffers. These methods allow PjRt
// clients to implement various optimizations for cross-host transfers.

#define PJRT_API_CROSS_HOST_TRANSFERS_EXTENSION_VERSION 6
#define PJRT_API_CROSS_HOST_TRANSFERS_EXTENSION_VERSION 7
// Version 6 adds descriptor_destructor callback to CopyToRemoteDevice to fix
// memory management across C API boundary.
// Version 7 adds allow_cancel_notifier to
// PJRT_Transfers_PJRT_Client_MakeCrossHostReceiveBuffers_Args. The
// cancellation notifier only takes effect if allow_cancel_notifier is set to
// true.

// ---------------------------------- Methods ----------------------------------

Expand All @@ -51,7 +55,7 @@ struct PJRT_Transfers_PJRT_Client_CrossHostSendBuffers_Args {
size_t num_buffers;
PJRT_Buffer** buffers;
const xla::GlobalDeviceId* dst_global_device_ids; // Has size num_buffers.
const xla::CrossHostTransferKey* transfer_keys; // Has size num_buffers.
const xla::CrossHostTransferKey* transfer_keys; // Has size num_buffers.
PJRT_Event** send_events; // Output; has size num_buffers.
};

Expand All @@ -71,8 +75,8 @@ struct PJRT_Transfers_PJRT_Client_CrossHostReceiveBuffers_Args {
PJRT_Buffer_Type* element_types;
PJRT_Buffer_MemoryLayout** layouts;
PJRT_Device* device;
const xla::GlobalDeviceId* src_global_device_ids; // Has size num_shapes.
const xla::CrossHostTransferKey* transfer_keys; // Has size num_shapes.
const xla::GlobalDeviceId* src_global_device_ids; // Has size num_shapes.
const xla::CrossHostTransferKey* transfer_keys; // Has size num_shapes.
PJRT_Buffer** buffers; // Output; has size num_shapes.
};

Expand Down Expand Up @@ -119,9 +123,14 @@ struct PJRT_Transfers_PJRT_Client_MakeCrossHostReceiveBuffers_Args {
PJRT_Transfers_CrossHostRecvNotifierInfo notifier;
PJRT_Buffer** buffers; // out
size_t num_buffers; // out
// If true, enables and allows the cancellation notifier to take effect.
// The backend owns and manages the lifetime of cancel_notifier_user_arg.
// Added in version 7.
bool allow_cancel_notifier;
};
PJRT_DEFINE_STRUCT_TRAITS(
PJRT_Transfers_PJRT_Client_MakeCrossHostReceiveBuffers_Args, num_buffers);
PJRT_Transfers_PJRT_Client_MakeCrossHostReceiveBuffers_Args,
allow_cancel_notifier);

typedef PJRT_Error* PJRT_Transfers_PJRT_Client_MakeCrossHostReceiveBuffers(
PJRT_Transfers_PJRT_Client_MakeCrossHostReceiveBuffers_Args* args);
Expand Down