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

Investigate using NeuralMagic as post-training step [Tracker] #91

Open
erikerlandson opened this issue Nov 4, 2021 · 7 comments
Open
Assignees
Labels
sparsification Indicates that the issue exists to achieve model sparsification.

Comments

@erikerlandson
Copy link
Contributor

erikerlandson commented Nov 4, 2021

cc @ChristianMeyndt

NeuralMagic is basically a tool for analyzing a neural net model, and identifying a modified sparse topology that is much smaller and faster. It operates as a second training phase. So one trains a model and then run a tool to analyze the model, and then a second training run to fine tune the new sparse architecture.

NeuralMagic is capable of making sparse versions of a model that are 10-100 times smaller and faster. Actual results are of course dependent on specifics of the problem domain.

Once we have the training pipeline fully ported, it should be relatively easy to add a neural-magic stage to generate a sparse version of the model.

in Neural magic the typical steps are:
1. train a model 
2. convert to ONNX 
3. use their sparsify tool (it analyzes the model and show the performance improvement you can get with pruning (only available in NM yet))
4. get a sparsify recipe (a YAML file for their optimizer)
5. now train the model with their optimizer (sparseML)
6. convert to ONNX 
7. deploy with their deepsparse inference engine, working with avx2 or avx512 only at the moment

references

@pacospace
Copy link
Member

pacospace commented Nov 29, 2021

Thanks @erikerlandson!

Neural Magic has also the possibility to fine-tune models. We could start working on a new Elyra pipeline that:

cc @markurtz (welcome) What could be resources for fine-tuning that model?

@ChristianMeyndt
Copy link

Hi @erikerlandson and @pacospace,
making the models smaller will help a lot for sure and Neural Magic sounds very promising!
If you need any further information on the current model training solution feel free to reach out to me.
I'm curious to see the outcome of this fine tuning!
Thanks

@erikerlandson
Copy link
Contributor Author

erikerlandson commented Dec 8, 2021 via email

@ChristianMeyndt
Copy link

We need the KPI mapping file (https://github.com/os-climate/corporate_data_pipeline/tree/main/data_input/ESG/kpi_mapping) and the annotations file (https://github.com/os-climate/corporate_data_pipeline/tree/main/data_input/ESG/annotations) as input.
And then of course we also need all the PDFs that are mentioned in the annotations file.
Probably we already have these PDFs within these 40.000 reports on S3, but I'm not sure if you can easily find them by the file name.
Else we have these 300-400 reports on our side and could also upload them somewhere.

@ChristianMeyndt
Copy link

FYI @HeatherAck @JeremyGohBNP @LeaADeleris @andraNew @OferHarari @idemir-ids @DaBeIDS @mriefer
This is the issue for NeuralMagic we talked about on Monday. It sounds really promising.

@pacospace
Copy link
Member

pacospace commented Dec 15, 2021

We need the KPI mapping file (https://github.com/os-climate/corporate_data_pipeline/tree/main/data_input/ESG/kpi_mapping) and the annotations file (https://github.com/os-climate/corporate_data_pipeline/tree/main/data_input/ESG/annotations) as input. And then of course we also need all the PDFs that are mentioned in the annotations file. Probably we already have these PDFs within these 40.000 reports on S3, but I'm not sure if you can easily find them by the file name. Else we have these 300-400 reports on our side and could also upload them somewhere.

Thanks @ChristianMeyndt!! I will check and let you know in case I have any trouble!

@pacospace pacospace changed the title Investigate using NeuralMagic as post-training step Investigate using NeuralMagic as post-training step [Tracker] Feb 10, 2022
@pacospace
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sparsification Indicates that the issue exists to achieve model sparsification.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants