export HIP_VISIBLE_DEVICES=5

# export LD_LIBRARY_PATH=/home/user/sugon-test/cx/wan/ComfyUI/rocblas-install-0910/lib:$LD_LIBRARY_PATH
# ldd /opt/dtk-25.04.1/lib/rocblas/benchmark_tool/rocblas-bench 
# export ROCBLAS_LAYER=3

# export FLASH_ATTENTION_PRINT_PARAM=1

# export TORCHINDUCTOR_CACHE_DIR=./tune-cache-vae-0923

# export GPU_FLUSH_ON_EXECUTION=1
# export AMD_SERIALIZE_KERNEL=1
# export AMD_SERIALIZE_COPY=1
# 日志路径
BASE_DIR="./wan21-bs2-log"

if [ ! -d "$BASE_DIR" ]; then
    mkdir -p "$BASE_DIR"
    echo "目录 $BASE_DIR 已创建。"
else
    echo "目录 $BASE_DIR 已存在。"
fi

TIMESTAMP="$(date +%Y%m%d%H%M%S)"

JSON_FILE="${BASE_DIR}/${TIMESTAMP}.json"
LOG_FILE="${BASE_DIR}/${TIMESTAMP}.log"
python main.py --use-pytorch-cross-attention --jsondir "$JSON_FILE" 2>&1 | tee "$LOG_FILE"
# python main.py --use-flash-attention --jsondir "$JSON_FILE" 2>&1 | tee "$LOG_FILE"
