Skip to content

Commit

Permalink
Initialize the run_id in run_options with launch_id in the exec…
Browse files Browse the repository at this point in the history
…ution_options instead of `run_id` for GPUs.\

PiperOrigin-RevId: 531033719
  • Loading branch information
tensorflower-gardener authored and copybara-github committed May 10, 2023
1 parent 6d57120 commit b637e62
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion xla/pjrt/pjrt_stream_executor_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2185,6 +2185,8 @@ static RecvDeviceMemoryFunction ConvertRecvCallbacksToRecvFunction(
// Enqueues a computation onto the compute stream. Each buffer returned in
// device_buffers has a usage hold added that must be dropped on error or
// converted on success.
// When `options` has non-zero `launch_id`, use `launch_id` instead of `run_id`
// to initialize `run_options`.
StatusOr<ScopedShapedBuffer> PjRtStreamExecutorExecutable::EnqueueExecution(
absl::Span<PjRtBuffer* const> argument_handles, int replica, int partition,
int executable_idx, const RunId& run_id, const ExecuteOptions& options,
Expand Down Expand Up @@ -2310,7 +2312,11 @@ StatusOr<ScopedShapedBuffer> PjRtStreamExecutorExecutable::EnqueueExecution(
run_options.set_intra_op_thread_pool(
client_->client()->backend().eigen_intra_op_thread_pool_device());
run_options.set_device_assignment(device_assignment.get());
run_options.set_run_id(run_id);
if (options.launch_id != 0) {
run_options.set_run_id(RunId(options.launch_id));
} else {
run_options.set_run_id(run_id);
}
run_options.set_rng_seed(device_state->GetNewPrngSeed());
run_options.set_gpu_executable_run_options(client_->gpu_run_options());
run_options.set_launch_id(options.launch_id);
Expand Down

0 comments on commit b637e62

Please sign in to comment.