-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FTT-NAS doc] amend ftt-nas doc, configs. Small fix of the rram patch.
- Loading branch information
1 parent
d9d0ba2
commit 8126860
Showing
8 changed files
with
192 additions
and
64 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
## ---- Component search_space ---- | ||
# ---- Type cnn ---- | ||
search_space_type: cnn | ||
search_space_cfg: | ||
# Schedulable attributes: | ||
# cell_layout: [0, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 3] | ||
cell_layout: null | ||
num_cell_groups: 2 | ||
num_init_nodes: 2 | ||
num_layers: 8 | ||
num_node_inputs: 2 | ||
num_steps: 4 | ||
reduce_cell_groups: | ||
- 1 | ||
shared_primitives: # this is not used | ||
- none | ||
- max_pool_3x3 | ||
- avg_pool_3x3 | ||
- skip_connect | ||
- sep_conv_3x3 | ||
- sep_conv_5x5 | ||
- dil_conv_3x3 | ||
- dil_conv_5x5 | ||
# ---- End Type cnn ---- | ||
## ---- End Component search_space ---- | ||
|
||
## ---- Component dataset ---- | ||
# ---- Type cifar10 ---- | ||
dataset_type: cifar10 | ||
dataset_cfg: | ||
# Schedulable attributes: | ||
cutout: null | ||
# ---- End Type cifar10 ---- | ||
## ---- End Component dataset ---- | ||
|
||
## ---- Component final_model ---- | ||
# ---- Type cnn_genotype ---- | ||
final_model_type: cnn_patch_final_model | ||
final_model_cfg: | ||
# Schedulable attributes: dropout_path_rate | ||
genotypes: "normal_0=[('relu_conv_bn_3x3', 0, 2), ('relu_conv_bn_5x5', 0, 2), ('conv_1x1', 1, 3), ('dil_conv_3x3', 1, 3), ('sep_conv_3x3', 1, 4), ('sep_conv_3x3', 0, 4), ('max_pool_3x3', 2, 5), ('relu_conv_bn_5x5', 1, 5)], reduce_1=[('skip_connect', 0, 2), ('relu_conv_bn_5x5', 1, 2), ('dil_conv_3x3', 2, 3), ('sep_conv_3x3', 0, 3), ('max_pool_3x3', 1, 4), ('conv_1x1', 3, 4), ('dil_conv_3x3', 4, 5), ('skip_connect', 2, 5)]" | ||
auxiliary_cfg: null | ||
auxiliary_head: false | ||
dropout_path_rate: 0.0 | ||
dropout_rate: 0.0 | ||
init_channels: 20 | ||
num_classes: 10 | ||
cell_use_preprocess: true | ||
cell_preprocess_stride: relu_conv_bn_3x3 | ||
cell_preprocess_normal: relu_conv_bn_3x3 | ||
# modified due to interface change of cnn_final_model | ||
# preprocess_op_type: relu_conv_bn_3x3 | ||
schedule_cfg: null | ||
stem_multiplier: 3 | ||
# ---- End Type cnn_genotype ---- | ||
## ---- End Component final_model ---- | ||
|
||
objective_type: saf_injection | ||
objective_cfg: | ||
as_evaluator_regularization: true | ||
as_controller_regularization: true | ||
inject_prob: 0.08 | ||
fault_loss_coeff: 0.7 | ||
fault_reward_coeff: 0.2 | ||
latency_reward_coeff: 0 | ||
activation_fixed_bitwidth: 8 | ||
|
||
## ---- Component final_trainer ---- | ||
# ---- Type cnn_trainer ---- | ||
final_trainer_type: cnn_trainer | ||
final_trainer_cfg: | ||
# Schedulable attributes: | ||
auxiliary_head: false | ||
auxiliary_weight: 0.0 | ||
add_regularization: true | ||
batch_size: 128 | ||
epochs: 100 | ||
grad_clip: 5.0 | ||
learning_rate: 0.1 | ||
momentum: 0.9 | ||
no_bias_decay: false | ||
optimizer_type: SGD | ||
optimizer_scheduler: | ||
type: MultiStepLR | ||
milestones: [40, 80] | ||
gamma: 0.1 | ||
schedule_cfg: null | ||
warmup_epochs: 0 | ||
weight_decay: 0.00004 | ||
save_as_state_dict: true | ||
# ---- End Type cnn_trainer ---- | ||
## ---- End Component final_trainer ---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
here=$(dirname "$0") | ||
weight_fault=1 | ||
gpu=${GPU:-0} | ||
cfg_file=${1} | ||
default_exp_name=$(basename ${cfg_file}) | ||
default_exp_name=${default_exp_name%.yaml} | ||
exp_name=${2:-${default_exp_name}} | ||
result_dir=$here/results/ftt_nas_adsaf_search/$exp_name | ||
|
||
if [[ $weight_fault -gt 0 ]]; then | ||
echo "$result_dir/awnas/plugins" | ||
if [[ -d "$result_dir/awnas/plugins" ]]; then | ||
rm -r $result_dir/awnas/plugins | ||
fi | ||
mkdir -p $result_dir/awnas/plugins | ||
if [[ ! -e $result_dir/awnas/data ]]; then | ||
ln -s ~/awnas/data $result_dir/awnas/data | ||
fi | ||
cp $here/fixed_point_plugins/fixed_point_rram_patch_bit.py $result_dir/awnas/plugins/ | ||
fi | ||
|
||
AWNAS_HOME=$result_dir/awnas/ awnas search --gpu $gpu --train-dir $result_dir/train --vis-dir results/tensorboard_new/weights/$exp_name/ --save-every 10 $cfg_file --develop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
here=$(dirname "$0") | ||
fixed=${FIXED:-1} | ||
gpu=${GPU:-0} | ||
cfg_file=${1} | ||
default_exp_name=$(basename ${cfg_file}) | ||
default_exp_name=${default_exp_name%.yaml} | ||
exp_name=${2:-${default_exp_name}} | ||
result_dir=$here/results/ftt_nas_mibb_search/$exp_name | ||
addi_args=${ADDI_ARGS:-""} | ||
|
||
echo "use plugin dir: $result_dir/awnas/plugins" | ||
if [[ -d "$result_dir/awnas/plugins" ]]; then | ||
rm -r $result_dir/awnas/plugins | ||
fi | ||
mkdir -p $result_dir/awnas/plugins | ||
if [[ ! -e $result_dir/awnas/data ]]; then | ||
ln -s $HOME/awnas/data $result_dir/awnas/data | ||
fi | ||
|
||
if [[ $fixed -gt 0 ]]; then | ||
echo "copy fixed patch to plugin dir $result_dir/awnas/plugins/" | ||
cp $here/fixed_point_plugins/fixed_point_patch_new.py $result_dir/awnas/plugins/ | ||
fi | ||
# For profiling only | ||
# AWNAS_HOME=$result_dir/awnas/ python -m cProfile awnas search --gpu $gpu --train-dir $result_dir/train --vis-dir results/tensorboard/ftt_search_tcad/$exp_name/ --save-every 10 ${2} --develop ${addi_args} | ||
|
||
AWNAS_HOME=$result_dir/awnas/ awnas search --gpu $gpu --train-dir $result_dir/train --vis-dir $result_dir/tensorboard --save-every 10 ${cfg_file} --develop ${addi_args} |