-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[NODE][Serialization]fix serialization precision loss in float #4503
Conversation
When we want to serialize a tvm.tensor object(like pickle), we will get a precision loss cause by std::to_string()。 For example, a2.value will be 0.0 while a.value=0.00000001 in the following: import tvm import pickle a = tvm.const(0.00000001, 'float32') a2 = pickle.loads(pickle.dumps(a))
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@junrushao1994 Hi, Shao, what should I do before this PR merged? It's the 1st time I start a pr to TVM. Not very clear to the rules. |
You should @ maintainers (aka committers how have permission to merge) on this thread. They will look at the patch and decide. Thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@HisiFish Welcome to the TVM community and thanks for your contribution! This change sounds good to me.
…e#4503) * fix serialization precision loss in float When we want to serialize a tvm.tensor object(like pickle), we will get a precision loss cause by std::to_string()。 For example, a2.value will be 0.0 while a.value=0.00000001 in the following: import tvm import pickle a = tvm.const(0.00000001, 'float32') a2 = pickle.loads(pickle.dumps(a)) * remove line end spaces
…e#4503) * fix serialization precision loss in float When we want to serialize a tvm.tensor object(like pickle), we will get a precision loss cause by std::to_string()。 For example, a2.value will be 0.0 while a.value=0.00000001 in the following: import tvm import pickle a = tvm.const(0.00000001, 'float32') a2 = pickle.loads(pickle.dumps(a)) * remove line end spaces
When we want to serialize(such as pickle.dumps) a tvm.tensor object, we will get a precision loss caused by std::to_string()。
For example, a2.value will be 0.0 while a.value=0.00000001 in the following:
import tvm
import pickle
a = tvm.const(0.00000001, 'float32')
a2 = pickle.loads(pickle.dumps(a))
Thanks for contributing to TVM! Please refer to guideline https://docs.tvm.ai/contribute/ for useful information and tips. After the pull request is submitted, please request code reviews from Reviewers by @ them in the pull request thread.