jikechao commented on PR #18390: URL: https://github.com/apache/tvm/pull/18390#issuecomment-3445895604
> Idea for future, > > Beside this casting to float (simplest) I think we could try using a LUT like implementation assuring that we truly emit integer ISA counter part from llvm (staying in the int domain), so we could also tackle on a good integer `softmax()` implementation, TVM being a compiler I would expect such capability. > > See: https://github.com/google/gemmlowp/blob/16e8662c34917be0065110bfcd9cc27d30f52fdf/fixedpoint/fixedpoint.h#L781-L800 Hi @cbalint13, thanks for your review and suggestion. While LUT is well-suited for softmax due to its normalized output and constrained input range, implementing `exp(x)` for arbitrary integers is challenging and may not yield optimal performance because of the exponential function's vast output range and the complexity of fixed-point arithmetic for large values. For a quick fix, I prepared this patch as a workaround. -- 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]
