question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature Request: C++ logging from non-TensorFlow frameworks

See original GitHub issue

TensorBoard logging can be done from a variety of ML frameworks, including PyTorch with torch.utils.tensorboard. The FileWriter and protos exposed from TensorBoard provide an API contract that can be easily accessed in Python code to log everything from scalars and histograms to model graphs.

However, things get complicated with C++. Any proto specifications or code would need to be built as a static or dynamic library and referenced by frameworks at build as well as runtime.

A couple of questions:

  1. How much interest is there in the community for TensorBoard logging from non-Python languages and non-TensorFlow libraries?
  2. Should proto files exist in a separate TensorFlow/TensorBoard repository so they can be pinned, updated, etc. across logging implementations or just be copied as needed into other code bases?
  3. Is there value in a shared C++ logging implementation and a precompiled library to match?

We are exploring C++ logging for PyTorch with libtorch and so wanted to get community involvement on this topic. Comments welcome!

cc @nfelt @manivaradarajan @GalOshri @natalialunova @lanpa @sanekmelnikov @caraya10 @jspisak

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:16
  • Comments:5

github_iconTop GitHub Comments

1reaction
jackshi0912commented, Oct 13, 2021

I work in RL with various search algorithms (including beam search and MCTS) and use C++ for performance. We currently use custom hacked together frameworks. TensorBoard logging for Libtorch would be absolutely awesome!

0reactions
jackshi0912commented, Dec 19, 2021

This is really good feedback. I feel like there are two motivations here. 1) Integration within an already implemented C++ workflow; and 2) Performance. Sounds like both are important and critical but the former is the must have?

“Performance” in this context refers to python’s terrible performance. There is not really a fix for that. Even python wrappers for C++ code is much slower than cache optimised / e2e compile time optimised native C/C++. For example, writing a MCTS algorithm in python using python data structures in my case is ~3-4 orders of magnitude slower than the most naive C++ implementation (heap allocate everything, don’t pack struct or cache lines, no vectorised operations). If you optimise C++ code and use thread parallelisation (can’t do in python with GIL), the performance gap widens even more.

I think exposing a C++ or proto interface would be really helpful.

Read more comments on GitHub >

github_iconTop Results From Across the Web

7 Best Practices for C# Logging (With Examples) - Papertrail
One of the most useful features of a logging library like log4net is the ability to ignore messages that are unimportant for a...
Read more >
C# Logging best practices in 2021 with examples and tools
Logging frameworks. Logging frameworks typically support features including: Logging levels; Logging targets; Structured (also called “semantic”) ...
Read more >
Web SDK - Use a logging framework (winston for example)
Is your feature request related to a problem? Please describe. The Web SDK is writing useful debugging information on the console output (on ......
Read more >
Joys Of Apex: Advanced Logging Using Nebula Logger
Salesforce does provide some basic logging functionality ... Nebula Logger now uses Salesforce's provided Request ID as the Log__c records ...
Read more >
Logging Framework for iOS? [closed] - Stack Overflow
"It is similar in concept to other popular logging frameworks such as log4j, yet is designed specifically for Objective-C, and takes advantage ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found