Spaces:
Running on CPU Upgrade
Download docs/architecture.md from PrismScienceOrg/PLUG-challenge: direct link, hf CLI and curl.
- Browser
- Download file 7.17 kB
-
https://huggingface.co/spaces/PrismScienceOrg/PLUG-challenge/resolve/main/docs/architecture.md
- Command line
-
hf download hf://spaces/PrismScienceOrg/PLUG-challenge/docs/architecture.md
-
curl -L -o architecture.md https://huggingface.co/spaces/PrismScienceOrg/PLUG-challenge/resolve/main/docs/architecture.md
Architecture, and what changed from the template
This challenge is modelled on
OpenADMET's blind-challenge-template.
The participant-facing shape is deliberately the same β a Gradio Space with About /
Submit / Leaderboard / FAQ tabs, a config.py holding every challenge-specific string, a
separate scoring library with its own tests, anonymity and disclosure flags on the
leaderboard, and a submission cooldown. The backend is not.
The template's architecture
Space (Gradio) ββuploadβββΊ S3 submissions/
β
EventBridge (scheduled)
βΌ
Lambda (scoring image from ECR)
ββββΊ S3 scores/
ββββΊ Discord webhook
Lambda (leaderboard) βββΊ S3 leaderboard/*.csv
β²
Space ββββββββββββreadββββββββ
Submissions are asynchronous because the challenge is blind: a participant must not learn their score immediately, or the held-out labels leak one submission at a time. That requirement is what buys the queue, the container image, the OpenTofu stack, the OIDC deploy role and the Discord receipts.
This challenge's architecture
Space (Gradio)
βββ validate bundle plug_challenge.validation
βββ score vs held-back labels plug_challenge.scoring βββ private repo: ground_truth/
βββ store bundle + metadata βββΊ private repo: submissions/
βββ store scores βββΊ private repo: scores/
βββ append leaderboard row βββΊ private repo: leaderboard/entries.csv
β
Space leaderboard tabs ββββββββββββββreadβββββββββββββββββββββββββββ
public repo: manifest (ids + Lo-Hi splits) / proteins.csv βββΊ participants
(labels come from each benchmark's original source)
PLUG is not blinded, so scoring can happen inside the request. Removing the asynchrony removes everything the asynchrony was for:
| Template | Here | Why |
|---|---|---|
| S3 bucket | private Hub dataset repo | One storage system, and it is the one the Space already authenticates to |
| Scoring Lambdas + ECR image + EventBridge | a function call in the Submit handler | Nothing to queue when the answer is allowed to be immediate |
| Leaderboard Lambda | aggregate.build_leaderboard, called on read |
The board is small; ranking it per page load is cheaper than storing a ranked copy |
OpenTofu stack, OIDC deploy role, AWS_DEPLOY_ROLE_ARN |
β | No cloud account |
GitHub repo deploying an hf_space/ subtree |
this repo is the Space | No second repo, no deploy workflow, no HF_TOKEN in GitHub |
| Discord webhook receipts | the response in the Submit tab | The participant already sees their per-benchmark scores and PLUG Score |
interim / final / live leaderboards |
one board per track (supervised, unsupervised), frozen at phase 2 | The interim/final split exists to stage the reveal of blinded results; the tracks instead separate methods fitted to these labels from methods that never see them |
ACTIVITY_DATASET_SIZE constants |
the ids in the ground truth | Row counts are read from the data rather than restated in config, so they cannot drift |
What that costs: there is no queue to absorb a burst, and a long scoring run would block
a request. Every metric is one or two NumPy passes over the scored rows, so a supervised
bundle (the Lo-Hi test rows, about 210,000 datapoints) scores in a second or two. An
unsupervised bundle is every row β about 6.5 million datapoints, dominated by DMS's 2.5
million variants and the three per-residue benchmarks β and is a ~37 MB zip that
validates in ~3 s and scores in ~25 s on a laptop. That is slow for a request but still
fits in one. Bootstrap resampling is off by default for the same reason, noted in
scoring.md: 1000 resamples of eleven benchmarks is not a request-time
workload.
Ordering guarantees in the Submit handler
The order in submission.submit_bundle is the part worth not breaking:
- Identity and form checks β cheapest, and they need no data.
- Cooldown check β before any work, so a rate-limited user pays nothing.
- Validation β before anything is stored. A malformed bundle costs the participant nothing and does not start their cooldown, which is what makes "validate locally, then upload" a reasonable instruction rather than a trap.
- Scoring β after validation, so the scorer can assume a clean join.
- Store the bundle and metadata β the durable record.
- Store the scores, then append the leaderboard row β in that order, so a failure
between them leaves a scored submission that
plug-challenge rebuildcan recover, rather than a leaderboard row with nothing behind it.
Consistency: one source of truth
plug_challenge/benchmarks.py declares each benchmark's submission schema, ground-truth
schema and metrics. Generated from it: the validator's column and range checks, the
scorer's metric dispatch, the leaderboard's columns and sort order, the Submit tab's
per-file schema tables, and the FAQ's format rules. The template keeps its endpoint lists
in two files (backend/config.py and hf_space/config.py) and asks you to keep them in
sync by hand; collapsing that into one import is the one place this repo departs from the
template's structure on purpose.
Threat model
It is worth being precise about what the held-back labels do and do not buy.
Prevented. Self-reported numbers. Every leaderboard value was computed here from an uploaded bundle that is still on file.
Bounded. Fitting the test set by repeated submission. The cooldown
(HOURS_BETWEEN_SUBMISSIONS, 12) and latest-submission-only ranking make this slow and
visible, but eleven scalars per attempt is still information. A determined participant
with months can extract some of it.
Not prevented. Sybil accounts. Hugging Face username validation is a typo check, not
an identity proof, and nothing here ties an account to a person. BANNED_USERNAMES in
utils.py is the manual remedy.
Not prevented. Fitting the unsupervised track to its labels. That track is scored on every row, train and val included, and those labels are available from the original sources. The required method link is how a method's track is checked, by reading it, not enforced.
Out of scope. Training on the test proteins. The splits are public by design β you cannot predict for them otherwise β and PLUG's whole subject is what it costs when training data resembles test data. The method report link (required on every submission) and the proprietary-data flag are how that gets disclosed, not prevented.