Skip to content

Conversation

@r4victor
Copy link
Collaborator

Closes #3303

This PR optimizes getting offers for multiple/all fleets when selecting optimal fleet for the run in get_run_plan() and during provisioning. It changes compute.get_offers() signature and implementations to return Iterator instead of list. This allows callers to take offers with a limit. A low limit (100) is used when selecting the optimal fleet. For configured backends with ~11k cached offers (aws+gcp) and 10 fleets, this reduces peak memory from 1.3GB to 0.5GB, and time of getting offers from 15-20s to 1.5-2s, essentially eliminating linear growth with the number of fleets.

The offers returned are the same. The only downside is that the optimal offers may not be in the first 100 offers in case many offers are not available, and a different fleet will be chosen as optimal.

@r4victor r4victor merged commit 85dd21e into master Nov 25, 2025
28 checks passed
@r4victor r4victor deleted the issue_3303_optimal_per_fleet_offers branch November 25, 2025 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Optimize getting offers for every fleet

2 participants