Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hpvm-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
hpvm-release
Commits
5dfa69f6
Commit
5dfa69f6
authored
3 years ago
by
Akash Kothari
Browse files
Options
Downloads
Patches
Plain Diff
Add code to install NVDLA compiler
parent
3291eae1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hpvm/scripts/hpvm_installer.py
+29
-0
29 additions, 0 deletions
hpvm/scripts/hpvm_installer.py
with
29 additions
and
0 deletions
hpvm/scripts/hpvm_installer.py
+
29
−
0
View file @
5dfa69f6
...
...
@@ -18,6 +18,14 @@ MODEL_PARAMS_TAR = Path("model_params.tar.gz")
MODEL_PARAMS_DIR
=
ROOT_DIR
/
"
test/dnn_benchmarks/model_params
"
MODEL_PARAMS_LINK
=
"
https://databank.illinois.edu/datafiles/o3izd/download
"
NVDLA_URL
=
"
https://github.com/nvdla/sw.git
"
NVDLA_DIR
=
ROOT_DIR
/
"
sw
"
NVDLA_UMD_DIR
=
NVDLA_DIR
/
"
umd
"
PROTOBUF_DIR
=
NVDLA_UMD_DIR
/
"
external/protobuf-2.6
"
PROTOBUF_STATIC_LIB
=
PROTOBUF_DIR
/
"
src/.libs/libprotobuf.a
"
COMPILER_APPS_DIR
=
NVDLA_UMD_DIR
/
"
apps/compiler
"
COMPILER_CORE_DIR
=
NVDLA_UMD_DIR
/
"
core/src/compiler
"
LINKS
=
[
"
CMakeLists.txt
"
,
"
cmake
"
,
...
...
@@ -262,6 +270,14 @@ def check_download_model_params():
if
MODEL_PARAMS_TAR
.
is_file
():
MODEL_PARAMS_TAR
.
unlink
()
def
check_download_nvdla_sw
():
if
NVDLA_DIR
.
is_dir
():
print
(
"
Found NVDLA compiler, not downloading it again.
"
)
return
print
(
f
"
Downloading the NVDLA compiler...
"
)
print
(
f
"
=============================
"
)
check_call
([
"
git
"
,
"
clone
"
,
NVDLA_URL
])
def
link_and_patch
():
from
os
import
symlink
...
...
@@ -282,6 +298,17 @@ def link_and_patch():
chdir
(
cwd
)
def
build_nvdla_compiler
():
print
(
"
Building NVDLA compiler...
"
)
chdir
(
PROTOBUF_DIR
)
check_call
([
"
./autogen.sh
"
])
check_call
([
"
./configure
"
])
check_call
([
"
make
"
])
check_call
([
"
cp
"
,
PROTOBUF_STATIC_LIB
,
COMPILER_CORE_DIR
])
check_call
([
"
cp
"
,
PROTOBUF_STATIC_LIB
,
COMPILER_APPS_DIR
])
chdir
(
NVDLA_UMD_DIR
)
check_call
([
"
make
"
,
"
TOP=
"
+
str
(
NVDLA_UMD_DIR
)])
def
build
(
build_dir
:
Path
,
nthreads
:
int
,
...
...
@@ -295,6 +322,7 @@ def build(
cwd
=
Path
.
cwd
()
chdir
(
build_dir
)
build_nvdla_compiler
()
cmake_args
=
[
"
cmake
"
,
str
(
ROOT_DIR
/
"
llvm
"
),
...
...
@@ -359,6 +387,7 @@ def main():
if
not
args
.
no_pypkg
:
check_python_version
()
print_args
(
args
)
check_download_nvdla_sw
()
check_download_llvm_clang
()
link_and_patch
()
if
not
args
.
no_params
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment