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
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,10 @@ def prefer_cross_layer_blocks(self) -> bool:
return False

extra_config = self.kv_transfer_config.kv_connector_extra_config
return bool(str(extra_config.get("enable_cross_layers_blocks", "False")))
return (
str(extra_config.get("enable_cross_layers_blocks", "False")).lower()
== "true"
Comment on lines +315 to +316
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

high

While this correctly fixes the original bug where bool("False") evaluates to True, the boolean conversion could be more robust. The current implementation only considers "true" (case-insensitive) as affirmative. It would be better to handle other common boolean string representations like "1", "t", "y", "yes" to prevent unexpected behavior if a user configures it differently. This would make the configuration parsing more resilient, especially since kv_connector_extra_config values can be of Any type.

Suggested change
str(extra_config.get("enable_cross_layers_blocks", "False")).lower()
== "true"
str(extra_config.get("enable_cross_layers_blocks", "False")).lower()
in ("true", "1", "t", "y", "yes")

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can be done later, let's make sure the feature is off by default in the release first

)

def __init__(
self,
Expand Down