Skip to content

Commit c31d116

Browse files
committed
Update build.yml
1 parent e61431f commit c31d116

1 file changed

Lines changed: 26 additions & 121 deletions

File tree

.github/workflows/build.yml

Lines changed: 26 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
type: boolean
1010
push:
1111
branches:
12-
- master
12+
- dreamio
1313
- ci
1414
paths:
1515
[
@@ -82,14 +82,14 @@ jobs:
8282
8383
- name: Pack artifacts
8484
id: pack_artifacts
85-
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
85+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/dreamio' ) || github.event.inputs.create_release == 'true' }}
8686
run: |
8787
cp ggml/LICENSE ./build/bin/ggml.txt
8888
cp LICENSE ./build/bin/stable-diffusion.cpp.txt
8989
zip -j sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-${{ steps.system-info.outputs.OS_NAME }}-${{ steps.system-info.outputs.OS_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}.zip ./build/bin/*
9090
9191
- name: Upload artifacts
92-
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
92+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/dreamio' ) || github.event.inputs.create_release == 'true' }}
9393
uses: actions/upload-artifact@v4
9494
with:
9595
name: sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-${{ steps.system-info.outputs.OS_NAME }}-${{ steps.system-info.outputs.OS_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}.zip
@@ -252,14 +252,14 @@ jobs:
252252
253253
- name: Pack artifacts
254254
id: pack_artifacts
255-
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
255+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/dreamio' ) || github.event.inputs.create_release == 'true' }}
256256
run: |
257257
cp ggml/LICENSE ./build/bin/ggml.txt
258258
cp LICENSE ./build/bin/stable-diffusion.cpp.txt
259259
zip -j sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-${{ steps.system-info.outputs.OS_NAME }}-${{ steps.system-info.outputs.OS_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}.zip ./build/bin/*
260260
261261
- name: Upload artifacts
262-
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
262+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/dreamio' ) || github.event.inputs.create_release == 'true' }}
263263
uses: actions/upload-artifact@v4
264264
with:
265265
name: sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-${{ steps.system-info.outputs.OS_TYPE }}-${{ steps.system-info.outputs.OS_NAME }}-${{ steps.system-info.outputs.OS_VERSION }}-${{ steps.system-info.outputs.CPU_ARCH }}.zip
@@ -276,17 +276,21 @@ jobs:
276276
matrix:
277277
include:
278278
- build: "noavx"
279-
defines: "-DGGML_NATIVE=OFF -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_FMA=OFF -DSD_BUILD_SHARED_LIBS=ON"
279+
defines: "-DGGML_NATIVE=OFF -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_AVX512=OFF -DGGML_FMA=OFF -DSD_BUILD_SHARED_LIBS=ON"
280280
- build: "avx2"
281-
defines: "-DGGML_NATIVE=OFF -DGGML_AVX2=ON -DSD_BUILD_SHARED_LIBS=ON"
281+
defines: "-DGGML_NATIVE=OFF -DGGML_AVX2=ON -DGGML_AVX512=OFF -DSD_BUILD_SHARED_LIBS=ON"
282282
- build: "avx"
283-
defines: "-DGGML_NATIVE=OFF -DGGML_AVX=ON -DGGML_AVX2=OFF -DSD_BUILD_SHARED_LIBS=ON"
283+
defines: "-DGGML_NATIVE=OFF -DGGML_AVX=ON -DGGML_AVX2=OFF -DGGML_AVX512=OFF -DSD_BUILD_SHARED_LIBS=ON"
284284
- build: "avx512"
285285
defines: "-DGGML_NATIVE=OFF -DGGML_AVX512=ON -DGGML_AVX=ON -DGGML_AVX2=ON -DSD_BUILD_SHARED_LIBS=ON"
286286
- build: "cuda12"
287-
defines: "-DSD_CUDA=ON -DSD_BUILD_SHARED_LIBS=ON -DCMAKE_CUDA_ARCHITECTURES='61;70;75;80;86;89;90;100;120' -DCMAKE_CUDA_FLAGS='-Xcudafe \"--diag_suppress=177\" -Xcudafe \"--diag_suppress=550\"'"
288-
- build: "vulkan"
289-
defines: "-DSD_VULKAN=ON -DSD_BUILD_SHARED_LIBS=ON"
287+
defines: "-DSD_CUDA=ON -DGGML_AVX512=OFF -DSD_BUILD_SHARED_LIBS=ON"
288+
- build: "cuda12-noavx"
289+
defines: "-DGGML_NATIVE=OFF -DSD_CUDA=ON -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_AVX512=OFF -DGGML_FMA=OFF -DSD_BUILD_SHARED_LIBS=ON"
290+
- build: 'vulkan'
291+
defines: "-DSD_VULKAN=ON -DGGML_AVX512=OFF -DSD_BUILD_SHARED_LIBS=ON"
292+
- build: 'vulkan-noavx'
293+
defines: "-DGGML_NATIVE=OFF -DSD_VULKAN=ON -DGGML_AVX=OFF -DGGML_AVX2=OFF -DGGML_AVX512=OFF -DGGML_FMA=OFF -DSD_BUILD_SHARED_LIBS=ON"
290294
steps:
291295
- name: Clone
292296
id: checkout
@@ -296,16 +300,16 @@ jobs:
296300

297301
- name: Install cuda-toolkit
298302
id: cuda-toolkit
299-
if: ${{ matrix.build == 'cuda12' }}
303+
if: ${{ matrix.build == 'cuda12' || matrix.build == 'cuda12-noavx' }}
300304
uses: Jimver/cuda-toolkit@v0.2.22
301305
with:
302-
cuda: "12.8.1"
306+
cuda: "12.4.0"
303307
method: "network"
304308
sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]'
305309

306310
- name: Install Vulkan SDK
307311
id: get_vulkan
308-
if: ${{ matrix.build == 'vulkan' }}
312+
if: ${{ matrix.build == 'vulkan' || matrix.build == 'vulkan-noavx' }}
309313
run: |
310314
curl.exe -o $env:RUNNER_TEMP/VulkanSDK-Installer.exe -L "https://sdk.lunarg.com/sdk/download/${env:VULKAN_VERSION}/windows/vulkansdk-windows-X64-${env:VULKAN_VERSION}.exe"
311315
& "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install
@@ -339,12 +343,12 @@ jobs:
339343
340344
- name: Get commit hash
341345
id: commit
342-
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
346+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/dreamio' ) || github.event.inputs.create_release == 'true' }}
343347
uses: pr-mpt/actions-commit-hash@v2
344348

345349
- name: Pack artifacts
346350
id: pack_artifacts
347-
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
351+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/dreamio' ) || github.event.inputs.create_release == 'true' }}
348352
run: |
349353
$filePath = ".\build\bin\Release\*"
350354
if (Test-Path $filePath) {
@@ -364,129 +368,31 @@ jobs:
364368
365369
- name: Copy and pack Cuda runtime
366370
id: pack_cuda_runtime
367-
if: ${{ matrix.build == 'cuda12' && (github.event_name == 'push' && github.ref == 'refs/heads/master' || github.event.inputs.create_release == 'true') }}
371+
if: ${{ matrix.build == 'cuda12' && (github.event_name == 'push' && github.ref == 'refs/heads/dreamio' || github.event.inputs.create_release == 'true') }}
368372
run: |
369373
echo "Cuda install location: ${{steps.cuda-toolkit.outputs.CUDA_PATH}}"
370374
$dst='.\build\bin\cudart\'
371375
robocopy "${{steps.cuda-toolkit.outputs.CUDA_PATH}}\bin" $dst cudart64_*.dll cublas64_*.dll cublasLt64_*.dll
372376
7z a cudart-sd-bin-win-cu12-x64.zip $dst\*
373377
374378
- name: Upload Cuda runtime
375-
if: ${{ matrix.build == 'cuda12' && (github.event_name == 'push' && github.ref == 'refs/heads/master' || github.event.inputs.create_release == 'true') }}
379+
if: ${{ matrix.build == 'cuda12' && (github.event_name == 'push' && github.ref == 'refs/heads/dreamio' || github.event.inputs.create_release == 'true') }}
376380
uses: actions/upload-artifact@v4
377381
with:
378382
name: sd-cudart-sd-bin-win-cu12-x64.zip
379383
path: |
380384
cudart-sd-bin-win-cu12-x64.zip
381385
382386
- name: Upload artifacts
383-
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
387+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/dreamio' ) || github.event.inputs.create_release == 'true' }}
384388
uses: actions/upload-artifact@v4
385389
with:
386390
name: sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-x64.zip
387391
path: |
388392
sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-${{ matrix.build }}-x64.zip
389393
390-
windows-latest-cmake-hip:
391-
runs-on: windows-2022
392-
393-
env:
394-
HIPSDK_INSTALLER_VERSION: "25.Q3"
395-
GPU_TARGETS: "gfx1151;gfx1200;gfx1201;gfx1100;gfx1101;gfx1102;gfx1030;gfx1031;gfx1032"
396-
397-
steps:
398-
- uses: actions/checkout@v3
399-
with:
400-
submodules: recursive
401-
402-
- name: Cache ROCm Installation
403-
id: cache-rocm
404-
uses: actions/cache@v4
405-
with:
406-
path: C:\Program Files\AMD\ROCm
407-
key: rocm-${{ env.HIPSDK_INSTALLER_VERSION }}-${{ runner.os }}
408-
409-
- name: ccache
410-
uses: ggml-org/ccache-action@v1.2.16
411-
with:
412-
key: windows-latest-cmake-hip-${{ env.HIPSDK_INSTALLER_VERSION }}-x64
413-
evict-old-files: 1d
414-
415-
- name: Install ROCm
416-
if: steps.cache-rocm.outputs.cache-hit != 'true'
417-
run: |
418-
$ErrorActionPreference = "Stop"
419-
write-host "Downloading AMD HIP SDK Installer"
420-
Invoke-WebRequest -Uri "https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-${{ env.HIPSDK_INSTALLER_VERSION }}-WinSvr2022-For-HIP.exe" -OutFile "${env:RUNNER_TEMP}\rocm-install.exe"
421-
write-host "Installing AMD HIP SDK"
422-
$proc = Start-Process "${env:RUNNER_TEMP}\rocm-install.exe" -ArgumentList '-install' -NoNewWindow -PassThru
423-
$completed = $proc.WaitForExit(600000)
424-
if (-not $completed) {
425-
Write-Error "ROCm installation timed out after 10 minutes. Killing the process"
426-
$proc.Kill()
427-
exit 1
428-
}
429-
if ($proc.ExitCode -ne 0) {
430-
Write-Error "ROCm installation failed with exit code $($proc.ExitCode)"
431-
exit 1
432-
}
433-
write-host "Completed AMD HIP SDK installation"
434-
435-
- name: Verify ROCm
436-
run: |
437-
# Find and test ROCm installation
438-
$clangPath = Get-ChildItem 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | Select-Object -First 1
439-
if (-not $clangPath) {
440-
Write-Error "ROCm installation not found"
441-
exit 1
442-
}
443-
& $clangPath.FullName --version
444-
# Set HIP_PATH environment variable for later steps
445-
echo "HIP_PATH=$(Resolve-Path 'C:\Program Files\AMD\ROCm\*\bin\clang.exe' | split-path | split-path)" >> $env:GITHUB_ENV
446-
447-
- name: Build
448-
run: |
449-
mkdir build
450-
cd build
451-
$env:CMAKE_PREFIX_PATH="${env:HIP_PATH}"
452-
cmake .. `
453-
-G "Unix Makefiles" `
454-
-DSD_HIPBLAS=ON `
455-
-DSD_BUILD_SHARED_LIBS=ON `
456-
-DGGML_NATIVE=OFF `
457-
-DCMAKE_C_COMPILER=clang `
458-
-DCMAKE_CXX_COMPILER=clang++ `
459-
-DCMAKE_BUILD_TYPE=Release `
460-
-DGPU_TARGETS="${{ env.GPU_TARGETS }}"
461-
cmake --build . --config Release --parallel ${env:NUMBER_OF_PROCESSORS}
462-
463-
- name: Get commit hash
464-
id: commit
465-
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
466-
uses: pr-mpt/actions-commit-hash@v2
467-
468-
- name: Pack artifacts
469-
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
470-
run: |
471-
md "build\bin\rocblas\library\"
472-
md "build\bin\hipblaslt\library"
473-
cp "${env:HIP_PATH}\bin\hipblas.dll" "build\bin\"
474-
cp "${env:HIP_PATH}\bin\hipblaslt.dll" "build\bin\"
475-
cp "${env:HIP_PATH}\bin\rocblas.dll" "build\bin\"
476-
cp "${env:HIP_PATH}\bin\rocblas\library\*" "build\bin\rocblas\library\"
477-
cp "${env:HIP_PATH}\bin\hipblaslt\library\*" "build\bin\hipblaslt\library\"
478-
7z a sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-rocm-x64.zip .\build\bin\*
479-
480-
- name: Upload artifacts
481-
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
482-
uses: actions/upload-artifact@v4
483-
with:
484-
name: sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-rocm-x64.zip
485-
path: |
486-
sd-${{ env.BRANCH_NAME }}-${{ steps.commit.outputs.short }}-bin-win-rocm-x64.zip
487-
488394
release:
489-
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/master' ) || github.event.inputs.create_release == 'true' }}
395+
if: ${{ ( github.event_name == 'push' && github.ref == 'refs/heads/dreamio' ) || github.event.inputs.create_release == 'true' }}
490396

491397
runs-on: ubuntu-latest
492398

@@ -496,7 +402,6 @@ jobs:
496402
- build-and-push-docker-images
497403
- macOS-latest-cmake
498404
- windows-latest-cmake
499-
- windows-latest-cmake-hip
500405

501406
steps:
502407
- name: Clone
@@ -523,7 +428,7 @@ jobs:
523428

524429
- name: Create release
525430
id: create_release
526-
if: ${{ github.event_name == 'workflow_dispatch' || github.ref_name == 'master' }}
431+
if: ${{ github.event_name == 'workflow_dispatch' || github.ref_name == 'dreamio' }}
527432
uses: anzz1/action-create-release@v1
528433
env:
529434
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -532,7 +437,7 @@ jobs:
532437

533438
- name: Upload release
534439
id: upload_release
535-
if: ${{ github.event_name == 'workflow_dispatch' || github.ref_name == 'master' }}
440+
if: ${{ github.event_name == 'workflow_dispatch' || github.ref_name == 'dreamio' }}
536441
uses: actions/github-script@v3
537442
with:
538443
github-token: ${{secrets.GITHUB_TOKEN}}

0 commit comments

Comments
 (0)