update
This commit is contained in:
@@ -41,10 +41,10 @@ To try sliding tile attention (optional), please follow the instruction in [csrc
|
||||
## 🚀 Inference
|
||||
|
||||
### Inference HunyuanVideo with Sliding Tile Attention
|
||||
Coming soon... Merging commits now.
|
||||
```bash
|
||||
python scripts/huggingface/download_hf.py --repo_id=FastVideo/hunyuan --local_dir=data/hunyuan --repo_type=model
|
||||
# Inference with FA2 full attn
|
||||
sh scripts/inference/inference_hunyuan_STA.sh
|
||||
```
|
||||
|
||||
### Inference FastHunyuan on single RTX4090
|
||||
|
||||
@@ -1,13 +1,19 @@
|
||||
import torch
|
||||
import torch.nn.functional as F
|
||||
|
||||
from einops import rearrange
|
||||
|
||||
from fastvideo.models.flash_attn_no_pad import flash_attn_no_pad
|
||||
from fastvideo.utils.communications import all_gather, all_to_all_4D
|
||||
from fastvideo.utils.parallel_states import (get_sequence_parallel_state,
|
||||
nccl_info)
|
||||
from fastvideo.utils.parallel_states import (
|
||||
get_sequence_parallel_state,
|
||||
nccl_info,
|
||||
)
|
||||
|
||||
from st_attn import sliding_tile_attention
|
||||
|
||||
|
||||
|
||||
def attention(
|
||||
q,
|
||||
k,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import argparse
|
||||
import json
|
||||
import os
|
||||
from pathlib import Path
|
||||
from typing import Any, Dict, Optional, Union
|
||||
|
||||
import imageio
|
||||
import numpy as np
|
||||
@@ -8,12 +10,13 @@ import torch
|
||||
import torch.distributed as dist
|
||||
import torchvision
|
||||
from einops import rearrange
|
||||
import json
|
||||
|
||||
from fastvideo.models.hunyuan.inference import HunyuanVideoSampler
|
||||
from fastvideo.models.hunyuan.modules.modulate_layers import modulate
|
||||
from typing import Any, Optional, Union, Dict
|
||||
from fastvideo.utils.parallel_states import (
|
||||
initialize_sequence_parallel_state, nccl_info)
|
||||
initialize_sequence_parallel_state,
|
||||
nccl_info,
|
||||
)
|
||||
|
||||
|
||||
def teacache_forward(
|
||||
|
||||
Reference in New Issue
Block a user