-
Notifications
You must be signed in to change notification settings - Fork 8
61 lines (58 loc) · 1.77 KB
/
libtorch-linux-cpu-x86_64.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: LibTorch Linux x86_64
on:
workflow_dispatch:
inputs:
branch:
type: string
description: The name of the branch you want to build.
required: true
jobs:
build:
runs-on: ['ubuntu-latest']
container: ubuntu:20.04
defaults:
run:
shell: bash -el {0}
timeout-minutes: 120
steps:
- uses: actions/checkout@v3
- name: Install compilation tools
run: |
apt-get update
apt-get install -y build-essential
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: pytorch
- name: Conda deps
run: |
conda install cmake ninja python git
- name: Clone
run: |
git clone -b ${{ github.event.inputs.branch }} --recurse-submodule https://github.com/pytorch/pytorch.git
- name: Install deps
run: |
cd pytorch
pip install -r requirements.txt
pip install mkl-static mkl-include
- name: Build Libtorch
run: |
mkdir pytorch-build
cd pytorch-build
cmake \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DCMAKE_BUILD_TYPE:STRING=Release \
-DBUILD_PYTHON=OFF \
-DUSE_CUDA=OFF \
-DCMAKE_INSTALL_PREFIX:PATH=../libtorch \
../pytorch
cmake --build . --target install --parallel 8
- name: Create archive
run: |
zip -r libtorch-linux-x86_64-${{ github.event.inputs.branch }}.zip libtorch/
- uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: libtorch-linux-x86_64-${{ github.event.inputs.branch }}.zip
overwrite: true
file_glob: true
tag: LibTorch-for-R