Skip to content

Commit 92b1e87

Browse files
mresoagunapal
andauthored
Update cpp/README.md (#2980)
* Update cpp/README.md * Fix spell check --------- Co-authored-by: Ankith Gunapal <[email protected]>
1 parent c207cd2 commit 92b1e87

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

cpp/README.md

+30
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,16 @@ cd cpp
2020
cd ..
2121
python ts_scripts/install_from_src.py
2222
```
23+
### Set Environment Var
24+
#### On Mac
25+
```
26+
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$(pwd)/_build/_deps/libtorch/lib
27+
```
28+
#### On Ubuntu
29+
```
30+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(pwd)/_build/_deps/libtorch/lib
31+
```
32+
2333
### Run TorchServe
2434
```
2535
mkdir model_store
@@ -67,3 +77,23 @@ This will make the TorchServe installation editable and the updated cpp backend
6777
```
6878
python ts_scripts/install_from_src.py --environment dev
6979
```
80+
81+
#### FAQs
82+
Q: After running ./build.sh TorchServe can not find model_worker_socket
83+
A:
84+
1. See if the binary `model_worker_socket` exists by running:
85+
```bash
86+
python -c "import ts; from pathlib import Path; print((Path(ts.__file__).parent / 'cpp/bin/model_worker_socket').exists())
87+
```
88+
2. Look if ./build.sh was actually successful and if the tests ran without any error at the end. If a test failed the binary will not be copied into the appropriate directory.
89+
3. Make sure you have the right conda/venv environment activated during building that you're also using to run TorchServe.
90+
91+
Q: Build on Mac fails with `Library not loaded: @rpath/libomp.dylib`
92+
A: Install libomp with brew and link in /usr/local/lib
93+
```bash
94+
brew install libomp
95+
sudo ln -s /opt/homebrew/opt/libomp/lib/libomp.dylib /usr/local/lib/libomp.dylib
96+
```
97+
98+
Q: When loading a handler which uses a model exported with torch._export.aot_compile the handler dies with "error: Error in dlopen: MODEL.SO : undefined symbol: SOME_SYMBOL".
99+
A: Make sure that you are using matching libtorch and Pytorch versions for inference and export, respectively.

ts_scripts/spellcheck_conf/wordlist.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1210,3 +1210,8 @@ fj
12101210
generateKeyFile
12111211
setTime
12121212
urlPattern
1213+
dlopen
1214+
dylib
1215+
libomp
1216+
rpath
1217+
venv

0 commit comments

Comments
 (0)