-
Notifications
You must be signed in to change notification settings - Fork 430
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
Don't overwrite existing excepthook in mlflow logger #3672
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, good catch!
@@ -322,7 +322,13 @@ def init(self, state: State, logger: Logger) -> None: | |||
self.run_name += f'-rank{dist.get_global_rank()}' | |||
|
|||
# Register the global exception handler so that uncaught exception is tracked. | |||
sys.excepthook = self._global_exception_handler | |||
original_excepthook = sys.excepthook |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternatively you could save original_excepthook
on self (i.e. self.original_excepthook
), so you don't need to use a lambda below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah i think lambda is ok. could've also done functools.partial. don't feel particularly strongly between any of those options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, good catch
Closing in favor of #3675 |
What does this PR do?
The previous PR that added exception hook handling to mlflow just blindly overwrites the existing excepthook. This PR changes that to use the existing excepthook and just add what the mlflow logger needs.
Before:
llama-7b-commits-6-D3ipHw
(exception is not rich formatted, because systemwide excepthook is not triggered)After:
llama-7b-commits-11-3KdS8L
(exception is rich formatted, because systemwide excepthook is triggered)