You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Spec] urUSMFree is non conformant for CUDA, HIP adapters #2782
Note that implementations are required to wait for previously enqueued commands that may be accessing pMem to finish before freeing the memory.
The CUDA and HIP adapters don't do any kind of dependency analysis to make sure that previously enqueued commands are complete before the native free is called. The OpenCL adapter seems to be the only adapter that gives blocking behaviour by using clMemBlockingFreeINTEL.
I suggest the spec is updated to not require urUSMFree to wait on previously enqueued commands to finish, and the OpenCL adapter can therefore use a simple clMemFreeINTEL, or that the CUDA and HIP adapters are updated to do some dependency analysis.
Activity
pbalcer commentedon Jun 16, 2025
CUDA does blocking free for normal (non-async) allocations. @igchor verified that experimentally.
The L0 adapter does as well, it's implemented in the driver.
hdelan commentedon Jun 17, 2025
The wording in the CUDA driver API states:
Is it valid to upgrade may to will when using this to implement the UR specification?
pbalcer commentedon Jun 17, 2025
Good point. In that case we should probably change UR docs to something like:
hdelan commentedon Jun 17, 2025
I'm happy with that change.