|
| 1 | +<!--Copyright 2024 The HuggingFace Team. All rights reserved. |
| 2 | +
|
| 3 | +Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with |
| 4 | +the License. You may obtain a copy of the License at |
| 5 | +
|
| 6 | +http://www.apache.org/licenses/LICENSE-2.0 |
| 7 | +
|
| 8 | +Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on |
| 9 | +an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the |
| 10 | +specific language governing permissions and limitations under the License. |
| 11 | +
|
| 12 | +⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be |
| 13 | +rendered properly in your Markdown viewer. |
| 14 | +
|
| 15 | +--> |
| 16 | + |
| 17 | +# Using TEI locally with an AMD GPU |
| 18 | + |
| 19 | +Text-Embeddings-Inference supports the [AMD GPUs officially supporting ROCm](https://rocm.docs.amd.com/projects/install-on-linux/en/latest/reference/system-requirements.html), including AMD Instinct MI210, MI250, MI300 and some of the AMD Radeon series GPUs. |
| 20 | + |
| 21 | +To leverage AMD GPUs, Text-Embeddings-Inference relies on its Python backend, and not on the [candle](https://github.com/huggingface/candle) backend that is used for CPU, Nvidia GPUs and Metal. The support in the python backend is more limited (Bert embeddings) but easily extendible. We welcome contributions to extend the supported models. |
| 22 | + |
| 23 | +## Usage through docker |
| 24 | + |
| 25 | +Using docker is the recommended approach. |
| 26 | + |
| 27 | +```bash |
| 28 | +docker run --rm -it --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --net host \ |
| 29 | + --device=/dev/kfd --device=/dev/dri --group-add video --ipc=host --shm-size 32g \ |
| 30 | + ghcr.io/huggingface/text-embeddings-inference:rocm-1.2.4 \ |
| 31 | + --model-id sentence-transformers/all-MiniLM-L6-v2 |
| 32 | +``` |
| 33 | + |
| 34 | +and |
| 35 | + |
| 36 | +```bash |
| 37 | +curl 127.0.0.1:80/embed \ |
| 38 | + -X POST -d '{"inputs":"What is Deep Learning?"}' \ |
| 39 | + -H 'Content-Type: application/json' |
| 40 | +``` |
0 commit comments