Skip to content

Logger module in Efficient Transformers #517

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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

quic-hemagnih
Copy link
Contributor

This PR adds a logger module to the Efficient Transformer, enabling users to log messages at various levels such as INFO, DEBUG, WARNING, and ERROR.
It also provides the flexibility to configure the logging level based on the user's specific execution needs.

Signed-off-by: Hem Agnihotri <[email protected]>
Signed-off-by: Hem Agnihotri <[email protected]>
from QEfficient.utils.logging_utils import logger
from QEfficient.utils.logging_utils import QEFFLogger

logger = QEFFLogger.get_logger()
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: where will this logs be dumped? in the default QEFF_HOME path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently I am placing the logs at "~/.cache/.log, but we can think of a better place to keep all the logs. Only consideration we need to keep is we need to store init time logs also, so at init time many directories or sub-directories won't be available.

logger = QEFFLogger.get_logger()

# Register the cleanup function
atexit.register(QEFFLogger.close_logger)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we make the naming as QEffLogger, consistent with other library naming styles.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes agree


def _initialize_logger(self) -> logging.Logger:
# Define the hidden log directory path
log_dir = os.path.expanduser("~/.cache/.log")
Copy link
Contributor

Choose a reason for hiding this comment

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

should be QEFF_HOME set by the user instead of default.
Default would be ~/.cache/qeff_models, but can be overridden by the user.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Need to see whether during init time directory qeff_models is created or not?

@quic-hemagnih
Copy link
Contributor Author

This change is not ready for review. Developement is still going on. Will post comment once its ready for review.

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

Successfully merging this pull request may close these issues.

2 participants