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

Add OpEvo example #2549

Merged
merged 10 commits into from
Jun 30, 2020
Merged

Add OpEvo example #2549

merged 10 commits into from
Jun 30, 2020

Conversation

gxiaotian
Copy link

@gxiaotian gxiaotian commented Jun 11, 2020

This pr aims to provide examples of tuning tensor operators with NNI. Three tuning algorithms, OpEvo, G-BFS and N-A2C are implemented with NNI. All examples locate at examples/trials/systems/opevo/, and a doc file docs/en_US/TrialExample/OpEvoExamples.md is also provided for demonstrating how to set up experiment environment and run these experiments. Please refer to the doc for detailed explanation of this pr.

@QuanluZhang
Copy link
Contributor

@gxiaotian could you write description of this pr, which makes it easy for others to review

@gxiaotian
Copy link
Author

@QuanluZhang Description added. Would like to add more if needed. Thanks.

README_zh_CN.md Outdated
代码库遵循 [MIT 许可协议](LICENSE)
Copy link
Contributor

Choose a reason for hiding this comment

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

please revert the changes to chinese doc

Copy link
Author

Choose a reason for hiding this comment

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

I didn't change this file in fact. I believe there might be some invisible characters modified by the editor. I will try to figure it out.

Copy link
Author

Choose a reason for hiding this comment

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

updated


Abundant applications raise the demands of training and inference deep neural networks (DNNs) efficiently on diverse hardware platforms ranging from cloud servers to embedded devices. Moreover, computational graph-level optimization of deep neural network, like tensor operator fusion, may introduce new tensor operators. Thus, manually optimized tensor operators provided by hardware-specific libraries have limitations in terms of supporting new hardware platforms or supporting new operators, so automatically optimizing tensor operators on diverse hardware platforms is essential for large-scale deployment and application of deep learning technologies in the real-world problems.

Tensor operator optimization is substantially a combinatorial optimization problem. The objective function is the performance of a tensor operator on specific hardware platform, which should be maximized with respect to the hyper-parameters of corresponding device code, such as how to tile a matrix or whether to unroll a loop. This example illustrates how to automatically tune tensor operators with NNI. Three tuning algorithms, OpEvo, G-BFS and N-A2C are provided. Please refer to [OpEvo: An Evolutionary Method for Tensor Operator Optimization](https://128.84.21.199/abs/2006.05664) for detailed explanation about these algorithms.
Copy link
Contributor

Choose a reason for hiding this comment

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

could you use arxiv link for the paper, not the IP one?

Copy link
Author

Choose a reason for hiding this comment

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

updated


## Run Experiments:

Three representative kinds of tensor operators, matrix multiplication, batched matrix multiplication and 2D convolution, are chosen from BERT and AlexNet, and tuned with NNI. The `Trial` code for all tensor operators is `/root/compiler_auto_tune_stable.py`, and `Search Space` files and `config` files for each tuning algorithm locate in `/root/experiments/`, which are categorized by tensor operators. Here `/root` refers to the root of the container.
Copy link
Contributor

Choose a reason for hiding this comment

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

"matrix multiplication, batched matrix multiplication and 2D convolution" -> "matrix multiplication, batched matrix multiplication and 2D convolution"

Copy link
Author

Choose a reason for hiding this comment

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

updated


Three representative kinds of tensor operators, matrix multiplication, batched matrix multiplication and 2D convolution, are chosen from BERT and AlexNet, and tuned with NNI. The `Trial` code for all tensor operators is `/root/compiler_auto_tune_stable.py`, and `Search Space` files and `config` files for each tuning algorithm locate in `/root/experiments/`, which are categorized by tensor operators. Here `/root` refers to the root of the container.

For tuning the operators of matrix multiplication, please run below commands from `/root`:
Copy link
Contributor

Choose a reason for hiding this comment

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

how to start the container?

Copy link
Contributor

Choose a reason for hiding this comment

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

got it. make cuda-env will directly start the container, right?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, you are right~

@QuanluZhang
Copy link
Contributor

looks great to me.

@liuzhe-lz liuzhe-lz merged commit 6de1570 into microsoft:master Jun 30, 2020
chicm-ms added a commit to chicm-ms/nni that referenced this pull request Jun 30, 2020
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.

4 participants