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
Add filepaths to pretty_errors' stacktraces; pretty_errors is installed by PL #9167
Conversation
…ed by PL Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
f19bd54
to
4f423f9
Compare
Signed-off-by: akoumpa <akoumpa@users.noreply.github.com>
Signed-off-by: Alexandros Koumparoulis <akoumparouli@nvidia.com>
Example list of synonym files in NeMo
|
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. Thanks!
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.
Might be nicer to move this to nemo.utils.logging. doing stuff inside init which usually doesn't get checked often is not a good pattern.
We almost always import logging so you can do a global var check if you already set it once and if so ignore otherwise do this setup in side the logging.py file
Also, it's a core change so whether here or logging, it needs sign-offs from @nithinraok @ericharper @blisc @yaoyu-33 |
@titu1994 no problem, I will move this to nemo/utils/logging. |
Cool thanks ! Also for some reason the speech text we disabled failed so rebase latest main changes. |
Ok, false alarm everyone. On the container I tested on Friday it used torchmetrics v1.4.0, which was installing pretty-errors (https://github.com/Lightning-AI/torchmetrics/blob/v1.4.0/requirements/base.txt#L9) Ten hours ago, it was moved to a debug requirement https://github.com/Lightning-AI/torchmetrics/pull/2527/files and now the default stack trace is used. As a result, this is no longer required and I will be closing this PR. Apologies for pulling everyone to review. If any take-away from this PR, I would keep perhaps that adding a test to confirm software dependencies altering global behaviors would be a good idea to avoid having them go unnoticed (TODO). |
PL installs pretty_errors which alters
sys.excepthook
fromsys.__excepthook__
to a text formatting function the pretty_errors library defines. However, the format used is incomplete as it misses filepaths, which hinders debugging.This PR includes pretty_errors and configures it so that we get filepaths in the stacktraces, for example:
Before:
After:
What does this PR do ?
Add a one line overview of what this PR aims to accomplish.
Collection: [Note which collection this PR will affect]
Changelog
Usage
# Add a code snippet demonstrating how to use this
GitHub Actions CI
The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.
The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".
Before your PR is "Ready for review"
Pre checks:
PR Type:
If you haven't finished some of the above items you can still open "Draft" PR.
Who can review?
Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.
Additional Information