Variable._execution_engine.queue_callback is aware of finishing backward behavior of each device

In pipeline parallelism, I want to do something after all the backward behavior in certain devices (i.e., model partition). I wonder whether Variable._execution_engine.queue_callback can be used to implement this function. Is it Variable._execution_engine.queue_callback device-aware or not?