Takes a function, traces it into a computational graph, lowers it to StableHLO, and compiles it to a PJRT executable. Returns the compiled executable along with metadata needed for execution.
Arguments
- f
(
function)
Function to compile.- args_flat
(
list)
Flat list of abstract input values.- in_tree
(
Node)
Tree structure of the inputs.- donate
(
character())
Names of the arguments whose buffers should be donated.- device
(
NULL|character(1))
Target device (e.g."cpu","cuda"). IfNULL, inferred fromarg_devicesand traced arrays.- arg_devices
(
list)
Devices of the concrete (non-static) input arguments, extracted before converting to abstract values. Used together with traced devices for device inference whendeviceisNULL.- fallback_device
(
NULL| device)
The device to compile for whendeviceisNULLand nothing in the graph names one. pjrt's dispatcher supplies the device it keyed the entry on, so the program and its cache key agree.NULL(a caller with no dispatcher in front of it) falls back todefault_device().