Skip to content
This repository was archived by the owner on Jun 3, 2025. It is now read-only.

Commit e97b806

Browse files
mwitiderrickmgoinrahul-tuli
authored
Update SparseML Docker README.md (#1543)
* Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md * Update docker/README.md Co-authored-by: Rahul Tuli <rahul@neuralmagic.com> --------- Co-authored-by: Michael Goin <michael@neuralmagic.com> Co-authored-by: Rahul Tuli <rahul@neuralmagic.com>
1 parent 8341aac commit e97b806

File tree

1 file changed

+28
-29
lines changed

1 file changed

+28
-29
lines changed

docker/README.md

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SparseML docker image
1+
# SparseML Docker Image
22
This directory contains the Dockerfile to create a minimal SparseML docker image.
33

44
The included `Dockerfile` builds an image on top of the official NVIDIA development Ubuntu 18.04.5 LTS
@@ -11,27 +11,25 @@ This `Dockerfile` is tested on the Ubuntu 20.04.2 LTS with CUDA Version: 11.4.
1111
You can access the already built image detailed at https://github.com/orgs/neuralmagic/packages/container/package/sparseml:
1212

1313
```bash
14-
docker pull ghcr.io/neuralmagic/sparseml:1.0.1-ubuntu18.04-cu11.1
15-
docker tag ghcr.io/neuralmagic/sparseml:1.0.1-ubuntu18.04-cu11.1 sparseml_docker
14+
docker pull ghcr.io/neuralmagic/sparseml:1.4.4-cu111
15+
docker tag ghcr.io/neuralmagic/sparseml:1.4.4-cu111 sparseml_docker
1616
```
1717

1818
## Extend
1919
If you would like to customize the docker image, you can use the pre-built images as a base in your own `Dockerfile`:
2020

2121
```Dockerfile
22-
from ghcr.io/neuralmagic/sparseml:1.0.1-ubuntu18.04-cu11.1
22+
from ghcr.io/neuralmagic/sparseml:1.4.4-cu111
2323

2424
...
2525
```
2626

2727
## Build
28-
To build and launch this image with the tag `sparseml_docker`, run from the root directory:
29-
- for compute platform CUDA 10.2: `docker build --build-arg CUDA_VERSION=10.2 -t sparseml_docker .`
30-
- for compute platform CUDA 11.1: `docker build --build-arg CUDA_VERSION=11.1 -t sparseml_docker .`
28+
To build and launch this image with the tag `sparseml_docker`, run from the root directory: `docker build -t sparseml_docker`
3129

32-
If you want to use a specific branch from sparseml you can use the `GIT_CHECKOUT` build arg:
33-
```
34-
docker build --build-arg CUDA_VERSION=11.1 --build-arg GIT_CHECKOUT=main -t sparseml_nightly .`
30+
If you want to use a specific branch from sparseml you can use the `BRANCH` build arg:
31+
```bash
32+
docker build --build-arg BRANCH=main -t sparseml_docker .
3533
```
3634

3735
## Run
@@ -45,29 +43,30 @@ Note: RuntimeError: DataLoader worker (pid 1388) is killed by signal: Bus error.
4543

4644
### Example 1: Image Classification Pipeline:
4745

48-
```
49-
sparseml.image_classification.train \
50-
--recipe-path zoo:cv/classification/resnet_v1-50/pytorch/sparseml/imagenet/pruned85_quant-none-vnni \
51-
--arch-key resnet50 \
52-
--pretrained pruned-moderate \
53-
--dataset imagenette \
54-
--dataset-path dataset \
55-
--train-batch-size 4 \
56-
--test-batch-size 8
57-
```
46+
Download a subset of the ImageNet dataset and use it to train a ResNet-50 model.
47+
```bash
48+
curl https://s3.amazonaws.com/fast-ai-imageclas/imagenette2-320.tgz --output imagenette2-320.tgz
49+
tar -xvf imagenette2-320.tgz
50+
sparseml.image_classification.train \
51+
--recipe zoo:cv/classification/resnet_v1-50/pytorch/sparseml/imagenet/pruned95_quant-none?recipe_type=transfer-classification \
52+
--checkpoint-path zoo:cv/classification/resnet_v1-50/pytorch/sparseml/imagenet/pruned95_quant-none?recipe_type=transfer-classification \
53+
--arch-key resnet50 \
54+
--dataset-path ./imagenette2-320 \
55+
--batch-size 32
56+
```
5857

5958
### Example 2: Transformers Question Answering Pipeline:
6059

61-
```python
60+
```bash
6261
sparseml.transformers.question_answering \
63-
--model_name_or_path bert-base-uncased \
64-
--dataset_name squad \
65-
--do_train \
66-
--do_eval \
67-
--output_dir './output' \
68-
--cache_dir cache \
69-
--distill_teacher disable \
70-
--recipe zoo:nlp/question_answering/bert-base/pytorch/huggingface/squad/pruned-aggressive_98
62+
--model_name_or_path bert-base-uncased \
63+
--dataset_name squad \
64+
--do_train \
65+
--do_eval \
66+
--output_dir './output' \
67+
--cache_dir cache \
68+
--distill_teacher disable \
69+
--recipe zoo:nlp/question_answering/bert-base/pytorch/huggingface/squad/pruned-aggressive_98
7170
```
7271

7372
Note:

0 commit comments

Comments
 (0)