4
4
import warnings
5
5
from dataclasses import dataclass , field , replace
6
6
from pathlib import Path
7
- from typing import (TYPE_CHECKING , Any , Callable , ClassVar , Dict , Final , List ,
8
- Literal , Mapping , Optional , Set , Tuple , Type , Union )
7
+ from typing import (TYPE_CHECKING , Any , Callable , ClassVar , Counter , Dict ,
8
+ Final , List , Literal , Mapping , Optional , Set , Tuple , Type ,
9
+ Union )
9
10
10
11
import torch
11
12
from pydantic import BaseModel , Field , PrivateAttr
@@ -2169,6 +2170,10 @@ class CompilationConfig(BaseModel):
2169
2170
compile_sizes : List [int ] = PrivateAttr
2170
2171
capture_sizes : List [int ] = PrivateAttr
2171
2172
2173
+ # keep track of enabled and disabled custom ops
2174
+ enabled_custom_ops : Counter [str ] = PrivateAttr
2175
+ disabled_custom_ops : Counter [str ] = PrivateAttr
2176
+
2172
2177
def model_post_init (self , __context : Any ) -> None :
2173
2178
self .level = envs .VLLM_TORCH_COMPILE_LEVEL
2174
2179
@@ -2190,6 +2195,9 @@ def model_post_init(self, __context: Any) -> None:
2190
2195
func = __import__ (module ).__dict__ [func_name ]
2191
2196
self .inductor_compile_config [k ] = func
2192
2197
2198
+ self .enabled_custom_ops = Counter ()
2199
+ self .disabled_custom_ops = Counter ()
2200
+
2193
2201
def init_backend (self ) -> Union [str , Callable ]:
2194
2202
if self .level == CompilationLevel .NO_COMPILATION :
2195
2203
raise ValueError ("No compilation level is set." )
0 commit comments