Fixing ExecuTorch Logging #10432
Replies: 6 comments 7 replies
-
@dbort Do you have any thoughts on this? |
Beta Was this translation helpful? Give feedback.
-
+1 Move the Android and iOS log routing into the default PAL Android for sure. |
Beta Was this translation helpful? Give feedback.
-
Just curious why is this case? |
Beta Was this translation helpful? Give feedback.
-
nit: don't use |
Beta Was this translation helpful? Give feedback.
-
For other edge devices other than Android/iOS, I'm not sure what's the use case of a multi-subscriber pattern. Say for a specific board, they can override this with their own source (they need some config anyway) and they can dupe the output buffer themselves. We don't want to be too complicated within ET |
Beta Was this translation helpful? Give feedback.
-
I think the point of PAL is not being able to support multiple logging pipelines though. PAL is to abstract out the different running environment, not supporting multiple running environments as I don't believe that's a concrete requirement. In other words, what is the problem we are solving here? I think in the end 1 application with ExecuTorch should only have to hook up with 1 primitive logging capability (concretely 1 If weak symbol doesn't satisfy the needs of plugin the correct implementation based on the target hardware, we should solve that issue. Having a subscriber pattern doesn't actually solve it, because it implies that we will have multiple listeners which I doubt is the case. |
Beta Was this translation helpful? Give feedback.
-
Logging for ExecuTorch is a critical part of debugability. Unfortunately, most users do not get ET logs. While we have the tools to expose it, it often doesn’t work or is difficult to use. In my experience, this is the single-largest driver of user frustration. We need to address this prior to ET 1.0.
Note: ExecuTorch does contain any telemetry. The discussion regarding production logging integration and routing are to give users hooks to route logs as desired.
Pain Points
Regarding link order, if there is a weak symbol and strong symbol, the linker may not always take the strong symbol, it can take whichever it sees first (source). This means that if a user overrides the PAL log emit method, the user implementation may or may not be used, depending on the order that libraries are passed to the linker. In CMake, this can be controlled, but buck does not expose a control for this.
For example, if we have executorch.o with the framework and user.o with the override:
ld ... executorch.o user.o
will not work, butld ... user.o executorch.o
will work. This is often hidden by the build system and not very obvious.The other linkage issue is that the override has to be statically linked with the PAL itself. Within Meta-internal buck, we can't always control this. CMake gives more control, but there are cases where it may be desirable to have the log routing code live in a different .so.
Suggested Remediations
Beta Was this translation helpful? Give feedback.
All reactions