cc-hpc-itwm / TensorQuant

Apache License 2.0
47 stars 11 forks source link

Where is round_zero defined? #4

Closed jixi2018 closed 4 years ago

jixi2018 commented 5 years ago

I am trying to understand the code: Fixedpoint.py:

round_module_zero = tf.load_op_library(local_dir+'/../Kernels/RoundOp_zero.so') def round_zero(input1, fixed_size, fixed_prec): ''' Truncates input1 to a fixed point number. Rounds towards zero.''' result = round_module_zero.round_zero(input1,fixed_size=fixed_size,fixed_prec=fixed_prec)

But it seems that RoundOp_zero.so doesn't define the function round_zero(). Could you advise?

DominikFHG commented 5 years ago

Do you get an error message? Can you post it, please?

There should be no error with how the symbol names are resolved. "RoundZero" is translated into lower-case "round_zero" for python.

Please see https://www.tensorflow.org/guide/extend/op#use_the_op_in_python for more details.

jixi2018 commented 5 years ago

No, I didn’t get any error message. But I just could not match the function name in different codes.

Another question: My understanding is that the tensor is computed in FP format. How could GPU compute the fixed-point data when TensorQuant converts the tensor into fixed-point?

-Jinwen From: DominikFHG notifications@github.com Sent: Friday, May 24, 2019 4:02 AM To: cc-hpc-itwm/TensorQuant TensorQuant@noreply.github.com Cc: Jinwen Xi Jinwen.Xi@microsoft.com; Author author@noreply.github.com Subject: Re: [cc-hpc-itwm/TensorQuant] Where is round_zero defined? (#4)

Do you get an error message? Can you post it, please?

There should be no error with how the symbol names are resolved. "RoundZero" is translated into lower-case "round_zero" for python.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcc-hpc-itwm%2FTensorQuant%2Fissues%2F4%3Femail_source%3Dnotifications%26email_token%3DALJNZWHPJ3TQWOS3GNRGPWLPW7DLJA5CNFSM4HON4TR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODWE6D7Y%23issuecomment-495575551&data=02%7C01%7CJinwen.Xi%40microsoft.com%7C4165f0ebd3ed4aaa1d1c08d6e0374715%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636942925355247055&sdata=MKAh2Wc5X9zSNTqAkDrV%2FCOna0BoP94UEk0ws%2BKsilA%3D&reserved=0, or mute the threadhttps://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fnotifications%2Funsubscribe-auth%2FALJNZWDM3ZD3EAN2DIZ62NTPW7DLJANCNFSM4HON4TRQ&data=02%7C01%7CJinwen.Xi%40microsoft.com%7C4165f0ebd3ed4aaa1d1c08d6e0374715%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636942925355247055&sdata=ZDDGoN6c1uJAI1A%2BoxP%2FdsrCmCWo5GCGi9lCG13of9A%3D&reserved=0.

DominikFHG commented 5 years ago

TensorQuant does not convert numbers into a fixed-point representation. It is a tool which emualtes fixed-point behavior. Please see https://arxiv.org/abs/1710.05758 for more details.