o
    ٷi                     @   sN   d dl mZ d dlmZ d dlmZ eeZdejdededejfdd	Z	dS )
    )AnyN)init_loggermodelcompile_argscompile_kwargsreturnc                 O   sj   t | dd}|std | S d}|  D ]}|jj|v r'|j|i | d}q|s3td| d | S )aH  
    Apply regional compilation to a PyTorch model.

    Args:
        model: The PyTorch model instance to compile
        *compile_args: Positional arguments forwarded to torch.compile
        **compile_kwargs: Keyword arguments forwarded to torch.compile

    Returns:
        The same model instance (modified in-place)
    _repeated_blocksNzRRegional compilation skipped because the model does not define `_repeated_blocks`.FTz%Regional compilation skipped because z$ classes are not found in the model.)getattrloggerwarningmodules	__class____name__compile)r   r   r   repeated_blockshas_compiled_regionsubmod r   O/home/ubuntu/.local/lib/python3.10/site-packages/vllm_omni/diffusion/compile.pyregionally_compile   s   
r   )
typingr   torch.nnnnvllm.loggerr   r   r
   Moduler   r   r   r   r   <module>   s
   "