-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CI][Contrib] Add Vitis-AI docker installation #6342
Merged
tmoreau89
merged 4 commits into
apache:master
from
anilmartha:vitis-ai-ci-docker-contrib
Sep 3, 2020
Merged
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
96f039b
[CI][Contrib] Add Vitis-AI docker installation
e24d958
rename ubuntu_install_vai_packages.sh to ubuntu_install_vitis_ai_pack…
d4bfcd4
Add Dockerfile.demo_vitis_ai and environment scripts
029471f
Add comment to docker/bash describing Xilinx Vitis-AI specific setup
jornt-xilinx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
# CI docker VAI env | ||
FROM xilinx/vitis-ai:latest | ||
|
||
RUN apt-get update --fix-missing | ||
|
||
|
||
COPY install/ubuntu_install_core.sh /install/ubuntu_install_core.sh | ||
RUN bash /install/ubuntu_install_core.sh | ||
|
||
COPY install/ubuntu_install_python.sh /install/ubuntu_install_python.sh | ||
RUN bash /install/ubuntu_install_python.sh | ||
|
||
COPY install/ubuntu_install_python_package.sh /install/ubuntu_install_python_package.sh | ||
RUN bash /install/ubuntu_install_python_package.sh | ||
|
||
COPY install/ubuntu_install_llvm.sh /install/ubuntu_install_llvm.sh | ||
RUN bash /install/ubuntu_install_llvm.sh | ||
|
||
# NNPACK deps | ||
COPY install/ubuntu_install_nnpack.sh /install/ubuntu_install_nnpack.sh | ||
RUN bash /install/ubuntu_install_nnpack.sh | ||
|
||
ENV PATH $PATH:$CARGO_HOME/bin:/usr/lib/go-1.10/bin | ||
|
||
# ANTLR deps | ||
COPY install/ubuntu_install_java.sh /install/ubuntu_install_java.sh | ||
RUN bash /install/ubuntu_install_java.sh | ||
|
||
# Install Vitis-AI ubuntu dependencies | ||
COPY install/ubuntu_install_vitis_ai_core.sh /install/ubuntu_install_vitis_ai_core.sh | ||
RUN bash /install/ubuntu_install_vitis_ai_core.sh | ||
|
||
# Install dependencies inside vitis-ai-tensorflow conda | ||
RUN . $VAI_ROOT/conda/etc/profile.d/conda.sh && \ | ||
conda activate vitis-ai-tensorflow && \ | ||
pip install --no-cache-dir antlr4-python3-runtime && bash /install/ubuntu_install_python_package.sh | ||
|
||
ENV USER="root" |
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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
set -e | ||
set -u | ||
set -o pipefail | ||
|
||
# install libraries for building Vitis-AI on ubuntu | ||
apt-get update && apt-get install -y --no-install-recommends \ | ||
graphviz\ | ||
gnupg2 | ||
|
||
apt-get update && apt-get install -y gcc-aarch64-linux-gnu | ||
|
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
# Licensed to the Apache Software Foundation (ASF) under one | ||
# or more contributor license agreements. See the NOTICE file | ||
# distributed with this work for additional information | ||
# regarding copyright ownership. The ASF licenses this file | ||
# to you under the Apache License, Version 2.0 (the | ||
# "License"); you may not use this file except in compliance | ||
# with the License. You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, | ||
# software distributed under the License is distributed on an | ||
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the License for the | ||
# specific language governing permissions and limitations | ||
# under the License. | ||
|
||
set -e | ||
set -u | ||
set -o pipefail | ||
|
||
export PYXIR_HOME=/opt/pyxir | ||
mkdir "$PYXIR_HOME" | ||
|
||
pip3 install progressbar | ||
|
||
git clone --recursive --branch v0.1.2 https://github.com/Xilinx/pyxir.git "${PYXIR_HOME}" | ||
cd "${PYXIR_HOME}" && python3 setup.py install |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be too xilinx specific. Is it possible to do it in another way ousdier docker/bash? e.g. like the runtime case in nvidia
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The check is indeed Xilinx specific but there are also NVIDIA and GPU specific checks (https://github.com/apache/incubator-tvm/blob/d4bfcd4c4f8861f6716406ebae391f9936434c4e/docker/bash.sh#L54) in the bash.sh so I don't see how this differs. And this is the usual way in which we setup the docker environment with Vitis-AI. Also, the change shouldn't affect the other docker environments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Please add some comments on top of the if section to describe the set of env being setup. We will need to think about cleanly organize the code as we start to add support to more devices, this could be a good starting pt.
Thanks @jtuyls
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One option - out of scope for this specific patch: have a 1:1 function that will do "all that is special about dealing with this specific image."
In this case,
bash.sh
will still be self contained, but we know that some logic (as a function) is only executed if the image requires it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the proposal of @leandron. Would improve clarity in the bash.sh for multiple devices. We could additionally standardize on variables like $VITIS_AI_FLAGS, etc to be edited in the function and to be added to the
docker run
command.@leandron You specifically want to leave this out of this PR as we could easily already write our Vitis-AI changes in this format?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jtuyls I feel it needs a bit more discussion so I wouldn't block this PR merge for that. Despite feeling the idea is appropriate, I think we need to collect feedback in a specific PR.