Skip to content

Commit 9bcbd22

Browse files
jakki-amdeppaneamdsmedegaardsamutamm
authored
740 add generic support for different gpu hardware (#3371)
* Add AMD backend support * Add AMD frontend support * Add Dockerfile.rocm Co-authored-by: Samu Tamminen <[email protected]> * Add AMD documentation * Fix null pointer bug with populateAccelerators trying to get null AppleUtil GPU env value * Fix formatting --------- Co-authored-by: Rony Leppänen <[email protected]> Co-authored-by: Anders Smedegaard Pedersen <[email protected]> Co-authored-by: Samu Tamminen <[email protected]>
1 parent 0985386 commit 9bcbd22

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2609
-365
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -46,3 +46,9 @@ instances.yaml.backup
4646
# cpp
4747
cpp/_build
4848
cpp/third-party
49+
50+
# projects
51+
.tool-versions
52+
**/*/.classpath
53+
**/*/.settings
54+
**/*/.project

CONTRIBUTING.md

+18-25
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,7 @@ Your contributions will fall into two categories:
1111
- Search for your issue here: https://github.com/pytorch/serve/issues (look for the "good first issue" tag if you're a first time contributor)
1212
- Pick an issue and comment on the task that you want to work on this feature.
1313
- To ensure your changes doesn't break any of the existing features run the sanity suite as follows from serve directory:
14-
- Install dependencies (if not already installed)
15-
For CPU
16-
17-
```bash
18-
python ts_scripts/install_dependencies.py --environment=dev
19-
```
20-
21-
For GPU
22-
```bash
23-
python ts_scripts/install_dependencies.py --environment=dev --cuda=cu121
24-
```
25-
> Supported cuda versions as cu121, cu118, cu117, cu116, cu113, cu111, cu102, cu101, cu92
14+
- [Install dependencies](#Install-TorchServe-for-development) (if not already installed)
2615
- Install `pre-commit` to your Git flow:
2716
```bash
2817
pre-commit install
@@ -60,26 +49,30 @@ pytest -k test/pytest/test_mnist_template.py
6049

6150
If you plan to develop with TorchServe and change some source code, you must install it from source code.
6251

63-
Ensure that you have `python3` installed, and the user has access to the site-packages or `~/.local/bin` is added to the `PATH` environment variable.
52+
1. Clone the repository, including third-party modules, with `git clone --recurse-submodules --remote-submodules [email protected]:pytorch/serve.git`
53+
2. Ensure that you have `python3` installed, and the user has access to the site-packages or `~/.local/bin` is added to the `PATH` environment variable.
54+
3. Run the following script from the top of the source directory. NOTE: This script force re-installs `torchserve`, `torch-model-archiver` and `torch-workflow-archiver` if existing installations are found
6455

65-
Run the following script from the top of the source directory.
56+
#### For Debian Based Systems/MacOS
6657

67-
NOTE: This script force re-installs `torchserve`, `torch-model-archiver` and `torch-workflow-archiver` if existing installations are found
58+
```
59+
python ./ts_scripts/install_dependencies.py --environment=dev
60+
python ./ts_scripts/install_from_src.py --environment=dev
61+
```
62+
##### Installing Dependencies for Accelerator Support
63+
Use the optional `--rocm` or `--cuda` flag with `install_dependencies.py` for installing accelerator specific dependencies.
6864

69-
#### For Debian Based Systems/ MacOS
70-
71-
```
72-
python ./ts_scripts/install_dependencies.py --environment=dev
73-
python ./ts_scripts/install_from_src.py --environment=dev
74-
```
65+
Possible values are
66+
- rocm: `rocm61`, `rocm60`
67+
- cuda: `cu111`, `cu102`, `cu101`, `cu92`
7568

76-
Use `--cuda` flag with `install_dependencies.py` for installing cuda version specific dependencies. Possible values are `cu111`, `cu102`, `cu101`, `cu92`
69+
For example `python ./ts_scripts/install_dependencies.py --environment=dev --rocm=rocm61`
7770

78-
#### For Windows
71+
#### For Windows
7972

80-
Refer to the documentation [here](docs/torchserve_on_win_native.md).
73+
Refer to the documentation [here](docs/torchserve_on_win_native.md).
8174

82-
For information about the model archiver, see [detailed documentation](model-archiver/README.md).
75+
For information about the model archiver, see [detailed documentation](model-archiver/README.md).
8376

8477
### What to Contribute?
8578

README.md

+8-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,10 @@ curl http://127.0.0.1:8080/predictions/bert -T input.txt
2222

2323
```bash
2424
# Install dependencies
25-
# cuda is optional
25+
python ./ts_scripts/install_dependencies.py
26+
27+
# Include dependencies for accelerator support with the relevant optional flags
28+
python ./ts_scripts/install_dependencies.py --rocm=rocm61
2629
python ./ts_scripts/install_dependencies.py --cuda=cu121
2730

2831
# Latest release
@@ -36,7 +39,10 @@ pip install torchserve-nightly torch-model-archiver-nightly torch-workflow-archi
3639

3740
```bash
3841
# Install dependencies
39-
# cuda is optional
42+
python ./ts_scripts/install_dependencies.py
43+
44+
# Include depeendencies for accelerator support with the relevant optional flags
45+
python ./ts_scripts/install_dependencies.py --rocm=rocm61
4046
python ./ts_scripts/install_dependencies.py --cuda=cu121
4147

4248
# Latest release

0 commit comments

Comments
 (0)