-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make HTEX scale-down be aware of unstarted blocks #3353
Conversation
…htex can now make use of that information source... so I can try to make a better implementation of PR #3232 i think this fixes 3232
there's one todo here aimed at @khk-globus - what's the nicest way to make a defaultdict entry come into existence without specifying any changes to the default? |
def new_block_info(): | ||
return BlockInfo(tasks=0, idle=float('inf')) | ||
|
||
block_info: Dict[str, BlockInfo] = defaultdict(new_block_info) | ||
|
||
for block_id, job_status in self._status.items(): | ||
if job_status.state not in TERMINAL_STATES: | ||
block_info[block_id] = new_block_info() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per the PR comment to me, I think this looks fine. The only suggestion I might make is to take advantage of the dataclass
's default handling via:
@dataclass
class BlockInfo:
tasks: int = 0
idle: float = float('inf')
And then there's no need for the new_block_info
function. Just:
block_info = defaultdict(BlockInfo)
Beyond that, per our side-band conversation, I don't think now's the time to tackle the code smell you've discovered. This whole method could be cleaner yes, but suggest "not now."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh; I hate that 15000
ms (test `try_assert) is where we're at currently. But it is.
Description
Prior to this PR, the scale_in code for the
HighThroughputExecutor
will not scale in any block that has not had at least one manager register with the interchange, because it retrieves the list of blocks from the interchange. This is documented in issue #3232This PR makes the htex scale in code also pay attention to blocks in the status_facade list - which includes blocks that have been submitted, and blocks which have been reported by the provider mechanism.
Changed Behaviour
Scaling in will now scale in more blocks.
Fixes
Fixes #3232
Type of change