Skip to content
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

config torch to avoid graph breaks caused by logger #6999

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

ShellyNR
Copy link
Contributor

@ShellyNR ShellyNR commented Feb 4, 2025

Following changes in Pytorch trace rules , my previous PR to avoid graph breaks caused by logger is no longer relevant. So instead I've added this functionality to torch dynamo - pytorch/pytorch@16ea0dd
This commit allows the user to config torch to ignore logger methods and avoid associated graph breaks.

To enable ignore logger methods - os.environ["DISABLE_LOGS_WHILE_COMPILING"] = "1"
To ignore logger methods except for a specific method / methods (for example, info and isEnabledFor) - os.environ["DISABLE_LOGS_WHILE_COMPILING"] = "1"
and os.environ["LOGGER_METHODS_TO_EXCLUDE_FROM_DISABLE"] = "info, isEnabledFor"

@ShellyNR ShellyNR requested a review from tjruwase as a code owner February 4, 2025 17:43
@tohtana
Copy link
Contributor

tohtana commented Feb 4, 2025

Thank you @ShellyNR, this is a very clean approach.
I would like to approve this, but DCO prevents tests from running because of the migration to deepspeedai. Can you rebase based on the explanation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants