tens.qsize() shows how slow the consumer process is, and we could not mock it by another counter since it is the result of the multiple processes communication.

One workaround probably can be calling an allreduce to sum up the counters on each process, and hence know how many tensors are consumed in total. You can change the frequency of allreduce. Agree that this may not be elegant. Hopefully other people can give better suggestions here.