diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..9979d7ec --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,29 @@ +name: GitHub Actions Demo +run-name: Pushed by ${{ github.actor }} 🚀 +on: [push] +jobs: + test-xfuser: + name: Test xfuser + runs-on: [self-hosted, linux, x64] + strategy: + fail-fast: false + max-parallel: 5 + matrix: + python-versions: [3.11] + torch-versions: [2.4.1] + include: + - python-versions: 3.11 + python-versions-full: 3_11 + - torch-versions: 2.4.1 + torch-versions-full: 2_4_1 + steps: + - uses: actions/checkout@v4 + + - name: Setup docker + run: docker run --rm --name xfuser_test_docker -d -i -t --runtime=nvidia --gpus all -v /data/models/:/cfs/dit/ -v /home/github/actions-runner/_work/xDiT/xDiT:/code xfuser_cicd/test-py_${{matrix.python-versions-full}}-torch_${{matrix.torch-versions-full}} /bin/bash + - name: Install xfuser + run: docker exec -w /code xfuser_test_docker pip${{matrix.python-versions}} install -e . + - name: Test xfuser + run: docker exec -w /code xfuser_test_docker sh -c "torchrun --nproc_per_node=4 ./examples/sd3_example.py --model /cfs/dit/stable-diffusion-3-medium-diffusers --pipefusion_parallel_degree 2 --ulysses_degree 2 --ring_degree 1 --height 1024 --width 1024 --no_use_resolution_binning --num_inference_steps 20 --warmup_steps 0 --prompt 'A small dog'" + - name: Destroy docker + run: docker stop xfuser_test_docker diff --git a/examples/run.sh b/examples/run.sh index ab9e8d53..b305ff55 100644 --- a/examples/run.sh +++ b/examples/run.sh @@ -94,6 +94,4 @@ $PARALLLEL_VAE \ $COMPILE_FLAG done -done - - +done \ No newline at end of file diff --git a/setup.py b/setup.py index bd19931d..9d5e49bb 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,18 @@ from setuptools import find_packages, setup import subprocess + def get_cuda_version(): try: nvcc_version = subprocess.check_output(["nvcc", "--version"]).decode("utf-8") - version_line = [line for line in nvcc_version.split('\n') if "release" in line][0] - cuda_version = version_line.split(' ')[-2].replace(',', '') - return 'cu' + cuda_version.replace('.', '') + version_line = [line for line in nvcc_version.split("\n") if "release" in line][ + 0 + ] + cuda_version = version_line.split(" ")[-2].replace(",", "") + return "cu" + cuda_version.replace(".", "") except Exception as e: - return 'no_cuda' + return "no_cuda" + if __name__ == "__main__": with open("README.md", "r") as f: @@ -22,16 +26,17 @@ def get_cuda_version(): author_email="fangjiarui123@gmail.com", packages=find_packages(), install_requires=[ - "torch>=2.3.0", - "accelerate==0.33.0", - "diffusers==0.30.2", + "torch>=2.1.0", + "accelerate>=0.33.0", + "diffusers @ git+https://github.com/huggingface/diffusers.git", "transformers>=4.39.1", "sentencepiece>=0.1.99", "beautifulsoup4>=4.12.3", "distvae", - "yunchang==0.3", + "yunchang>=0.3.0", "pytest", "flask", + "opencv-python", ], extras_require={ "[flash_attn]": [