feat: compact durable logs and refine framework routing
This commit is contained in:
@@ -22,7 +22,7 @@ DEFAULT_FRAMEWORK_MIN_SAMPLES = 300
|
||||
DEFAULT_GPU_MIN_RECENT_TERMINALS = 20
|
||||
DEFAULT_FRAMEWORK_MIN_WILSON = 0.05
|
||||
DEFAULT_COMMUNITY_WINDOW_DAYS = 30
|
||||
DEFAULT_COMMUNITY_MAX_MODELS = 2000
|
||||
DEFAULT_COMMUNITY_MAX_MODELS = 200
|
||||
DEFAULT_COMMUNITY_HYDRATE_PER_REFRESH = 50
|
||||
NEW_FRAMEWORK_PROMOTION_MARGIN = 1.10
|
||||
ERROR_RETRY_SECONDS = 300
|
||||
@@ -248,6 +248,16 @@ class MarketIntelligenceManager:
|
||||
else:
|
||||
state = self._base_state(gpus, tasks, now)
|
||||
|
||||
community_sample = state.get("communitySample") or {}
|
||||
if isinstance(community_sample, dict) and len(community_sample) > DEFAULT_COMMUNITY_MAX_MODELS:
|
||||
cutoff = now - timedelta(days=DEFAULT_COMMUNITY_WINDOW_DAYS)
|
||||
ordered = sorted(
|
||||
community_sample.items(),
|
||||
key=lambda item: parse_datetime((item[1] or {}).get("updateTime")) or cutoff,
|
||||
reverse=True,
|
||||
)
|
||||
state["communitySample"] = dict(ordered[:DEFAULT_COMMUNITY_MAX_MODELS])
|
||||
|
||||
queue_due = not _fresh(
|
||||
state.get("queueUpdatedAt"),
|
||||
now=now,
|
||||
|
||||
Reference in New Issue
Block a user