File tree Expand file tree Collapse file tree 13 files changed +163
-36
lines changed Expand file tree Collapse file tree 13 files changed +163
-36
lines changed Original file line number Diff line number Diff line change @@ -17,17 +17,23 @@ OS_VERSION=22.04
17
17
CLANG_VERSION=12
18
18
PYTHON_VERSION=3.10
19
19
MINICONDA_VERSION=23.5.1-0
20
- TORCH_VERSION=$( cat ci_commit_pins/pytorch.txt)
21
20
BUCK2_VERSION=$( cat ci_commit_pins/buck2.txt)
22
21
22
+ NIGHTLY=$( cat ci_commit_pins/nightly.txt)
23
+ TORCH_VERSION=$( cat ci_commit_pins/pytorch.txt)
24
+ TORCHAUDIO_VERSION=$( cat ci_commit_pins/audio.txt)
25
+ TORCHVISION_VERSION=$( cat ci_commit_pins/vision.txt)
26
+
23
27
docker build \
24
28
--no-cache \
25
29
--progress=plain \
26
30
--build-arg " OS_VERSION=${OS_VERSION} " \
27
31
--build-arg " CLANG_VERSION=${CLANG_VERSION} " \
28
32
--build-arg " PYTHON_VERSION=${PYTHON_VERSION} " \
29
33
--build-arg " MINICONDA_VERSION=${MINICONDA_VERSION} " \
30
- --build-arg " TORCH_VERSION=${TORCH_VERSION} " \
34
+ --build-arg " TORCH_VERSION=${TORCH_VERSION} .${NIGHTLY} " \
35
+ --build-arg " TORCHAUDIO_VERSION=${TORCHAUDIO_VERSION} .${NIGHTLY} " \
36
+ --build-arg " TORCHVISION_VERSION=${TORCHVISION_VERSION} .${NIGHTLY} " \
31
37
--build-arg " BUCK2_VERSION=${BUCK2_VERSION} " \
32
38
-f " ${OS} " /Dockerfile \
33
39
" $@ " \
Original file line number Diff line number Diff line change
1
+ 2.1.0
Original file line number Diff line number Diff line change
1
+ dev20230813
Original file line number Diff line number Diff line change 1
- 2.1.0.dev20230813
1
+ 2.1.0
Original file line number Diff line number Diff line change
1
+ 0.16.0
Original file line number Diff line number Diff line change @@ -40,7 +40,11 @@ install_pip_dependencies() {
40
40
pushd /opt/conda
41
41
# Install all Python dependencies, including PyTorch
42
42
pip_install -r /opt/conda/requirements-ci.txt
43
- pip_install --pre torch==" ${TORCH_VERSION} " --index-url https://download.pytorch.org/whl/nightly/cpu
43
+ pip_install --pre \
44
+ torch==" ${TORCH_VERSION} " \
45
+ torchaudio==" ${TORCHAUDIO_VERSION} " \
46
+ torchvision==" ${TORCHVISION_VERSION} " \
47
+ --index-url https://download.pytorch.org/whl/nightly/cpu
44
48
popd
45
49
}
46
50
Original file line number Diff line number Diff line change @@ -28,6 +28,8 @@ RUN bash ./install_user.sh && rm install_user.sh
28
28
ARG MINICONDA_VERSION
29
29
ARG PYTHON_VERSION
30
30
ARG TORCH_VERSION
31
+ ARG TORCHAUDIO_VERSION
32
+ ARG TORCHVISION_VERSION
31
33
ENV PYTHON_VERSION=$PYTHON_VERSION
32
34
ENV PATH /opt/conda/envs/py_$PYTHON_VERSION/bin:/opt/conda/bin:$PATH
33
35
COPY requirements-ci.txt /opt/conda/
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/env python
2
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ # All rights reserved.
4
+ #
5
+ # This source code is licensed under the BSD-style license found in the
6
+ # LICENSE file in the root directory of this source tree.
7
+
8
+ import json
9
+ import os
10
+ from typing import Any
11
+
12
+ from examples .models import MODEL_NAME_TO_MODEL
13
+
14
+
15
+ def set_output (name : str , val : Any ) -> None :
16
+ """
17
+ Set the GitHb output so that it can be accessed by other jobs
18
+ """
19
+ print (f"Setting { val } to GitHub output" )
20
+
21
+ if os .getenv ("GITHUB_OUTPUT" ):
22
+ with open (str (os .getenv ("GITHUB_OUTPUT" )), "a" ) as env :
23
+ print (f"{ name } ={ val } " , file = env )
24
+ else :
25
+ print (f"::set-output name={ name } ::{ val } " )
26
+
27
+
28
+ def export_models_for_ci () -> None :
29
+ """
30
+ This gathers all the example models that we want to test on GitHub OSS CI
31
+ """
32
+ # This is the JSON syntax for configuration matrix used by GitHub
33
+ # https://docs.github.com/en/actions/using-jobs/using-a-matrix-for-your-jobs
34
+ models = {"include" : [{"model" : name } for name in MODEL_NAME_TO_MODEL .keys ()]}
35
+ set_output ("models" , json .dumps (models ))
36
+
37
+
38
+ if __name__ == "__main__" :
39
+ export_models_for_ci ()
Original file line number Diff line number Diff line change 7
7
8
8
set -exu
9
9
10
+ # shellcheck source=/dev/null
11
+ source " $( dirname " ${BASH_SOURCE[0]} " ) /utils.sh"
12
+
10
13
install_buck () {
11
14
if ! command -v zstd & > /dev/null; then
12
15
brew install zstd
@@ -33,23 +36,6 @@ install_buck() {
33
36
fi
34
37
}
35
38
36
- install_conda () {
37
- pushd .ci/docker
38
- # Install conda dependencies like flatbuffer
39
- conda install --file conda-env-ci.txt
40
- popd
41
- }
42
-
43
- install_pip_dependencies () {
44
- pushd .ci/docker
45
- # Install all Python dependencies, including PyTorch
46
- pip install --progress-bar off -r requirements-ci.txt
47
-
48
- TORCH_VERSION=$( cat ci_commit_pins/pytorch.txt)
49
- pip install --progress-bar off --pre torch==" ${TORCH_VERSION} " --index-url https://download.pytorch.org/whl/nightly/cpu
50
- popd
51
- }
52
-
53
39
install_buck
54
40
install_conda
55
41
install_pip_dependencies
Original file line number Diff line number Diff line change @@ -10,8 +10,15 @@ set -exu
10
10
# shellcheck source=/dev/null
11
11
source " $( dirname " ${BASH_SOURCE[0]} " ) /utils.sh"
12
12
13
+ MODEL_NAME=$1
14
+ if [[ -z " ${MODEL_NAME:- } " ]]; then
15
+ echo " Missing model name, exiting..."
16
+ exit 1
17
+ else
18
+ echo " Testing ${MODEL_NAME} ..."
19
+ fi
20
+
13
21
test_model () {
14
- MODEL_NAME=$1
15
22
python -m examples.export.export_example --model_name=" ${MODEL_NAME} "
16
23
17
24
# Run test model
@@ -24,7 +31,7 @@ build_and_test_executorch() {
24
31
rm -rf " ${CMAKE_OUTPUT_DIR} " && mkdir " ${CMAKE_OUTPUT_DIR} "
25
32
26
33
pushd " ${CMAKE_OUTPUT_DIR} "
27
- cmake -DBUCK2=buck2 ..
34
+ cmake -DBUCK2=buck2 -DPYTHON_EXECUTABLE= " ${PYTHON_EXECUTABLE} " ..
28
35
popd
29
36
30
37
if [ " $( uname) " == " Darwin" ]; then
@@ -35,9 +42,13 @@ build_and_test_executorch() {
35
42
cmake --build " ${CMAKE_OUTPUT_DIR} " -j " ${CMAKE_JOBS} "
36
43
37
44
which python
38
- # Test the example linear model
39
- test_model " linear "
45
+ # Test the select model
46
+ test_model
40
47
}
41
48
49
+ if [[ -z " ${PYTHON_EXECUTABLE:- } " ]]; then
50
+ PYTHON_EXECUTABLE=python3
51
+ fi
52
+
42
53
install_executorch
43
54
build_and_test_executorch
You can’t perform that action at this time.
0 commit comments