Skip to content

Commit fa5db13

Browse files
FindHaofacebook-github-bot
authored andcommitted
Add init_with_env function for environment-based initialization (#87)
Summary: This commit introduces a new function, `init_with_env`, which initializes TritonParse using the environment variables `TRITON_TRACE_FOLDER` and `TRITON_TRACE_LAUNCH`. This function is intended for use specifically within OSS Triton's source code. Changes: - Added `init_with_env` function to facilitate environment-based initialization. Testing/Verification: 1. Ensure the environment variables are set correctly. 2. Call `init_with_env` and verify that it initializes with the expected parameters. This enhancement improves the flexibility of the initialization process for users working with environment configurations. Pull Request resolved: #87 Reviewed By: sfzhu93 Differential Revision: D81160380 Pulled By: FindHao fbshipit-source-id: 41ecccc17b5a5e0d0d40e1df3dddd6733505f917
1 parent 9635953 commit fa5db13

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tritonparse/structured_logging.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,6 +1013,15 @@ def init(trace_folder: Optional[str] = None, enable_trace_launch: bool = False):
10131013
knobs.compilation.listener = maybe_trace_triton
10141014

10151015

1016+
def init_with_env():
1017+
"""
1018+
This function is used to initialize TritonParse with the environment variable TRITON_TRACE_FOLDER and TRITON_TRACE_LAUNCH specifically.
1019+
It is only supposed to be used in OSS triton's source code.
1020+
"""
1021+
if triton_trace_folder:
1022+
init(triton_trace_folder, enable_trace_launch=TRITON_TRACE_LAUNCH)
1023+
1024+
10161025
def clear_logging_config():
10171026
"""
10181027
Clear all configurations made by init() and init_basic().

0 commit comments

Comments
 (0)