nvmexplorer_src.nvmFI.data_transforms package¶
Submodules¶
nvmexplorer_src.nvmFI.data_transforms.bitmask_utils module¶
-
nvmexplorer_src.nvmFI.data_transforms.bitmask_utils.
encoded_capacity
(wmb, data, num_bits)¶ Returns the total capacity in bits of the bitmask + data
- Parameters
wmb – weight mask bits – bit vectors to indicate non-zero values in original weight matrix M
data – Data corresponding to the non-zero elements of matrix M
num_bits – number of bits per data value to use
-
nvmexplorer_src.nvmFI.data_transforms.bitmask_utils.
from_bitmask
(wmb, data)¶ Translate bitmask encoded data back to original matrix M
- Parameters
wmb – weight mask bits – bit vectors to indicate non-zero values in original weight matrix M
data – Data corresponding to the non-zero elements of matrix M
-
nvmexplorer_src.nvmFI.data_transforms.bitmask_utils.
to_bitmask
(M)¶ Returns the bitmask sparse format of matrix ‘M’
- Parameters
M – original weight matrix M
nvmexplorer_src.nvmFI.data_transforms.data_transform_utils module¶
-
nvmexplorer_src.nvmFI.data_transforms.data_transform_utils.
convert_f_mat
(v_mlc, conf, int_bits, frac_bits, exp_bias, q_type)¶ Convert MLC-packed per-storage-cell values back to floating point values
- Parameters
v_mlc – vector of per-storage-cell values (possible MLC encoding)
conf – mapping from number of bits in input value to number of levels per NVM storage cell (e.g., [2, 2] for a 2 bit input into SLCs)
int_bits – number of integer bits for data format (if applicable)
frac_bits – number of fractional bits for data format (if applicable)
exp_bias – exponent bias for data format (if applicable)
q_type – data format choice (e.g., signed, unsigned, adaptive floating point)
-
nvmexplorer_src.nvmFI.data_transforms.data_transform_utils.
convert_mlc_mat
(num_float, rep_conf, int_bits, frac_bits, exp_bias, q_type)¶ Format an entire input matrix into per-memory-cell array under MLC config for bit-level fault injection
- Parameters
num_float – input value (floating point)
rep_conf – mapping from number of bits in input value to number of levels per NVM storage cell (e.g., [2, 2] for a 2 bit input into SLCs)
int_bits – number of integer bits for data format (if applicable)
frac_bits – number of fractional bits for data format (if applicable)
exp_bias – exponent bias for data format (if applicable)
q_type – data format choice (e.g., signed, unsigned, adaptive floating point)
-
nvmexplorer_src.nvmFI.data_transforms.data_transform_utils.
get_afloat_bias
(num_float, n_exp)¶ Extract bias term for AdaptivFloat data format https://arxiv.org/abs/1909.13271
- Parameters
num_float – input value as float
n_exp – number of exponential bits for adaptivFloar data format
-
nvmexplorer_src.nvmFI.data_transforms.data_transform_utils.
get_binary_array_mat
(orig_flt, rep_conf, int_bits, frac_bits, exp_bias, q_type)¶ Format an input float value into binary array for bit-level fault injection
- Parameters
orig_flt – input value (floating point)
rep_conf – mapping from number of bits in input value to number of levels per NVM storage cell (e.g., [2, 2] for a 2 bit input into SLCs)
int_bits – number of integer bits for data format (if applicable)
frac_bits – number of fractional bits for data format (if applicable)
exp_bias – exponent bias for data format (if applicable)
q_type – data format choice (e.g., signed, unsigned, adaptive floating point)
-
nvmexplorer_src.nvmFI.data_transforms.data_transform_utils.
get_q_afloat
(num_float, n_bits, n_exp, bias)¶ Conversion to AdaptivFloat data format https://arxiv.org/abs/1909.13271
- Parameters
num_float – input value as float
n_bits – total number of bits per value (mantissa bits = n_bits - n_exp)
n_exp – number of exponential bits for adaptivFloar data format
bias – input bias term
nvmexplorer_src.nvmFI.data_transforms.graph_utils module¶
-
nvmexplorer_src.nvmFI.data_transforms.graph_utils.
gen_adj_mat
(G)¶ Generate an adjacency matrix (size NxN for N node graph) for an input snapPY graph
- Parameters
G – snapPY input graph
-
nvmexplorer_src.nvmFI.data_transforms.graph_utils.
gen_graph
(M)¶ Generate a snapPY graph based on an adjacency matrix
- Parameters
M – adjacency matrix representing stored graph
-
nvmexplorer_src.nvmFI.data_transforms.graph_utils.
pack_bits
(M, bpc=2)¶ For MLC storage, pack adjacency matrix according to MLC settings
- Parameters
M – adjacency matrix representing stored graph
bpc – bits-per-cell for MLC storage format
-
nvmexplorer_src.nvmFI.data_transforms.graph_utils.
unpack_bits
(M_pack, bpc=2)¶ For MLC storage, unpack adjacency matrix according to MLC settings
- Parameters
M – adjacency matrix representing stored graph, packed according to MLC storage settings
bpc – bits-per-cell for MLC storage format