Skip to content

Commit

Permalink
Merge pull request #28 from locaal-ai/roy.fix_acceleration_flags
Browse files Browse the repository at this point in the history
refactor: Update acceleration option in build and package scripts
  • Loading branch information
royshil authored Sep 22, 2024
2 parents 112d1cb + 1e45ac7 commit ccf7bd4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .github/actions/build-plugin/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ inputs:
description: 'Build configuration'
required: false
default: 'RelWithDebInfo'
cublas:
description: 'Enable cuBLAS'
acceleration:
description: 'Enable acceleration'
required: false
default: 'cpu'
codesign:
Expand Down Expand Up @@ -86,7 +86,7 @@ runs:
.github/scripts/Build-Windows.ps1 @BuildArgs
env:
CPU_OR_CUDA: ${{ inputs.cublas }}
ACCELERATION: ${{ inputs.acceleration }}

- name: Create Summary 📊
if: contains(fromJSON('["Linux", "macOS"]'),runner.os)
Expand Down
6 changes: 3 additions & 3 deletions .github/actions/package-plugin/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ inputs:
description: 'Build configuration'
required: false
default: 'RelWithDebInfo'
cublas:
description: 'Enable cuBLAS'
acceleration:
description: 'Enable acceleration'
required: false
default: 'cpu'
codesign:
Expand Down Expand Up @@ -112,7 +112,7 @@ runs:
$PackageArgs = @{
Target = '${{ inputs.target }}'
Configuration = '${{ inputs.config }}'
Cublas = '${{ inputs.cublas }}'
acceleration = '${{ inputs.acceleration }}'
}
if ( '${{ inputs.package }}' -eq 'true' ) {
Expand Down
12 changes: 2 additions & 10 deletions .github/scripts/Package-Windows.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ param(
[ValidateSet('Debug', 'RelWithDebInfo', 'Release', 'MinSizeRel')]
[string] $Configuration = 'RelWithDebInfo',
[ValidateSet('cpu', 'cuda', 'hipblas')]
[string] $Cublas = 'cpu',
[string] $acceleration = 'cpu',
[switch] $BuildInstaller,
[switch] $SkipDeps
)
Expand Down Expand Up @@ -49,16 +49,8 @@ function Package {
$BuildSpec = Get-Content -Path ${BuildSpecFile} -Raw | ConvertFrom-Json
$ProductName = $BuildSpec.name
$ProductVersion = $BuildSpec.version
# Check if $cublas is cpu or cuda
if ( $Cublas -eq 'cpu' ) {
$CudaName = 'cpu'
} elseif ( $Cublas -eq 'clblast' ) {
$CudaName = 'clblast'
} else {
$CudaName = "cuda${Cublas}"
}

$OutputName = "${ProductName}-${ProductVersion}-windows-${Target}-${CudaName}"
$OutputName = "${ProductName}-${ProductVersion}-windows-${Target}-${acceleration}"

if ( ! $SkipDeps ) {
Install-BuildDependencies -WingetFile "${ScriptHome}/.Wingetfile"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/build-project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ jobs:
needs: check-event
strategy:
matrix:
cublas: [cpu, hipblas, cuda]
acceleration: [cpu, hipblas, cuda]
defaults:
run:
shell: pwsh
Expand Down Expand Up @@ -257,18 +257,18 @@ jobs:
with:
target: x64
config: ${{ needs.check-event.outputs.config }}
cublas: ${{ matrix.cublas }}
acceleration: ${{ matrix.acceleration }}

- name: Package Plugin 📀
uses: ./.github/actions/package-plugin
with:
target: x64
config: ${{ needs.check-event.outputs.config }}
package: ${{ fromJSON(needs.check-event.outputs.package) }}
cublas: ${{ matrix.cublas }}
acceleration: ${{ matrix.acceleration }}

- name: Upload Artifacts 📡
uses: actions/upload-artifact@v4
with:
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-windows-x64-${{ matrix.cublas }}-${{ needs.check-event.outputs.commitHash }}
name: ${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-windows-x64-${{ matrix.acceleration }}-${{ needs.check-event.outputs.commitHash }}
path: ${{ github.workspace }}/release/${{ steps.setup.outputs.pluginName }}-${{ steps.setup.outputs.pluginVersion }}-windows-x64*.*

0 comments on commit ccf7bd4

Please sign in to comment.