tensorflow / tensorflow/tensorboard

Locale issue in profiler/trace logger

Open
#4,992 1 comment 0 reactions 1 assignee View on GitHub

Nobody has claimed this yet.

core:backend plugin:profile stat:awaiting tensorflower type:bug
Dominant language
TypeScript
Stars
7.2k
Forks
1.7k
Avg merge
4d 22h
Merged PRs (30d)
1

Description

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!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.