Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion vllm_ascend/attention/attention_v1.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def copy_blocks(

@staticmethod
def get_supported_block_size() -> list[int]:
return [64]
return [128]
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The block size 128 is a magic number that appears in multiple files. Consider defining this value as a named constant in a shared utility module (e.g., vllm_ascend/utils.py) to improve maintainability and ensure consistency across the codebase. Duplicating such values can lead to errors if the value needs to be updated in the future.



class AscendAttentionState(Enum):
Expand Down
2 changes: 1 addition & 1 deletion vllm_ascend/patch/platform/patch_mamba_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def verify_and_update_config(cls, vllm_config) -> None:
block_size=model_config.max_model_len,
).page_size_bytes

block_alignment_bytes = 64
block_alignment_bytes = 128
Copy link
Contributor

Choose a reason for hiding this comment

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

high

This block_alignment_bytes value of 128 is duplicated with the get_supported_block_size in vllm_ascend/attention/attention_v1.py. To enhance maintainability and prevent inconsistencies, it is recommended to define this as a single, shared constant in a central utility file.


# some attention backends (e.g. FA) only support setting
# block size to multiple of 16, so let's suggest a value
Expand Down
Loading