-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
use extract_local for test_hybrid_attn.py (#74)
- Loading branch information
1 parent
567ca32
commit 5ac27d8
Showing
11 changed files
with
179 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
## Install for AMD GPU | ||
|
||
Supported GPU : MI300X, MI308X | ||
|
||
GPU arch : gfx942 | ||
|
||
Step 1: prepare docker envrionment | ||
|
||
Tow recommended docker container to start with | ||
|
||
- rocm/pytorch:rocm6.2_ubuntu22.04_py3.10_pytorch_release_2.3.0 : hosted in dockerhub, no conda | ||
- [dockerhub repo](https://github.com/yiakwy-xpu-ml-framework-team/Tools-dockerhub/blob/main/rocm/Dockerfile.rocm62.ubuntu-22.04) : Customerized Dockerfile with conda virtual env and develop kit support | ||
|
||
An example to create an docker container : | ||
|
||
```bash | ||
# create docker container | ||
IMG=rocm/pytorch:rocm6.2_ubuntu22.04_py3.10_pytorch_release_2.3.0 | ||
tag=py310-rocm6.2-distattn-dev | ||
|
||
docker_args=$(echo -it --privileged \ | ||
--name $tag \ | ||
--ulimit memlock=-1:-1 --net=host --cap-add=IPC_LOCK \ | ||
--device=/dev/kfd --device=/dev/dri \ | ||
--ipc=host \ | ||
--security-opt seccomp=unconfined \ | ||
--shm-size 16G \ | ||
--group-add video \ | ||
-v $(readlink -f `pwd`):/workspace \ | ||
--workdir /workspace \ | ||
--cpus=$((`nproc` / 2 - 1)) \ | ||
$IMG | ||
) | ||
|
||
docker_args=($docker_args) | ||
|
||
docker container create "${docker_args[@]}" | ||
|
||
# start it | ||
docker start -a -i $tag | ||
``` | ||
|
||
Update ROCM SDK using this [script](https://github.com/yiakwy-xpu-ml-framework-team/Tools-dockerhub/blob/main/rocm/update_sdk.sh): | ||
|
||
```bash | ||
# e.g.: | ||
ROCM_VERSION=6.3 bash rocm/update_sdk.sh | ||
``` | ||
|
||
Step 2 : build from local. | ||
|
||
> MAX_JOBS=$(nproc) pip install .[amd] --verbose | ||
**Features:** | ||
|
||
1. No Limitation on the Number of Heads: Our approach does not impose a restriction on the number of heads, providing greater flexibility for various attention mechanisms. | ||
|
||
2. Cover the Capability of either Ulysses and Ring: By setting the ulysses_degree to the sequence parallel degree, the system operates identically to Ulysses. Conversely, setting the ulysses_degree to 1 mirrors the functionality of Ring. | ||
|
||
3. Enhanced Performance: We achieve superior performance benchmarks over both Ulysses and Ring, offering a more efficient solution for attention mechanism computations. | ||
|
||
4. Compatibility with Advanced Parallel Strategies: LongContextAttention is fully compatible with other sophisticated parallelization techniques, including Tensor Parallelism, ZeRO, and Pipeline Parallelism, ensuring seamless integration with the latest advancements in parallel computing. |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,15 @@ | ||
from setuptools import setup, find_packages | ||
import os | ||
|
||
# 读取版本信息 | ||
version_file = os.path.join(os.path.dirname(__file__), 'yunchang', '__version__.py') | ||
with open(version_file, 'r') as f: | ||
exec(f.read()) | ||
|
||
setup( | ||
name="yunchang", | ||
version="0.3", | ||
author="Jiarui Fang, Zilin Zhu, Yang Yu", | ||
version=__version__, | ||
author="[email protected]", | ||
url="https://github.com/feifeibear/long-context-attention", | ||
packages=find_packages(exclude=['test', 'benchmark']), | ||
install_requires=[ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.