No iree instal (#294)

* adds support to default to tuned model

currently setup for tf bert/resnet50
going to refactor test class to avoid having to
add an argument to 50+ files

* adds an option to avoid installing iree

useful when building iree from source
specify env variable NO_BACKEND=1
This commit is contained in:
Daniel Garvey
2022-08-25 15:02:28 -05:00
committed by GitHub
parent 02d857260c
commit 64424877ac
2 changed files with 15 additions and 6 deletions

View File

@@ -7,6 +7,12 @@ with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
PACKAGE_VERSION = os.environ.get("SHARK_PACKAGE_VERSION") or "0.0.4"
backend_deps = []
if os.environ["NO_BACKEND"] is None:
backend_deps = [
"iree-compiler>=20220427.13",
"iree-runtime>=20220427.13",
]
setup(
name="nodai-SHARK",
@@ -32,7 +38,6 @@ setup(
"numpy",
"PyYAML",
"torch-mlir>=20220428.420",
"iree-compiler>=20220427.13",
"iree-runtime>=20220427.13",
],
]
+ backend_deps,
)

View File

@@ -7,6 +7,7 @@
# VENV_DIR=myshark.venv #create a venv called myshark.venv
# USE_IREE=1 #use stock IREE instead of Nod.ai's SHARK build
# IMPORTER=1 #Install importer deps
# NO_BACKEND=1 #Don't install iree or shark backend
# if you run the script from a conda env it will install in your conda env
TD="$(cd $(dirname $0) && pwd)"
@@ -91,9 +92,12 @@ if [[ -z "${USE_IREE}" ]]; then
else
RUNTIME="google/iree"
fi
echo "Installing ${RUNTIME}..."
$PYTHON -m pip install --find-links https://github.com/${RUNTIME}/releases iree-compiler iree-runtime
if [[ -z "${NO_BACKEND}" ]]; then
echo "Installing ${RUNTIME}..."
$PYTHON -m pip install --find-links https://github.com/${RUNTIME}/releases iree-compiler iree-runtime
else
echo "Not installing a backend, please make sure to add your backend to PYTHONPATH"
fi
if [[ ! -z "${IMPORTER}" ]]; then
echo "${Yellow}Installing importer tools.."
if [[ $(uname -s) = 'Linux' ]]; then