LSQuantization icon indicating copy to clipboard operation
LSQuantization copied to clipboard

Heavy cpu usage for the backward pass in method 1 (FunLSQ)

Open haolibai opened this issue 4 years ago • 1 comments

In my case, the following code seems to consume heavy cpu usage during the backward pass in FunLSQ. (>1000% cpu usage).

indicate_middle = torch.ones(indicate_small.shape).to(indicate_small.device) - indicate_small - indicate_big

When I turn it to

indicate_middle = 1.0 - indicate_small - indicate_big

, the problem gets solved.

I wonder whether this is also a case for other models in your case. If yes, this could be a reason to explain why method 2 is slower than method 1.

haolibai avatar Nov 19 '20 04:11 haolibai

Thanks for your advice. I will update the code afterwise.

hustzxd avatar Nov 19 '20 12:11 hustzxd