Open ICsin opened 1 year ago
Let me try to split the questions as follows:
Let me know if the above answers your question.
Thank you very much for your answer, I have some new questions. In the hardware design, the input {-1, -1/3, 1/3, 1} is represented as {00, 01, 10, 11}, so should the result calculated by the hardware be multiplied by 1/3?
Yes correct. See here: https://github.com/cornell-zhang/FracBNN/blob/main/xcel-cifar10/source/pgconv.h#L71 msb_scale = 1/3 << 1, so essentially the msb_conv is multiplied by 1/3.
Thanks for your prompt response, how did you solve the problem of slow training caused by temperature encoding. Is it a configuration problem? My gpu is 3070ti
How slow did you observe with/without thermometer encoding? The released InputEncoder is fairly efficient in terms of GPU latency in our experiment. I can imagine the two sources of slow training: (1) expanded input channel due to encoding; (2) other quantization functions, but not related to thermometer encoding. For both we currently do not have a good solution.
Thanks for answering my doubts. Because I used it on 3DCNN, the delay is more obvious. I train almost 70 times slower after adding temperature encoding. Perhaps I can increase the training speed by increasing the size of the R parameter to reduce the number of expanded channels. Thank you very much for your recent help
Sorry to bother you again, there is something I forgot to ask you last time. What is the role of FastSign in the software? (Because when calculating msb, the input has to go through a FastSign).
Then in hardware, I want to implement FracBNN in verilog. For the calculation process of {00,01,10,11} divided into msb and lsb, last time you said to multiply by 1/3 and then shift left by 1 bit, but here in the paper is the directly calculated output whether How about multiplying the output by 1/3 and passing it to the next layer for calculation?
After reading your paper, I have some doubts and hope to get your help. First of all, what is the role of delta in the quantization process of the quantSign function? (Because your comment is to quantize the input into arbitrary bits, the result obtained by using delta here is still a float). Then use FastSign in PGBinaryConv2d to binarize the input (based on quantSign). At this time, have the high bits of the binarized input been separated? Why is the result of out_msb multiplied by two thirds. Moreover, in the process of calculating FracBNN, I did not understand the separation process of MSB and LSB. Whether it is the shift operation described in the paper or the sparse operation of LSB, there is no clear expression in the code. The end result seems to be just choosing between out_msb and out_full。