From b91020b407452d7eb135acab3d9a3dfb5add4255 Mon Sep 17 00:00:00 2001 From: William Lin Date: Thu, 28 Aug 2025 22:34:03 -0700 Subject: [PATCH] [VSA] [STA] Fix directory structure for pypi publishing (#769) Co-authored-by: Peiyuan Zhang --- .buildkite/pipeline.yml | 32 +++++++++---------- .github/workflows/pr-test.yml | 16 +++++----- .github/workflows/sta-publish.yml | 22 ++++++------- .github/workflows/vsa-publish.yml | 22 ++++++------- csrc/attn/README.md | 4 +-- csrc/attn/scratch.sh | 4 --- .../{ => sliding_tile_attn}/config_sta.py | 0 .../setup.py} | 4 +-- csrc/attn/{ => sliding_tile_attn}/st_attn.cpp | 0 .../st_attn/__init__.py | 0 .../st_attn/st_attn_h100.cu | 0 csrc/attn/tk | 2 +- .../{ => video_sparse_attn}/config_vsa.py | 0 .../setup.py} | 6 ++-- csrc/attn/{ => video_sparse_attn}/vsa.cpp | 0 .../{ => video_sparse_attn}/vsa/__init__.py | 0 .../vsa/block_sparse_attn_triton.py | 0 .../vsa/block_sparse_h100.cu | 0 .../vsa/block_sparse_wrapper.py | 0 .../attn/{ => video_sparse_attn}/vsa/index.py | 0 docker/Dockerfile.python3.10 | 10 +++--- docker/Dockerfile.python3.11 | 10 +++--- docker/Dockerfile.python3.12 | 10 +++--- docker/Dockerfile.python3.12.cuda12.9.1 | 10 +++--- .../sliding_tile_attention/installation.md | 13 +++++--- .../video_sparse_attention/installation.md | 7 ++-- .../Wan2.1-T2V/Wan-Syn-Data-480P/README.md | 4 +-- .../Data-free/README.md | 4 +-- .../crush_smol/README.md | 4 +-- .../Wan2.1-VSA/Wan-Syn-Data/README.md | 4 +-- 30 files changed, 90 insertions(+), 98 deletions(-) delete mode 100644 csrc/attn/scratch.sh rename csrc/attn/{ => sliding_tile_attn}/config_sta.py (100%) rename csrc/attn/{setup_sta.py => sliding_tile_attn/setup.py} (98%) rename csrc/attn/{ => sliding_tile_attn}/st_attn.cpp (100%) rename csrc/attn/{ => sliding_tile_attn}/st_attn/__init__.py (100%) rename csrc/attn/{ => sliding_tile_attn}/st_attn/st_attn_h100.cu (100%) rename csrc/attn/{ => video_sparse_attn}/config_vsa.py (100%) rename csrc/attn/{setup_vsa.py => video_sparse_attn/setup.py} (97%) rename csrc/attn/{ => video_sparse_attn}/vsa.cpp (100%) rename csrc/attn/{ => video_sparse_attn}/vsa/__init__.py (100%) rename csrc/attn/{ => video_sparse_attn}/vsa/block_sparse_attn_triton.py (100%) rename csrc/attn/{ => video_sparse_attn}/vsa/block_sparse_h100.cu (100%) rename csrc/attn/{ => video_sparse_attn}/vsa/block_sparse_wrapper.py (100%) rename csrc/attn/{ => video_sparse_attn}/vsa/index.py (100%) diff --git a/.buildkite/pipeline.yml b/.buildkite/pipeline.yml index 9f3850b84..9de4fe587 100644 --- a/.buildkite/pipeline.yml +++ b/.buildkite/pipeline.yml @@ -117,11 +117,11 @@ steps: queue: "default" - path: - "fastvideo/**" - - "csrc/attn/vsa/**" + - "csrc/attn/video_sparse_attn/**" - "csrc/attn/tk/**" - - "csrc/attn/setup_vsa.py" - - "csrc/attn/config_vsa.py" - - "csrc/attn/vsa.cpp" + - "csrc/attn/video_sparse_attn/setup.py" + - "csrc/attn/video_sparse_attn/config_vsa.py" + - "csrc/attn/video_sparse_attn/vsa.cpp" - "pyproject.toml" - "docker/Dockerfile.python3.12" config: @@ -133,10 +133,10 @@ steps: queue: "default" - path: - "fastvideo/**" - - "csrc/attn/st_attn/**" - - "csrc/attn/setup_sta.py" - - "csrc/attn/config_sta.py" - - "csrc/attn/st_attn.cpp" + - "csrc/attn/sliding_tile_attn/**" + - "csrc/attn/sliding_tile_attn/setup.py" + - "csrc/attn/sliding_tile_attn/config_sta.py" + - "csrc/attn/sliding_tile_attn/st_attn.cpp" - "pyproject.toml" - "docker/Dockerfile.python3.12" config: @@ -147,10 +147,10 @@ steps: agents: queue: "default" - path: - - "csrc/attn/st_attn/**" - - "csrc/attn/setup_sta.py" - - "csrc/attn/config_sta.py" - - "csrc/attn/st_attn.cpp" + - "csrc/attn/sliding_tile_attn/**" + - "csrc/attn/sliding_tile_attn/setup.py" + - "csrc/attn/sliding_tile_attn/config_sta.py" + - "csrc/attn/sliding_tile_attn/st_attn.cpp" - "pyproject.toml" - "docker/Dockerfile.python3.12" config: @@ -161,12 +161,12 @@ steps: agents: queue: "default" - path: - - "csrc/attn/vsa/**" + - "csrc/attn/video_sparse_attn/**" - "csrc/attn/tk/**" - "csrc/attn/tests/test_vsa.py" - - "csrc/attn/setup_vsa.py" - - "csrc/attn/config_vsa.py" - - "csrc/attn/vsa.cpp" + - "csrc/attn/video_sparse_attn/setup.py" + - "csrc/attn/video_sparse_attn/config_vsa.py" + - "csrc/attn/video_sparse_attn/vsa.cpp" - "pyproject.toml" - "docker/Dockerfile.python3.12" config: diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index 995d6b667..3d8e8f667 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -104,16 +104,16 @@ jobs: - 'pyproject.toml' - 'docker/Dockerfile.python3.12' sta-kernel-paths: &sta-kernel-paths - - 'csrc/attn/st_attn/**' - - 'csrc/attn/setup_sta.py' - - 'csrc/attn/config_sta.py' - - 'csrc/attn/st_attn.cpp' + - 'csrc/attn/sliding_tile_attn/**' + - 'csrc/attn/sliding_tile_attn/setup.py' + - 'csrc/attn/sliding_tile_attn/config_sta.py' + - 'csrc/attn/sliding_tile_attn/st_attn.cpp' vsa-kernel-paths: &vsa-kernel-paths - - 'csrc/attn/vsa/**' + - 'csrc/attn/video_sparse_attn/**' - 'csrc/attn/tk/**' - - 'csrc/attn/setup_vsa.py' - - 'csrc/attn/config_vsa.py' - - 'csrc/attn/vsa.cpp' + - 'csrc/attn/video_sparse_attn/setup.py' + - 'csrc/attn/video_sparse_attn/config_vsa.py' + - 'csrc/attn/video_sparse_attn/vsa.cpp' vsa-paths: &vsa-paths - 'fastvideo/**' - *common-paths diff --git a/.github/workflows/sta-publish.yml b/.github/workflows/sta-publish.yml index f442e3efd..b2dd79522 100644 --- a/.github/workflows/sta-publish.yml +++ b/.github/workflows/sta-publish.yml @@ -5,7 +5,7 @@ on: branches: - main paths: - - "csrc/attn/setup_sta.py" + - "csrc/attn/sliding_tile_attn/setup.py" workflow_dispatch: jobs: @@ -23,13 +23,13 @@ jobs: - name: Check if version changed id: check-version run: | - cd csrc/attn + cd csrc/attn/sliding_tile_attn # Get current commit's version - NEW_VERSION=$(grep -oP 'VERSION\s*=\s*"\K[^"]+' setup_sta.py) + NEW_VERSION=$(grep -oP 'VERSION\s*=\s*"\K[^"]+' setup.py) echo "New version: $NEW_VERSION" # Get previous version from git history - OLD_VERSION=$(git show HEAD~1:./setup_sta.py | grep -oP 'VERSION\s*=\s*"\K[^"]+' || echo "0.0.0") + OLD_VERSION=$(git show HEAD~1:./setup.py | grep -oP 'VERSION\s*=\s*"\K[^"]+' || echo "0.0.0") echo "Old version: $OLD_VERSION" if [ "$NEW_VERSION" != "$OLD_VERSION" ]; then @@ -144,13 +144,13 @@ jobs: pip install setuptools pip install ninja packaging wheel - cd csrc/attn # Move into the correct folder + cd csrc/attn/sliding_tile_attn # Move into the correct folder git submodule update --init --recursive # Ensure ThunderKittens submodule is initialized - python setup_sta.py bdist_wheel --dist-dir=dist + python setup.py bdist_wheel --dist-dir=dist - name: Rename wheel file run: | - cd csrc/attn + cd csrc/attn/sliding_tile_attn CUDA_SHORT_VERSION=$(echo ${{ matrix.cuda-version }} | cut -d. -f1,2 | sed 's/\.//g') TORCH_SHORT_VERSION=$(echo ${{ matrix.torch-version }} | cut -d. -f1,2) @@ -165,7 +165,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ env.wheel_name }} - path: csrc/attn/dist/*.whl + path: csrc/attn/sliding_tile_attn/dist/*.whl retention-days: 90 publish_package: @@ -239,11 +239,11 @@ jobs: pip install setuptools pip install ninja packaging wheel - cd csrc/attn # Move into the correct folder + cd csrc/attn/sliding_tile_attn # Move into the correct folder git submodule update --init --recursive # Ensure ThunderKittens submodule is initialized - python setup_sta.py sdist --dist-dir=dist + python setup.py sdist --dist-dir=dist - name: Publish release distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - packages-dir: csrc/attn/dist/ + packages-dir: csrc/attn/sliding_tile_attn/dist/ diff --git a/.github/workflows/vsa-publish.yml b/.github/workflows/vsa-publish.yml index e3f08fdc4..c9f257a14 100644 --- a/.github/workflows/vsa-publish.yml +++ b/.github/workflows/vsa-publish.yml @@ -5,7 +5,7 @@ on: branches: - main paths: - - "csrc/attn/setup_vsa.py" + - "csrc/attn/video_sparse_attn/setup.py" workflow_dispatch: jobs: @@ -23,13 +23,13 @@ jobs: - name: Check if version changed id: check-version run: | - cd csrc/attn + cd csrc/attn/video_sparse_attn # Get current commit's version - NEW_VERSION=$(grep -oP 'VERSION\s*=\s*"\K[^"]+' setup_vsa.py) + NEW_VERSION=$(grep -oP 'VERSION\s*=\s*"\K[^"]+' setup.py) echo "New version: $NEW_VERSION" # Get previous version from git history - OLD_VERSION=$(git show HEAD~1:./setup_vsa.py | grep -oP 'VERSION\s*=\s*"\K[^"]+' || echo "0.0.0") + OLD_VERSION=$(git show HEAD~1:./setup.py | grep -oP 'VERSION\s*=\s*"\K[^"]+' || echo "0.0.0") echo "Old version: $OLD_VERSION" if [ "$NEW_VERSION" != "$OLD_VERSION" ]; then @@ -152,13 +152,13 @@ jobs: pip install setuptools pip install ninja packaging wheel - cd csrc/attn # Move into the correct folder + cd csrc/attn/video_sparse_attn # Move into the correct folder git submodule update --init --recursive # Ensure ThunderKittens submodule is initialized - python setup_vsa.py bdist_wheel --dist-dir=dist + python setup.py bdist_wheel --dist-dir=dist - name: Rename wheel file run: | - cd csrc/attn + cd csrc/attn/video_sparse_attn CUDA_SHORT_VERSION=$(echo ${{ matrix.torch-cuda.cuda-version }} | cut -d. -f1,2 | sed 's/\.//g') TORCH_SHORT_VERSION=$(echo ${{ matrix.torch-cuda.torch-version }} | cut -d. -f1,2) @@ -173,7 +173,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: ${{ env.wheel_name }} - path: csrc/attn/dist/*.whl + path: csrc/attn/video_sparse_attn/dist/*.whl retention-days: 90 publish_package: @@ -247,11 +247,11 @@ jobs: pip install setuptools pip install ninja packaging wheel - cd csrc/attn # Move into the correct folder + cd csrc/attn/video_sparse_attn # Move into the correct folder git submodule update --init --recursive # Ensure ThunderKittens submodule is initialized - python setup_vsa.py sdist --dist-dir=dist + python setup.py sdist --dist-dir=dist - name: Publish release distributions to PyPI uses: pypa/gh-action-pypi-publish@release/v1 with: - packages-dir: csrc/attn/dist/ + packages-dir: csrc/attn/video_sparse_attn/dist/ diff --git a/csrc/attn/README.md b/csrc/attn/README.md index 30af4bf34..461e5bde5 100644 --- a/csrc/attn/README.md +++ b/csrc/attn/README.md @@ -25,9 +25,9 @@ sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 100 --slave sudo apt update sudo apt install clang-11 ``` -(If you use CUDA12.4) +(If you use CUDA12.8) ```bash -export CUDA_HOME=/usr/local/cuda-12.4 +export CUDA_HOME=/usr/local/cuda-12.8 export PATH=${CUDA_HOME}/bin:${PATH} export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH ``` diff --git a/csrc/attn/scratch.sh b/csrc/attn/scratch.sh deleted file mode 100644 index 84d846c77..000000000 --- a/csrc/attn/scratch.sh +++ /dev/null @@ -1,4 +0,0 @@ - off_hz = tl.program_id(2) - b = off_hz // H - h = off_hz % H - meta_base = ((b * H + h) * q_tiles + q_blk) \ No newline at end of file diff --git a/csrc/attn/config_sta.py b/csrc/attn/sliding_tile_attn/config_sta.py similarity index 100% rename from csrc/attn/config_sta.py rename to csrc/attn/sliding_tile_attn/config_sta.py diff --git a/csrc/attn/setup_sta.py b/csrc/attn/sliding_tile_attn/setup.py similarity index 98% rename from csrc/attn/setup_sta.py rename to csrc/attn/sliding_tile_attn/setup.py index 5e6361a6a..b690829ef 100644 --- a/csrc/attn/setup_sta.py +++ b/csrc/attn/sliding_tile_attn/setup.py @@ -9,13 +9,13 @@ target = target.lower() # Package metadata PACKAGE_NAME = "st_attn" -VERSION = "0.0.4" +VERSION = "0.0.5" AUTHOR = "Hao AI Lab" DESCRIPTION = "Sliding Tile Atteniton Kernel Used in FastVideo" URL = "https://github.com/hao-ai-lab/FastVideo/tree/main/csrc/sliding_tile_attention" # Set environment variables -tk_root = os.getenv('THUNDERKITTENS_ROOT', os.path.abspath(os.path.join(os.getcwd(), 'tk/'))) +tk_root = os.getenv('THUNDERKITTENS_ROOT', os.path.abspath(os.path.join(os.getcwd(), '../tk/'))) python_include = subprocess.check_output(['python', '-c', "import sysconfig; print(sysconfig.get_path('include'))"]).decode().strip() torch_include = subprocess.check_output([ diff --git a/csrc/attn/st_attn.cpp b/csrc/attn/sliding_tile_attn/st_attn.cpp similarity index 100% rename from csrc/attn/st_attn.cpp rename to csrc/attn/sliding_tile_attn/st_attn.cpp diff --git a/csrc/attn/st_attn/__init__.py b/csrc/attn/sliding_tile_attn/st_attn/__init__.py similarity index 100% rename from csrc/attn/st_attn/__init__.py rename to csrc/attn/sliding_tile_attn/st_attn/__init__.py diff --git a/csrc/attn/st_attn/st_attn_h100.cu b/csrc/attn/sliding_tile_attn/st_attn/st_attn_h100.cu similarity index 100% rename from csrc/attn/st_attn/st_attn_h100.cu rename to csrc/attn/sliding_tile_attn/st_attn/st_attn_h100.cu diff --git a/csrc/attn/tk b/csrc/attn/tk index 1719fb726..6c27e28c8 160000 --- a/csrc/attn/tk +++ b/csrc/attn/tk @@ -1 +1 @@ -Subproject commit 1719fb72641b965d26155a0515d413b007f9dc72 +Subproject commit 6c27e28c8115d1839d9eeeb530913c184a75fc87 diff --git a/csrc/attn/config_vsa.py b/csrc/attn/video_sparse_attn/config_vsa.py similarity index 100% rename from csrc/attn/config_vsa.py rename to csrc/attn/video_sparse_attn/config_vsa.py diff --git a/csrc/attn/setup_vsa.py b/csrc/attn/video_sparse_attn/setup.py similarity index 97% rename from csrc/attn/setup_vsa.py rename to csrc/attn/video_sparse_attn/setup.py index 7e9026269..909174033 100644 --- a/csrc/attn/setup_vsa.py +++ b/csrc/attn/video_sparse_attn/setup.py @@ -9,13 +9,13 @@ target = target.lower() # Package metadata PACKAGE_NAME = "vsa" -VERSION = "0.0.1" +VERSION = "0.0.2" AUTHOR = "Hao AI Lab" DESCRIPTION = "Video Sparse Attention Kernel Used in FastVideo" -URL = "https://github.com/hao-ai-lab/FastVideo/tree/main/csrc/attn" +URL = "https://github.com/hao-ai-lab/FastVideo/tree/main/csrc/attn/video_sparse_attn" # Set environment variables -tk_root = os.getenv('THUNDERKITTENS_ROOT', os.path.abspath(os.path.join(os.getcwd(), 'tk/'))) +tk_root = os.getenv('THUNDERKITTENS_ROOT', os.path.abspath(os.path.join(os.getcwd(), '../tk/'))) python_include = subprocess.check_output(['python', '-c', "import sysconfig; print(sysconfig.get_path('include'))"]).decode().strip() torch_include = subprocess.check_output([ diff --git a/csrc/attn/vsa.cpp b/csrc/attn/video_sparse_attn/vsa.cpp similarity index 100% rename from csrc/attn/vsa.cpp rename to csrc/attn/video_sparse_attn/vsa.cpp diff --git a/csrc/attn/vsa/__init__.py b/csrc/attn/video_sparse_attn/vsa/__init__.py similarity index 100% rename from csrc/attn/vsa/__init__.py rename to csrc/attn/video_sparse_attn/vsa/__init__.py diff --git a/csrc/attn/vsa/block_sparse_attn_triton.py b/csrc/attn/video_sparse_attn/vsa/block_sparse_attn_triton.py similarity index 100% rename from csrc/attn/vsa/block_sparse_attn_triton.py rename to csrc/attn/video_sparse_attn/vsa/block_sparse_attn_triton.py diff --git a/csrc/attn/vsa/block_sparse_h100.cu b/csrc/attn/video_sparse_attn/vsa/block_sparse_h100.cu similarity index 100% rename from csrc/attn/vsa/block_sparse_h100.cu rename to csrc/attn/video_sparse_attn/vsa/block_sparse_h100.cu diff --git a/csrc/attn/vsa/block_sparse_wrapper.py b/csrc/attn/video_sparse_attn/vsa/block_sparse_wrapper.py similarity index 100% rename from csrc/attn/vsa/block_sparse_wrapper.py rename to csrc/attn/video_sparse_attn/vsa/block_sparse_wrapper.py diff --git a/csrc/attn/vsa/index.py b/csrc/attn/video_sparse_attn/vsa/index.py similarity index 100% rename from csrc/attn/vsa/index.py rename to csrc/attn/video_sparse_attn/vsa/index.py diff --git a/docker/Dockerfile.python3.10 b/docker/Dockerfile.python3.10 index 0937fa1da..eaa0ecd9e 100644 --- a/docker/Dockerfile.python3.10 +++ b/docker/Dockerfile.python3.10 @@ -58,15 +58,15 @@ RUN source $HOME/.local/bin/env && \ # Install STA (Sliding Tile Attention) RUN source $HOME/.local/bin/env && \ source /opt/venv/bin/activate && \ - cd csrc/attn && \ + cd csrc/attn/sliding_tile_attn && \ git submodule update --init --recursive && \ - python setup_sta.py install + python setup.py install # Install VSA RUN source $HOME/.local/bin/env && \ source /opt/venv/bin/activate && \ - cd csrc/attn && \ + cd csrc/attn/video_sparse_attn && \ git submodule update --init --recursive && \ - python setup_vsa.py install + python setup.py install -EXPOSE 22 \ No newline at end of file +EXPOSE 22 diff --git a/docker/Dockerfile.python3.11 b/docker/Dockerfile.python3.11 index 60f9f49d9..91cc71e27 100644 --- a/docker/Dockerfile.python3.11 +++ b/docker/Dockerfile.python3.11 @@ -58,15 +58,15 @@ RUN source $HOME/.local/bin/env && \ # Install STA (Sliding Tile Attention) RUN source $HOME/.local/bin/env && \ source /opt/venv/bin/activate && \ - cd csrc/attn && \ + cd csrc/attn/sliding_tile_attn && \ git submodule update --init --recursive && \ - python setup_sta.py install + python setup.py install # Install VSA RUN source $HOME/.local/bin/env && \ source /opt/venv/bin/activate && \ - cd csrc/attn && \ + cd csrc/attn/video_sparse_attn && \ git submodule update --init --recursive && \ - python setup_vsa.py install + python setup.py install -EXPOSE 22 \ No newline at end of file +EXPOSE 22 diff --git a/docker/Dockerfile.python3.12 b/docker/Dockerfile.python3.12 index 0140e5705..65690f11e 100644 --- a/docker/Dockerfile.python3.12 +++ b/docker/Dockerfile.python3.12 @@ -58,15 +58,15 @@ RUN source $HOME/.local/bin/env && \ # Install STA (Sliding Tile Attention) RUN source $HOME/.local/bin/env && \ source /opt/venv/bin/activate && \ - cd csrc/attn && \ + cd csrc/attn/sliding_tile_attn && \ git submodule update --init --recursive && \ - python setup_sta.py install + python setup.py install # Install VSA RUN source $HOME/.local/bin/env && \ source /opt/venv/bin/activate && \ - cd csrc/attn && \ + cd csrc/attn/video_sparse_attn && \ git submodule update --init --recursive && \ - python setup_vsa.py install + python setup.py install -EXPOSE 22 \ No newline at end of file +EXPOSE 22 diff --git a/docker/Dockerfile.python3.12.cuda12.9.1 b/docker/Dockerfile.python3.12.cuda12.9.1 index 068ced4f8..5ecaf95d0 100644 --- a/docker/Dockerfile.python3.12.cuda12.9.1 +++ b/docker/Dockerfile.python3.12.cuda12.9.1 @@ -58,15 +58,15 @@ RUN source $HOME/.local/bin/env && \ # Install STA (Sliding Tile Attention) RUN source $HOME/.local/bin/env && \ source /opt/venv/bin/activate && \ - cd csrc/attn && \ + cd csrc/attn/sliding_tile_attn && \ git submodule update --init --recursive && \ - python setup_sta.py install + python setup.py install # Install VSA RUN source $HOME/.local/bin/env && \ source /opt/venv/bin/activate && \ - cd csrc/attn && \ + cd csrc/attn/video_sparse_attn && \ git submodule update --init --recursive && \ - python setup_vsa.py install + python setup.py install -EXPOSE 22 \ No newline at end of file +EXPOSE 22 diff --git a/docs/source/sliding_tile_attention/installation.md b/docs/source/sliding_tile_attention/installation.md index 46bde6b6f..8e9f1daec 100644 --- a/docs/source/sliding_tile_attention/installation.md +++ b/docs/source/sliding_tile_attention/installation.md @@ -4,7 +4,7 @@ You can install the Sliding Tile Attention package using ``` -pip install st_attn==0.0.4 +pip install st_attn ``` # Building from Source @@ -12,7 +12,6 @@ We test our code on Pytorch 2.5.0 and CUDA>=12.4. Currently we only have impleme First, install C++20 for ThunderKittens: ```bash -cd csrc/sliding_tile_attention/ sudo apt update sudo apt install gcc-11 g++-11 @@ -22,14 +21,20 @@ sudo apt update sudo apt install clang-11 ``` -Install STA: +Set up CUDA environment (if using CUDA 12.4): ```bash export CUDA_HOME=/usr/local/cuda-12.4 export PATH=${CUDA_HOME}/bin:${PATH} export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH +``` + +Install STA: + +```bash +cd csrc/attn/sliding_tile_attn/ git submodule update --init --recursive -python setup_sta.py install +python setup.py install ``` # 🧪 Test diff --git a/docs/source/video_sparse_attention/installation.md b/docs/source/video_sparse_attention/installation.md index a71f3bed2..e436922b0 100644 --- a/docs/source/video_sparse_attention/installation.md +++ b/docs/source/video_sparse_attention/installation.md @@ -4,8 +4,7 @@ You can install the Video Sparse Attention package using ```bash -git submodule update --init --recursive -python setup_vsa.py install +pip install vsa ``` # Building from Source @@ -34,9 +33,9 @@ export LD_LIBRARY_PATH=${CUDA_HOME}/lib64:$LD_LIBRARY_PATH Install VSA: ```bash -cd csrc/attn/ +cd csrc/attn/video_sparse_attn/ git submodule update --init --recursive -python setup_vsa.py install +python setup.py install ``` # 🧪 Test diff --git a/examples/distill/Wan2.1-T2V/Wan-Syn-Data-480P/README.md b/examples/distill/Wan2.1-T2V/Wan-Syn-Data-480P/README.md index de32dadb6..cce5a097f 100644 --- a/examples/distill/Wan2.1-T2V/Wan-Syn-Data-480P/README.md +++ b/examples/distill/Wan2.1-T2V/Wan-Syn-Data-480P/README.md @@ -4,9 +4,7 @@ These are end-to-end example scripts for distilling Wan2.1 T2V 1.3B model using ### 0. Make sure you have installed VSA ```bash -cd csrc/attn -git submodule update --init --recursive -python setup_vsa.py install +pip install vsa ``` ### 1. Download dataset: diff --git a/examples/distill/Wan2.2-TI2V-5B-Diffusers/Data-free/README.md b/examples/distill/Wan2.2-TI2V-5B-Diffusers/Data-free/README.md index f709a92da..4770f402c 100644 --- a/examples/distill/Wan2.2-TI2V-5B-Diffusers/Data-free/README.md +++ b/examples/distill/Wan2.2-TI2V-5B-Diffusers/Data-free/README.md @@ -4,9 +4,7 @@ These are end-to-end example scripts for distilling Wan2.2 TI2V 5B model DMD+VSA ### 0. Make sure you have installed VSA ```bash -cd csrc/attn -git submodule update --init --recursive -python setup_vsa.py install +pip install vsa ``` ### Data-free Distillation diff --git a/examples/distill/Wan2.2-TI2V-5B-Diffusers/crush_smol/README.md b/examples/distill/Wan2.2-TI2V-5B-Diffusers/crush_smol/README.md index 0c71a0005..82bed98fd 100644 --- a/examples/distill/Wan2.2-TI2V-5B-Diffusers/crush_smol/README.md +++ b/examples/distill/Wan2.2-TI2V-5B-Diffusers/crush_smol/README.md @@ -4,9 +4,7 @@ These are end-to-end example scripts for distilling Wan2.2 TI2V 5B model DMD+VSA ### 0. Make sure you have installed VSA ```bash -cd csrc/attn -git submodule update --init --recursive -python setup_vsa.py install +pip install vsa ``` ### 1. Download dataset: diff --git a/examples/training/finetune/Wan2.1-VSA/Wan-Syn-Data/README.md b/examples/training/finetune/Wan2.1-VSA/Wan-Syn-Data/README.md index a497be6fe..e7ffaedaf 100644 --- a/examples/training/finetune/Wan2.1-VSA/Wan-Syn-Data/README.md +++ b/examples/training/finetune/Wan2.1-VSA/Wan-Syn-Data/README.md @@ -7,9 +7,7 @@ These are e2e example scripts for finetuning Wan2.1 T2V with VSA to accelerate i ## Make sure you have installed VSA ```bash -cd csrc/attn -git submodule update --init --recursive -python setup_vsa.py install +pip install vsa ``` ### Download the synthetic dataset: