Oneflow-Inc / oneflow

OneFlow is a deep learning framework designed to be user-friendly, scalable and efficient.
http://www.oneflow.org
Apache License 2.0
5.79k stars 658 forks source link

oneflow.log10 has accuracy difference between cpu and cuda #10468

Closed Redmept1on closed 3 months ago

Redmept1on commented 3 months ago

Summary

oneflow.log10 has accuracy differences on the cpu and cuda, but this issue does not seem to exist on other log apis

Code to reproduce bug

import oneflow as flow
import numpy as np

x = flow.tensor(np.array([[float('inf'), 0, -1, float('nan'), 5]], dtype=np.float32))
x = x.cuda()
y = flow.log10(x)
print(y.device,y)

x=x.cpu()
y1 = flow.log10(x)
print(y1.device,y1)

image

System Information