nvmexplorer_src.nvmFI package¶
Subpackages¶
Submodules¶
nvmexplorer_src.nvmFI.fault_injection module¶
-
nvmexplorer_src.nvmFI.fault_injection.
dnn_fi
(model, seed=0, int_bits=2, frac_bits=6, rep_conf=array([2, 2, 2, 2, 2, 2, 2, 2]), q_type='signed', encode='dense')¶ Single fault injection experiment for an input DNN model with provided quantization, datatype, optional envocing per value to MLCs, and optional sparse encoding
- Parameters
model – input dnn model (injection on all weights across entire test set by default)
seed – random seed for use in fault modeling
int_bits – number of integer bits per value in data format (if applicable)
frac_bits – number of fractional or decimal bits per value in data format (if applicable)
rep_conf – array of number of levels per cell used for storage per data value (SLC default would be np.array([2, 2, 2, 2, 2, 2, 2, 2]) for 8-bit datatype, for example)
q_type – datatype specification (e.g., signed or unsigned, or AdaptivFloat)
encode – indicate whether the data should be mapped into NVM using a sparse encoding (e.g., bitmask) or in standard format (dense)
-
nvmexplorer_src.nvmFI.fault_injection.
mat_fi
(mat, seed=0, int_bits=2, frac_bits=6, rep_conf=array([2, 2, 2, 2, 2, 2, 2, 2]), q_type='signed', encode='dense')¶ Single fault injection experiment for an input matrix with provided quantization, datatype, optional envocing per value to MLCs, and optional sparse encoding
- Parameters
mat – input matrix (can be 1,2,N-dimensional; will be flattened into NVM storage)
seed – random seed for use in fault modeling
int_bits – number of integer bits per value in data format (if applicable)
frac_bits – number of fractional or decimal bits per value in data format (if applicable)
rep_conf – array of number of levels per cell used for storage per data value (SLC default would be np.array([2, 2, 2, 2, 2, 2, 2, 2]) for 8-bit datatype, for example)
q_type – datatype specification (e.g., signed or unsigned, or AdaptivFloat)
encode – indicate whether the data should be mapped into NVM using a sparse encoding (e.g., bitmask) or in standard format (dense)
nvmexplorer_src.nvmFI.fi_config module¶
nvmexplorer_src.nvmFI.fi_utils module¶
-
nvmexplorer_src.nvmFI.fi_utils.
fault_rate_gen
(dist_args)¶ Randomly generate fault rate per experiment and storage cell config according to fault model
- Parameters
dist_args – arguments describing the distribution of level-to-level faults (programmed level means and sdevs)
-
nvmexplorer_src.nvmFI.fi_utils.
get_error_map
(max_lvls_cell)¶ Retrieve the correct per-storage-cell error map for the configured NVM settings according to the maximum levels-per-cell used
- Parameters
max_lvls_cell – Across the storage settings for fault injection experiment, provide the maximum number of levels-per-cell required (max 16 for 4BPC for provided fault models)
-
nvmexplorer_src.nvmFI.fi_utils.
get_temp_th
(dist_args, lvl)¶ Helper function to compute threshold for detecting a mis-read storage cell according to input fault model and stored value
- Parameters
dist_args – arguments describing the distribution of level-to-level faults
lvl – programmed value to specific memory cell (e.g., 0 or 1 for SLC)
-
nvmexplorer_src.nvmFI.fi_utils.
inject_faults
(mlc_weights, rep_conf, error_map)¶ Perform fault injection on input MLC-packed data values according to storage settings and fault model
- Parameters
mlc_weights – MLC-packed data values giving stored value per memory cell, prepared for fault injection
rep_conf – storage setting dictating bits-per-cell per data value
error_map – generated base fault rates according to storage configs and fault model
-
nvmexplorer_src.nvmFI.fi_utils.
solveGauss
(mu1, sdev1, mu2, sdev2)¶ Helper function to compute intersection of two normal distributions; used to calculate probability of level-to-level fault for specific current/voltage distributions
- Parameters
mu1 – mean of first distribution
mu2 – mean of second distribution
sdev1 – standard dev of first distribution
sdev2 – standard dev of second distribution