facebookresearch / HolisticTraceAnalysis

A library to analyze PyTorch traces.
http://hta.readthedocs.io
MIT License
270 stars 37 forks source link

add env options and disable negative weights check #177

Closed briancoutinho closed 1 month ago

briancoutinho commented 1 month ago

What does this PR do?

  1. Adds a file to encapsulate environment variable based options.
  2. Critical path, make negative weight check more tolerant

Testing: pytest tests/test_config.py

We can also see the options.

>>> from hta.configs.env_options import get_options
>>> print(get_options())

disable_ns_rounding=False, HTA_DISABLE_NS_ROUNDING_ENV=unset
disable_call_graph_depth=False, HTA_DISABLE_CG_DEPTH_ENV=unset
critical_path_add_zero_weight_launch_edges=False, CP_LAUNCH_EDGE_ENV=unset
critical_path_show_zero_weight_launch_edges=False, CP_LAUNCH_EDGE_SHOW_ENV=unset
critical_path_strict_negative_weight_check=False, CP_STRICT_NEG_WEIGHT_CHECK_ENV=unset

Before submitting

fengxizhou commented 1 month ago

Thanks for adding the support for configuring with env variables. One of my suggestion is to also support the customization through local configuration, i.e., command line option > env vars > local configuration file > default configuration file.

facebook-github-bot commented 1 month ago

@briancoutinho has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot commented 1 month ago

@briancoutinho has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

facebook-github-bot commented 1 month ago

This pull request was exported from Phabricator. Differential Revision: D60842130

facebook-github-bot commented 1 month ago

@briancoutinho merged this pull request in facebookresearch/HolisticTraceAnalysis@6697ab79ead19774613035b757c04358b78bf6d9.