Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
predtuner
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
Package registry
Model registry
Operate
Environments
Terraform modules
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
predtuner
Commits
70ead4a7
Commit
70ead4a7
authored
4 years ago
by
Yifan Zhao
Browse files
Options
Downloads
Patches
Plain Diff
Added example for hpvm binary tuning
parent
97c95f63
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+7
-0
7 additions, 0 deletions
README.md
examples/tune_hpvm_bin.py
+21
-0
21 additions, 0 deletions
examples/tune_hpvm_bin.py
predtuner/__init__.py
+1
-0
1 addition, 0 deletions
predtuner/__init__.py
with
29 additions
and
0 deletions
README.md
+
7
−
0
View file @
70ead4a7
...
...
@@ -40,3 +40,10 @@ You can open this in the browser and browse to "Getting Started" section.
[
here
](
https://drive.google.com/file/d/1Z84z-nsv_nbrr8t9i28UoxSJg-Sd_Ddu/view?usp=sharing
)
.
In either case, there should be a
`model_params/`
folder at the root of repo after extraction.
## Binary Tuning Support for HPVM
This branch (
`hpvm`
) contains experimental support for tuning with HPVM binary.
See
`examples/tune_hpvm_bin.py`
for an example tuning session using such a binary file.
TODO: attach a frontend-generated binary as an actual example.
This diff is collapsed.
Click to expand it.
examples/tune_hpvm_bin.py
0 → 100644
+
21
−
0
View file @
70ead4a7
import
site
from
pathlib
import
Path
site
.
addsitedir
(
Path
(
__file__
).
parent
.
parent
.
absolute
().
as_posix
())
from
predtuner
import
PipedBinaryApp
,
config_pylogger
# Set up logger to put log file in /tmp
msg_logger
=
config_pylogger
(
output_dir
=
"
/tmp
"
,
verbose
=
True
)
# TODO: fill in these 2 paths:
binary_file
=
""
metadata_file
=
""
# Create a "piped binary application"
app
=
PipedBinaryApp
(
"
TestBinaryApp
"
,
binary_file
,
metadata_file
)
# Start tuning -- see tune_vgg16_cifar10.py for more details on the options
tuner
=
app
.
get_tuner
()
tuner
.
tune
(
100
,
3.0
,
3.0
,
True
,
50
,
cost_model
=
"
cost_linear
"
)
tuner
.
dump_configs
(
"
configs.json
"
)
fig
=
tuner
.
plot_configs
(
show_qos_loss
=
True
)
fig
.
savefig
(
"
configs.png
"
,
dpi
=
300
)
app
.
dump_hpvm_configs
(
tuner
.
best_configs
,
"
hpvm_confs.txt
"
)
This diff is collapsed.
Click to expand it.
predtuner/__init__.py
+
1
−
0
View file @
70ead4a7
...
...
@@ -9,5 +9,6 @@ from .modeledapp import (
QoSModelP1
,
QoSModelP2
,
)
from
.pipedbin
import
PipedBinaryApp
from
.torchapp
import
TorchApp
,
TorchApproxKnob
from
.torchutil
import
accuracy
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