llvm icon indicating copy to clipboard operation
llvm copied to clipboard

[L0v2] add submitted kernel vector compaction

Open pbalcer opened this issue 4 weeks ago • 1 comments

L0v2 avoids internally tracking each kernel submission through an event for lifetime management. Instead, when a kernel is submitted to the queue, its handle is added to a vector, to be removed at the next queue synchronization point, urQueueFinish(). This is a much more efficient way of handling kernel tracking, since it avoids taking and storing an event. However, if the application never synchronizes the queue, this vector of submitted kernels will grow unbounded.

This patch avoids this problem by dynamically compacting the submitted kernel vector at set intervals, deduplicating identical kernel handles. The larger the amount of unique kernels, the larger the vector will be.

pbalcer avatar Dec 09 '25 18:12 pbalcer

Failed Tests (1): SYCL :: Regression/queue_submitted_kernels_oom.cpp

Eh, I tried adding margin to the memory use check to make it works across all adapters, but not sure if it's possible. If I add too much margin to account for other, unrelated, behavior like in L0v1, we won't catch issues in L0v2.

pbalcer avatar Dec 10 '25 06:12 pbalcer