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
12 changes: 9 additions & 3 deletions vllm/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,18 @@ def compute_hash(self) -> str:
factors.append(self.quantization)
factors.append(self.revision)
factors.append(self.code_revision)
factors.append(self.max_model_len)
factors.append(self.max_logprobs)
factors.append(self.disable_sliding_window)
factors.append(self.trust_remote_code)
factors.append(self.mm_processor_kwargs)
factors.append(self.generation_config)
factors.append(self.model_impl)
factors.append(self.override_generation_config)
factors.append(self.rope_scaling)
factors.append(self.rope_theta)
# rope cos/sin cache depends on the max_position_embeddings
factors.append(
getattr(self.hf_config, "max_position_embeddings", "None"))
# hf_config can control how the model looks!
factors.append(self.hf_config.to_json_string())
return hashlib.sha256(str(factors).encode()).hexdigest()
Copy link
Member

Choose a reason for hiding this comment

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

sorry for the late feedback, can we add one more assert to make sure str(factors) do not contain object ids? like searching for object at 0x. not sure how stable python object representations are.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I can do that. @youkaichao Were you thinking an assert (hard error) or a warning?

Copy link
Member

Choose a reason for hiding this comment

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

I think it should be an assert (hard error). we should make sure object id does not occur, and when it occurs, we should be aware of it and let users report so that we can investigate.


def __init__(
Expand Down