-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the workflow for Windows build (#93)
- Loading branch information
Showing
17 changed files
with
291 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ on: | |
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
|
||
env: | ||
BUILD_TYPE: Release | ||
|
@@ -17,14 +18,64 @@ jobs: | |
- name: Install Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: '>=1.17.0' | ||
go-version: '1.22.5' | ||
- run: go version | ||
- uses: actions/checkout@v3 | ||
- name: Install OpenMP | ||
run: brew install libomp | ||
run: | | ||
brew install libomp | ||
ls $(brew --prefix)/opt/libomp | ||
- name: Build ffmpeg | ||
run: | | ||
cd third_party | ||
bash install_ffmpeg.sh | ||
rm ffmpeg/version | ||
- name: Configure CMake | ||
run: OpenMP_ROOT=$(brew --prefix)/opt/libomp cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
run: OpenMP_ROOT=$(brew --prefix)/opt/libomp cmake | ||
-B ${{github.workspace}}/build | ||
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
-DWITH_FFMPEG=ON | ||
- name: Build | ||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | ||
- name: Copy dependencies | ||
run: cp $(brew --prefix)/opt/libomp/lib/libomp.dylib ${{github.workspace}}/build/ | ||
- run: install_name_tool | ||
-change "$(brew --prefix)/opt/libomp/lib/libomp.dylib" | ||
'@loader_path/libomp.dylib' | ||
${{github.workspace}}/build/libllm.dylib | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: darwin-build | ||
path: ${{github.workspace}}/build | ||
- name: Test | ||
run: ctest --verbose -C ${{env.BUILD_TYPE}} --test-dir ${{github.workspace}}/build/src/libllm | ||
|
||
release: | ||
permissions: | ||
contents: write | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: download | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: artifacts | ||
- name: Create release package | ||
run: ls -lh artifacts/darwin-build/ && | ||
cd artifacts/darwin-build/ && | ||
chmod +x llm && | ||
tar -cvzf release-darwin-arm64.tar.gz | ||
llm | ||
libllm.dylib | ||
libllmpluginffmpeg.dylib | ||
libomp.dylib | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: darwin-package | ||
path: artifacts/darwin-build/release-darwin-arm64.tar.gz | ||
- name: create-release | ||
uses: softprops/action-gh-release@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
artifacts/darwin-build/release-darwin-arm64.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,34 +19,58 @@ jobs: | |
- uses: Jimver/[email protected] | ||
id: cuda-toolkit | ||
with: | ||
cuda: '12.5.0' | ||
cuda: '11.8.0' | ||
linux-local-args: '["--toolkit"]' | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22.5' | ||
- run: nvcc -V | ||
- run: df -h | ||
- uses: actions/checkout@v3 | ||
- uses: actions/checkout@v3 | ||
- name: Build ffmpeg | ||
run: cd third_party && bash install_ffmpeg.sh | ||
- name: Install cutlass | ||
run: cd third_party && bash install_cutlass.sh | ||
- name: Configure CMake | ||
run: cmake -B ${{github.workspace}}/build | ||
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
-DWITH_CUDA=ON | ||
-DENABLE_FFMPEG_PLUGIN=ON | ||
-DWITH_FFMPEG=ON | ||
-DWITH_CUTLASS=ON | ||
- name: Build | ||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | ||
- name: Test | ||
run: ctest --verbose -C ${{env.BUILD_TYPE}} --test-dir ${{github.workspace}}/build/src/libllm | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: linux-build | ||
path: ${{github.workspace}}/build | ||
|
||
release: | ||
permissions: | ||
contents: write | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: download | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: artifacts | ||
- name: Create release package | ||
run: cd ${{github.workspace}}/build/ && zip release-linux-x64-cuda.zip | ||
run: ls -lh artifacts/linux-build/ && | ||
cd artifacts/linux-build/ && | ||
chmod +x llm && | ||
tar -cvzf release-linux-x64-cuda.tar.gz | ||
llm | ||
libllm.so | ||
libllmplugincublas.so | ||
libllmpluginffmpeg.so | ||
- name: Release | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: linux-package | ||
path: artifacts/linux-build/release-linux-x64-cuda.tar.gz | ||
- name: create-release | ||
uses: softprops/action-gh-release@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: | | ||
${{github.workspace}}/build/release-linux-x64-cuda.zip | ||
artifacts/linux-build/release-linux-x64-cuda.tar.gz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,23 +5,98 @@ on: | |
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
workflow_dispatch: | ||
|
||
env: | ||
BUILD_TYPE: Release | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
runs-on: windows-2019 | ||
steps: | ||
- uses: Jimver/[email protected] | ||
id: cuda-toolkit | ||
with: | ||
cuda: '11.8.0' | ||
method: 'network' | ||
sub-packages: '["nvcc", "cudart", "cublas", "cublas_dev", "thrust", "visual_studio_integration"]' | ||
- name: Install Go | ||
uses: actions/[email protected] | ||
with: | ||
go-version: '>=1.17.0' | ||
go-version: '1.22.5' | ||
- run: go version | ||
- uses: actions/checkout@v3 | ||
- name: Install wget | ||
run: choco install wget --no-progress | ||
- name: Build ffmpeg | ||
run: cd third_party && bash install_ffmpeg.sh | ||
- name: Install cutlass | ||
run: cd third_party && bash install_cutlass.sh | ||
- name: Build ffmpeg plugin for Windows | ||
run: gcc -shared -o llmpluginffmpeg.dll | ||
-Isrc | ||
-Ithird_party/ffmpeg | ||
-DLIBLLM_EXPORTS | ||
-O2 | ||
src/libllm/read_audio_ffmpeg.cc | ||
-Lthird_party/ffmpeg/libavformat | ||
-Lthird_party/ffmpeg/libavcodec | ||
-Lthird_party/ffmpeg/libavfilter | ||
-Lthird_party/ffmpeg/libavutil | ||
-Lthird_party/ffmpeg/libswresample | ||
-lavformat | ||
-lavcodec | ||
-lavfilter | ||
-lavutil | ||
-lswresample | ||
-lbcrypt | ||
-static | ||
shell: bash | ||
- name: Configure CMake | ||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
run: cmake -B ${{github.workspace}}/build | ||
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} | ||
-DWITH_CUDA=ON | ||
-DWITH_CUTLASS=ON | ||
- name: Build | ||
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | ||
- name: Copy dependencies | ||
run: | | ||
copy llmpluginffmpeg.dll ${{github.workspace}}\build | ||
copy c:\windows\system32\vcomp140.dll ${{github.workspace}}\build | ||
copy ${{github.workspace}}\build\${{env.BUILD_TYPE}}\llm.exe ${{github.workspace}}\build | ||
copy ${{github.workspace}}\build\${{env.BUILD_TYPE}}\llm.dll ${{github.workspace}}\build | ||
copy ${{github.workspace}}\build\${{env.BUILD_TYPE}}\llmplugincublas.dll ${{github.workspace}}\build | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: windows-build | ||
path: ${{github.workspace}}/build | ||
- name: Test | ||
run: ${{github.workspace}}\build\${{env.BUILD_TYPE}}\unittest.exe | ||
|
||
release: | ||
permissions: | ||
contents: write # for softprops/action-gh-release to create a release | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: download | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: artifacts | ||
- name: Create release package | ||
run: cd artifacts/windows-build/ && zip release-windows-x64-cuda.zip | ||
llm.exe | ||
llm.dll | ||
llmplugincublas.dll | ||
llmpluginffmpeg.dll | ||
vcomp140.dll | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: windows-package | ||
path: artifacts/windows-build/release-windows-x64-cuda.zip | ||
- name: create-release | ||
if: startsWith(github.ref, 'refs/tags/') | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: | | ||
artifacts/windows-build/release-windows-x64-cuda.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,6 +4,8 @@ transformers | |
/build | ||
/run | ||
/model | ||
/third_party/ffmpeg | ||
/third_party/cutlass | ||
|
||
__pycache__ | ||
*.model | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.