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

Add support for nested progressbar to tracincp even when tqdm is not available. #1046

Closed
wants to merge 15 commits into from

Conversation

cyrjano
Copy link
Contributor

@cyrjano cyrjano commented Oct 13, 2022

This Pull request add support for nested progressbar in SimpleProgress bar (i.e. when tqdm is not installed) by leveraging Python contexts (with statements) that is also implemented in tqdm. To keep SimpleProgress simple this is the behaviour:

  • Add a new line per each update of the parent progress bar.
  • Guarantee that each update for parent progress bar is refreshed.
  • Do not write refresh at the ending of parent progress bar (to avoid duplicate lines).

This support is used now in TracInCp and TracInCpFast methods.
Screen Shot 2022-10-11 at 12 43 23 PM

cyrjano and others added 8 commits October 10, 2022 16:13
Summary:
In SimpleProgress add support for context methods (__enter__, __exit__).
For simple progress bar it means the parent(context) progress bar is
shown once each time its value change.
Test Plan:
Unit tests.
python -m unittest -v tests.utils.test_progress
Reviewers:

Subscribers:

Tasks:

Tags:
Summary:
NullProgress implements the Progress API, but has no output.
It can be used to simplify code showing no progress.

Test Plan:
python -m unittest -v tests.utils.test_progress
Reviewers:

Subscribers:

Tasks:

Tags:
Summary:
Add support for nested progress bars for tracincp
including support without `tqdm`.
Test Plan:
python -m unittest -v
tests.influence._core.test_tracin_show_progress.TestTracInShowProgress.test_tracin_show_progress_TracInCPFast_self_influence_by_checkpoints

Reviewers:

Subscribers:

Tasks:

Tags:
Summary:
use only one `or` for multiple types

Pull Request resolved: pytorch#1034

Reviewed By: vivekmig

Differential Revision: D40030553

Pulled By: aobo-y

fbshipit-source-id: 4fec520d82e3b7c200f6fdc50fd66e8ae71da8c1
Summary:
- Require successful sphinx build in CI. Previously sphinx build will always pass even with errors (example below)
![image](https://user-images.githubusercontent.com/5113450/191642234-66e4a90a-6410-4371-899e-f9f6941e263d.png)

- Fixed the remaining sphinx errors:
  - remove `pytext.rst`. We never really make pytext model public and its doc cannot be built due to missing pytext package (which is deprecated now); we can later migrate to torchtext and re-opensource it if needed
  - remove `approximation_methods.rst` which is not public
  - other trivial format issues

Pull Request resolved: pytorch#1033

Reviewed By: vivekmig

Differential Revision: D39721114

Pulled By: aobo-y

fbshipit-source-id: e0a9af1975f6bf29fb4b8ca394f028325afb5f49
Summary:
Fixes formatting issues according to Flake8

Test Plan:
flake8 .
Produces no output.

Reviewers:

Subscribers:

Tasks:

Tags:
Summary:
Fix some typing issues on progressbar work.

Test Plan:
./scripts/run_mypy.sh

Reviewers:

Subscribers:

Tasks:

Tags:
Summary:
- Require successful sphinx build in CI. Previously sphinx build will always pass even with errors (example below)
![image](https://user-images.githubusercontent.com/5113450/191642234-66e4a90a-6410-4371-899e-f9f6941e263d.png)

- Fixed the remaining sphinx errors:
  - remove `pytext.rst`. We never really make pytext model public and its doc cannot be built due to missing pytext package (which is deprecated now); we can later migrate to torchtext and re-opensource it if needed
  - remove `approximation_methods.rst` which is not public
  - other trivial format issues

Pull Request resolved: pytorch#1033

Reviewed By: vivekmig

Differential Revision: D39721114

Pulled By: aobo-y

fbshipit-source-id: e0a9af1975f6bf29fb4b8ca394f028325afb5f49
@cyrjano cyrjano marked this pull request as ready for review October 13, 2022 21:53
@facebook-github-bot
Copy link
Contributor

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

@facebook-github-bot
Copy link
Contributor

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

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

Successfully merging this pull request may close these issues.

None yet

3 participants