-
Notifications
You must be signed in to change notification settings - Fork 1
108 lines (105 loc) · 3.66 KB
/
unittest_ci_cpu.yml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: CPU Unit Test CI
on:
push:
paths-ignore:
- "docs/*"
- "third_party/*"
- .gitignore
- "*.md"
pull_request:
paths-ignore:
- "docs/*"
- "third_party/*"
- .gitignore
- "*.md"
jobs:
build_test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: linux.2xlarge
# ideally we run on 3.8 and 3.9 as well, however we are limited in resources.
python-version: 3.7
python-tag: "py37"
cuda-tag: "cpu"
# build and test on cpu hosts
steps:
- name: Check ldd --version
run: ldd --version
- name: Checkout
uses: actions/checkout@v2
- name: Update pip
run: |
sudo yum update -y
sudo yum -y install git python3-pip
sudo pip3 install --upgrade pip
- name: Setup conda
run: |
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh
bash ~/miniconda.sh -b -p $HOME/miniconda
- name: setup Path
run: |
echo "/home/ec2-user/miniconda/bin" >> $GITHUB_PATH
echo "CONDA=/home/ec2-user/miniconda" >> $GITHUB_PATH
- name: create conda env
run: |
conda create --name build_binary python=${{ matrix.python-version }}
conda info
- name: check python version no Conda
run: |
python --version
- name: check python version
run: |
conda run -n build_binary python --version
- name: Install gcc
shell: bash
run: |
sudo yum group install -y "Development Tools"
- name: setup Path
run: |
echo /usr/local/bin >> $GITHUB_PATH
- name: Install PyTorch
shell: bash
run: |
conda run -n build_binary python -m pip install --pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cpu
- name: Install Dependencies
shell: bash
run: |
conda run -n build_binary python -m pip install -r requirements.txt
- name: Replace fbgemm_gpu_gpu to fbgemm_gpu_cpu
shell: bash
run: |
conda run -n build_binary python -m pip uninstall fbgemm_gpu-nightly -y
conda run -n build_binary python -m pip install fbgemm-gpu-nightly-cpu
- name: Test Installation of dependencies
run: |
conda run -n build_binary python -c "import torch.distributed"
echo "torch.distributed succeeded"
conda run -n build_binary python -c "import skbuild"
echo "skbuild succeeded"
conda run -n build_binary python -c "import numpy"
echo "numpy succeeded"
conda run -n build_binary python -c "import fbgemm_gpu"
echo "fbgemm_gpu succeeded"
# for the conda run with quotes, we have to use "\" and double quotes
# here is the issue: https://github.com/conda/conda/issues/10972
- name: Build TorchRec
run: |
conda run -n build_binary \
python setup.py bdist_wheel \
--package_name torchrec-test-cpu \
--python-tag=${{ matrix.python-tag }}
- name: Test torchrec installation
shell: bash
run: |
conda run -n build_binary \
python -c "import torchrec"
- name: Test with pytest
run: |
conda run -n build_binary \
python -m pip install pytest
conda run -n build_binary \
python -m pytest torchrec -v -s -W ignore::pytest.PytestCollectionWarning --continue-on-collection-errors -k 'not test_sharding_gloo_cw'