andrei-pokrovsky / bert-onnx Goto Github PK
View Code? Open in Web Editor NEWThis project forked from virajdeshwal/bert-onnx
BERT ONNX PRE/POST - OPTIMIZATION
This project forked from virajdeshwal/bert-onnx
BERT ONNX PRE/POST - OPTIMIZATION
This ReadMe contains instruction for Seq-to-Seq model converstion from Tensorflow to ONNXRuntime. Step 1 - Download the BERT model from from googleapis using the following command. -> !wget https://storage.googleapis.com/bert_models/2018_10_18/uncased_L-12_H-768_A-12.zip Step 2 - Download the Benchmarking dataset called SQuAD for the official Implementation and Benchmark testing of BERT. -> !wget -q https://storage.googleapis.com/bert_models/2018_10_18/uncased_L-12_H-768_A-12.zip Step 3 - Fine-tune the BERT model on SQuAD model using run_squad.py script. Step 4 - After fine-tuning, Create an Inference Graph using the squad serving function. Step 5 - Export the model from the Inference graph to convert it to ONNX format. Step 6 - Convert the tf model to ONNX format using tf2onnx lib. Step 7 - Run and verify the ONNX implementation of BERT using ONNXRuntime lib. --------------------------- # Post-processing Optimization of the bert.onnx model. Step 8 - Clone the official implementation of Onnx for post-Optimization for PyTorch, Keras, Tensorflow. -> !wget -O ./bert_op_scripts/bert_model_optimization.py https://raw.githubusercontent.com/microsoft/onnxruntime/master/onnxruntime/python/tools/bert/bert_model_optimization.py Step 9 - Choose the framework of your choice and Flag the framework=True. Step 10 - Optimize onnx version of BERT for Half-precision (fp32) and for CPU(x86) using bert_model_optimization.py script and passing correct parameters. Step 11 - Run the inference on CPU and GPU version of BERT and compare the results.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.