Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
distiller
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
distiller
Commits
4cc0e7d6
Commit
4cc0e7d6
authored
6 years ago
by
Neta Zmora
Browse files
Options
Downloads
Patches
Plain Diff
Fix for CPU support
parent
e564a05f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
apputils/checkpoint.py
+1
-1
1 addition, 1 deletion
apputils/checkpoint.py
distiller/scheduler.py
+3
-2
3 additions, 2 deletions
distiller/scheduler.py
with
4 additions
and
3 deletions
apputils/checkpoint.py
+
1
−
1
View file @
4cc0e7d6
...
...
@@ -94,7 +94,7 @@ def load_checkpoint(model, chkpt_file, optimizer=None):
if
'
compression_sched
'
in
checkpoint
:
compression_scheduler
=
distiller
.
CompressionScheduler
(
model
)
compression_scheduler
.
load_state_dict
(
checkpoint
[
'
compression_sched
'
]
,
distiller
.
model_device
(
model
)
)
compression_scheduler
.
load_state_dict
(
checkpoint
[
'
compression_sched
'
])
msglogger
.
info
(
"
Loaded compression schedule from checkpoint (epoch %d)
"
,
checkpoint
[
'
epoch
'
])
else
:
...
...
This diff is collapsed.
Click to expand it.
distiller/scheduler.py
+
3
−
2
View file @
4cc0e7d6
...
...
@@ -23,7 +23,7 @@ import logging
import
torch
from
.quantization.quantizer
import
FP_BKP_PREFIX
from
.policy
import
PolicyLoss
,
LossComponent
from
.utils
import
model_device
msglogger
=
logging
.
getLogger
()
...
...
@@ -187,7 +187,7 @@ class CompressionScheduler(object):
state
=
{
'
masks_dict
'
:
masks
}
return
state
def
load_state_dict
(
self
,
state
,
device
):
def
load_state_dict
(
self
,
state
):
"""
Loads the scheduler state.
Currently the scheduler state is comprised only of the set of pruning masks.
...
...
@@ -207,6 +207,7 @@ class CompressionScheduler(object):
print
(
"
\t\t
"
+
k
)
exit
(
1
)
device
=
model_device
(
self
.
model
)
for
name
,
mask
in
self
.
zeros_mask_dict
.
items
():
masker
=
self
.
zeros_mask_dict
[
name
]
masker
.
mask
=
loaded_masks
[
name
]
...
...
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