Skip to content

Commit

Permalink
Fix documentation related to number of sockets (#63)
Browse files Browse the repository at this point in the history
* Fix documentation related to number of sockets

* Update src/deepsparse/engine.py

Co-authored-by: Michael Goin <[email protected]>

* Update src/deepsparse/engine.py

Co-authored-by: Michael Goin <[email protected]>

Co-authored-by: Michael Goin <[email protected]>
  • Loading branch information
bnellnm and mgoin authored Mar 22, 2021
1 parent 6d859fc commit ba45c3d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/source/debugging-optimizing/numactl-utility.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Given the architecture above, to run the DeepSparse Engine on the first four CPU

Appending `--preferred 1` is needed here since the DeepSparse Engine is being bound to CPUs on the second socket.

Note that using more than two sockets may not offer improvements over two sockets; if you have options, try different scenarios to see which setup is ideal for your use case. For batch size considerations, use an amount that is evenly divisible by the number of sockets you intend to use.
Note: When running on multiple sockets using a batch size that is evenly divisible by the number of sockets will yield the best performance.


## DeepSparse Engine and Thread Pinning
Expand Down
14 changes: 7 additions & 7 deletions src/deepsparse/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,6 @@ class Engine(object):
Note 1: Engines are compiled for a specific batch size and
for a specific number of CPU cores.
Note 2: multi socket support is not yet built in to the Engine,
all execution assumes single socket
| Example:
| # create an engine for batch size 1 on all available cores
| engine = Engine("path/to/onnx", batch_size=1, num_cores=None)
Expand Down Expand Up @@ -224,8 +221,7 @@ def num_cores(self) -> int:
@property
def num_sockets(self) -> int:
"""
:return: The number of sockets the engine is compiled to run on;
only current support is 1
:return: The number of sockets the engine is compiled to run on
"""
return self._num_sockets

Expand Down Expand Up @@ -501,8 +497,8 @@ def compile_model(
"""
Convenience function to compile a model in the DeepSparse Engine
from an ONNX file for inference.
Gives defaults of batch_size == 1 and num_cores == None
(will use all physical cores available on a single socket).
Gives defaults of batch_size == 1, num_cores == None and num_sockets = None
(will use all physical cores available on all available sockets).
:param model: Either a path to the model's onnx file, a SparseZoo model stub
prefixed by 'zoo:', a SparseZoo Model object, or a SparseZoo ONNX File
Expand Down Expand Up @@ -537,6 +533,8 @@ def benchmark_model(
Gives defaults of batch_size == 1 and num_cores == None
(will use all physical cores available on a single socket).
Note 1: Benchmarking is currently only supported on a single socket.
:param model: Either a path to the model's onnx file, a SparseZoo model stub
prefixed by 'zoo:', a SparseZoo Model object, or a SparseZoo ONNX File
object that defines the neural network
Expand Down Expand Up @@ -592,6 +590,8 @@ def analyze_model(
Gives defaults of batch_size == 1 and num_cores == None
(will use all physical cores available on a single socket).
Note 1: Analysis is currently only supported on a single socket.
:param model: Either a path to the model's onnx file, a SparseZoo model stub
prefixed by 'zoo:', a SparseZoo Model object, or a SparseZoo ONNX File
object that defines the neural network graph definition to analyze
Expand Down

0 comments on commit ba45c3d

Please sign in to comment.