Skip to content

Commit 5596477

Browse files
authored
Update hardware flavors with HF Hub (#3965)
* Update hardware flavors with HF Hub * Update docs * Apply cursor suggests * Let's not break things * Remove inconsistent casing for A100 constants Removed backward-compatible constants with inconsistent casing.
1 parent 63cc929 commit 5596477

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

docs/source/en/package_reference/cli.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2159,7 +2159,7 @@ $ hf jobs run [OPTIONS] IMAGE COMMAND...
21592159
* `-l, --label TEXT`: Set labels. E.g. --label KEY=VALUE or --label LABEL
21602160
* `--env-file TEXT`: Read in a file of environment variables.
21612161
* `--secrets-file TEXT`: Read in a file of secret environment variables.
2162-
* `--flavor [cpu-basic|cpu-upgrade|cpu-xl|zero-a10g|t4-small|t4-medium|l4x1|l4x4|l40sx1|l40sx4|l40sx8|a10g-small|a10g-large|a10g-largex2|a10g-largex4|a100-large|a100x4|a100x8]`: Flavor for the hardware, as in HF Spaces. Run 'hf jobs hardware' to list available flavors. Defaults to `cpu-basic`.
2162+
* `--flavor [cpu-basic|cpu-upgrade|cpu-performance|cpu-xl|sprx8|zero-a10g|t4-small|t4-medium|l4x1|l4x4|l40sx1|l40sx4|l40sx8|a10g-small|a10g-large|a10g-largex2|a10g-largex4|a100-large|a100x4|a100x8|h200|h200x2|h200x4|h200x8|inf2x6]`: Flavor for the hardware, as in HF Spaces. Run 'hf jobs hardware' to list available flavors. Defaults to `cpu-basic`.
21632163
* `--timeout TEXT`: Max duration: int/float with s (seconds, default), m (minutes), h (hours) or d (days).
21642164
* `-d, --detach`: Run the Job in the background and print the Job ID.
21652165
* `--namespace TEXT`: The namespace where the job will be running. Defaults to the current user's namespace.
@@ -2337,7 +2337,7 @@ $ hf jobs scheduled run [OPTIONS] SCHEDULE IMAGE COMMAND...
23372337
* `-l, --label TEXT`: Set labels. E.g. --label KEY=VALUE or --label LABEL
23382338
* `--env-file TEXT`: Read in a file of environment variables.
23392339
* `--secrets-file TEXT`: Read in a file of secret environment variables.
2340-
* `--flavor [cpu-basic|cpu-upgrade|cpu-xl|zero-a10g|t4-small|t4-medium|l4x1|l4x4|l40sx1|l40sx4|l40sx8|a10g-small|a10g-large|a10g-largex2|a10g-largex4|a100-large|a100x4|a100x8]`: Flavor for the hardware, as in HF Spaces. Run 'hf jobs hardware' to list available flavors. Defaults to `cpu-basic`.
2340+
* `--flavor [cpu-basic|cpu-upgrade|cpu-performance|cpu-xl|sprx8|zero-a10g|t4-small|t4-medium|l4x1|l4x4|l40sx1|l40sx4|l40sx8|a10g-small|a10g-large|a10g-largex2|a10g-largex4|a100-large|a100x4|a100x8|h200|h200x2|h200x4|h200x8|inf2x6]`: Flavor for the hardware, as in HF Spaces. Run 'hf jobs hardware' to list available flavors. Defaults to `cpu-basic`.
23412341
* `--timeout TEXT`: Max duration: int/float with s (seconds, default), m (minutes), h (hours) or d (days).
23422342
* `--namespace TEXT`: The namespace where the job will be running. Defaults to the current user's namespace.
23432343
* `--token TEXT`: A User Access Token generated from https://huggingface.co/settings/tokens.
@@ -2418,7 +2418,7 @@ $ hf jobs scheduled uv run [OPTIONS] SCHEDULE SCRIPT [SCRIPT_ARGS]...
24182418
* `--suspend / --no-suspend`: Suspend (pause) the scheduled Job
24192419
* `--concurrency / --no-concurrency`: Allow multiple instances of this Job to run concurrently
24202420
* `--image TEXT`: Use a custom Docker image with `uv` installed.
2421-
* `--flavor [cpu-basic|cpu-upgrade|cpu-xl|zero-a10g|t4-small|t4-medium|l4x1|l4x4|l40sx1|l40sx4|l40sx8|a10g-small|a10g-large|a10g-largex2|a10g-largex4|a100-large|a100x4|a100x8]`: Flavor for the hardware, as in HF Spaces. Run 'hf jobs hardware' to list available flavors. Defaults to `cpu-basic`.
2421+
* `--flavor [cpu-basic|cpu-upgrade|cpu-performance|cpu-xl|sprx8|zero-a10g|t4-small|t4-medium|l4x1|l4x4|l40sx1|l40sx4|l40sx8|a10g-small|a10g-large|a10g-largex2|a10g-largex4|a100-large|a100x4|a100x8|h200|h200x2|h200x4|h200x8|inf2x6]`: Flavor for the hardware, as in HF Spaces. Run 'hf jobs hardware' to list available flavors. Defaults to `cpu-basic`.
24222422
* `-e, --env TEXT`: Set environment variables. E.g. --env ENV=value
24232423
* `-s, --secrets TEXT`: Set secret environment variables. E.g. --secrets SECRET=value or `--secrets HF_TOKEN` to pass your Hugging Face token.
24242424
* `-l, --label TEXT`: Set labels. E.g. --label KEY=VALUE or --label LABEL
@@ -2504,7 +2504,7 @@ $ hf jobs uv run [OPTIONS] SCRIPT [SCRIPT_ARGS]...
25042504
**Options**:
25052505

25062506
* `--image TEXT`: Use a custom Docker image with `uv` installed.
2507-
* `--flavor [cpu-basic|cpu-upgrade|cpu-xl|zero-a10g|t4-small|t4-medium|l4x1|l4x4|l40sx1|l40sx4|l40sx8|a10g-small|a10g-large|a10g-largex2|a10g-largex4|a100-large|a100x4|a100x8]`: Flavor for the hardware, as in HF Spaces. Run 'hf jobs hardware' to list available flavors. Defaults to `cpu-basic`.
2507+
* `--flavor [cpu-basic|cpu-upgrade|cpu-performance|cpu-xl|sprx8|zero-a10g|t4-small|t4-medium|l4x1|l4x4|l40sx1|l40sx4|l40sx8|a10g-small|a10g-large|a10g-largex2|a10g-largex4|a100-large|a100x4|a100x8|h200|h200x2|h200x4|h200x8|inf2x6]`: Flavor for the hardware, as in HF Spaces. Run 'hf jobs hardware' to list available flavors. Defaults to `cpu-basic`.
25082508
* `-e, --env TEXT`: Set environment variables. E.g. --env ENV=value
25092509
* `-s, --secrets TEXT`: Set secret environment variables. E.g. --secrets SECRET=value or `--secrets HF_TOKEN` to pass your Hugging Face token.
25102510
* `-l, --label TEXT`: Set labels. E.g. --label KEY=VALUE or --label LABEL

src/huggingface_hub/_space_api.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ class SpaceHardware(str, Enum):
6262
# CPU
6363
CPU_BASIC = "cpu-basic"
6464
CPU_UPGRADE = "cpu-upgrade"
65+
CPU_PERFORMANCE = "cpu-performance"
6566
CPU_XL = "cpu-xl"
67+
SPRX8 = "sprx8"
6668

6769
# ZeroGPU
6870
ZERO_A10G = "zero-a10g"
@@ -80,8 +82,15 @@ class SpaceHardware(str, Enum):
8082
A10G_LARGEX2 = "a10g-largex2"
8183
A10G_LARGEX4 = "a10g-largex4"
8284
A100_LARGE = "a100-large"
83-
A100x4 = "a100x4"
84-
A100x8 = "a100x8"
85+
A100X4 = "a100x4"
86+
A100X8 = "a100x8"
87+
H200 = "h200"
88+
H200X2 = "h200x2"
89+
H200X4 = "h200x4"
90+
H200X8 = "h200x8"
91+
92+
# Neuron
93+
INF2X6 = "inf2x6"
8594

8695

8796
class SpaceStorage(str, Enum):

0 commit comments

Comments
 (0)