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

[move][logger] Move logger.py to sparseml.core #1759

Merged
merged 3 commits into from
Oct 19, 2023

Conversation

rahul-tuli
Copy link
Member

@rahul-tuli rahul-tuli commented Oct 11, 2023

This PR migrates existing logger framework to sparseml.core

Main Changes:

  • Move src/sparseml/pytorch/utils/logger.py --> src/sparseml/core/logger.py + update __init__.py files
  • Update usages
  • Move Tests

Also asserted that imports work just fine:

$ python                                                                                                   (migrate-existing-logger-framework|12)
[GCC 7.5.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from sparseml.pytorch.sparsification import LayerPruningModifier
>>> from sparseml.pytorch.utils import log_sparsification_info
>>> from sparseml.pytorch.optim import RecipeManagerStepWrapper
>>> 

Note: Updated import logic to include loggers in sparseml/pytorch/utils/__init__.py all above import verified to still work as expected

@rahul-tuli rahul-tuli changed the base branch from logger-framework to main October 11, 2023 17:49
@rahul-tuli rahul-tuli force-pushed the migrate-existing-logger-framework branch from 6095216 to bf22554 Compare October 11, 2023 18:29
@rahul-tuli rahul-tuli marked this pull request as ready for review October 11, 2023 18:31
@rahul-tuli rahul-tuli marked this pull request as draft October 11, 2023 18:33
@rahul-tuli rahul-tuli marked this pull request as ready for review October 11, 2023 18:47
@rahul-tuli rahul-tuli changed the title Move logger.py to sparseml/core [move][logger] Move logger.py to sparseml.core Oct 11, 2023
@rahul-tuli rahul-tuli self-assigned this Oct 11, 2023
@rahul-tuli rahul-tuli changed the base branch from main to logger-framework October 11, 2023 19:10
@rahul-tuli rahul-tuli changed the base branch from logger-framework to main October 11, 2023 19:36
dsikka
dsikka previously approved these changes Oct 12, 2023
Copy link
Contributor

@dsikka dsikka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending tests

@Satrat
Copy link
Contributor

Satrat commented Oct 13, 2023

Looks like there is failing integration test, but otherwise looks fine to me!

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.9.18/x64/bin/sparseml.yolov5.export_onnx", line 5, in <module>
    from sparseml.yolov5.scripts import export
  File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/sparseml/yolov5/scripts.py", line 17, in <module>
    from yolov5.export import export_run
  File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/yolov5/export.py", line 76, in <module>
    from yolov5.utils.neuralmagic import apply_recipe_one_shot, export_sample_inputs_outputs, neuralmagic_onnx_export
  File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/yolov5/utils/neuralmagic/__init__.py", line 1, in <module>
    from .sparsification_manager import *
  File "/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/yolov5/utils/neuralmagic/sparsification_manager.py", line 7, in <module>
    from sparseml.pytorch.utils import SparsificationGroupLogger
ImportError: cannot import name 'SparsificationGroupLogger' from 'sparseml.pytorch.utils' (/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/site-packages/sparseml/pytorch/utils/__init__.py)
tests/integrations/yolov5/test_yolov5.py E

@rahul-tuli rahul-tuli force-pushed the migrate-existing-logger-framework branch from 5643369 to 049a753 Compare October 17, 2023 19:47
@rahul-tuli rahul-tuli merged commit a234bef into main Oct 19, 2023
11 checks passed
@rahul-tuli rahul-tuli deleted the migrate-existing-logger-framework branch October 19, 2023 12:23
@rahul-tuli rahul-tuli mentioned this pull request Nov 28, 2023
17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants