зеркало из https://github.com/microsoft/antares.git
recognize current python executable
This commit is contained in:
Родитель
fd26d8476f
Коммит
6c3c9ae7d5
|
@ -1,11 +1,11 @@
|
|||
## What is Antares:
|
||||
|
||||
**Antares** is an engine to automatically generate optimized kernels for [Multi Backends](backends). It is a framework not only for ***Software developers*** to get backend-related code, but also for ***Hardware developers*** to extend new backends/hareware quickly and easily. Antares frontend is based on [Antares IR](AntaresIR.md) that follows "One Language Syntax for All Platforms".
|
||||
**Antares** (https://github.com/microsoft/antares) is an engine to auto generate optimized kernels for [Multi Backends](backends). It is a framework not only for ***Software developers*** to get backend-related code, but also for ***Hardware developers*** to extend new backends/hareware quickly and easily. Antares frontend is based on [Antares IR](AntaresIR.md) that follows "One Language Syntax for All Platforms".
|
||||
|
||||
### How to Install:
|
||||
|
||||
```sh
|
||||
python3 -m pip install antares
|
||||
python3 -m pip install --upgrade antares
|
||||
```
|
||||
|
||||
### Quick Test:
|
||||
|
@ -40,6 +40,9 @@ antares clean
|
|||
|
||||
# Boot HTTP daemon for accepting searching tasks:
|
||||
antares rest-service
|
||||
|
||||
# Help Information:
|
||||
antares help
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
|
|
@ -13,6 +13,12 @@ if [[ "$@" == "clean" ]]; then
|
|||
exit 0
|
||||
elif [[ "$@" == "rest-server" ]]; then
|
||||
export HTTP_SERVICE=1
|
||||
elif [[ "$@" == "help" ]]; then
|
||||
more ./README.md
|
||||
exit 0
|
||||
elif [[ "$@" != "" ]]; then
|
||||
echo "[ERROR] Unsupported command arguments: $@" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if grep Microsoft /proc/sys/kernel/osrelease >/dev/null || grep WSL2 /proc/sys/kernel/osrelease >/dev/null; then
|
||||
|
@ -77,4 +83,4 @@ ldconfig >/dev/null 2>&1 || true
|
|||
|
||||
[[ "$USING_GDB" == "" ]] || USING_GDB="gdb --ex run --args"
|
||||
|
||||
STEP=${STEP:-0} ${USING_GDB} python3 ./antares/antares_compiler.py "$@"
|
||||
STEP=${STEP:-0} ${USING_GDB} ${PYTHON_EXEC:-python3} ./antares/antares_compiler.py "$@"
|
||||
|
|
|
@ -21,7 +21,7 @@ RUN bash -c 'rm -rf ~/.local/antares/3rdparty/tvm/build/{CMake*,Makefile,cmake_i
|
|||
RUN bash -c 'rm -rf ~/.local/antares/3rdparty/tvm/{src,include,golang,tests,3rdparty,device-stub,apps,.??*}'
|
||||
RUN echo '' > ~/.local/antares/3rdparty/tvm/python/tvm/relay/__init__.py
|
||||
|
||||
ENV ANTARES_VERSION 0.3.1
|
||||
ENV ANTARES_VERSION 0.3.4
|
||||
|
||||
RUN cd ~ && git clone https://github.com/microsoft/antares --single-branch --depth 1 antares_core && mv ~/.local/antares/3rdparty antares_core
|
||||
RUN cd ~ && sed -i "s/@VERSION@/${ANTARES_VERSION}/g" /antares/engine/dist-info/METADATA && cp -r /antares/engine/dist-info ~/antares-${ANTARES_VERSION}.dist-info
|
||||
|
|
|
@ -4,9 +4,9 @@ cd $(dirname $0)/..
|
|||
WORKDIR=$(pwd)
|
||||
|
||||
# Check Python Version
|
||||
python3 -c 'import sys; assert sys.version >= "3.6", "Python Error: Antares depends on Python >= 3.6"'
|
||||
${PYTHON_EXEC:-python3} -c 'import sys; assert sys.version_info.major == 3 and sys.version_info.minor >= 6, "Python Error: Antares depends on Python >= 3.6"'
|
||||
|
||||
if python3 -c 'assert "-packages/antares_core" in "'${WORKDIR}'"' >/dev/null 2>&1; then
|
||||
if ${PYTHON_EXEC:-python3} -c 'assert "-packages/antares_core" in "'${WORKDIR}'"' >/dev/null 2>&1; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
|
Различия файлов скрыты, потому что одна или несколько строк слишком длинны
До Ширина: | Высота: | Размер: 50 KiB |
1
main.py
1
main.py
|
@ -9,6 +9,7 @@ def main():
|
|||
dirname = pathlib.Path(__file__).resolve().parent
|
||||
os.chdir(dirname)
|
||||
cmd = './antares/run.sh'
|
||||
os.environ['PYTHON_EXEC'] = sys.executable
|
||||
os.execl(cmd, cmd, *sys.argv[1:])
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
|
Загрузка…
Ссылка в новой задаче