Enhance tracing functionality and add Chrome tracing support#12
Merged
Enhance tracing functionality and add Chrome tracing support#12
Conversation
- Implemented tracing API in Rust with functions to start, stop, and list traceable functions. - Added Python frontend for tracing, including UI for starting/stopping traces and displaying traceable functions. - Created unit tests for tracing functionality, including edge cases and error handling. - Enhanced existing tests for tracing decorators and context managers in Python. - Introduced new helper functions for filtering and determining traceable items. - Updated REPL commands to support tracing features.
…le tracking - Introduced `TraceableItem` struct to represent traceable functions/modules with variable information. - Updated `get_traceable_functions` to return a list of functions in the old format for compatibility. - Implemented `get_traceable_items` to return a list of `TraceableItem` objects, supporting both old and new formats. - Refactored variable record retrieval to use SQL queries, improving flexibility and error handling. - Added a new method `dataframe_to_variable_records` to convert DataFrame to `VariableRecord` objects. - Updated the Python page to utilize the new traceable items structure and improved UI for variable records. - Enhanced the traceable functions list to display variables and allow interaction for starting traces. - Introduced a popover for displaying variable records associated with functions.
… queries and data handling
…grate DataFrameView for variable records display
… tracing functions
- Implemented CORS handling for extension calls in `extension_handler.rs` to support cross-origin requests from Perfetto UI. - Added a new route for `/chrome-tracing` in `mod.rs` to handle Chrome tracing requests. - Enhanced the PyTorch magic commands in `torch_magic.py` to include a new `%pytorch timeline` command for exporting timeline data in Chrome tracing format. - Created a new API client method in `pytorch.rs` to fetch PyTorch profiler timeline data. - Updated the `traces.rs` API to include a method for retrieving Chrome tracing JSON data. - Developed a new `ChromeTracing` page in the web application to visualize tracing data using Perfetto UI. - Added navigation links for Chrome tracing in the `nav_drawer.rs` component. - Created a dedicated `chrome_tracing.rs` page to handle the display and interaction with Chrome tracing data. - Updated the main application routing to include the new Chrome tracing page.
- Updated the PyTorch timeline API to ensure consistency with REPL by using the same method for timeline data retrieval. - Improved error handling in the timeline API to provide clearer messages when no profiler instances are found or when timeline data is empty. - Added a new command-line argument to the inspect magic for listing all PyTorch modules, including submodules. - Refactored the TorchMagic class to implement a global profiler that automatically records data after each optimizer step. - Enhanced the Chrome tracing page to handle loading and displaying timeline data more effectively, including improved error messages and user guidance. - Updated the API client to validate the response format for timeline data and log appropriate warnings for errors.
…nce documentation parsing - Updated the magic command from %lsmagics to %cmds for listing probing magic commands. - Enhanced the docstring parsing to extract subcommands and descriptions more effectively. - Updated tests to reflect the command name change and ensure functionality remains intact. - Improved output formatting to include subcommands in the help display.
- Deleted the test file `test_trace.py` which contained unit tests for the probing.inspect.trace module. - The removal includes tests for the probe decorator, ProbingTracer class, and various tracing functions. - This change cleans up the test suite as part of a broader refactor.
…nd improve trace.py documentation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Introduce comprehensive tracing capabilities in Rust and Python, including variable tracking, UI enhancements, and improved error handling. Add support for Chrome tracing and integrate it into the web application, along with updated navigation. Refactor existing code for better maintainability and clarity.