Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Dokcerfile.cpp and documentation #3015

Merged
merged 6 commits into from
Mar 12, 2024
Merged

Conversation

namannandan
Copy link
Collaborator

@namannandan namannandan commented Mar 12, 2024

Description

Address follow up review comments on: #2976

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Feature/Issue validation/testing

  • Manual test
$ ./build_image.sh -g -bt dev -cv cu118 -cpp

$ docker images
REPOSITORY           TAG                               IMAGE ID       CREATED          SIZE
pytorch/torchserve   cpp-dev-gpu                       01f3de83e243   38 minutes ago   10.4GB

$ docker run --gpus all -it 01f3de83e243 /bin/bash

root@ddffb9dd9111:/serve# python ts_scripts/install_dependencies.py --environment=dev --cuda=cu118 --cpp

root@ddffb9dd9111:/serve# gcc --version
gcc (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

root@ddffb9dd9111:/serve# cmake --version
cmake version 3.26.4

CMake suite maintained and supported by Kitware (kitware.com/cmake).

root@ddffb9dd9111:/serve# cd cpp
root@ddffb9dd9111:/serve/cpp# ./build.sh
root@ddffb9dd9111:/serve# cd ..

root@ddffb9dd9111:/serve# export LD_LIBRARY_PATH=`python -c "import torch;from pathlib import Path;p=Path(torch.__file__);print(f\"{(p.parent / 'lib').as_posix()}:{(p.parents[1] / 'nvidia/nccl/lib').as_posix()}\")"`:$LD_LIBRARY_PATH
root@ddffb9dd9111:/serve# mkdir model_store
root@ddffb9dd9111:/serve# torchserve --ncs --start --model-store ./model_store --models mnist=/serve/cpp/_build/test/resources/examples/mnist/mnist_handler/
root@ddffb9dd9111:/serve# curl http://127.0.0.1:8080/predictions/mnist -T /serve/cpp/_build/test/resources/examples/mnist/0_png.pt --output out.pt
root@ddffb9dd9111:/serve# python -c "import torch; print(torch.load('out.pt'))"
tensor(0, device='cuda:0')

@namannandan namannandan requested review from lxning and mreso and removed request for lxning March 12, 2024 18:28
cpp/README.md Show resolved Hide resolved
@namannandan namannandan requested a review from lxning March 12, 2024 21:48
@namannandan namannandan added this pull request to the merge queue Mar 12, 2024
Merged via the queue into master with commit 9a27a63 Mar 12, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants