Repository navigation
Run TensorFlow checks with one check50 worker so the job fits its 1 GiB - #55
Merged
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Checks that import TensorFlow (
ai50/projectstraffic,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,
attentionpasses 10/10 andtraffic7/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.shexportsCHECK50_WORKERS=1when it routes a job to the TensorFlow runtime. Non-TensorFlow jobs are unchanged.tests/smoke.shruns 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 spawnedpython3no 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.