a
    h                     @   s   d Z ddlZddlZddlmZmZ ddlmZmZ dZ	e
ej dddZed	Ze	szddlZd
ZW n ey   dZY n0 eedddZejed dddZdS )a  Logging utilities for Dynamo and Inductor.

This module provides specialized logging functionality including:
- Step-based logging that prepends step numbers to log messages
- Progress bar management for compilation phases
- Centralized logger management for Dynamo and Inductor components

The logging system helps track the progress of compilation phases and provides structured
logging output for debugging and monitoring.
    N)AnyCallable)	_FaketqdmtqdmT)returnc                   C   s   t dt dt dgS )Nz%torch.fx.experimental.symbolic_shapesztorch._dynamoztorch._inductor)logging	getLogger r	   r	   C/var/www/auris/lib/python3.9/site-packages/torch/_dynamo/logging.pyget_loggers   s    r            ztorch.compile())totaldescdelay).N)loggerr   c                    sL   t s&td ttts&t j  ttt	t
td d fdd}|S )Nr   )levelmsgkwargsr   c                    s,   d|vrd|d<  j | d|fi | d S )N
stacklevelr   zStep %s: %s)log)r   r   r   r   stepr	   r
   r   C   s    zget_step_logger.<locals>.log)disable_progresspbarupdate
isinstancer   Zset_postfix_strnamenext_step_counterintstrr   )r   r   r	   r   r
   get_step_logger;   s    

r#   )__doc__	itertoolsr   typingr   r   Z	torch.hubr   r   r   listLoggerr   countr    ZtritonZ	num_stepsImportErrorr   r#   r	   r	   r	   r
   <module>   s   

