Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Unity][MSC][M2.1] Add pruner for model pruning #16186

Merged
merged 3 commits into from
Dec 2, 2023
Merged

Conversation

Archermmt
Copy link
Contributor

@Archermmt Archermmt commented Nov 30, 2023

This is a pull request for MSC(Multi-System Compile)
RFC: https://discuss.tvm.apache.org/t/rfc-unity-msc-introduction-to-multi-system-compiler/15251/5
Tracking issue: #15233

This is the Milestone 2 for MSC: Use msc.runtime.Manager to manage the compiling pipeline && tools.
To limit each PR in reviewable size, the Milestone 2 will be split into some steps:
M2.1 Add Manager for compile pipeline
M2.2 Add pruner for model pruning
M2.3 Add tracker for track layer datas
M2.4 Add quantizer for quantize model

The tools are basic modules for optimize the model. They works in model rewriting as well as runtime controlling. Tool can be used in training system as well as in deploy system.

This PR add basic part of tool and pruner for all frameworks. The pruner in torch, tvm and tensorrt are tested. Pruner compress the model by given density. It works together with gym(auto optimization system, which will be added in later PRs) to prune the model automatically. It can also works together with distiller (will be added in later PRs) to update weights in pruned model.

WeightGraph is used in pruning. A WeightGraph describe the topology of weights in model. This graph can also be used in model parallel, which requires split the weights depends on topology.

cc @Hzfengsy @junrushao

@Hzfengsy Hzfengsy merged commit ed2772f into apache:unity Dec 2, 2023
15 checks passed
Archermmt added a commit to Archermmt/tvm that referenced this pull request Dec 18, 2023
* add tool and pruner

* update pruner

* change debug level
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants