maekawatoshiki commented on PR #14536: URL: https://github.com/apache/tvm/pull/14536#issuecomment-1515628400
I took a look at the latest tensorflow implementation and noticed it is, for some reason, using float arithmetic: https://github.com/tensorflow/tensorflow/blob/98a187a8bfcdcf0c55c16f07b4a06b50e06a9a26/tensorflow/lite/kernels/internal/optimized/optimized_ops.h#L3471-L3477. I also found another paper proposing quantized softmax (https://arxiv.org/pdf/2101.01321.pdf) and its implementation (https://github.com/kssteven418/I-BERT/blob/1b09c759d6aeb71312df9c6ef74fa268a87c934e/fairseq/quantization/utils/quant_modules.py#L578). However, unlike the proposed algorithm in the paper, its implementation looks like using float arithmetic in several places of code. I realized that it's difficult to implement integer-only quantized softmax with satisfying quality in a variety of input scales. Let me abandon this PR for now to investigate further, and hopefully, I'll make another PR. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
