Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

[Model Compression] add scheduler high level api #4236

Merged
merged 12 commits into from
Oct 13, 2021

Conversation

J-shang
Copy link
Contributor

@J-shang J-shang commented Oct 8, 2021

waiting for #4125 merge

@J-shang J-shang changed the title [Model Compression] add scheduler higher api [Model Compression] add scheduler high level api Oct 11, 2021
@J-shang J-shang force-pushed the compression_v2_hapi branch from cc3e112 to 76890fe Compare October 12, 2021 02:37
@J-shang J-shang marked this pull request as ready for review October 12, 2021 03:25
@@ -54,9 +54,11 @@ def __init__(self, model: Module, config_list: List[Dict]):
config_list
The config list used by compressor, usually specifies the 'op_types' or 'op_names' that want to compress.
"""
assert isinstance(model, Module)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In what case, the model will be None?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we use the scheduler, in fact, we don't need to pass model and config_list to pruner when initializing. Model and config_list will pass to pruner by pruner.reset(model, config_list) during each iteration.

The best result (and intermediate result if keeped) during iteration is under `log_dir` (default: \\.).')


class LinearPruner(IterativePruner):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any example for these iterative pruners?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

update an AGPPruner example.

Copy link
Contributor

@zheng-ningxin zheng-ningxin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@J-shang J-shang merged commit cdb65da into microsoft:master Oct 13, 2021
@J-shang J-shang deleted the compression_v2_hapi branch October 25, 2021 03:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants