Skip to content

Conversation

@macsz
Copy link
Contributor

@macsz macsz commented Nov 30, 2022

Type of Change

Feature. Extends current Dynamic Neural Architecture Search Toolkit set of supported search spaces with Transformer LT super-network for En-De language translation.

Description

DyNAS-T (Dynamic Neural Architecture Search Toolkit) is a SuperNet NAS optimization package (part of Intel Neural Compressor) designed for finding the optimal Pareto front during neural architecture search while minimizing the number of search validation measurements. It supports single-/multi-/many-objective problems for a variety of domains supported. The system currently heavily utilizes the pymoo optimization library. Some of the key DyNAS-T features are:

  • Automatic handling of super-network parameters for search and predictor training
  • Genetic Algorithm (e.g., NSGA-II) multi-objective subnetworks
  • LINAS (Lightweight Iterative Neural Architecture Search) accelerated search using approximate predictors
  • Warm-start (transfer) search
  • Search population statistical analysis

This PR extends supported search spaces with Transformer-based Language Translation (transformer_lt_wmt_en_de) for English and German languages. Implementation of the supernet is based on Hardware Aware Transformers (HAT) by MIT HAN Lab.

How has this PR been tested?

To run an example, trained supernet weights and preprocessed WMT En-De dataset is needed. Both can be downloaded from Hardware Aware Transformers (HAT) repository.

  • Script to download preprocessed dataset: link
  • Download trained supernet weights: link

Example code to test new functionality:

config = NASConfig(approach='dynas', search_algorithm='nsga2')
config.dynas.supernet = 'transformer_lt_wmt_en_de'
config.seed = 42
config.dynas.metrics = ['acc', 'macs']

config.dynas.population = 50
config.dynas.num_evals = 500
config.dynas.batch_size = 64
config.dynas.results_csv_path = 'results.csv'
config.dynas.dataset_path = '/datasets/hat_dataset/data/binary/wmt16_en_de'
config.dynas.supernet_ckpt_path  ='/datasets/hat_dataset/HAT_wmt14ende_super_space0.pt'
agent = NAS(config)
results = agent.search()

Dependency Change?

  • fairseq
  • sacremoses
  • torchprofile

Signed-off-by: Maciej Szankin [email protected]

Signed-off-by: Maciej Szankin <[email protected]>
@macsz
Copy link
Contributor Author

macsz commented Dec 10, 2022

Failing on timeout now. Locally the same test passes. Will re-run to see if anything has changed...

@macsz macsz force-pushed the dynas/transformer branch from e08f567 to 858d7b0 Compare December 11, 2022 00:39
Signed-off-by: Xinyu Ye <[email protected]>

Conflicts:
	test/nas/test_nas.py
@chensuyue
Copy link
Contributor

/Azurepipeline run

@ftian1
Copy link
Contributor

ftian1 commented Dec 12, 2022

@macsz we have root caused the timeout issue and fixed it. we also made rebase operation. now we are waiting for test report. if it passes, we will merge it today.

@azure-pipelines
Copy link

Azure Pipelines successfully started running 4 pipeline(s).

@macsz
Copy link
Contributor Author

macsz commented Dec 12, 2022

@macsz we have root caused the timeout issue and fixed it. we also made rebase operation. now we are waiting for test report. if it passes, we will merge it today.

Thanks! Appreciate the help to rebase to speed things up! I will be monitoring the PR as well.

@chensuyue
Copy link
Contributor

image
Failed with UT coverage regression. I think we can merge at first for code freeze.

Maciej Szankin added 2 commits December 12, 2022 01:08
@macsz
Copy link
Contributor Author

macsz commented Dec 12, 2022

Merged master & Removed cleanup in UTs that I added before you fixed the model cache problem. This triggered the CI to re-run the tests.

So we are ok with this PR once it passes? To avoid additional delays I won't be touching anything till you say so.

By the way - Where in the CI can I see visual test coverage, like the one you posted @chensuyue ? Tried decoding raw output but it was a little bit too much ...

@chensuyue
Copy link
Contributor

  1. Go to the artifacts.
    image
  2. Download the coverage report package.
    image
  3. Open the coverage compare html.
    image

@macsz
Copy link
Contributor Author

macsz commented Dec 12, 2022

Should we merge now for code freeze, as @chensuyue suggested? I will work on adding unit tests as a follow up to this PR.

@chensuyue chensuyue merged commit 40ab5a3 into master Dec 12, 2022
@chensuyue chensuyue deleted the dynas/transformer branch December 12, 2022 11:06
zehao-intel pushed a commit that referenced this pull request Dec 20, 2022
…arch Toolkit (#197)

Signed-off-by: Maciej Szankin <[email protected]>
Co-authored-by: Nittur Sridhar, Sharath <[email protected]>
Co-authored-by: Xinyu Ye <[email protected]>
Signed-off-by: zehao-intel <[email protected]>
VincyZhang pushed a commit that referenced this pull request Feb 12, 2023
* add primitive_cache & weight_sharing & dispatcher_tuning ut

* fix pybandit

* add weight sharing with dispatcher ut

* change model load method

* change model load method

* add the ut of dispatcher tuning perf

* remove unuse files

* change moudle,dataset address

* remove unuse file

* fix the ut and add glog level =2

* add the time module

* change format

* remove the ir

* modify

* modify-

* review modify

* test modify

* modify for unuse

Co-authored-by: Wang, Wenqi2 <[email protected]>
Co-authored-by: sys-lpot-val <[email protected]>
Co-authored-by: Bo Dong <[email protected]>
yiliu30 added a commit that referenced this pull request Apr 30, 2025
* add autoround UTs back

Change-Id: I0614ffd8be4f89e9787037ee99e24a60f8548b49

---------

Signed-off-by: Yi Liu <[email protected]>
Co-authored-by: Yi Liu <[email protected]>
xin3he pushed a commit that referenced this pull request Jul 15, 2025
* add autoround UTs back

Change-Id: I0614ffd8be4f89e9787037ee99e24a60f8548b49

---------

Signed-off-by: Yi Liu <[email protected]>
Co-authored-by: Yi Liu <[email protected]>
Signed-off-by: Xin He <[email protected]>
XuehaoSun pushed a commit that referenced this pull request Jul 19, 2025
* add autoround UTs back

Change-Id: I0614ffd8be4f89e9787037ee99e24a60f8548b49

---------

Signed-off-by: Yi Liu <[email protected]>
Co-authored-by: Yi Liu <[email protected]>
Signed-off-by: Xin He <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants