|
Download README.md from fastforks/starnet: direct link, hf CLI and curl.
- Browser
- Download file 7.83 kB
-
https://huggingface.co/fastforks/starnet/resolve/main/README.md
- Command line
-
hf download hf://fastforks/starnet/README.md
-
curl -L -o README.md https://huggingface.co/fastforks/starnet/resolve/main/README.md
7.83 kB
| library_name: "fastforks" | |
| pipeline_tag: "image-classification" | |
| license: "apache-2.0" | |
| tags: | |
| - "classification" | |
| - "image-classification" | |
| - "cuda" | |
| - "pytorch" | |
| - "fastforks" | |
| - "fastforks-card" | |
| # StarNet (fastforks) | |
| StarNet (Ma et al. 2024, Rewrite the Stars): a small convolutional classifier whose blocks multiply two branches element-wise (the star operation). | |
| This repo is the model card only: it holds no weights. fastforks downloads the authors' weights from the links below and checks them against the SHA-256 in the model card. Code: <https://github.com/kleinicke/fastforks>. Kernels for the `kernels` backend: <https://huggingface.co/fastforks/kernels>. Original code: <https://github.com/huggingface/pytorch-image-models> at `0df212b369a5`. | |
| Author weight repos: <https://huggingface.co/timm/starnet_s1.in1k>, <https://huggingface.co/timm/starnet_s2.in1k>, <https://huggingface.co/timm/starnet_s3.in1k>, <https://huggingface.co/timm/starnet_s4.in1k>. | |
| Task: classification. Tier: experimental. Outputs: `logits`. Backends: `portable`, `kernels`. | |
| Input: one RGB image. Output: ImageNet-1k class logits. | |
| ## Variants | |
| Weights are the authors' files (not hosted here). SHA-256 shortened to 12 hex digits; the full hashes are in [`card.toml`](https://github.com/kleinicke/fastforks/blob/main/src/fastforks/classification/models/starnet/card.toml). | |
| | variant | weights (author link) | SHA-256 | weights licence | commercial use | | |
| |---|---|---|---|---| | |
| | `starnet_s1.in1k@1` | [starnet_s1.in1k.safetensors](https://huggingface.co/timm/starnet_s1.in1k/resolve/e3fbe6d1e24b6293fa6e7b897f380bd62f77e01f/model.safetensors) | `314e10df155c` | Apache-2.0 | yes | | |
| | `starnet_s2.in1k@1` | [starnet_s2.in1k.safetensors](https://huggingface.co/timm/starnet_s2.in1k/resolve/7d4c84c067b9fea3fb81df22ea2cbb929dda37a0/model.safetensors) | `dc73c27d1b71` | Apache-2.0 | yes | | |
| | `starnet_s3.in1k@1` | [starnet_s3.in1k.safetensors](https://huggingface.co/timm/starnet_s3.in1k/resolve/07426414963bc86c5df39e253c3bbcb7935168cf/model.safetensors) | `7fbdee07ac6b` | Apache-2.0 | yes | | |
| | `starnet_s4.in1k@1` | [starnet_s4.in1k.safetensors](https://huggingface.co/timm/starnet_s4.in1k/resolve/58d1fd51e6737653446cef5ac3bc75328a88ef65/model.safetensors) | `6d75002d5e77` | Apache-2.0 | yes | | |
| ## Licence | |
| Original-code strings, recorded as they are (research-use package; check them before any other use). Code: Apache-2.0. | |
| Training data: ImageNet-1k (ILSVRC 2012 classification). | |
| Licence evidence: <https://huggingface.co/timm/starnet_s1.in1k/blob/e3fbe6d1e24b6293fa6e7b897f380bd62f77e01f/README.md> | |
| ## Input size | |
| fixed 224x224: the input is resized (short side 256) and centre-cropped to it | |
| Tested up to (portable, fp16, RTX 5060 Ti 16 GB): `starnet_s1.in1k` 224x224 (0.0 GiB peak allocated, 0.1 reserved); `starnet_s2.in1k` 224x224 (0.0 GiB peak allocated, 0.1 reserved); `starnet_s3.in1k` 224x224 (0.0 GiB peak allocated, 0.1 reserved); `starnet_s4.in1k` 224x224 (0.0 GiB peak allocated, 0.1 reserved) | |
| ## Speed and memory | |
| ### Classification, synthetic | |
| | model | input | time (ms): original fp32 | original | portable | kernels | kernels speed-up: vs original | vs portable | peak memory (MiB, allocated / reserved): original | portable | kernels | | |
| | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | |
| | `starnet_s1.in1k` | 224x224 | 4.57 | 7.29 | 3.88 | 0.683 | 6.7x | 5.7x | 51 / 60 | 41 / 52 | 41 / 56 | | |
| | `starnet_s2.in1k` | 224x224 | 3.64 | 5.63 | 3.02 | 0.578 | 6.3x | 5.2x | 55 / 64 | 43 / 54 | 43 / 58 | | |
| | `starnet_s3.in1k` | 224x224 | 4.96 | 7.67 | 4.19 | 0.715 | 6.9x | 5.9x | 67 / 76 | 47 / 60 | 47 / 64 | | |
| | `starnet_s4.in1k` | 224x224 | 6.84 | 11.3 | 5.63 | 0.912 | 7.5x | 6.2x | 77 / 86 | 50 / 66 | 51 / 72 | | |
| ### Startup and first call | |
| | model | load (s): original | portable | kernels | first call (s): original | portable | kernels | | |
| | --- | --- | --- | --- | --- | --- | --- | | |
| | `starnet_s1.in1k` | 0.18 | 1.60 | 2.20 | 0.26 | 0.24 | 0.21 | | |
| | `starnet_s2.in1k` | 0.17 | 1.62 | 1.86 | 0.02 | 0.24 | 0.06 | | |
| | `starnet_s3.in1k` | 0.30 | 1.60 | 1.82 | 0.01 | 0.24 | 0.05 | | |
| | `starnet_s4.in1k` | 0.21 | 1.66 | 2.00 | 0.01 | 0.24 | 0.05 | | |
| ### torch.compile and TensorRT | |
| | model | input | time: portable | compile | TensorRT fp16 | kernels | preparation: compile (cold first call) | ONNX + engine build | peak MiB (alloc / reserved): portable | compile | kernels | TensorRT (engine + torch) | | |
| | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | | |
| | `starnet_s1.in1k` | 224x224 | 3.88 ms | 2.41 ms | 0.774 ms | 0.683 ms | 6.23 s | 24.4 s | 41 / 52 | 73 / 92 | 41 / 56 | 73 / 86 | | |
| | `starnet_s2.in1k` | 224x224 | 3.02 ms | 1.96 ms | 0.622 ms | 0.578 ms | 5.71 s | 24.7 s | 43 / 54 | 75 / 94 | 43 / 58 | 74 / 88 | | |
| | `starnet_s3.in1k` | 224x224 | 4.19 ms | 2.60 ms | 0.878 ms | 0.715 ms | 6.03 s | 27.5 s | 47 / 60 | 79 / 100 | 47 / 64 | 80 / 96 | | |
| | `starnet_s4.in1k` | 224x224 | 5.63 ms | 3.37 ms | 1.18 ms | 0.912 ms | 6.84 s | 28.0 s | 50 / 66 | 82 / 106 | 51 / 72 | 85 / 104 | | |
| Fixed-size cells: time (ms) / peak allocated / peak reserved memory (MiB). | |
| Hardware, protocol and caveats: [benchmarks](https://github.com/kleinicke/fastforks/blob/main/docs/benchmarks.md) (RTX 5060 Ti 16 GB, sm_120). Original = the original code named above at the precision of portable (fp16, or `(fp32)` where fp16 is unsupported or not finite); original fp32 = its default fp32 run. Peak memory is the torch allocator's. | |
| ## Accuracy | |
| ### On public datasets | |
| fastforks: the model's own resize / crop on the GPU; original: the library's pretrained loader and its PIL eval transform. Original = the original code named under Details, same checkpoint and protocol. | |
| | variant | dataset | original fp32 | original fp16 | portable | kernels | note | | |
| |---|---|---|---|---|---|---| | |
| | `starnet_s1.in1k` | ImageNet-1k val, 5000 random images, top-1 / top-5 % | 74.50 / 91.94 | 74.50 / 91.96 | 74.48 / 91.92 | 74.52 / 91.92 | | | |
| | `starnet_s2.in1k` | ImageNet-1k val, 5000 random images, top-1 / top-5 % | 75.82 / 92.14 | 75.84 / 92.12 | 75.84 / 92.10 | 75.88 / 92.12 | | | |
| | `starnet_s3.in1k` | ImageNet-1k val, 5000 random images, top-1 / top-5 % | 78.08 / 93.72 | 78.14 / 93.74 | 78.10 / 93.80 | 78.06 / 93.80 | | | |
| | `starnet_s4.in1k` | ImageNet-1k val, 5000 random images, top-1 / top-5 % | 80.08 / 94.56 | 80.06 / 94.56 | 79.98 / 94.58 | 79.92 / 94.58 | | | |
| Measured on NVIDIA GeForce RTX 5060 Ti, torch 2.14.1+cu130, fastforks 9e68b313, 2026-11-11. | |
| ### Parity with the original code | |
| Every variant is checked against reference outputs of the original code at its pinned commit. CPU, float32: max |diff| <= 1.1e-05 vs the original. GPU, float16 (the default), portable and kernels: mean |diff| <= 0.0035 and p99 <= 0.012 (absolute error of the output `logits`). | |
| ## Usage | |
| ```python | |
| from fastforks import classification | |
| model = classification.load("starnet_s1.in1k") # mode="auto": the preferred backend from recorded measurements | |
| result = model("photo.jpg") | |
| result.top(5) # top-5 classes | |
| result.backend # what ran, e.g. Backend(mode='portable', device='cuda:0', dtype='float16') | |
| ``` | |
| Install with `pip install fastforks` (see <https://github.com/kleinicke/fastforks>). Other variants: `starnet_s1.in1k`, `starnet_s2.in1k`, `starnet_s3.in1k`, `starnet_s4.in1k`. | |
| ## Kernels backend | |
| `classification.load("starnet_s1.in1k", mode="kernels")` runs our CUDA kernels (`cudnn_hacc`, `fvm_conv`, `fvm_extra`, `fvm_mb`, `fvm_r3`). It needs a prebuilt kernel for your GPU architecture (downloaded from <https://huggingface.co/fastforks/kernels> on first use) and a recent NVIDIA driver; if there is none it raises `BackendUnavailableError` with the reason and never falls back silently. `mode="auto"` picks `kernels` when it can run and logs the choice. | |
| <!-- staged from fastforks 1cbf1671 (2026-11-15) --> | |