Problem
ElasticPagedTokenToKVPoolAllocator.free() computes page ids from free_index and then converts the result to Python indices for kvcached_allocator.free().
When free_index is a GPU tensor, doing the unique/conversion path directly can couple allocator free bookkeeping to CUDA device execution and synchronization behavior. This is fragile for high-concurrency SGLang serving paths.
Expected behavior
Move the free index tensor to CPU before deriving unique page ids and converting them to Python indices. The allocator backend only needs page id integers for bookkeeping, so the Python conversion should happen from CPU data.
Problem
ElasticPagedTokenToKVPoolAllocator.free()computes page ids fromfree_indexand then converts the result to Python indices forkvcached_allocator.free().When
free_indexis a GPU tensor, doing the unique/conversion path directly can couple allocator free bookkeeping to CUDA device execution and synchronization behavior. This is fragile for high-concurrency SGLang serving paths.Expected behavior
Move the free index tensor to CPU before deriving unique page ids and converting them to Python indices. The allocator backend only needs page id integers for bookkeeping, so the Python conversion should happen from CPU data.