Skip to content
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

More compute for fw2 #3117

Merged
merged 2 commits into from
Dec 9, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading