Skip to content

Commit 24cd587

Browse files
committed
Improved READMEs
1 parent 9517dd7 commit 24cd587

File tree

9 files changed

+34
-43
lines changed

9 files changed

+34
-43
lines changed

BootstrapNAS/README.md

+6-11
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ If you already have a super-network trained with BootstrapNAS, please follow the
1616

1717
More information about BootstrapNAS is available in our papers:
1818

19-
[Automated Super-Network Generation for Scalable Neural Architecture Search](https://openreview.net/attachment?id=HK-zmbTB8gq&name=main_paper_and_supplementary_material).
19+
[Automated Super-Network Generation for Scalable Neural Architecture Search](https://openreview.net/pdf?id=HK-zmbTB8gq).
2020

2121
```bibtex
2222
@inproceedings{
@@ -25,7 +25,7 @@ More information about BootstrapNAS is available in our papers:
2525
author={Muñoz, J. Pablo and Lyalyushkin, Nikolay and Lacewell, Chaunte and Senina, Anastasia and Cummings, Daniel and Sarah, Anthony and Kozlov, Alexander and Jain, Nilesh},
2626
booktitle={First Conference on Automated Machine Learning (Main Track)},
2727
year={2022},
28-
url={https://openreview.net/forum?id=HK-zmbTB8gq}
28+
url={https://openreview.net/pdf?id=HK-zmbTB8gq}
2929
}
3030
```
3131
[Enabling NAS with Automated Super-Network Generation](https://arxiv.org/abs/2112.10878)
@@ -35,15 +35,10 @@ More information about BootstrapNAS is available in our papers:
3535
bootstrapNAS,
3636
author = {Muñoz, J. Pablo and Lyalyushkin, Nikolay and Akhauri, Yash and Senina, Anastasia and Kozlov, Alexander and Jain, Nilesh},
3737
title = {Enabling NAS with Automated Super-Network Generation},
38-
journal = {CoRR},
39-
volume = {abs/2112.10878},
40-
year = {2021},
41-
url = {https://arxiv.org/abs/2112.10878},
42-
eprinttype = {arXiv},
43-
eprint = {2112.10878},
44-
timestamp = {Tue, 04 Jan 2022 15:59:27 +0100},
45-
biburl = {https://dblp.org/rec/journals/corr/abs-2112-10878.bib},
46-
bibsource = {dblp computer science bibliography, https://dblp.org}
38+
journal = {1st International Workshop on Practical
39+
Deep Learning in the Wild at AAAI},
40+
year = {2022},
41+
url = {https://practical-dl.github.io/2022/short_paper/21.pdf},
4742
}
4843
```
4944

BootstrapNAS/instructions/Configuration.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
### Configuration file
22

3-
The parameters for generating, training and searching on the super-network are defined in a configuration file within two exclusive subsets of parameters for training and search:
3+
The parameters for generating, training, and searching on the super-network are defined in a configuration file within two exclusive subsets of parameters for training and search:
44
```json
55
"bootstrapNAS": {
66
"training": {
@@ -12,7 +12,7 @@ The parameters for generating, training and searching on the super-network are d
1212
}
1313
```
1414

15-
In the `training` section, you specify the training algorithm, e.g., `progressive_shrinking`, schedule and elasticity parameters:
15+
In the `training` section, you specify the training algorithm, e.g., `progressive_shrinking`, schedule, and elasticity parameters:
1616

1717
```json
1818
"training": {
@@ -41,7 +41,7 @@ In the `training` section, you specify the training algorithm, e.g., `progressiv
4141
}
4242

4343
```
44-
In the search section, you specify the search algorithm, e.g., `NSGA-II` and its parameters. For example:
44+
In the search section, you specify the search algorithm, e.g., `NSGA-II`, and its parameters. For example:
4545
```json
4646
"search": {
4747
"algorithm": "NSGA2",
@@ -51,7 +51,7 @@ In the search section, you specify the search algorithm, e.g., `NSGA-II` and its
5151
}
5252
```
5353

54-
By default, BootstrapNAS uses `NSGA-II` (Dev et al., 2002), an genetic algorithm that constructs a pareto front of efficient sub-networks.
54+
By default, BootstrapNAS uses `NSGA-II` (Dev et al., 2002), a genetic algorithm that constructs a Pareto front of efficient sub-networks.
5555

5656
List of parameters that can be used in the configuration file:
5757

@@ -65,20 +65,20 @@ List of parameters that can be used in the configuration file:
6565

6666
`schedule`: The schedule section includes a list of stage descriptors (`list_stage_descriptions`) that specify the elasticity dimensions enabled for a particular stage (`train_dims`), the number of `epochs` for the stage, the `depth_indicator` which in the case of elastic depth, restricts the maximum number of blocks in each independent group that can be skipped, the `width_indicator`, which restricts the maximum number of width values in each elastic layer. The user can also specify whether weights should be reorganized (`reorg_weights`), whether batch norm adaptation should be triggered at the beginning of the stage (`bn_adapt`), the initial learning rate for the stage (`init_lr`), and the epochs to use for adjusting the learning rate (`epochs_lr`).
6767

68-
`elasticity`: Currently, BootstrapNAS supports three elastic dimensions (`kernel`, `width` and `depth`). The `mode` for elastic depth can be set as `auto` or `manual`. If manual is selected, the user can specify, a list of possible `skipped_blocks` that, as the name suggest, might be skipped. In `auto` mode, the user can specify the `min_block_size`, i.e., minimal number of operations in the skipping block, and the `max_block_size`, i.e., maximal number of operations in the block. The user can also `allow_nested_blocks` or `allow_linear_combination` of blocks. In the case of elastic width, the user can specify the `min_width`, i.e., the minimal number of output channels that can be activated for each layers with elastic width. Default value is 32, the `max_num_widths`, which restricts total number of different elastic width values for each layer, a `width_step`, which defines a step size for a generation of the elastic width search space, or a `width_multiplier` to define the elastic width search space via a list of multipliers. Finally, the user can determine the type of filter importance metric: L1, L2 or geometric mean. L2 is selected by default. For elastic kernel, the user can specify the `max_num_kernels`, which restricts the total number of different elastic kernel values for each layer.
68+
`elasticity`: Currently, BootstrapNAS supports three elastic dimensions (`kernel`, `width`, and `depth`). The `mode` for elastic depth can be set as `auto` or `manual`. If _manual_ is selected, the user can specify a list of possible `skipped_blocks` that might be skipped, as the name suggests. In `auto` mode, the user can specify the `min_block_size`, i.e., the minimal number of operations in the skipping block, and the `max_block_size`, i.e., the maximal number of operations in the block. The user can also `allow_nested_blocks` or `allow_linear_combination` of blocks. In the case of elastic width, the user can specify the `min_width`, i.e., the minimal number of output channels that can be activated for each layer with elastic width. The default value is 32, the `max_num_widths`, which restricts the total number of different elastic width values for each layer, a `width_step`, which defines a step size for a generation of the elastic width search space, or a `width_multiplier` to define the elastic width search space via a list of multipliers. Finally, the user can determine the type of filter importance metric: L1, L2 or geometric mean. L2 is selected by default. The user can specify the `max_num_kernels` for the elastic kernel, which restricts the total number of different elastic kernel values for each layer.
6969

7070
`train_steps`: Defines the number of samples used for each training epoch.
7171

7272
**Search:**
7373

7474
`algorithm`: Defines the search algorithm. The default algorithm is NSGA-II.
7575

76-
`num_evals`: Defines the number of evaluations that will be used by the search algorithm.
76+
`num_evals`: Defines the number of evaluations the search algorithm will use.
7777

7878
`population`: Defines the population size when using an evolutionary search algorithm.
7979

8080
`acc_delta`: Defines the absolute difference in accuracy that is tolerated when looking for a subnetwork.
8181

8282
`ref_acc`: Defines the reference accuracy from the pre-trained model used to generate the super-network.
8383

84-
*A full list of the possible configuration parameters can be found [here](https://github.com/openvinotoolkit/nncf/blob/develop/nncf/config/experimental_schema.py).
84+
*A complete list of the possible configuration parameters can be found [here](https://github.com/openvinotoolkit/nncf/blob/develop/nncf/config/experimental_schema.py).

BootstrapNAS/instructions/Home.md

-2
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,3 @@
66

77
### [Configuration](https://github.com/IntelLabs/Hardware-Aware-Automated-Machine-Learning/tree/main/BootstrapNAS/instructions/Configuration.md)
88

9-
More detailed guides coming soon.
10-

BootstrapNAS/instructions/Quickstart.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ python bootstrap_nas.py -m train \
5151

5252

5353
### Expected Output Files after executing BootstrapNAS
54-
The output of running ```bootstrap_nas.py``` will be a sub-network configuration that has an accuracy similar to the input model (by default a $\pm$1% absolute difference in accuracy is allowed), but with improvements in MACs. Format: ([MACs_subnet, ACC_subnet]).
54+
The output of running ```bootstrap_nas.py``` will be a sub-network configuration with an accuracy similar to the input model (by default a $\pm$1% absolute difference in accuracy is allowed), but with improvements in MACs. Format: ([MACs_subnet, ACC_subnet]).
5555

5656
Several files are saved to your `log_dir` after the training has ended:
5757

@@ -62,9 +62,9 @@ Several files are saved to your `log_dir` after the training has ended:
6262
- `last_elasticity.pth`- Super-network's elasticity information. This file can be used when loading super-networks for searching or inspection.
6363
- `last_model_weights.pth`- Super-network's weights after training.
6464
- `snapshot.tar.gz` - Copy of the code used for this run.
65-
- `subnetwork_best.pth` - Dictionary with the configuration of the best sub-network. Best defined as a sub-network that performs in the Pareto front, and that deviates a maximum `acc_delta` from original model.
65+
- `subnetwork_best.pth` - Dictionary with the configuration of the best sub-network. Best is defined as a sub-network that performs in the Pareto front and deviates a maximum `acc_delta` from the original model.
6666
- `supernet_{best, last}.pth` - Super-network weights at its best and last state.
6767

6868
If the user wants to have a CSV output file of the search progression, ```search_algo.search_progression_to_csv()``` can be called after running the search step.
6969

70-
For a visualization of the search progression please use ```search_algo.visualize_search_progression()``` after the search has concluded. A PNG file will be generated.
70+
For a visualization of the search progression, please use ```search_algo.visualize_search_progression()``` after the search has concluded. A PNG file will be generated.

BootstrapNAS/instructions/Subnetwork_Search.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@
22

33
If you have a trained super-network, you can start the search stage directly using the ```bootstrap_nas_search.py``` script located [here](https://github.com/openvinotoolkit/nncf/blob/develop/examples/experimental/torch/classification/bootstrap_nas_search.py).
44

5-
You will need to pass the path where the weights and elasticity information has been stored, which by default is your log directory.
5+
You must pass the path where the weights and elasticity information have been stored, which is your log directory by default.
66

77
```shell
88
python bootstrap_nas_search.py -m
99
train
1010
--config <Config path to your config.json used when training the super-network>
1111
--log-dir <Path to your log dir for the search stage>
1212
--dataset
13-
<cifar10, imagenet, or other depending on your model>
13+
<cifar10, imagenet, or other, depending on your model>
1414
--data <Path to your dataset>
1515
--elasticity-state-path
1616
<Path to your last_elasticity.pth file generated when training of the super-network>
@@ -20,4 +20,4 @@ train
2020

2121
#### Hardware-aware search
2222

23-
BootstrapNAS can be made hardware-aware when searching for efficient sub-networks. To accomplish this, you can pass your own `eficiency evaluator` for the target hardware to the search component.
23+
BootstrapNAS can be made hardware-aware when searching for efficient sub-networks. To accomplish this, you can pass your own `efficiency evaluator` for the target hardware to the search component.

EFTNAS/README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -74,15 +74,15 @@ CUDA_VISIBLE_DEVICES=${DEVICES} python examples/pytorch/text-classification/run_
7474
- `--nncf_config`: the NNCF configuration including the config of movement sparsity
7575
(refer to [MovementSparsity.md](https://github.com/openvinotoolkit/nncf/blob/develop/nncf/experimental/torch/sparsity/movement/MovementSparsity.md)
7676
for more details).
77-
- `--output_dir`: the directory to save importance weights.
77+
- `--output_dir`: the directory used to save the weights' importance information.
7878

7979
After movement sparsity training, the importance for the pretrained weights of `--model_name_or_path` can
80-
be obtained in the `--output_dir` directory, which will be utilized for search space generation and weight-reorder during
80+
be obtained in the `--output_dir` directory, which will be utilized for search space generation and weight reorder during
8181
NAS training.
8282

8383
#### Generate search space
8484

85-
Based on the trained weight importance, EFTNAS has a well-designed algorithm to automatically generate
85+
Based on the trained weight importance, EFTNAS has a well-designed algorithm to generate automatically
8686
the search space for the super-network.
8787
Below is an example command for search space generation using the weight importance:
8888
```bash
@@ -101,7 +101,7 @@ The generated search space will be saved in `--target_config`.
101101
### Step 2. Training
102102

103103
Once the weight importance scores and the NNCF configuration with the automatically generated search space are obtained,
104-
EFTNAS conducts NAS training utilizing based on the information from Step 1.
104+
EFTNAS conducts NAS training based on the information from Step 1.
105105

106106
Due to the feature of BootstrapNAS, we need to manually set the epoch and learning rate for NAS training in the
107107
NNCF configuration (please refer to [BootstrapNAS.md](https://github.com/openvinotoolkit/nncf/blob/develop/nncf/experimental/torch/nas/bootstrapNAS/BootstrapNAS.md)

LoNAS/README.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ CUDA_VISIBLE_DEVICES=${DEVICES} python run_commonsense.py \
5555

5656
The `nncf_config` indicates the NNCF configuration encompassing the search space for elastic adapters and modules of the base model (e.g., `q_proj`).
5757
The implementation of the elastic modules leverages the BootstrapNAS feature of [OpenVINO™ NNCF](https://github.com/openvinotoolkit/nncf).
58-
And we employ the stage LR scheduler within NNCF, so the learning rate schedule is specified within the NNCF configuration file,
58+
We employ the stage LR scheduler within NNCF, so the learning rate schedule is specified within the NNCF configuration file,
5959
rather than within the arguments of `TrainingArguments`. For instance,
6060
```json
6161
"schedule": {
@@ -128,9 +128,8 @@ CUDA_VISIBLE_DEVICES=${DEVICES} python run_commonsense.py \
128128
```
129129

130130
The argument `--val_set_size 1000` signifies the utilization of 1k validation samples to evaluate each discovered
131-
subnetwork. After running this command, results of the 200 identified subnetworks (`"num_evals": 200` set in `search` field of NNCF config)
132-
can be obtained in the `--output_dir` folder, including `search_progression.png` and `search_progression.csv`.
133-
From these results, we can select the subnetwork configurations that best meets different requirements.
131+
subnetwork. After running this command, the results of the 200 identified subnetworks (`"num_evals": 200` set in the `search` field of NNCF config) will be placed in the `--output_dir` folder, including `search_progression.png` and `search_progression.csv`.
132+
From these results, we can select the subnetwork configurations that best meet different requirements.
134133

135134

136135
## Released Models

SQFT/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ quantized_sparse_base_model_path=sqft-llama-3-8b-50-base-gptq
117117
python utils/quantization.py --base_model_path ${sparse_base_model_path} --output_dir ${quantized_sparse_base_model_path}
118118
```
119119

120-
You can also skip the quantization step and adopt our released quantized models (find them in Sparse-and-Quantized Model of [this Table](#released-foundation-models-)).
120+
You can also skip the quantization step and adopt our released quantized models (find them in the *Sparse-and-Quantized Model* column of [this Table](#released-foundation-models-)).
121121

122122
#### :hammer_and_wrench: SQFT
123123

@@ -152,7 +152,7 @@ python run_standard_tuning.py \
152152
--search_space ${search_space} # low-rank search space
153153
```
154154

155-
After the completion of the super-adapter training, the command to extract the heuristic sub-adapter is as follows.
155+
After completing the super-adapter training, the command to extract the heuristic sub-adapter is as follows.
156156
Additionally, more powerful sub-adapters can be obtained through other advanced search algorithms.
157157

158158
```bash

0 commit comments

Comments
 (0)