Skip to content

Commit

Permalink
More compute for fw2 (#3117)
Browse files Browse the repository at this point in the history
* more compute for fw2

* style
  • Loading branch information
lhoestq authored Dec 9, 2024
1 parent 06415f8 commit 6f5aecb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion libs/libcommon/src/libcommon/queue/past_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def __get__(self, instance: object, cls: type[U]) -> QuerySet[U]:
# don't record short durations, because they will not have impact, but can clutter the collection
JOB_DURATION_MIN_SECONDS = 30

# hardcoded list of datasets for which we allocated more compute
# (typically impactful datasets with tons of subsets)
ALLOWED_COMPUTE_MULTIPLIER = {"HuggingFaceFW/fineweb-2": 100}


class PastJobDocument(Document):
"""The duration of a job that has been completed.
Expand Down Expand Up @@ -96,7 +100,8 @@ def create_past_job(dataset: str, started_at: datetime, finished_at: datetime) -
PastJobDocument(dataset=dataset, duration=duration, finished_at=finished_at).save()

if not is_blocked(dataset) and duration > JOB_DURATION_CHECK_MIN_SECONDS:
if PastJobDocument.objects(dataset=dataset).sum("duration") > DATASET_BLOCKAGE_THRESHOLD_SECONDS:
max_duration = DATASET_BLOCKAGE_THRESHOLD_SECONDS * ALLOWED_COMPUTE_MULTIPLIER.get(dataset, 1)
if PastJobDocument.objects(dataset=dataset).sum("duration") > max_duration:
block_dataset(dataset)
return True
return False

0 comments on commit 6f5aecb

Please sign in to comment.