Skip to content

Run TensorFlow checks with one check50 worker so the job fits its 1 GiB - #55

Merged
rongxin-liu merged 1 commit into
mainfrom
tensorflow-single-worker
Nov 26, 2026
Merged

rongxin-liu merged 1 commit into
mainfrom
tensorflow-single-worker

Conversation

@rongxin-liu

@rongxin-liu rongxin-liu commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Checks that import TensorFlow (ai50/projects traffic, attention) have been failing to produce results since #53. This runs those jobs with a single check50 worker, which keeps them within the memory a grading job is allowed.

Cause

check50 runs each check in a worker process and, by default, starts one worker per CPU it sees. The parent imports the check module (and so TensorFlow) to discover the checks, then every worker imports it again; for attention, transformers too. Several TensorFlow processes at once do not fit in a grading job's memory budget, so the job is killed and never reports back. The image before #53 was already right at that budget; the new runtime's slightly different footprint tipped it over.

With one worker, attention passes 10/10 and traffic 7/7, each in well under the time allowed and with comfortable headroom. The jobs have little CPU to begin with, so the parallel workers were not making them faster.

Change

  • docker-entry.sh exports CHECK50_WORKERS=1 when it routes a job to the TensorFlow runtime. Non-TensorFlow jobs are unchanged.
  • tests/smoke.sh runs its TensorFlow check50 job under a memory and CPU limit representative of a grading job, with the same env, so a regression fails CI; before, it ran unconstrained and could not see this. Verified on the production image: the test fails without the env and passes with it. Its probe of the spawned python3 no longer imports TensorFlow a third time (real checks do not spawn TensorFlow subprocesses), and it matches stdout literally: stdout() is a regex by default, so the (3, 14) in the old assertion never matched as written.

Since #53, a job whose checks import TensorFlow is OOM-killed on the
cluster: check50 starts one worker per CPU the node reports (2), the
parent and each worker import TensorFlow (and, for attention, transformers),
and together they exceed the 1 GiB the Job spec allows. The Job retries
until its 120 s deadline, never calls back, and the student sees "Waiting
for results" until check50 gives up. Measured on a cluster node: attention
with the default workers is killed; with CHECK50_WORKERS=1 it passes 10/10
in 14 s at a 762 MiB peak. The pre-#53 image survived only by a hair, at a
1024 MiB peak and twice the runtime.

docker-entry.sh sets CHECK50_WORKERS=1 when it routes a job to the
TensorFlow runtime. The pod has 1.2 CPUs, so parallelism was not buying
anything there.

The smoke test now runs its TensorFlow check50 job under the cluster's
limits (--memory 1g --cpus 1.2) and the same env, so regressing this fails
CI; before, it ran unconstrained and could not see the problem. Its probe
of the spawned python3 no longer imports TensorFlow a third time, and it
matches stdout literally (stdout() is a regex by default, so the
parentheses in the version tuple never matched as written).
@rongxin-liu rongxin-liu self-assigned this Nov 26, 2026
@rongxin-liu
rongxin-liu merged commit eee0b80 into main Nov 26, 2026
1 check passed
@rongxin-liu
rongxin-liu deleted the tensorflow-single-worker branch November 26, 2026 12:28
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.

1 participant