i think i arrived to timing the histc function specifically and its parent function where it was called  through the pytorch profiler.
it doesnt detail all the functions i guess. so, i had to manually further time some functions.
the profiler also showed that min and max tensor take the cake in time. but i think it is because i used them in the evaluation of the condition in if which is blocking cause of gpu-2-cpu transfer.