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
4e810910
Commit
4e810910
authored
4 years ago
by
Yifan Zhao
Browse files
Options
Downloads
Patches
Plain Diff
Added (partial) support for tuning device
parent
bc4614fb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
predtuner/pipedbin.py
+4
-3
4 additions, 3 deletions
predtuner/pipedbin.py
with
4 additions
and
3 deletions
predtuner/pipedbin.py
+
4
−
3
View file @
4e810910
...
...
@@ -6,7 +6,7 @@ from typing import Dict, List, Optional, Sequence, Tuple, Union
import
numpy
as
np
import
torch
from
.approxapp
import
ApproxKnob
,
BaselineKnob
,
KnobsT
from
.approxapp
import
ApproxKnob
,
KnobsT
from
.modeledapp
import
(
IPerfModel
,
IQoSModel
,
...
...
@@ -29,6 +29,7 @@ class PipedBinaryApp(ModeledApp):
metadata_path
:
PathLike
,
base_dir
:
PathLike
=
None
,
qos_relpath
:
PathLike
=
"
final_accuracy
"
,
tuning_device
:
str
=
None
,
model_storage_folder
:
Optional
[
PathLike
]
=
None
,
):
self
.
app_name
=
app_name
...
...
@@ -54,7 +55,7 @@ class PipedBinaryApp(ModeledApp):
if
not
self
.
binary_path
.
is_file
():
raise
RuntimeError
(
f
"
Binary file
{
self
.
binary_path
}
not found
"
)
super
().
__init__
(
op_knobs
)
# Init here
super
().
__init__
(
op_knobs
,
tuning_device
)
# Init here
self
.
knob_exporter
=
HPVMConfigBuilder
(
list
(
op_knobs
.
keys
()))
self
.
process
=
None
self
.
_invoke_binary
()
...
...
@@ -178,7 +179,7 @@ class PipedBinaryApp(ModeledApp):
raise
ValueError
(
f
"
baseline_knob
{
baseline_knob
}
is undefined
"
)
# Create actual knob object from knob names
name2knob
=
{
s
:
BaselineKnob
(
s
)
if
s
==
baseline_knob
else
ApproxKnob
(
s
)
s
:
ApproxKnob
(
s
,
baseline_priority
=
(
0
if
s
==
baseline_knob
else
None
)
)
for
s
in
knobs_used
}
op_knobs
=
{
op
:
[
name2knob
[
k
]
for
k
in
knobs
]
for
op
,
knobs
in
op_knobs
.
items
()}
...
...
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