Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions serving/core/trace_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@
# ----------------------------------------------------------------------
_perf_db_cache = {}

# key: model_type
# value: parsed architecture yaml dict
_arch_cache = {}

logger = get_logger("TraceGenerator")


Expand Down Expand Up @@ -245,6 +249,8 @@ def flush(self, ctx, enable_attn_offloading=False):

def _load_architecture(model_type):
"""Load catalog + sequence from profiler/models/<model_type>.yaml."""
if model_type in _arch_cache:
return _arch_cache[model_type]
path = _arch_yaml_path(model_type)
if not os.path.isfile(path):
raise FileNotFoundError(
Expand All @@ -257,6 +263,7 @@ def _load_architecture(model_type):
raise KeyError(
f"Architecture yaml {path} must define both 'catalog' and 'sequence'."
)
_arch_cache[model_type] = arch
return arch


Expand Down
Loading