Skip to content

[Performance] model_config.compute_hash is computed every time and introduce overhead in each new multi-modal req #25671

@imkero

Description

@imkero

call stack: InputPreprocessor::_process_multimodal -> MultiModalRegistry::create_processor -> MultiModalRegistry::_get_model_cls -> get_model_architecture -> model_config.compute_hash

def get_model_architecture(
model_config: ModelConfig) -> tuple[type[nn.Module], str]:
key = model_config.compute_hash()
if key in _MODEL_ARCH_BY_HASH:
return _MODEL_ARCH_BY_HASH[key]
model_arch = _get_model_architecture(model_config)
_MODEL_ARCH_BY_HASH[key] = model_arch
return model_arch

Metadata

Metadata

Assignees

No one assigned

    Labels

    performancePerformance-related issues

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions