diff --git a/pallets/subtensor/src/epoch/math.rs b/pallets/subtensor/src/epoch/math.rs index 4b613fa961..2cbbfae77d 100644 --- a/pallets/subtensor/src/epoch/math.rs +++ b/pallets/subtensor/src/epoch/math.rs @@ -294,7 +294,7 @@ pub fn inplace_row_normalize_64(x: &mut [Vec]) { pub fn vecdiv(x: &[I32F32], y: &[I32F32]) -> Vec { if x.len() != y.len() { log::error!( - "vecdiv input lengths are not equal: {:?} != {:?}", + "math error: vecdiv input lengths are not equal: {:?} != {:?}", x.len(), y.len() ); @@ -487,7 +487,7 @@ pub fn inplace_col_max_upscale(x: &mut [Vec]) { pub fn inplace_mask_vector(mask: &[bool], vector: &mut [I32F32]) { if mask.len() != vector.len() { log::error!( - "inplace_mask_vector input lengths are not equal: {:?} != {:?}", + "math error: inplace_mask_vector input lengths are not equal: {:?} != {:?}", mask.len(), vector.len() ); @@ -508,7 +508,7 @@ pub fn inplace_mask_vector(mask: &[bool], vector: &mut [I32F32]) { pub fn inplace_mask_matrix(mask: &[Vec], matrix: &mut [Vec]) { if mask.len() != matrix.len() { log::error!( - "inplace_mask_matrix input sizes are not equal: {:?} != {:?}", + "math error: inplace_mask_matrix input sizes are not equal: {:?} != {:?}", mask.len(), matrix.len() ); @@ -538,7 +538,7 @@ pub fn inplace_mask_matrix(mask: &[Vec], matrix: &mut [Vec]) { pub fn inplace_mask_rows(mask: &[bool], matrix: &mut [Vec]) { if mask.len() != matrix.len() { log::error!( - "inplace_mask_rows input sizes are not equal: {:?} != {:?}", + "math error: inplace_mask_rows input sizes are not equal: {:?} != {:?}", mask.len(), matrix.len() ); @@ -560,7 +560,7 @@ pub fn inplace_mask_rows(mask: &[bool], matrix: &mut [Vec]) { pub fn inplace_mask_cols(mask: &[bool], matrix: &mut [Vec]) { if mask.len() != matrix.len() { log::error!( - "inplace_mask_cols input sizes are not equal: {:?} != {:?}", + "math error: inplace_mask_cols input sizes are not equal: {:?} != {:?}", mask.len(), matrix.len() ); @@ -591,7 +591,7 @@ pub fn inplace_mask_diag(matrix: &mut [Vec]) { // with no action. Log error if this happens. if matrix.len() != first_row.len() { log::error!( - "inplace_mask_diag: matrix.len {:?} != first_row.len {:?}", + "math error: inplace_mask_diag: matrix.len {:?} != first_row.len {:?}", matrix.len(), first_row.len() ); @@ -641,7 +641,7 @@ pub fn inplace_mask_diag_except_index(matrix: &mut [Vec], except_index: } if matrix.len() != first_row.len() { log::error!( - "inplace_mask_diag input matrix is now square: {:?} != {:?}", + "math error: inplace_mask_diag input matrix is now square: {:?} != {:?}", matrix.len(), first_row.len() ); @@ -794,7 +794,7 @@ pub fn matmul(matrix: &[Vec], vector: &[I32F32]) -> Vec { } if matrix.len() != vector.len() { log::error!( - "matmul input sizes are not equal: {:?} != {:?}", + "math error: matmul input sizes are not equal: {:?} != {:?}", matrix.len(), vector.len() ); @@ -830,11 +830,11 @@ pub fn matmul_transpose(matrix: &[Vec], vector: &[I32F32]) -> Vec], mat2: &[Vec], ratio: I32F32) -> } if mat1.len() != mat2.len() { log::error!( - "interpolate mat1.len() != mat2.len(): {:?} != {:?}", + "math error: interpolate mat1.len() != mat2.len(): {:?} != {:?}", mat1.len(), mat2.len() ); @@ -1213,12 +1213,12 @@ pub fn interpolate(mat1: &[Vec], mat2: &[Vec], ratio: I32F32) -> for row1 in mat1.iter() { let (Some(row2), Some(out_row)) = (m2_it.next(), out_it.next()) else { - log::error!("interpolate: No more rows in mat2"); + log::error!("math error: interpolate: No more rows in mat2"); break; }; if row1.len() != row2.len() { log::error!( - "interpolate row1.len() != row2.len(): {:?} != {:?}", + "math error: interpolate row1.len() != row2.len(): {:?} != {:?}", row1.len(), row2.len() ); @@ -1259,7 +1259,7 @@ pub fn interpolate_sparse( if mat1.len() != mat2.len() { // In case if sizes mismatch, return clipped weights log::error!( - "interpolate_sparse: mat1.len() != mat2.len(): {:?} != {:?}", + "math error: interpolate_sparse: mat1.len() != mat2.len(): {:?} != {:?}", mat1.len(), mat2.len() ); @@ -1410,7 +1410,7 @@ pub fn mat_ema_sparse( ) -> Vec> { if new.len() != old.len() { log::error!( - "mat_ema_sparse: new.len() == old.len(): {:?} != {:?}", + "math error: mat_ema_sparse: new.len() == old.len(): {:?} != {:?}", new.len(), old.len() ); @@ -1469,7 +1469,7 @@ pub fn mat_ema_alpha_sparse( // If shapes don't match, just return `new` if new.len() != old.len() || new.len() != alpha.len() { log::error!( - "mat_ema_alpha_sparse shapes don't match: {:?} vs. {:?} vs. {:?}", + "math error: mat_ema_alpha_sparse shapes don't match: {:?} vs. {:?} vs. {:?}", old.len(), new.len(), alpha.len() @@ -1490,15 +1490,6 @@ pub fn mat_ema_alpha_sparse( break; }; - if new_row.len() != old_row.len() || new_row.len() != alpha_row.len() { - log::error!( - "mat_ema_alpha_sparse row shapes don't match: {:?} vs. {:?} vs. {:?}", - old_row.len(), - new_row.len(), - alpha_row.len() - ); - } - // Densified accumulator sized to alpha_row length (columns outside are ignored). let mut decayed_values = vec![zero; alpha_row.len()]; @@ -1546,7 +1537,7 @@ pub fn mat_ema_alpha( // If outer dimensions don't match, return bonds unchanged if new.len() != old.len() || new.len() != alpha.len() { log::error!( - "mat_ema_alpha shapes don't match: {:?} vs. {:?} vs. {:?}", + "math error: mat_ema_alpha shapes don't match: {:?} vs. {:?} vs. {:?}", old.len(), new.len(), alpha.len() diff --git a/pallets/subtensor/src/epoch/run_epoch.rs b/pallets/subtensor/src/epoch/run_epoch.rs index 660690ae9f..cf7d4dc050 100644 --- a/pallets/subtensor/src/epoch/run_epoch.rs +++ b/pallets/subtensor/src/epoch/run_epoch.rs @@ -1128,7 +1128,7 @@ impl Pallet { if let Some(row) = weights.get_mut(uid_i as usize) { row.push((*uid_j, I32F32::saturating_from_num(*weight_ij))); } else { - log::error!("uid_i {uid_i:?} is filtered to be less than n"); + log::error!("math error: uid_i {uid_i:?} is filtered to be less than n"); } } } @@ -1391,7 +1391,7 @@ impl Pallet { if weights.len() != bonds.len() { log::error!( - "compute_liquid_alpha_values: weights and bonds have different lengths: {:?} != {:?}", + "math error: compute_liquid_alpha_values: weights and bonds have different lengths: {:?} != {:?}", weights.len(), bonds.len() ); @@ -1444,7 +1444,7 @@ impl Pallet { if weights.len() != bonds.len() { log::error!( - "compute_liquid_alpha_values: weights and bonds have different lengths: {:?} != {:?}", + "math error: compute_liquid_alpha_values: weights and bonds have different lengths: {:?} != {:?}", weights.len(), bonds.len() ); diff --git a/runtime/src/lib.rs b/runtime/src/lib.rs index 254bec73a3..20f4bac2b3 100644 --- a/runtime/src/lib.rs +++ b/runtime/src/lib.rs @@ -220,7 +220,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { // `spec_version`, and `authoring_version` are the same between Wasm and native. // This value is set to 100 to notify Polkadot-JS App (https://polkadot.js.org/apps) to use // the compatible custom types. - spec_version: 318, + spec_version: 319, impl_version: 1, apis: RUNTIME_API_VERSIONS, transaction_version: 1,