Unverified Commit 1f69fb9e authored by Merve Noyan's avatar Merve Noyan Committed by GitHub
Browse files

Tensor Parallelism conceptual guide (#886)


Co-authored-by: default avatarNicolas Patry <patry.nicolas@protonmail.com>
Co-authored-by: default avatarOmar Sanseviero <osanseviero@gmail.com>
Co-authored-by: default avatarPedro Cuenca <pedro@huggingface.co>
parent 4cce8430
...@@ -21,6 +21,8 @@ ...@@ -21,6 +21,8 @@
- sections: - sections:
- local: conceptual/streaming - local: conceptual/streaming
title: Streaming title: Streaming
- local: conceptual/tensor_parallelism
title: Tensor Parallelism
- local: conceptual/paged_attention - local: conceptual/paged_attention
title: PagedAttention title: PagedAttention
- local: conceptual/safetensors - local: conceptual/safetensors
......
# Tensor Parallelism
Tensor parallelism is a technique used to fit a large model in multiple GPUs. For example, when multiplying the input tensors with the first weight tensor, the matrix multiplication is equivalent to splitting the weight tensor column-wise, multiplying each column with the input separately, and then concatenating the separate outputs. These outputs are then transferred from the GPUs and concatenated together to get the final result, like below 👇
![Image courtesy of Anton Lozkhov](https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/tgi/TP.png)
<Tip warning={true}>
Tensor Parallelism only works for [models officially supported](../supported_models), it will not work when falling back to `transformers`. You can get more information about unsupported models [here](../basic_tutorials/non_core_models).
</Tip>
You can learn a lot more details about tensor-parallelism from [the `transformers` docs](https://huggingface.co/docs/transformers/main/en/perf_train_gpu_many#tensor-parallelism).
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment