1
- # SparseML docker image
1
+ # SparseML Docker Image
2
2
This directory contains the Dockerfile to create a minimal SparseML docker image.
3
3
4
4
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.
11
11
You can access the already built image detailed at https://github.com/orgs/neuralmagic/packages/container/package/sparseml :
12
12
13
13
``` 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
16
16
```
17
17
18
18
## Extend
19
19
If you would like to customize the docker image, you can use the pre-built images as a base in your own ` Dockerfile ` :
20
20
21
21
``` Dockerfile
22
- from ghcr.io/neuralmagic/sparseml:1.0.1-ubuntu18.04-cu11.1
22
+ from ghcr.io/neuralmagic/sparseml:1.4.4-cu111
23
23
24
24
...
25
25
```
26
26
27
27
## 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 `
31
29
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 .
35
33
```
36
34
37
35
## Run
@@ -45,29 +43,30 @@ Note: RuntimeError: DataLoader worker (pid 1388) is killed by signal: Bus error.
45
43
46
44
### Example 1: Image Classification Pipeline:
47
45
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
+ ```
58
57
59
58
### Example 2: Transformers Question Answering Pipeline:
60
59
61
- ``` python
60
+ ``` bash
62
61
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
71
70
```
72
71
73
72
Note:
0 commit comments