Skip to content

Enhance structured logging initialization and test coverage #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

FindHao
Copy link
Member

@FindHao FindHao commented Jul 14, 2025

Summary:

  • Updated tritonparse.structured_logging.init to accept an enable_trace_launch parameter, allowing for improved logging capabilities.
  • Modified test files to utilize the new logging feature and verify event type counts in generated log files, ensuring accurate tracking of 'launch' and 'compilation' events.
  • Added checks in test_tritonparse.py to assert the expected counts of log events, enhancing test robustness.

These changes aim to improve the logging functionality and ensure comprehensive testing of the logging behavior.

FindHao and others added 2 commits July 11, 2025 23:42
Summary:
- Updated `tritonparse.structured_logging.init` to accept an `enable_trace_launch` parameter, allowing for improved logging capabilities.
- Modified test files to utilize the new logging feature and verify event type counts in generated log files, ensuring accurate tracking of 'launch' and 'compilation' events.
- Added checks in `test_tritonparse.py` to assert the expected counts of log events, enhancing test robustness.

These changes aim to improve the logging functionality and ensure comprehensive testing of the logging behavior.
Summary:
- Introduced helper methods to streamline kernel creation, execution, and log verification in the test suite.
- Enhanced the test workflow by separating concerns into dedicated methods for setting up directories, generating test data, and verifying log outputs.
- Updated the `test_whole_workflow` method to utilize the new helper methods, improving readability and maintainability.
- Added assertions to verify event counts and parsing output, ensuring comprehensive testing of the unified_parse functionality.

These changes aim to enhance the organization and robustness of the test suite, facilitating easier future modifications and debugging.
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 14, 2025
@facebook-github-bot
Copy link
Contributor

@FindHao has imported this pull request. If you are a Meta employee, you can view this in D78310275.

…ity and functionality

Summary:
- Consolidated kernel creation and execution into the `test_whole_workflow` method, enhancing readability.
- Removed redundant helper methods and integrated their logic directly into the test, streamlining the workflow.
- Added assertions to verify the existence of log files and event counts, ensuring comprehensive testing of the unified_parse functionality.
- Simplified setup and data generation processes within the test, improving maintainability.

These changes aim to enhance the organization and robustness of the test suite, facilitating easier future modifications and debugging.
@facebook-github-bot
Copy link
Contributor

@FindHao has imported this pull request. If you are a Meta employee, you can view this in D78310275.

Copy link

@davidberard98 davidberard98 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm!

@@ -981,13 +981,16 @@ def init_basic(trace_folder: Optional[str] = None):
maybe_enable_trace_launch()


def init(trace_folder: Optional[str] = None):
def init(trace_folder: Optional[str] = None, enable_trace_launch: bool = False):
"""
This function is a wrapper around init_basic() that also setup the compilation listener.

Args:
trace_folder (Optional[str]): The folder to store the trace files.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: description for enable_trace_launch

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, sorry, didn't see this comment. Will fix in next BE PR for comments.

@facebook-github-bot
Copy link
Contributor

@FindHao merged this pull request in acdac2c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot. Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants