Skip to content

pagezyhf/aws-instance-requirements

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aws-instance-requirements

Daily automation to recommend AWS SageMaker GPU instance types for popular Hugging Face models and update the amazon-sagemaker/repository-metadata dataset (modal.json).

What it does

  • Uses the Hugging Face Hub CLI (hf) to fetch the top 100 models by:
    • likes
    • downloads
    • trending_score
  • Computes the union of these lists (up to 300 unique models/day).
  • Downloads the current dataset config (modal.json) from amazon-sagemaker/repository-metadata.
  • For models not present in modal.json, runs hf-mem to estimate memory requirements.
  • Picks the cheapest allowed SageMaker instance that should not OOM using aggregate GPU VRAM.
  • The set of “allowed” instances is defined by config/instance_catalog.json. For now we only consider the G5, G6, G6e, P4 (p4d/p4de), and P5 (p5/p5e) families.
  • Appends a new entry with:
    • id
    • instanceType
    • numGpu (all GPUs on that instance)
    • containerStartupHealthCheckTimeout (hardcoded per instance type)

Repo layout

  • scripts/sync_modal.py: main entrypoint (discover → diff → hf-mem → map → update → upload/PR)
  • scripts/hf_mem.py: runs uvx hf-mem and parses output
  • scripts/instance_selection.py: instance catalog loading and cheapest-instance selection logic
  • scripts/modal_io.py: reads/writes modal.json config format
  • config/instance_catalog.json: instance allowlist, VRAM, GPU counts, timeouts, and pricing
  • .github/workflows/daily-sync.yml: scheduled GitHub Actions workflow

Running locally

Prereqs:

  • Python 3.10+
  • uv installed (so uvx hf-mem ... works)
  • Hugging Face CLI available via pip install -U huggingface_hub (provides the hf command)

Auth (needed for gated models + dataset PRs):

export HF_TOKEN="hf_..."
hf auth login --token "$HF_TOKEN"

Dry-run (no upload):

python scripts/sync_modal.py --dry-run

Write + open PR on the dataset:

python scripts/sync_modal.py --write --create-pr

GitHub Actions

Set a repository secret named HF_TOKEN with write access to the dataset.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages