-
Notifications
You must be signed in to change notification settings - Fork 696
Open
Labels
err:performancePerformance issuesPerformance issuesstat:awaiting openxla-engAwaiting response from openxla-engAwaiting response from openxla-eng
Description
xla/xla/backends/cpu/runtime/while_thunk.cc
Lines 92 to 101 in eb9c4f6
| for (int64_t loop_counter = 0; loop_counter < trip_count; ++loop_counter) { | |
| auto body_event = body_executor_.Execute(params); | |
| // If loop iteration has not completed yet, switch to async execution mode | |
| // using `body_event` as a dependency and continue the loop iteration | |
| // starting from `loop_counter + 1`. | |
| if (ABSL_PREDICT_FALSE(!body_event.IsAvailable())) { | |
| return ExecuteAsyncForLoop(params, std::move(body_event), | |
| loop_counter + 1, trip_count); | |
| } |
Sometimes even if the body is fast enough to execute synchronously, it may block for a long time when the number of iterations is large enough.
Possible solutions:
- Use cost_model of body function(If possible) to decide whether to execute asynchronously.
- Use timeout timer to execute asynchronously after exceeding the threshold.
Metadata
Metadata
Assignees
Labels
err:performancePerformance issuesPerformance issuesstat:awaiting openxla-engAwaiting response from openxla-engAwaiting response from openxla-eng