Skip to content

Conversation

@magnatelee
Copy link
Contributor

@magnatelee magnatelee commented Sep 28, 2022

One side effect of PR #364 is that it eagerly collects region managers even when their fields can be reused immediately after their active field counts become zero. This makes the code create many fresh regions, most of which aren't necessary if the code was able to reuse managers with no active fields. This is problematic as the runtime doesn't perform region destruction as frequently as those fresh regions are created, which ends up limiting how far the runtime can run ahead.

To solve this problem, this PR introduces a pool of inactive region managers with some simple LRU eviction policy.

@magnatelee magnatelee added the category:improvement PR introduces an improvement and will be classified as such in release notes label Sep 28, 2022
@magnatelee magnatelee merged commit ca0519c into nv-legate:branch-22.10 Sep 28, 2022
@magnatelee magnatelee deleted the lru branch September 28, 2022 09:43
Comment on lines +1249 to +1254
lru_managers: Deque[RegionManager] = deque()
for to_check in self.lru_managers:
if to_check is not region_mgr:
lru_managers.append(to_check)
assert len(lru_managers) < len(self.lru_managers)
self.lru_managers = lru_managers
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, did this not work?

self.lru_managers.remove(region_mgr)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that would have worked. (the original code this was copied from needed a loop, but then it has become unnecessary after the code went through some simplification.) will make a follow-on PR to clean this up after the release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:improvement PR introduces an improvement and will be classified as such in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants