Leading to it is (Injection #81 Use structured logging to emit telemetry inline).
This is a large project. Basically, the goal is to replace our custom logging framework for all the scientific data with a logging-like telemetry pipeline that emits snapshot events. Essentially, replacing tbp.monty/src/tbp/monty/frameworks/loggers/graph_matching_loggers.py at main · thousandbrainsproject/tbp.monty · GitHub and everything that interacts with it. That is, no longer collecting data at hardcoded step, episode, or epoch boundaries, but instead emit them inline with appropriate event metadata so that any application reading the telemetry snapshot stream can construct whatever it needs for data analysis/visualization purposes.
The Current Reality Tree Undesirable Effect (103 Platform internal representations are difficult to visualize) contains more context on the problem we are running into.
I have only thought through the design of this at a very high level. Essentially, what I’m thinking is something analogous to the logger interface, but for telemetry.
So, where we have logger:
logger = logging.getLogger(__name__)
# ...
logger.error(...)
logger.warn(...)
logger.info(...)
logger.debug(...)
We would have an analogous pipeline (using logging as the implementation detail) that would emit telemetry events:
telemetry = monty.getTelemetry(__name__)
# ...
telemetry.snapshot(...) # some scientific data
telemetry.snapshot(...) # some scientific data
This way, we could reuse all the existing logging infrastructure to select, handle, and filter scientific data emitted by the application.
Aside from the emit side of things, this project also requires rethinking and redoing all of the live and offline visualizations.
This is a large topic. I think we’ll need an RFC to keep everyone on the same page. Before we start going through all the details, I want to see if this is of interest first.
Regarding the splitting of the work. I’m not yet sure if it can be split up. However, if we were to try…
One constraint on what we’d merge into tbp.monty is that we do not want to include dead code. So, practically speaking, if there’s a PR with an unused class, I think it is very unlikely to get merged.
If the work were split, I think we might end up needing to add new telemetry without removing the old way. This can then be done in parts. For example, all learning modules now (also) emit telemetry in a new way. All sensor modules, environments, habitat, mujoco.. I’m not sure what the best way of breaking it up will be, but there’s probably something that will make sense. However, always adding a full implementation to a portion of Monty, as opposed to a partial implementation to none of Monty.
The reason I think we might want to emit both telemetry types is that tools rely on the current way telemetry is aggregated. Even with all the new telemetry in place, there is a tail of tools that would need to be updated. Only once those tools are updated (to be enumerated), would we then fully transition to the new telemetry.

