Closed akashAD98 closed 2 years ago
Hey @akashAD98, great questions.
To answer Q3 first: SparseML is an optimization library which provides tools to prune and quantize models. You can immediately run our supported integrations (e.g. HuggingFace Transformers, Ultralytics Yolov5) or with a bit of setup run with a custom integration. Deepsparse on the other hand is the engine built to exploit high sparsity in models to accelerate them to high performance on CPUs.
You can use SparseML with most pytorch models by wrapping it with ScheduledModifierManager
. You can find our instructions for how to set that up here.
This allows you to run the model with a recipe which can prune, quantize, or otherwise alter the training schedule. You can read more on how to construct recipes here and I'd also recommend checking out the How to Optimize Deep Learning Models for Production workshop that we just held today and will have uploaded on our Youtube channel soon.
Our most effective pruning methods are training-aware, which means they are employed during training. These methods gradually prune during training and allow your model to converge with the new pruned structure. You can technically apply a pruning recipe in a "one-shot" manner and we have a short example of it here, but you won't be able to achieve the same accuracy/sparsity tradeoff. We are currently researching more effective one-shot methods though and plan to expand that capability in the future.
Once you have a sparse model, you'll want to export it to onnx and run it through DeepSparse. You can run your original onnx model through DeepSparse as well for comparison.
Hope that helps!
@KSGulin thanks for your information, it's an open-source project ?
@akashAD98 yes, all the libraries mentioned are open-source. The engine is the one component which we have not open sourced.
I'm using this repo for object detection https://github.com/AlexeyAB/darknet ,there are very good models which has a good map on coco, so is there any way to support this model?
also i have a few questions about neuralmagic