Skip to content
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

Locale issue in profiler/trace logger #4992

Open
mvieth opened this issue May 19, 2021 · 1 comment
Open

Locale issue in profiler/trace logger #4992

mvieth opened this issue May 19, 2021 · 1 comment

Comments

@mvieth
Copy link

mvieth commented May 19, 2021

System information

  • Have I written custom code (as opposed to using a stock example script provided in TensorFlow): yes, but bug is not in custom code
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux Ubuntu 20.04.2
  • Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: no
  • TensorFlow installed from (source or binary): pip3
  • TensorFlow version (use command below): v2.4.0-49-g85c8b2a817f 2.4.1
  • Python version: 3.8.5
  • Bazel version (if compiling from source): no
  • GCC/Compiler version (if compiling from source): no
  • CUDA/cuDNN version: -
  • GPU model and memory: -

Describe the current behavior
The trace.json written by the TensorBoard callback is locale dependent. Example that was written while a German locale was set:

"ts":45,805999999999997,"dur":318,03199999999998

Describe the expected behavior
The decimal commas should be decimal points to comply with the JSON syntax.
I believe that snprintf here should write a decimal point, no matter which locale is set.
Also for reference: MaxPrecision is called from here, and PicosToMicrosString is called from here.

As a side note, it is unnecessary to write so many digits/decimal places. Looking at PicosToMicros, there can be no more than six non-zero digits after the decimal point, in my example above seemingly only three.

Contributing

  • Do you want to contribute a PR? (yes/no): inclined to contribute, but don't know enough about tensorflow to know what solution would be best
  • Briefly describe your candidate solution (if contributing): not sure

Standalone code to reproduce the issue
This example should reproduce the issue if a locale without decimal point is set.

Thank you!

@stephanwlee
Copy link
Contributor

Thanks a lot for pointer to the code, repro steps, and very clear description. Assigning it to @yisitu, owner of https://github.com/tensorflow/profiler.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants