Skip to content
Closed
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
14 changes: 14 additions & 0 deletions vllm/forward_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,20 @@ class ForwardContext:
# set dynamically for each forward pass
dp_metadata: Optional[DPMetadata] = None

def get_virtual_engine(self):
return self.virtual_engine
Comment on lines +48 to +49
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this for?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tlrmchlsmth OK will use VllmConfig.get_layers_from_vllm_config() inside LMCache and close this PR.


def get_kv_cache_attn_layers(self) -> dict[str, Any]:
attn_layers = {}
for layer_name in self.no_compile_layers:
attn_layer = self.no_compile_layers[layer_name]
if not hasattr(attn_layer, "kv_cache"):
logger.debug("The layer %s does not have kv_cache, skip it",
layer_name)
continue
attn_layers[layer_name] = attn_layer

return attn_layers

_forward_context: Optional[ForwardContext] = None

Expand Down
Loading