llvm icon indicating copy to clipboard operation
llvm copied to clipboard

[SYCL] Events caching for in-order queues in the L0 plugin

Open againull opened this issue 3 years ago • 3 comments

For in-order queues we can reuse events even before they are completed and released. Simplified scheme looks like this: submit command1 [] -> pi_event1 (ze_event1) submit command2 [dep pi_event1] -> pi_event2 (ze_event2) submit reset ze_event1 submit command3 [dep pi_event2] -> pi_event3 (ze_event1) So, in this example same native handle ze_event1 is used for command 1 and command3.

There are several levels of caching supported:

  1. Caching disabled.
  2. Only discarded device-scope events are cached and reused for in-order queues.
  3. All device-scope events are cached and reused for in-order queues.

For 3. external ref count is used to track number of external references. Event can be reused only when this number turns to zero.

E2E tests: https://github.com/intel/llvm-test-suite/pull/1263

againull avatar Aug 25 '22 10:08 againull

Fix for SYCL/Plugin/level_zero_device_scope_events.cpp test is here: https://github.com/intel/llvm-test-suite/pull/1179

againull avatar Aug 25 '22 16:08 againull

HIP backend AtomicRef failures are unrelated.

againull avatar Sep 08 '22 06:09 againull

Hi @steffenlarsen, @sergey-semenov, could you please review these changes (as far as I know you contributed to L0 plugin) by any chance because Sergey Maslov is in sick leave.

againull avatar Sep 14 '22 06:09 againull