diff --git a/backends/tfhe-hpu-backend/config_store/sim/hpu_config.toml b/backends/tfhe-hpu-backend/config_store/sim/hpu_config.toml index 6fc222d6b..80e7a4827 100644 --- a/backends/tfhe-hpu-backend/config_store/sim/hpu_config.toml +++ b/backends/tfhe-hpu-backend/config_store/sim/hpu_config.toml @@ -62,8 +62,7 @@ trace_depth = 32 # In MB [firmware] - # implementation = "Llt" - implementation = "Ilp" + implementation = "Llt" integer_w=[2,4,6,8,10,12,14,16,32,64,128] min_batch_size = 11 kogge_cfg = "${HPU_BACKEND_DIR}/config_store/${HPU_CONFIG}/kogge_cfg.toml" diff --git a/tfhe/src/high_level_api/integers/unsigned/base.rs b/tfhe/src/high_level_api/integers/unsigned/base.rs index 965fac98d..7506f00a6 100644 --- a/tfhe/src/high_level_api/integers/unsigned/base.rs +++ b/tfhe/src/high_level_api/integers/unsigned/base.rs @@ -183,7 +183,7 @@ where &iop.format().expect("Unspecified IOP format").proto, ) }; - // These clones are cheap are they are just Arc + // These clones are cheap as they are just Arc let hpu_res = HpuRadixCiphertext::exec(proto, opcode, &srcs, &src.imm); HpuHandle { native: hpu_res @@ -507,7 +507,7 @@ where &asm_iop.format().expect("Unspecified IOP format").proto, ) }; - // These clones are cheap are they are just Arc + // These clones are cheap as they are just Arc let hpu_result = HpuRadixCiphertext::exec(proto, opcode, &[hpu_self.clone()], &[]) .pop() .expect("IOP_LEAD0 must return 1 value"); @@ -570,7 +570,7 @@ where &asm_iop.format().expect("Unspecified IOP format").proto, ) }; - // These clones are cheap are they are just Arc + // These clones are cheap as they are just Arc let hpu_result = HpuRadixCiphertext::exec(proto, opcode, &[hpu_self.clone()], &[]) .pop() .expect("IOP_LEAD1 must return 1 value"); @@ -633,7 +633,7 @@ where &asm_iop.format().expect("Unspecified IOP format").proto, ) }; - // These clones are cheap are they are just Arc + // These clones are cheap as they are just Arc let hpu_result = HpuRadixCiphertext::exec(proto, opcode, &[hpu_self.clone()], &[]) .pop() .expect("IOP_TRAIL0 must return 1 value"); @@ -696,7 +696,7 @@ where &asm_iop.format().expect("Unspecified IOP format").proto, ) }; - // These clones are cheap are they are just Arc + // These clones are cheap as they are just Arc let hpu_result = HpuRadixCiphertext::exec(proto, opcode, &[hpu_self.clone()], &[]) .pop() .expect("IOP_TRAIL1 must return 1 value"); @@ -750,7 +750,7 @@ where &asm_iop.format().expect("Unspecified IOP format").proto, ) }; - // These clones are cheap are they are just Arc + // These clones are cheap as they are just Arc let hpu_result = HpuRadixCiphertext::exec(proto, opcode, &[hpu_self.clone()], &[]) .pop() .expect("IOP_COUNT0 must return 1 value"); @@ -804,7 +804,7 @@ where &asm_iop.format().expect("Unspecified IOP format").proto, ) }; - // These clones are cheap are they are just Arc + // These clones are cheap as they are just Arc let hpu_result = HpuRadixCiphertext::exec(proto, opcode, &[hpu_self.clone()], &[]) .pop() .expect("IOP_COUNT1 must return 1 value"); @@ -869,7 +869,7 @@ where &asm_iop.format().expect("Unspecified IOP format").proto, ) }; - // These clones are cheap are they are just Arc + // These clones are cheap as they are just Arc let hpu_result = HpuRadixCiphertext::exec(proto, opcode, &[hpu_self.clone()], &[]) .pop() .expect("IOP_ILOG2 must return 1 value"); diff --git a/tfhe/src/high_level_api/integers/unsigned/tests/mod.rs b/tfhe/src/high_level_api/integers/unsigned/tests/mod.rs index 9333705a3..27609fb96 100644 --- a/tfhe/src/high_level_api/integers/unsigned/tests/mod.rs +++ b/tfhe/src/high_level_api/integers/unsigned/tests/mod.rs @@ -329,8 +329,7 @@ fn test_case_uint32_shift(cks: &ClientKey) { } // clear shifts - #[cfg(not(feature = "hpu"))] - { + if cfg!(not(feature = "hpu")) { let c = &a << clear_b; let decrypted: u32 = c.decrypt(cks); assert_eq!(decrypted, clear_a << clear_b); @@ -348,6 +347,8 @@ fn test_case_uint32_shift(cks: &ClientKey) { c <<= clear_b; let decrypted: u32 = c.decrypt(cks); assert_eq!(decrypted, clear_a << clear_b); + } else { + println!("WARN: HPU currently not support Shift by a scalar"); } } @@ -458,8 +459,7 @@ fn test_case_uint32_rotate(cks: &ClientKey) { } // clear rotate - #[cfg(not(feature = "hpu"))] - { + if cfg!(not(feature = "hpu")) { let c = (&a).rotate_left(clear_b); let decrypted: u32 = c.decrypt(cks); assert_eq!(decrypted, clear_a.rotate_left(clear_b)); @@ -477,6 +477,8 @@ fn test_case_uint32_rotate(cks: &ClientKey) { c.rotate_left_assign(clear_b); let decrypted: u32 = c.decrypt(cks); assert_eq!(decrypted, clear_a.rotate_left(clear_b)); + } else { + println!("WARN: HPU currently not support Shift by a scalar"); } }