You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both the data destination and the logging pipeline of the ETDumpGen component were static: it was originally intended to log blob debug data into a user-owned memory space using this fixed and unmodifiable logging pipeline. This limitation highlighted the necessity for a more adaptable solution to cater to a wider range of user requirements.
Objective
The primary goal was to develop a fully customizable debug data logging pipeline. The specific objectives included:
Allowing users to define the type and location of the logged data destination.
Enabling users to control the method and timing of writing debug data to the destination.
Ensuring that users can return the offset of the logged data
Introducing DataSink Family Class
We introduced DataSink class to support extension requirements in a more object-oriented manner. This approach allows for better separation of functionalities and facilitates easier reuse across different projects.
Implementation Details
DataSinkBase Class: A new base class, DataSinkBase, was introduced to handle data storage. Users can extend this class to meet specific needs.
ETDumpGen Class Update: The ETDumpGen class was updated to utilize the new DataSink for debug data storage in ETDump.
classETDumpGen : public ::executorch::runtime::EventTracer {
public:ETDumpGen(::executorch::runtime::Span<uint8_t> buffer = {nullptr, (size_t)0}) {
// Constructor implementation...
}
~ETDumpGen() = default;
voidset_debug_handler(DataSinkBase* debug_handler);
// Other public methods, same as current ETDumpGen...
};
Benefits of DataSink
Full User Control: The new pipeline allows users to fully control the logging process, enabling them to customize both the data destination and the logging pipeline to meet their specific requirements. This flexibility ensures that users can tailor the system to their unique needs.
Object-Oriented Design: This approach provides a clearer separation of functionalities, making the process more understandable and maintainable. By encapsulating the logging logic within the DataSink class, users can easily extend and modify the behavior without affecting the core system.
Reusability: The solution is designed to be reused across different projects with similar customization needs. The modular design of the DataSink class allows for easy adaptation and integration into various contexts, promoting code reuse and reducing duplication.
Reduced User Ramp-Up Cost: Users can focus on implementing the small debug_handler class without delving into the internal logic of ETDumpGen. This reduces the learning curve and allows users to quickly implement their custom logging solutions.
module: devtoolsIssues related to developer tools and code under devtools/
1 participant
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Context
Both the data destination and the logging pipeline of the
ETDumpGen
component were static: it was originally intended to log blob debug data into a user-owned memory space using this fixed and unmodifiable logging pipeline. This limitation highlighted the necessity for a more adaptable solution to cater to a wider range of user requirements.Objective
The primary goal was to develop a fully customizable debug data logging pipeline. The specific objectives included:
Introducing DataSink Family Class
We introduced
DataSink
class to support extension requirements in a more object-oriented manner. This approach allows for better separation of functionalities and facilitates easier reuse across different projects.Implementation Details
DataSinkBase
, was introduced to handle data storage. Users can extend this class to meet specific needs.ETDumpGen
class was updated to utilize the newDataSink
for debug data storage inETDump
.Benefits of DataSink
Full User Control: The new pipeline allows users to fully control the logging process, enabling them to customize both the data destination and the logging pipeline to meet their specific requirements. This flexibility ensures that users can tailor the system to their unique needs.
Object-Oriented Design: This approach provides a clearer separation of functionalities, making the process more understandable and maintainable. By encapsulating the logging logic within the
DataSink
class, users can easily extend and modify the behavior without affecting the core system.Reusability: The solution is designed to be reused across different projects with similar customization needs. The modular design of the
DataSink
class allows for easy adaptation and integration into various contexts, promoting code reuse and reducing duplication.Reduced User Ramp-Up Cost: Users can focus on implementing the small
debug_handler
class without delving into the internal logic ofETDumpGen
. This reduces the learning curve and allows users to quickly implement their custom logging solutions.Code Pointer
Family of
DataSink
: https://github.com/pytorch/executorch/tree/main/devtools/etdump/data_sinksETDumpGen
Updates: https://github.com/pytorch/executorch/blob/main/devtools/etdump/etdump_flatcc.h#L146@tarun292 @byjlw
Beta Was this translation helpful? Give feedback.
All reactions