Skip to content

Commit 1da576b

Browse files
authored
Merge branch 'main' into rs/docs-update-use-cases
2 parents 46fd24c + 8423c8d commit 1da576b

38 files changed

+1006
-173
lines changed

DEVELOPING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ limitations under the License.
1616

1717
# Developing the DeepSparse Engine
1818

19-
The DeepSparse Python API is developed and tested using Python 3.6-3.10.
19+
The DeepSparse Python API is developed and tested using Python 3.7-3.10.
2020
To develop the Python API, you will also need the development dependencies and to follow the styling guidelines.
2121

2222
Here's some details to get started.

README.md

+11-5
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717

1818
<div style="display: flex; flex-direction: column; align-items: center;">
1919
<h1>
20-
<img alt="tool icon" src="https://raw.githubusercontent.com/neuralmagic/deepsparse/main/docs/source/icon-deepsparse.png" />
20+
<img alt="tool icon" src="https://raw.githubusercontent.com/neuralmagic/deepsparse/main/docs/old/source/icon-deepsparse.png" />
2121
&nbsp;&nbsp;DeepSparse
2222
</h1>
2323
<h4> An inference runtime offering GPU-class performance on CPUs and APIs to integrate ML into your application</h4>
@@ -56,10 +56,16 @@ limitations under the License.
5656
[DeepSparse](https://github.com/neuralmagic/deepsparse) is a CPU inference runtime that takes advantage of sparsity within neural networks to execute inference quickly. Coupled with [SparseML](https://github.com/neuralmagic/sparseml), an open-source optimization library, DeepSparse enables you to achieve GPU-class performance on commodity hardware.
5757

5858
<p align="center">
59-
<img alt="NM Flow" src="https://github.com/neuralmagic/deepsparse/tree/main/docs/neural-magic-workflow.png" width="60%" />
59+
<img alt="NM Flow" src="https://github.com/neuralmagic/deepsparse/blob/7ee5e60f13b1fd321c5282c91e2873b3363ec911/docs/neural-magic-workflow.png" width="60%" />
6060
</p>
6161

62-
For details of training a sparse model for deployment with DeepSparse, [check out SparseML](https://github.com/neuralmagic/sparseml).
62+
For details of training sparse models for deployment with DeepSparse, [check out SparseML](https://github.com/neuralmagic/sparseml).
63+
64+
### ✨NEW✨ DeepSparse ARM Alpha 💪
65+
66+
Neural Magic is bringing performant deep learning inference to ARM CPUs! In our recent product release, we launched alpha support for DeepSparse on AWS Graviton and Ampere. We are working towards a general release across ARM server, embedded, and mobile platforms in 2023.
67+
68+
**If you would like to trial the alpha or want early access to the general release, [sign up for the waitlist](https://neuralmagic.com/deepsparse-arm-waitlist/).**
6369

6470
## Installation
6571

@@ -212,13 +218,13 @@ DeepSparse offers different inference scenarios based on your use case.
212218

213219
**Single-stream** scheduling: the latency/synchronous scenario, requests execute serially. [`default`]
214220

215-
<img src="https://raw.githubusercontent.com/neuralmagic/deepsparse/main/docs/source/single-stream.png" alt="single stream diagram" />
221+
<img src="https://raw.githubusercontent.com/neuralmagic/deepsparse/main/docs/old/source/single-stream.png" alt="single stream diagram" />
216222

217223
It's highly optimized for minimum per-request latency, using all of the system's resources provided to it on every request it gets.
218224

219225
**Multi-stream** scheduling: the throughput/asynchronous scenario, requests execute in parallel.
220226

221-
<img src="https://raw.githubusercontent.com/neuralmagic/deepsparse/main/docs/source/multi-stream.png" alt="multi stream diagram" />
227+
<img src="https://raw.githubusercontent.com/neuralmagic/deepsparse/main/docs/old/source/multi-stream.png" alt="multi stream diagram" />
222228

223229
The most common use cases for the multi-stream scheduler are where parallelism is low with respect to core count, and where requests need to be made asynchronously without time to batch them.
224230

docker/Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,13 @@ COPY --from=build $VENV $VENV
113113
COPY --from=build deepsparse deepsparse
114114
ENV PATH="${VENV}/bin:$PATH"
115115
HEALTHCHECK CMD python -c 'import deepsparse'
116-
ENTRYPOINT bash
116+
CMD bash
117117

118118

119119
FROM base as prod
120120
ARG VENV
121121
COPY --from=build $VENV $VENV
122122
ENV PATH="${VENV}/bin:$PATH"
123123
HEALTHCHECK CMD python -c 'import deepsparse'
124-
ENTRYPOINT bash
124+
CMD bash
125125

docker/README.md

+8-13
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ This image is based off the latest official Python:3.8.16 image
77
You can access the already built image detailed at https://github.com/orgs/neuralmagic/packages/container/package/deepsparse:
88

99
```bash
10-
docker pull ghcr.io/neuralmagic/deepsparse:1.4
11-
docker tag ghcr.io/neuralmagic/deepsparse:1.4 deepsparse_docker
10+
docker pull ghcr.io/neuralmagic/deepsparse:1.4.2
11+
docker tag ghcr.io/neuralmagic/deepsparse:1.4.2 deepsparse_docker
1212
```
1313

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

1717
```Dockerfile
18-
FROM ghcr.io/neuralmagic/deepsparse:1.4
18+
FROM ghcr.io/neuralmagic/deepsparse:1.4.2
1919
...
2020
```
2121

@@ -34,15 +34,10 @@ docker build --build-arg BRANCH=main -t deepsparse_docker .
3434
We also provide the following pre-built images with all integration specific
3535
dependencies installed:
3636

37-
| Image Name | Description |
38-
|--------------------------- |------------------------------------------------------------------------ |
39-
| deepsparse-base | Base DeepSparse image with no integration specific dependencies |
40-
| deepsparse/deepsparse-all | DeepSparse image with all major integration dependencies installed |
41-
| deepsparse-server | DeepSparse image with `[server]` dependencies installed |
42-
| deepsparse-transformers | DeepSparse image with all transformer dependencies installed |
43-
| deepsparse-torchvision | DeepSparse image with torchvision dependencies installed |
44-
| deepsparse-ultralytics | DeepSparse image with yolov5 and yolov8 dependencies installed |
45-
37+
| Image Name | Description |
38+
|-------------------|----------------------------------------------------------------------|
39+
| deepsparse-base | Base DeepSparse image with no integration specific dependencies |
40+
| deepsparse | DeepSparse image with all major integration dependencies installed |
4641

4742
To build a development image for a specific branch use the following command:
4843

@@ -57,4 +52,4 @@ To run the container:
5752

5853
```bash
5954
docker container run -it deepsparse_docker
60-
```
55+
```

docs/use-cases/cv/embedding-extraction.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ print(len(result["embeddings"][0][0]))
106106

107107
### Cross Use Case Functionality
108108
Check out the [Server User Guide](../../user-guide/deepsparse-server.md) for more details on configuring the Server.
109+
109110
## Using a Custom ONNX File
110111
Apart from using models from the SparseZoo, DeepSparse allows you to define custom ONNX files for embedding extraction.
111112

@@ -132,4 +133,4 @@ rn50_embedding_pipeline = Pipeline.create(
132133
embedding = rn50_embedding_pipeline(images="lion.jpeg")
133134
print(len(embedding.embeddings[0][0]))
134135
# 2048
135-
```
136+
```

docs/use-cases/cv/image-classification.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,4 +284,4 @@ pipeline = Pipeline.create(
284284
prediction = pipeline(images=["lion.jpeg"])
285285
print(prediction.labels)
286286
# [291]
287-
```
287+
```

docs/use-cases/cv/image-segmentation-yolact.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -252,4 +252,4 @@ predictions = yolact_pipeline(images=images)
252252
# predictions has attributes `boxes`, `classes`, `masks` and `scores`
253253
predictions.classes[0]
254254
# [20,20, .......0, 0,24]
255-
```
255+
```

docs/use-cases/cv/object-detection-yolov5.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,6 @@ print(labels)
282282
# [['person', 'person', 'car', 'person', 'motorcycle', 'person', 'person', 'person', 'motorcycle', 'person']]
283283
```
284284

285-
286285
### Cross Use Case Functionality
287286

288287
Check out the [Server User Guide](../../user-guide/deepsparse-server.md) for more details on configuring a Server.
@@ -321,4 +320,4 @@ print(pipeline_outputs.boxes)
321320
print(pipeline_outputs.labels)
322321
# [[[-0.8809833526611328, 5.1244752407073975, 27.885415077209473, 57.20366072654724], [-9.014896631240845, -2.4366320967674255, 21.488688468933105, 37.2245477437973], [14.241515636444092, 11.096746131777763, 30.164274215698242, 22.02291651070118], [7.107024908065796, 5.017698150128126, 15.09239387512207, 10.45704211294651]]]
323322
# [['8367.0', '1274.0', '8192.0', '6344.0']]
324-
```
323+
```

docs/use-cases/nlp/question-answering.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -318,4 +318,4 @@ question = "What is DeepSparse?"
318318
output = qa_pipeline(question=question, context=q_context)
319319
print(output.answer)
320320
# sparsity-aware
321-
```
321+
```

docs/use-cases/nlp/text-classification.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -439,4 +439,4 @@ sequences = ["I think DeepSparse Pipelines are awesome!"]
439439
prediction = pipeline(sequences)
440440
print(prediction)
441441
# labels=['LABEL_1'] scores=[0.9996163845062256]
442-
```
442+
```

docs/use-cases/nlp/token-classification.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,7 @@ print(resp.text)
273273
### Cross Use Case Functionality
274274

275275
Check out the [Server User Guide](../../user-guide/deepsparse-server.md) for more details on configuring the Server.
276+
276277
## Using a Custom ONNX File
277278
Apart from using models from the SparseZoo, DeepSparse allows you to deploy token classification pipelines with custom ONNX files.
278279

@@ -300,4 +301,4 @@ pipeline = Pipeline.create(
300301
output = pipeline("Mary is flying from Nairobi to New York")
301302
print(output.predictions)
302303
# [[TokenClassificationResult(entity='B-PER', score=0.9971914291381836, word='mary', start=0, end=4, index=1, is_grouped=False), TokenClassificationResult(entity='B-LOC', score=0.9993892312049866, word='nairobi', start=20, end=27, index=5, is_grouped=False), TokenClassificationResult(entity='B-LOC', score=0.9993736147880554, word='new', start=31, end=34, index=7, is_grouped=False), TokenClassificationResult(entity='I-LOC', score=0.997299075126648, word='york', start=35, end=39, index=8, is_grouped=False)]]
303-
```
304+
```

docs/use-cases/nlp/transformers-embedding-extraction.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ print(len(result["embeddings"][0]))
209209
### Cross Use Case Functionality
210210

211211
Check out the [Server User Guide](../../user-guide/deepsparse-server.md) for more details on configuring the Server.
212+
212213
## Using a Custom ONNX File
213214
Apart from using models from the SparseZoo, DeepSparse allows you to deploy transformer embedding extraction pipelines with custom ONNX files.
214215

@@ -241,4 +242,4 @@ input_sequence = "The generalized embedding extraction Pipeline is the best!"
241242
embedding = bert_emb_pipeline(input_sequence)
242243
print(len(embedding.embeddings[0]))
243244
# 98304
244-
```
245+
```

docs/use-cases/nlp/zero-shot-text-classification.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,4 +284,4 @@ pipeline = Pipeline.create(
284284
prediction = pipeline("Who are you voting for in the upcoming election")
285285
print(prediction)
286286
# sequences='Who are you voting for in the upcoming election' labels=['sports', 'poltics', 'public health'] scores=[0.35093653202056885, 0.3335352838039398, 0.31552815437316895]
287-
```
287+
```

examples/aws-lambda/README.md

-76
This file was deleted.

0 commit comments

Comments
 (0)