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

Fix logging: do not duplicate lines, enable colors in Colab #156

Merged
merged 2 commits into from
Dec 15, 2022

Conversation

borzunov
Copy link
Collaborator

@borzunov borzunov commented Dec 15, 2022

Before this PR, logs contained duplicate lines in Colab, and the colors were disabled. This PR fixes it and does some refactoring of logging along the way. Now it's beautiful:

Screenshot 2022-12-15 at 09 11 23

logger = get_logger(__file__)

# We suppress asyncio error logs by default since they are mostly not relevant for the end user
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Moved to petals/utils/logging.py

@borzunov borzunov changed the title Fix logging in Colab: don't print duplicate lines, enable colors Fix logging: don't print duplicate lines, enable colors in Colab Dec 15, 2022
@borzunov borzunov changed the title Fix logging: don't print duplicate lines, enable colors in Colab Fix logging: do not duplicate lines, enable colors in Colab Dec 15, 2022
@borzunov borzunov merged commit 668b736 into main Dec 15, 2022
@borzunov borzunov deleted the fix-logging branch December 15, 2022 05:12
borzunov added a commit that referenced this pull request Dec 16, 2022
1. Added `from petals.client import *` to `petals/__init__.py`, so you can write just that:

    ```python
    from petals import DistributedBloomForCausalLM
    ```

    I didn't do the same with server, since its classes are supposed to by used by `petals.cli.run_server`, not end-users. Though it's still possible to do `from petals.server.smth import smth` if necessary.

2. Fixed one more logging issue: log lines from hivemind were shown twice due to a bug in #156.

3. Removed unused `runtime.py`, since the server actually uses `hivemind.moe.Runtime`, and `runtime.py` has no significant changes comparing to it.
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.

1 participant