From 31f821b6468375d77aebad4cdbe80c3e78f417fc Mon Sep 17 00:00:00 2001 From: Miles <2627273987@qq.com> Date: Wed, 20 Mar 2024 22:36:26 +0800 Subject: [PATCH] fix typos --- backends/concrete-cpu/implementation/README.md | 4 ++-- .../concrete-cuda/implementation/src/fft/bnsmfft.cuh | 6 +++--- .../implementation/src/fft/twiddles.cuh | 2 +- .../concretelang/Analysis/TypeInferenceAnalysis.h | 8 ++++---- .../compiler/include/concretelang/CAPI/Wrappers.h | 2 +- .../include/concretelang/Dialect/FHE/IR/FHEOps.h | 2 +- .../compiler/include/concretelang/Runtime/wrappers.h | 2 +- .../include/concretelang/TestLib/TestProgram.h | 2 +- .../concretelang/Transforms/TypeInferenceRewriter.h | 4 ++-- .../compiler/lib/Bindings/Python/CMakeLists.txt | 2 +- .../concrete-compiler/compiler/lib/Common/CRT.cpp | 2 +- .../concrete-compiler/compiler/lib/Common/Keys.cpp | 4 ++-- .../lib/Conversion/ConcreteToCAPI/ConcreteToCAPI.cpp | 2 +- .../FHETensorOpsToLinalg/TensorOpsToLinalg.cpp | 2 +- .../Conversion/FHEToTFHEScalar/FHEToTFHEScalar.cpp | 2 +- .../lib/Dialect/FHE/Analysis/ConcreteOptimizer.cpp | 2 +- .../compiler/lib/Dialect/FHE/Analysis/MANP.cpp | 2 +- .../compiler/lib/Dialect/FHE/IR/FHEOps.cpp | 2 +- .../compiler/lib/Dialect/FHE/Transforms/BigInt.cpp | 2 +- .../compiler/lib/Dialect/FHE/Transforms/Boolean.cpp | 2 +- .../lib/Dialect/FHELinalg/Transforms/Tiling.cpp | 2 +- .../compiler/lib/Dialect/TFHE/IR/TFHEDialect.cpp | 2 +- .../compiler/lib/Runtime/DFRuntime.cpp | 6 +++--- .../compiler/lib/Runtime/wrappers.cpp | 2 +- .../compiler/lib/Support/CompilerEngine.cpp | 2 +- .../compiler/lib/Transforms/Batching.cpp | 12 ++++++------ compilers/concrete-compiler/compiler/src/main.cpp | 2 +- .../tests/end_to_end_fixture/EndToEndFixture.cpp | 4 ++-- .../compiler/tests/end_to_end_tests/CMakeLists.txt | 2 +- .../compiler/tests/python/test_round_trip.py | 2 +- .../unit_tests/concretelang/Encodings/CMakeLists.txt | 2 +- .../unit_tests/concretelang/SDFG/CMakeLists.txt | 2 +- .../unit_tests/concretelang/TestLib/CMakeLists.txt | 2 +- compilers/concrete-optimizer/README.md | 2 +- .../brute-force-optimizer/src/gba.rs | 2 +- .../cmake-utils/CMakeLists.txt | 2 +- .../src/computing_cost/complexity.rs | 2 +- .../concrete-optimizer/src/dag/operator/operator.rs | 2 +- .../concrete-optimizer/src/dag/unparametrized.rs | 10 +++++----- .../src/optimization/atomic_pattern.rs | 2 +- .../optimization/dag/multi_parameters/keys_spec.rs | 2 +- .../dag/multi_parameters/optimize/mod.rs | 4 ++-- .../dag/multi_parameters/symbolic_variance.rs | 4 ++-- .../src/optimization/dag/solo_key/analyze.rs | 2 +- .../optimization/decomposition/circuit_bootstrap.rs | 2 +- .../src/optimization/decomposition/cmux.rs | 2 +- .../src/optimization/decomposition/keyswitch.rs | 2 +- compilers/concrete-optimizer/v0-parameters/README.md | 2 +- docs/application-tutorial/key_value_database.ipynb | 2 +- docs/compilation/composition.md | 2 +- docs/compilation/multi_parameters.md | 2 +- docs/core-features/rounding.md | 4 ++-- docs/dev/api/concrete.compiler.md | 2 +- docs/dev/api/concrete.fhe.dtypes.integer.md | 4 ++-- docs/dev/api/concrete.fhe.extensions.array.md | 2 +- docs/dev/api/concrete.fhe.extensions.ones.md | 4 ++-- .../api/concrete.fhe.extensions.round_bit_pattern.md | 4 ++-- docs/dev/api/concrete.fhe.extensions.zeros.md | 4 ++-- docs/explanations/backends/README.md | 2 +- .../concrete/fhe/compilation/configuration.py | 2 +- .../concrete-python/concrete/fhe/dtypes/integer.py | 4 ++-- .../concrete-python/concrete/fhe/extensions/array.py | 2 +- .../concrete-python/concrete/fhe/extensions/ones.py | 4 ++-- .../concrete/fhe/extensions/round_bit_pattern.py | 4 ++-- .../concrete-python/concrete/fhe/extensions/zeros.py | 2 +- .../concrete-python/concrete/fhe/mlir/context.py | 2 +- frontends/concrete-python/concrete/fhe/mlir/utils.py | 2 +- .../tests/execution/test_compressions.py | 2 +- .../tests/execution/test_static_assignment.py | 2 +- .../lattice-scripts/compare_curves_and_estimator.py | 2 +- 70 files changed, 100 insertions(+), 100 deletions(-) diff --git a/backends/concrete-cpu/implementation/README.md b/backends/concrete-cpu/implementation/README.md index dbfbaa6a1b..9a651f315e 100644 --- a/backends/concrete-cpu/implementation/README.md +++ b/backends/concrete-cpu/implementation/README.md @@ -8,11 +8,11 @@ In order to be integrated in a C-based project like the `concrete-compiler` runt ### Prerequisites -The `concrete-cpu` project is implemented thanks Rust, thus as the main prerequiste the rust toolchain must be installed. You can install from the official [Install Rust instructions](https://www.rust-lang.org/tools/install). Some of features like the use of avx512 instructions are available only with a nightly rust toolchain so if you want to use it you need to install it following those [instructions](https://rust-lang.github.io/rustup/concepts/channels.html). +The `concrete-cpu` project is implemented thanks Rust, thus as the main prerequisite the rust toolchain must be installed. You can install from the official [Install Rust instructions](https://www.rust-lang.org/tools/install). Some of features like the use of avx512 instructions are available only with a nightly rust toolchain so if you want to use it you need to install it following those [instructions](https://rust-lang.github.io/rustup/concepts/channels.html). ### Setting RUSTFLAGS -As mentionned before the `concrete-cpu` project aims to use moderns CPU features, to be sure to activate all that is available in your machine you can export the following rust flags: +As mentioned before the `concrete-cpu` project aims to use moderns CPU features, to be sure to activate all that is available in your machine you can export the following rust flags: ``` export RUSTFLAGS="-C target-cpu=native" diff --git a/backends/concrete-cuda/implementation/src/fft/bnsmfft.cuh b/backends/concrete-cuda/implementation/src/fft/bnsmfft.cuh index e00fa5ff20..8bf4de4334 100644 --- a/backends/concrete-cuda/implementation/src/fft/bnsmfft.cuh +++ b/backends/concrete-cuda/implementation/src/fft/bnsmfft.cuh @@ -181,7 +181,7 @@ template __device__ void NSMFFT_direct(double2 *A) { // from level 8, we need to check size of params degree, because we support // minimum actual polynomial size = 256, when compressed size is halfed and // minimum supported compressed size is 128, so we always need first 7 - // levels of butterfy operation, since butterfly levels are hardcoded + // levels of butterfly operation, since butterfly levels are hardcoded // we need to check if polynomial size is big enough to require specific level // of butterfly. if constexpr (params::degree >= 256) { @@ -354,7 +354,7 @@ template __device__ void NSMFFT_inverse(double2 *A) { // compressed size = 8192 is actual polynomial size = 16384. // twiddles for this size can't fit in constant memory so - // butterfly operation for this level acess device memory to fetch + // butterfly operation for this level access device memory to fetch // twiddles if constexpr (params::degree >= 8192) { // level 13 @@ -491,7 +491,7 @@ template __device__ void NSMFFT_inverse(double2 *A) { // below level 8, we don't need to check size of params degree, because we // support minimum actual polynomial size = 256, when compressed size is // halfed and minimum supported compressed size is 128, so we always need - // last 7 levels of butterfy operation, since butterfly levels are hardcoded + // last 7 levels of butterfly operation, since butterfly levels are hardcoded // we don't need to check if polynomial size is big enough to require // specific level of butterfly. // level 7 diff --git a/backends/concrete-cuda/implementation/src/fft/twiddles.cuh b/backends/concrete-cuda/implementation/src/fft/twiddles.cuh index 297ec3c5ce..ed4d885d7c 100644 --- a/backends/concrete-cuda/implementation/src/fft/twiddles.cuh +++ b/backends/concrete-cuda/implementation/src/fft/twiddles.cuh @@ -4,7 +4,7 @@ /* * 'negtwiddles' are stored in constant memory for faster access times - * because of it's limitied size, only twiddles for up to 2^12 polynomial size + * because of it's limited size, only twiddles for up to 2^12 polynomial size * can be stored there, twiddles for 2^13 are stored in device memory * 'negtwiddles13' */ diff --git a/compilers/concrete-compiler/compiler/include/concretelang/Analysis/TypeInferenceAnalysis.h b/compilers/concrete-compiler/compiler/include/concretelang/Analysis/TypeInferenceAnalysis.h index 996c749633..5768c863f5 100644 --- a/compilers/concrete-compiler/compiler/include/concretelang/Analysis/TypeInferenceAnalysis.h +++ b/compilers/concrete-compiler/compiler/include/concretelang/Analysis/TypeInferenceAnalysis.h @@ -43,14 +43,14 @@ // constraints (e.g., if two values must have the same type or the // same element type). These exist both as static constraints and as // dynamic constraints. Some pre-defined type constraints depend on a -// class that yields a pair of values for which the contraints shall +// class that yields a pair of values for which the constraints shall // be applied (e.g., yielding two operands or an operand and a result, // etc.). // // The global state of type inference after running the type inference // analyses is contained in the `DataFlowSolver` to which the analyses // where added. The local state of inference for an operation can be -// obtained at any stage of the anlysis via the helper methods of +// obtained at any stage of the analysis via the helper methods of // `TypeInferenceUtils`. #ifndef CONCRETELANG_ANALYSIS_TYPEINFERENCEANALYSIS_H @@ -550,7 +550,7 @@ class SameTypeConstraintBase : public BaseConstraintT { bool rightUnresolved = resolver.isUnresolvedType(rightType); // Priority is given from left to right, i.e., the type of the - // first value yielded by `yield()` takes precendence over the + // first value yielded by `yield()` takes precedence over the // type for the second value if (!leftUnresolved && rightUnresolved) { currState.set(leftValue, leftType); @@ -615,7 +615,7 @@ class SameElementTypeConstraintBase : public BaseConstraintT { bool rightUnresolved = resolver.isUnresolvedType(rightType); // Priority is given from left to right, i.e., the type of the - // first value yielded by `yield()` takes precendence over the + // first value yielded by `yield()` takes precedence over the // type for the second value if (!leftUnresolved && rightUnresolved) { currState.set(leftValue, leftType); diff --git a/compilers/concrete-compiler/compiler/include/concretelang/CAPI/Wrappers.h b/compilers/concrete-compiler/compiler/include/concretelang/CAPI/Wrappers.h index 6017cd7598..14b7d7b747 100644 --- a/compilers/concrete-compiler/compiler/include/concretelang/CAPI/Wrappers.h +++ b/compilers/concrete-compiler/compiler/include/concretelang/CAPI/Wrappers.h @@ -11,7 +11,7 @@ #include "concretelang/Support/LibrarySupport.h" /// Add a mechanism to go from Cpp objects to C-struct, with the ability to -/// represent errors. Also the other way arround. +/// represent errors. Also the other way around. #define DEFINE_C_API_PTR_METHODS_WITH_ERROR(name, cpptype) \ static inline name wrap(cpptype *cpp) { return name{cpp, (char *)NULL}; } \ static inline name wrap(cpptype *cpp, std::string errorStr) { \ diff --git a/compilers/concrete-compiler/compiler/include/concretelang/Dialect/FHE/IR/FHEOps.h b/compilers/concrete-compiler/compiler/include/concretelang/Dialect/FHE/IR/FHEOps.h index 1a878d03b4..6285395fad 100644 --- a/compilers/concrete-compiler/compiler/include/concretelang/Dialect/FHE/IR/FHEOps.h +++ b/compilers/concrete-compiler/compiler/include/concretelang/Dialect/FHE/IR/FHEOps.h @@ -29,7 +29,7 @@ bool verifyEncryptedIntegerInputsConsistency(mlir::Operation &op, /// Shared error message for all ApplyLookupTable variant Op (several Dialect) /// E.g. FHE.apply_lookup_table(input, lut) /// Message when the lut tensor has an invalid size, -/// i.e. it cannot accomodate the input elements bitwidth +/// i.e. it cannot accommodate the input elements bitwidth template void emitErrorBadLutSize(Op &op, std::string lutName, std::string inputName, int expectedSize, int bitWidth) { diff --git a/compilers/concrete-compiler/compiler/include/concretelang/Runtime/wrappers.h b/compilers/concrete-compiler/compiler/include/concretelang/Runtime/wrappers.h index 2794f72707..eaa1ab15a3 100644 --- a/compilers/concrete-compiler/compiler/include/concretelang/Runtime/wrappers.h +++ b/compilers/concrete-compiler/compiler/include/concretelang/Runtime/wrappers.h @@ -224,7 +224,7 @@ void memref_wop_pbs_crt_buffer( uint32_t polynomial_size, // Key indices uint32_t ksk_index, uint32_t bsk_index, uint32_t pksk_index, - // runtime context that hold evluation keys + // runtime context that hold evaluation keys mlir::concretelang::RuntimeContext *context); void memref_copy_one_rank(uint64_t *src_allocated, uint64_t *src_aligned, diff --git a/compilers/concrete-compiler/compiler/include/concretelang/TestLib/TestProgram.h b/compilers/concrete-compiler/compiler/include/concretelang/TestLib/TestProgram.h index 6feec25d83..7439e852ab 100644 --- a/compilers/concrete-compiler/compiler/include/concretelang/TestLib/TestProgram.h +++ b/compilers/concrete-compiler/compiler/include/concretelang/TestLib/TestProgram.h @@ -242,7 +242,7 @@ class TestProgram { } } else { llvm::errs() << "TestProgram: directory(" << pathString - << ") successfuly created\n"; + << ") successfully created\n"; return pathString; } } diff --git a/compilers/concrete-compiler/compiler/include/concretelang/Transforms/TypeInferenceRewriter.h b/compilers/concrete-compiler/compiler/include/concretelang/Transforms/TypeInferenceRewriter.h index 53698cfcef..334fe15dbc 100644 --- a/compilers/concrete-compiler/compiler/include/concretelang/Transforms/TypeInferenceRewriter.h +++ b/compilers/concrete-compiler/compiler/include/concretelang/Transforms/TypeInferenceRewriter.h @@ -175,7 +175,7 @@ class TypeInferenceRewriter { // parent operation, which, at this point, has already been // partially rewritten before recursing into this rewrite call. // - // Functions are a bit diffent though, since the types of the + // Functions are a bit different though, since the types of the // results are contained in a function type and not in the // result types. mlir::Operation *newParent = mapping.lookup(op->getParentOp()); @@ -187,7 +187,7 @@ class TypeInferenceRewriter { llvm::to_vector(newParentFunc.getFunctionType().getResults()); } else { // Look up new parent op and use the return types, since these - // are the authorative types obtained from the last invocation + // are the authoritative types obtained from the last invocation // of the type resolver resolvedOperandTypes = llvm::to_vector(newParent->getResultTypes()); } diff --git a/compilers/concrete-compiler/compiler/lib/Bindings/Python/CMakeLists.txt b/compilers/concrete-compiler/compiler/lib/Bindings/Python/CMakeLists.txt index d3c2e4a7c3..744b9dda69 100644 --- a/compilers/concrete-compiler/compiler/lib/Bindings/Python/CMakeLists.txt +++ b/compilers/concrete-compiler/compiler/lib/Bindings/Python/CMakeLists.txt @@ -4,7 +4,7 @@ include(AddMLIRPython) add_compile_options(-fexceptions) # ###################################################################################################################### -# Decalare native Python extension +# Declare native Python extension # ###################################################################################################################### declare_mlir_python_sources(ConcretelangBindingsPythonExtension) diff --git a/compilers/concrete-compiler/compiler/lib/Common/CRT.cpp b/compilers/concrete-compiler/compiler/lib/Common/CRT.cpp index 66468132f7..d1089882c1 100644 --- a/compilers/concrete-compiler/compiler/lib/Common/CRT.cpp +++ b/compilers/concrete-compiler/compiler/lib/Common/CRT.cpp @@ -79,7 +79,7 @@ uint64_t iCrt(std::vector moduli, std::vector remainders) { uint64_t encode(int64_t plaintext, uint64_t modulus, uint64_t product) { // values are represented on the interval [0; product[ so we represent - // plantext on this interval + // plaintext on this interval if (plaintext < 0) { plaintext = product + plaintext; } diff --git a/compilers/concrete-compiler/compiler/lib/Common/Keys.cpp b/compilers/concrete-compiler/compiler/lib/Common/Keys.cpp index 8ecd2de184..4cf2bdebe2 100644 --- a/compilers/concrete-compiler/compiler/lib/Common/Keys.cpp +++ b/compilers/concrete-compiler/compiler/lib/Common/Keys.cpp @@ -47,7 +47,7 @@ LweSecretKey::LweSecretKey(Message info, buffer = std::make_shared>( info.asReader().getParams().getLweDimension()); - // We copy the informations. + // We copy the information. this->info = info; #ifdef CONCRETELANG_GENERATE_UNSECURE_SECRET_KEYS @@ -349,7 +349,7 @@ PackingKeyswitchKey::PackingKeyswitchKey( buffer = std::make_shared>(); (*buffer).resize(bufferSize); - // We copy the informations. + // We copy the information. this->info = info; // Initialize the keyswitch key buffer diff --git a/compilers/concrete-compiler/compiler/lib/Conversion/ConcreteToCAPI/ConcreteToCAPI.cpp b/compilers/concrete-compiler/compiler/lib/Conversion/ConcreteToCAPI/ConcreteToCAPI.cpp index 350f3ba2ac..722112c029 100644 --- a/compilers/concrete-compiler/compiler/lib/Conversion/ConcreteToCAPI/ConcreteToCAPI.cpp +++ b/compilers/concrete-compiler/compiler/lib/Conversion/ConcreteToCAPI/ConcreteToCAPI.cpp @@ -224,7 +224,7 @@ mlir::LogicalResult insertForwardDeclarationOfTheCAPI( rewriter.getI32Type(), rewriter.getI32Type()}, {}); } else { - op->emitError("unknwon external function") << funcName; + op->emitError("unknown external function") << funcName; return mlir::failure(); } diff --git a/compilers/concrete-compiler/compiler/lib/Conversion/FHETensorOpsToLinalg/TensorOpsToLinalg.cpp b/compilers/concrete-compiler/compiler/lib/Conversion/FHETensorOpsToLinalg/TensorOpsToLinalg.cpp index 3dc83a8ca2..e2f0f3a498 100644 --- a/compilers/concrete-compiler/compiler/lib/Conversion/FHETensorOpsToLinalg/TensorOpsToLinalg.cpp +++ b/compilers/concrete-compiler/compiler/lib/Conversion/FHETensorOpsToLinalg/TensorOpsToLinalg.cpp @@ -1963,7 +1963,7 @@ struct TensorPartitionFrontierOpToLinalgGeneric mlir::Value init = rewriter.create( pfOp.getLoc(), resultTy, mlir::ValueRange{}); - // Create affine maps and iterator types for an embarassingly + // Create affine maps and iterator types for an embarrassingly // parallel op llvm::SmallVector maps{ mlir::AffineMap::getMultiDimIdentityMap(tensorTy.getShape().size(), diff --git a/compilers/concrete-compiler/compiler/lib/Conversion/FHEToTFHEScalar/FHEToTFHEScalar.cpp b/compilers/concrete-compiler/compiler/lib/Conversion/FHEToTFHEScalar/FHEToTFHEScalar.cpp index a816faeaa8..1fd15d1a94 100644 --- a/compilers/concrete-compiler/compiler/lib/Conversion/FHEToTFHEScalar/FHEToTFHEScalar.cpp +++ b/compilers/concrete-compiler/compiler/lib/Conversion/FHEToTFHEScalar/FHEToTFHEScalar.cpp @@ -479,7 +479,7 @@ std::vector extractBitWithClearedLowerBits( rewriter.getIntegerType(64)), rawLut)); - //-------------------------------------------------- CIPHERTEXT ALIGNEMENT + //-------------------------------------------------- CIPHERTEXT ALIGNMENT // In practice, TFHE ciphertexts are normally distributed around a value. // That means that if the lookup is performed _as is_, we have almost .5 // probability to return the wrong value. Imagine a ciphertext centered diff --git a/compilers/concrete-compiler/compiler/lib/Dialect/FHE/Analysis/ConcreteOptimizer.cpp b/compilers/concrete-compiler/compiler/lib/Dialect/FHE/Analysis/ConcreteOptimizer.cpp index 69125d60f8..d2d3a95acc 100644 --- a/compilers/concrete-compiler/compiler/lib/Dialect/FHE/Analysis/ConcreteOptimizer.cpp +++ b/compilers/concrete-compiler/compiler/lib/Dialect/FHE/Analysis/ConcreteOptimizer.cpp @@ -762,7 +762,7 @@ struct FunctionToDag { mlir::SmallVector operatorIndexes = {(int32_t)subNode.index, (int32_t)tluNode.index, (int32_t)resultNode.index}; - // TODO : The substraction of the signed case is not given to the optimizer + // TODO : The subtraction of the signed case is not given to the optimizer // which could lead to some issue with the dag partitioning of the // optimizer. // Note: Should not be an issue while the partition are computed diff --git a/compilers/concrete-compiler/compiler/lib/Dialect/FHE/Analysis/MANP.cpp b/compilers/concrete-compiler/compiler/lib/Dialect/FHE/Analysis/MANP.cpp index 828a53349b..821cee33aa 100644 --- a/compilers/concrete-compiler/compiler/lib/Dialect/FHE/Analysis/MANP.cpp +++ b/compilers/concrete-compiler/compiler/lib/Dialect/FHE/Analysis/MANP.cpp @@ -162,7 +162,7 @@ static llvm::APInt APIntWidthExtendUMul(const llvm::APInt &lhs, return lhs.zext(targetWidth) * rhs.zext(targetWidth); } -/// Returns the maximum value beetwen `lhs` and `rhs`, where both values are +/// Returns the maximum value between `lhs` and `rhs`, where both values are /// assumed to be positive. The bit width of the smaller `APInt` is extended /// before comparison via `APInt::ult`. static llvm::APInt APIntUMax(const llvm::APInt &lhs, const llvm::APInt &rhs) { diff --git a/compilers/concrete-compiler/compiler/lib/Dialect/FHE/IR/FHEOps.cpp b/compilers/concrete-compiler/compiler/lib/Dialect/FHE/IR/FHEOps.cpp index 6cba99b496..73eeee2b71 100644 --- a/compilers/concrete-compiler/compiler/lib/Dialect/FHE/IR/FHEOps.cpp +++ b/compilers/concrete-compiler/compiler/lib/Dialect/FHE/IR/FHEOps.cpp @@ -483,7 +483,7 @@ void ApplyLookupTableEintOp::getCanonicalizationPatterns( if (resultOfFirstLookup < 0) { // e.g., imagine first table resulted in -100_000 // (which can exist in tables...) - // then we set it to the smalles possible value + // then we set it to the smallest possible value // of the input to the table // So if -100 is encountered on a signed 7-bit tlu diff --git a/compilers/concrete-compiler/compiler/lib/Dialect/FHE/Transforms/BigInt.cpp b/compilers/concrete-compiler/compiler/lib/Dialect/FHE/Transforms/BigInt.cpp index 42043fb47b..cc0877692d 100644 --- a/compilers/concrete-compiler/compiler/lib/Dialect/FHE/Transforms/BigInt.cpp +++ b/compilers/concrete-compiler/compiler/lib/Dialect/FHE/Transforms/BigInt.cpp @@ -169,7 +169,7 @@ class AddEintPattern unsigned int chunkSize, chunkWidth; }; -/// Perfoms the transformation of big integer operations +/// Performs the transformation of big integer operations class FHEBigIntTransformPass : public FHEBigIntTransformBase { public: diff --git a/compilers/concrete-compiler/compiler/lib/Dialect/FHE/Transforms/Boolean.cpp b/compilers/concrete-compiler/compiler/lib/Dialect/FHE/Transforms/Boolean.cpp index 5195e8c2c1..0d718f288c 100644 --- a/compilers/concrete-compiler/compiler/lib/Dialect/FHE/Transforms/Boolean.cpp +++ b/compilers/concrete-compiler/compiler/lib/Dialect/FHE/Transforms/Boolean.cpp @@ -145,7 +145,7 @@ class MuxOpPattern } }; -/// Perfoms the transformation of boolean operations +/// Performs the transformation of boolean operations class FHEBooleanTransformPass : public FHEBooleanTransformBase { public: diff --git a/compilers/concrete-compiler/compiler/lib/Dialect/FHELinalg/Transforms/Tiling.cpp b/compilers/concrete-compiler/compiler/lib/Dialect/FHELinalg/Transforms/Tiling.cpp index 67cf341388..6a8211e65c 100644 --- a/compilers/concrete-compiler/compiler/lib/Dialect/FHELinalg/Transforms/Tiling.cpp +++ b/compilers/concrete-compiler/compiler/lib/Dialect/FHELinalg/Transforms/Tiling.cpp @@ -153,7 +153,7 @@ class GenericTilingPattern } }; -/// Perfoms the actual tiling of `FHELinalg.matmul_eint_int` +/// Performs the actual tiling of `FHELinalg.matmul_eint_int` /// operations that have been marked with a "tile-sizes" attribute. class LinalgTilingPass : public LinalgTilingBase { public: diff --git a/compilers/concrete-compiler/compiler/lib/Dialect/TFHE/IR/TFHEDialect.cpp b/compilers/concrete-compiler/compiler/lib/Dialect/TFHE/IR/TFHEDialect.cpp index 1bc01aaeaf..f9cbcb6d80 100644 --- a/compilers/concrete-compiler/compiler/lib/Dialect/TFHE/IR/TFHEDialect.cpp +++ b/compilers/concrete-compiler/compiler/lib/Dialect/TFHE/IR/TFHEDialect.cpp @@ -37,7 +37,7 @@ void TFHEDialect::initialize() { >(); } -/// Verify that GLWE parameter are consistant +/// Verify that GLWE parameter are consistent ::mlir::LogicalResult GLWECipherTextType::verify( ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError, GLWESecretKey key) { diff --git a/compilers/concrete-compiler/compiler/lib/Runtime/DFRuntime.cpp b/compilers/concrete-compiler/compiler/lib/Runtime/DFRuntime.cpp index 61ab21e64d..af5dc8089c 100644 --- a/compilers/concrete-compiler/compiler/lib/Runtime/DFRuntime.cpp +++ b/compilers/concrete-compiler/compiler/lib/Runtime/DFRuntime.cpp @@ -104,7 +104,7 @@ void _dfr_create_async_task(wfnptr wfn, void *ctx, size_t num_params, param_types, outputs, output_sizes, output_types); } -/// Runtime generic async_task with vector parametres. Each first +/// Runtime generic async_task with vector parameters. Each first /// NUM_OUTPUTS quadruplets of arguments in the variadic list /// corresponds to a size_t for the number of elements in the /// following array, a void * pointer on an array of @@ -112,7 +112,7 @@ void _dfr_create_async_task(wfnptr wfn, void *ctx, size_t num_params, /// of each output. After that come NUM_PARAMS quadruplets of /// arguments in the variadic list that correspond to a size_t for the /// number of elements in the following array, a void* pointer on an -/// array of hpx::future and the same two size_t parametres +/// array of hpx::future and the same two size_t parameters /// (size and type). void _dfr_create_async_task_vec(wfnptr wfn, void *ctx, size_t num_params, size_t num_outputs, ...) { @@ -349,7 +349,7 @@ void _dfr_start(int64_t use_dfr_p, void *ctx) { BEGIN_TIME(&whole_timer); if (use_dfr_p) { // The first invocation will initialise the runtime. As each call to - // _dfr_start is matched with _dfr_stop, if this is not hte first, + // _dfr_start is matched with _dfr_stop, if this is not the first, // we need to resume the HPX runtime. assert(init_guard != terminated && "DFR runtime: attempting to start runtime after it has been " diff --git a/compilers/concrete-compiler/compiler/lib/Runtime/wrappers.cpp b/compilers/concrete-compiler/compiler/lib/Runtime/wrappers.cpp index 4f3dd87295..a90e0f4474 100644 --- a/compilers/concrete-compiler/compiler/lib/Runtime/wrappers.cpp +++ b/compilers/concrete-compiler/compiler/lib/Runtime/wrappers.cpp @@ -845,7 +845,7 @@ void memref_wop_pbs_crt_buffer( uint32_t polynomial_size, // Key Indices, uint32_t ksk_index, uint32_t bsk_index, uint32_t pksk_index, - // runtime context that hold evluation keys + // runtime context that hold evaluation keys mlir::concretelang::RuntimeContext *context) { // The compiler should only generates 2D memref, where B is the number of diff --git a/compilers/concrete-compiler/compiler/lib/Support/CompilerEngine.cpp b/compilers/concrete-compiler/compiler/lib/Support/CompilerEngine.cpp index 0c93dc0931..6576b7016c 100644 --- a/compilers/concrete-compiler/compiler/lib/Support/CompilerEngine.cpp +++ b/compilers/concrete-compiler/compiler/lib/Support/CompilerEngine.cpp @@ -981,7 +981,7 @@ llvm::Expected CompilerEngine::Library::emitShared() { // it during load time. To solve this, we change the dep in the generated // library to be relative to the rpath which should be set correctly // during linking. This shouldn't have an impact when - // /DLC/concrete/.dylibs/* isn't a dependecy in the first place (when not + // /DLC/concrete/.dylibs/* isn't a dependency in the first place (when not // using python). if (fixRuntimeDep) { std::string fixRuntimeDepCmd = "install_name_tool -change " diff --git a/compilers/concrete-compiler/compiler/lib/Transforms/Batching.cpp b/compilers/concrete-compiler/compiler/lib/Transforms/Batching.cpp index 01bec55e56..2859e079e5 100644 --- a/compilers/concrete-compiler/compiler/lib/Transforms/Batching.cpp +++ b/compilers/concrete-compiler/compiler/lib/Transforms/Batching.cpp @@ -177,7 +177,7 @@ unsigned getOperandIndexForValue(mlir::Operation *op, mlir::Value v) { } // Walks up the use-def-chain of of the value `v`, executing `cb` -// for any value not previsouly encountered un `visited`. +// for any value not previously encountered un `visited`. static void walkUseDefChainRec(mlir::DenseSet &visited, mlir::Value v, llvm::function_ref cb) { @@ -473,7 +473,7 @@ static void rewritePerfectLoopNestWithReplacedNthResult( rewriter.replaceOp(currFor, newResults); } else { - // An inner loop has been rewriten -> remap uses of results of + // An inner loop has been rewritten -> remap uses of results of // the old loop to the new loop mlir::scf::ForOp parentFor = llvm::dyn_cast(currFor->getParentOp()); @@ -492,7 +492,7 @@ static void rewritePerfectLoopNestWithReplacedNthResult( } /// Checks if the value `v` is defined outside of the `loop` or a pure -/// operation that can be safely replicated ouside the loop (i.e., all +/// operation that can be safely replicated outside the loop (i.e., all /// of its operands are also recursively either defined outside of the /// loop or pure). static bool isHoistable(mlir::Value v, mlir::scf::ForOp loop) { @@ -1839,7 +1839,7 @@ class ConstantDenseFoldingPattern mlir::Type currOrigElementType = currConstantType.getElementType(); mlir::Type currFoldedElementType = currOrigElementType; - // Walk down the def-use chain from the extract operaion until + // Walk down the def-use chain from the extract operation until // an operation is found that is not foldable while (true) { if (!isFoldableOp(currOp)) @@ -1864,7 +1864,7 @@ class ConstantDenseFoldingPattern return mlir::WalkResult::skip(); // Check constraints on the index space of the extract - // operation. I.e., if the type changes during teh folding, + // operation. I.e., if the type changes during the folding, // ensure that the index space covers the entire tensor and that // there are no out-of-bounds accesses. for (auto it : llvm::enumerate(currExtractOp.getIndices())) { @@ -1913,7 +1913,7 @@ class ConstantDenseFoldingPattern .cast() .getValues(); - // Updated tensor of constants intialized with original values + // Updated tensor of constants initialized with original values SmallVector newDenseVals(denseVals.begin(), denseVals.end()); diff --git a/compilers/concrete-compiler/compiler/src/main.cpp b/compilers/concrete-compiler/compiler/src/main.cpp index b5cfefdf00..cd216810d8 100644 --- a/compilers/concrete-compiler/compiler/src/main.cpp +++ b/compilers/concrete-compiler/compiler/src/main.cpp @@ -630,7 +630,7 @@ mlir::LogicalResult processInputBuffer( } if (retOrErr->llvmModule) { - // At least usefull for intermediate binary object files naming + // At least useful for intermediate binary object files naming retOrErr->llvmModule->setSourceFileName(sourceFileName); retOrErr->llvmModule->setModuleIdentifier(sourceFileName); } diff --git a/compilers/concrete-compiler/compiler/tests/end_to_end_fixture/EndToEndFixture.cpp b/compilers/concrete-compiler/compiler/tests/end_to_end_fixture/EndToEndFixture.cpp index 37b53f1df2..00408b1d7a 100644 --- a/compilers/concrete-compiler/compiler/tests/end_to_end_fixture/EndToEndFixture.cpp +++ b/compilers/concrete-compiler/compiler/tests/end_to_end_fixture/EndToEndFixture.cpp @@ -213,7 +213,7 @@ template <> struct llvm::yaml::MappingTraits { io.mapOptional("v0-parameter", v0parameter); if (!v0parameter.empty()) { if (v0parameter.size() != 7) { - io.setError("v0-parameter expect to be a list 7 elemnts " + io.setError("v0-parameter expect to be a list 7 elements " "[glweDimension, logPolynomialSize, nSmall, brLevel, " "brLobBase, ksLevel, ksLogBase]"); } @@ -226,7 +226,7 @@ template <> struct llvm::yaml::MappingTraits { io.mapOptional("v0-constraint", v0constraint); if (!v0constraint.empty()) { if (v0constraint.size() != 2) { - io.setError("v0-constraint expect to be a list 2 elemnts " + io.setError("v0-constraint expect to be a list 2 elements " "[p, norm2]"); } desc.v0Constraint = mlir::concretelang::V0FHEConstraint(); diff --git a/compilers/concrete-compiler/compiler/tests/end_to_end_tests/CMakeLists.txt b/compilers/concrete-compiler/compiler/tests/end_to_end_tests/CMakeLists.txt index 6f80fdcfdb..16cf5b4e35 100644 --- a/compilers/concrete-compiler/compiler/tests/end_to_end_tests/CMakeLists.txt +++ b/compilers/concrete-compiler/compiler/tests/end_to_end_tests/CMakeLists.txt @@ -12,7 +12,7 @@ include_directories(${CONCRETE_OPTIMIZER_DIR}/concrete-optimizer-cpp/src/cpp) if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") link_libraries( - # usefull for old gcc versions + # useful for old gcc versions -Wl,--allow-multiple-definition # static concrete-optimizer and concrete shares some code ) endif() diff --git a/compilers/concrete-compiler/compiler/tests/python/test_round_trip.py b/compilers/concrete-compiler/compiler/tests/python/test_round_trip.py index befc2f1877..bba4b62725 100644 --- a/compilers/concrete-compiler/compiler/tests/python/test_round_trip.py +++ b/compilers/concrete-compiler/compiler/tests/python/test_round_trip.py @@ -88,6 +88,6 @@ def test_valid_mlir_inputs(mlir_input): @pytest.mark.parametrize("mlir_input", INVALID_INPUTS) def test_invalid_mlir_inputs(mlir_input): - # We need to check that invalud inputs are raising an error + # We need to check that invalid inputs are raising an error with pytest.raises(RuntimeError, match=r"MLIR parsing failed:"): compiler.round_trip(mlir_input) diff --git a/compilers/concrete-compiler/compiler/tests/unit_tests/concretelang/Encodings/CMakeLists.txt b/compilers/concrete-compiler/compiler/tests/unit_tests/concretelang/Encodings/CMakeLists.txt index 4742ff8c62..054e9abe06 100644 --- a/compilers/concrete-compiler/compiler/tests/unit_tests/concretelang/Encodings/CMakeLists.txt +++ b/compilers/concrete-compiler/compiler/tests/unit_tests/concretelang/Encodings/CMakeLists.txt @@ -11,7 +11,7 @@ endfunction() if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") link_libraries( - # usefull for old gcc versions + # useful for old gcc versions -Wl,--allow-multiple-definition # static concrete-optimizer and concrete shares some code ) endif() diff --git a/compilers/concrete-compiler/compiler/tests/unit_tests/concretelang/SDFG/CMakeLists.txt b/compilers/concrete-compiler/compiler/tests/unit_tests/concretelang/SDFG/CMakeLists.txt index 1da230275b..5743e1f418 100644 --- a/compilers/concrete-compiler/compiler/tests/unit_tests/concretelang/SDFG/CMakeLists.txt +++ b/compilers/concrete-compiler/compiler/tests/unit_tests/concretelang/SDFG/CMakeLists.txt @@ -10,7 +10,7 @@ endfunction() if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") link_libraries( - # usefull for old gcc versions + # useful for old gcc versions -Wl,--allow-multiple-definition # static concrete-optimizer and concrete shares some code ) endif() diff --git a/compilers/concrete-compiler/compiler/tests/unit_tests/concretelang/TestLib/CMakeLists.txt b/compilers/concrete-compiler/compiler/tests/unit_tests/concretelang/TestLib/CMakeLists.txt index bb198c31c4..7e89de0423 100644 --- a/compilers/concrete-compiler/compiler/tests/unit_tests/concretelang/TestLib/CMakeLists.txt +++ b/compilers/concrete-compiler/compiler/tests/unit_tests/concretelang/TestLib/CMakeLists.txt @@ -10,7 +10,7 @@ endfunction() if(NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin") link_libraries( - # usefull for old gcc versions + # useful for old gcc versions -Wl,--allow-multiple-definition # static concrete-optimizer and concrete shares some code ) endif() diff --git a/compilers/concrete-optimizer/README.md b/compilers/concrete-optimizer/README.md index 57d36a15c4..8fc43dcd75 100644 --- a/compilers/concrete-optimizer/README.md +++ b/compilers/concrete-optimizer/README.md @@ -1,7 +1,7 @@ # Concrete optimizer Concrete Optimizer is a Rust library that find the best cryptographic parameters for a given TFHE homomorphic circuit. -The goal if to minimize computation time under security and error constaints. +The goal if to minimize computation time under security and error constraints. Its main client is Concrete Compiler. It is implemented in Rust and offers a C++ API. It also provides a CLI tool to provide parameters for simplified circuits. diff --git a/compilers/concrete-optimizer/brute-force-optimizer/src/gba.rs b/compilers/concrete-optimizer/brute-force-optimizer/src/gba.rs index 15573fc853..185b1ed1b5 100644 --- a/compilers/concrete-optimizer/brute-force-optimizer/src/gba.rs +++ b/compilers/concrete-optimizer/brute-force-optimizer/src/gba.rs @@ -163,7 +163,7 @@ impl Problem for GBAConstraint { let complexity_packing_ks = message_modulus * (complexity_model.ks_complexity(pp_keyswitch_parameter, 64) + (1 << param.log_poly_size) as f64 * (k + 1.)); - // additon for packing ks + // addition for packing ks // ); let complexity_all_ppks = self.nb_inputs as f64 diff --git a/compilers/concrete-optimizer/concrete-optimizer-cpp/cmake-utils/CMakeLists.txt b/compilers/concrete-optimizer/concrete-optimizer-cpp/cmake-utils/CMakeLists.txt index f621485533..fdf48c4531 100644 --- a/compilers/concrete-optimizer/concrete-optimizer-cpp/cmake-utils/CMakeLists.txt +++ b/compilers/concrete-optimizer/concrete-optimizer-cpp/cmake-utils/CMakeLists.txt @@ -1,5 +1,5 @@ # In your project CMakeLists.txt: -# 1. define the path containing concrete-optimizer repository, builded. +# 1. define the path containing concrete-optimizer repository, built. # CONCRETE_OPTIMIZER_DIR # 2. add lines: # add_subdirectory(${CONCRETE_OPTIMIZER_DIR}/concrete-optimizer-cpp/cmake-utils) diff --git a/compilers/concrete-optimizer/concrete-optimizer/src/computing_cost/complexity.rs b/compilers/concrete-optimizer/concrete-optimizer/src/computing_cost/complexity.rs index 9087726547..684bb65407 100644 --- a/compilers/concrete-optimizer/concrete-optimizer/src/computing_cost/complexity.rs +++ b/compilers/concrete-optimizer/concrete-optimizer/src/computing_cost/complexity.rs @@ -1,5 +1,5 @@ /** Global count of operations To simplify all operations (addition and multiplication) count for 1. - * But note that depending on the completexity model used it can be accurately proportional to the real exectution time. + * But note that depending on the completexity model used it can be accurately proportional to the real execution time. * So complexities are only comparable inside the same complexity model. */ pub type Complexity = f64; diff --git a/compilers/concrete-optimizer/concrete-optimizer/src/dag/operator/operator.rs b/compilers/concrete-optimizer/concrete-optimizer/src/dag/operator/operator.rs index 1154db9bac..c52fcbf1dd 100644 --- a/compilers/concrete-optimizer/concrete-optimizer/src/dag/operator/operator.rs +++ b/compilers/concrete-optimizer/concrete-optimizer/src/dag/operator/operator.rs @@ -89,7 +89,7 @@ pub enum Operator { out_shape: Shape, comment: String, }, - // Used to reduced or increase precision when the cyphertext is compatible with different precision + // Used to reduced or increase precision when the ciphertext is compatible with different precision // This is done without any checking UnsafeCast { input: OperatorIndex, diff --git a/compilers/concrete-optimizer/concrete-optimizer/src/dag/unparametrized.rs b/compilers/concrete-optimizer/concrete-optimizer/src/dag/unparametrized.rs index ce144266f7..e235769d10 100644 --- a/compilers/concrete-optimizer/concrete-optimizer/src/dag/unparametrized.rs +++ b/compilers/concrete-optimizer/concrete-optimizer/src/dag/unparametrized.rs @@ -12,9 +12,9 @@ pub(crate) type UnparameterizedOperator = Operator; #[must_use] pub struct OperationDag { pub(crate) operators: Vec, - // Collect all operators ouput shape + // Collect all operators output shape pub(crate) out_shapes: Vec, - // Collect all operators ouput precision + // Collect all operators output precision pub(crate) out_precisions: Vec, // Collect whether operators are tagged as outputs pub(crate) output_tags: Vec, @@ -186,7 +186,7 @@ impl OperationDag { } fn add_isolate_lowest_bit(&mut self, input: OperatorIndex) -> OperatorIndex { - // The lowest bit is converted to a cyphertext of same precision as input. + // The lowest bit is converted to a ciphertext of same precision as input. // Introduce a pbs of input precision but this precision is only used on 1 levelled op and converted to lower precision // Noise is reduced by a pbs. let out_precision = self.out_precisions[input.i]; @@ -208,12 +208,12 @@ impl OperationDag { input: OperatorIndex, rounded_precision: Precision, ) -> OperatorIndex { - // Round such that the ouput has precision out_precision. + // Round such that the output has precision out_precision. // We round by adding 2**(removed_precision - 1) to the last remaining bit to clear (this step is a no-op). // Than all lower bits are cleared. // Note: this is a simplified graph, some constant additions are missing without consequence on crypto parameter choice. // Note: reset and rounds could be done by 4, 3, 2 and 1 bits groups for efficiency. - // bit efficiency is better for 4 precision then 3, but the feasability is lower for high noise + // bit efficiency is better for 4 precision then 3, but the feasibility is lower for high noise let in_precision = self.out_precisions[input.i]; assert!(rounded_precision <= in_precision); if in_precision == rounded_precision { diff --git a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/atomic_pattern.rs b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/atomic_pattern.rs index c4d0748ac3..e98f76bcd5 100644 --- a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/atomic_pattern.rs +++ b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/atomic_pattern.rs @@ -151,7 +151,7 @@ pub fn optimize_one( assert!(config.maximum_acceptable_error_probability < 1.0); // this assumed the noise level is equal at input/output - // the security of the noise level of ouput is controlled by + // the security of the noise level of output is controlled by // the blind rotate decomposition let ciphertext_modulus_log = config.ciphertext_modulus_log; diff --git a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/keys_spec.rs b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/keys_spec.rs index eca3009ebe..f2c0626a64 100644 --- a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/keys_spec.rs +++ b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/keys_spec.rs @@ -85,7 +85,7 @@ pub struct CircuitKeys { #[derive(Debug, Clone)] pub struct InstructionKeys { - /* Describe for each intructions what is the key of inputs/outputs. + /* Describe for each instructions what is the key of inputs/outputs. For tlus, it gives the internal keyswitch/pbs keys. It also express if the output need to be converted to other keys. */ /* Note: Levelled instructions doesn't need to use any keys.*/ diff --git a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/optimize/mod.rs b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/optimize/mod.rs index 2786ec584f..2151c9c782 100644 --- a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/optimize/mod.rs +++ b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/optimize/mod.rs @@ -113,10 +113,10 @@ fn optimize_many_independant_ks( caches: &mut keyswitch::Cache, cut_complexity: f64, ) -> Option<(Vec<(KsDst, KsComplexityNoise)>, OperationsCV)> { - // all ks are independant since they appears in mutually exclusive variance constraints + // all ks are independent since they appears in mutually exclusive variance constraints // only one ks can appear in a variance constraint, // we can obtain the best feasible by optimizing them separately since everything else is already chosen - // at this point feasability and minimal complexity has already been checked on lower bound + // at this point feasibility and minimal complexity has already been checked on lower bound // we know there a feasible solution and a better complexity solution // we just need to check if both properties at the same time occur debug_assert!(feasible.feasible(&operations.variance)); diff --git a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/symbolic_variance.rs b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/symbolic_variance.rs index 892b2c9805..25d26be0c9 100644 --- a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/symbolic_variance.rs +++ b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/multi_parameters/symbolic_variance.rs @@ -14,9 +14,9 @@ use crate::optimization::dag::multi_parameters::operations_value::OperationsValu * - partition keyswitch, * - modulus switching * - * We only kown that the fresh <= lut ouput in the same partition. + * We only known that the fresh <= lut output in the same partition. * Each linear coefficient is a variance factor. - * There are homogenious to squared weight (or summed square weights or squared norm2). + * There are homogeneous to squared weight (or summed square weights or squared norm2). */ #[derive(Clone, Debug, PartialEq, PartialOrd)] pub struct SymbolicVariance { diff --git a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/solo_key/analyze.rs b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/solo_key/analyze.rs index 883c9f960b..5cd97b0169 100644 --- a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/solo_key/analyze.rs +++ b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/dag/solo_key/analyze.rs @@ -124,7 +124,7 @@ fn variance_origin(inputs: &[OperatorIndex], out_variances: &[SymbolicVariance]) #[derive(Clone, Debug)] pub struct OperationDag { pub operators: Vec, - // Collect all operators ouput variances + // Collect all operators output variances pub out_variances: Vec, pub nb_luts: u64, // The full dag levelled complexity diff --git a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/decomposition/circuit_bootstrap.rs b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/decomposition/circuit_bootstrap.rs index a6472dc996..866b3828a1 100644 --- a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/decomposition/circuit_bootstrap.rs +++ b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/decomposition/circuit_bootstrap.rs @@ -27,7 +27,7 @@ impl CbComplexityNoise { } } -/* This is stricly variance decreasing and strictly complexity increasing */ +/* This is strictly variance decreasing and strictly complexity increasing */ pub fn pareto_quantities( complexity_model: &dyn ComplexityModel, ciphertext_modulus_log: u32, diff --git a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/decomposition/cmux.rs b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/decomposition/cmux.rs index f1aa0caf6e..fc28b5f89e 100644 --- a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/decomposition/cmux.rs +++ b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/decomposition/cmux.rs @@ -25,7 +25,7 @@ impl CmuxComplexityNoise { } } -/* This is stricly variance decreasing and strictly complexity increasing */ +/* This is strictly variance decreasing and strictly complexity increasing */ pub fn pareto_quantities( complexity_model: &dyn ComplexityModel, ciphertext_modulus_log: u32, diff --git a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/decomposition/keyswitch.rs b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/decomposition/keyswitch.rs index 750722ff6e..f947bb6ded 100644 --- a/compilers/concrete-optimizer/concrete-optimizer/src/optimization/decomposition/keyswitch.rs +++ b/compilers/concrete-optimizer/concrete-optimizer/src/optimization/decomposition/keyswitch.rs @@ -26,7 +26,7 @@ impl KsComplexityNoise { } } -/* This is stricly variance decreasing and strictly complexity increasing */ +/* This is strictly variance decreasing and strictly complexity increasing */ pub fn pareto_quantities( complexity_model: &dyn ComplexityModel, ciphertext_modulus_log: u32, diff --git a/compilers/concrete-optimizer/v0-parameters/README.md b/compilers/concrete-optimizer/v0-parameters/README.md index 772715972b..d841fa5735 100644 --- a/compilers/concrete-optimizer/v0-parameters/README.md +++ b/compilers/concrete-optimizer/v0-parameters/README.md @@ -5,7 +5,7 @@ computation without prior knowledge of the crypto-parameter optimization. For a given (`precision`, `log2(norm2)`), these parameters can be used in a TFHE integer circuit where the maximal integer precision is `precision` and the maximal norm2 between table lookups is `2^log2(norm2)`. The norm2 is the sum of the square of weights in multisum between table lookups or graph inputs (weights on the same input must first be combined as a single weight). -The probablity of error is the maximal acceptable probability of error of each table lookup. +The probability of error is the maximal acceptable probability of error of each table lookup. It can also be used to explore the crypto-parameter space w.r.t. the 2-norm of the dot product, the precision or even the failure probability. diff --git a/docs/application-tutorial/key_value_database.ipynb b/docs/application-tutorial/key_value_database.ipynb index f303fe2d6f..93cf418f51 100644 --- a/docs/application-tutorial/key_value_database.ipynb +++ b/docs/application-tutorial/key_value_database.ipynb @@ -236,7 +236,7 @@ "source": [ "This function takes any value, and a boolean flag that indicates if value is selected or not. Within homomorphic encryption circuits, we cannot compile this function as encrypted values cannot affect control flow. Instead, we turn this function into a lookup table.\n", "\n", - "Selected is preprended to the value, and function is modified to act as below.\n", + "Selected is prepended to the value, and function is modified to act as below.\n", "\n", "`keep_selected(i=0..15, 1) -> 0` \n", "`keep_selected(i=16..31, 0) -> i-16`\n", diff --git a/docs/compilation/composition.md b/docs/compilation/composition.md index 0b5ab0960a..faf1c9db69 100644 --- a/docs/compilation/composition.md +++ b/docs/compilation/composition.md @@ -198,7 +198,7 @@ Here we use a while loop that keeps iterating as long as the decryption of the r ## Limitations -Depending on the circuit, supporting composition may add a non-negligeable overhead when compared to a non-composable version. Indeed, to be composable a circuit must verify two conditions: +Depending on the circuit, supporting composition may add a non-negligible overhead when compared to a non-composable version. Indeed, to be composable a circuit must verify two conditions: 1) All inputs and outputs must share the same precision and the same crypto-parameters: the most expensive parameters that would otherwise be used for a single input or output, are generalized to all inputs and outputs. 2) There must be a noise refresh in every path between an input and an output: some circuits will need extra PBSes to be added to allow composability. diff --git a/docs/compilation/multi_parameters.md b/docs/compilation/multi_parameters.md index 2989fc8b60..a9d91a8ae3 100644 --- a/docs/compilation/multi_parameters.md +++ b/docs/compilation/multi_parameters.md @@ -11,4 +11,4 @@ When multi parameters are enabled, a different set of parameters are selected fo To disable it, you can use `parameter_selection_strategy=fhe.ParameterSelectionStrategy.MONO` configuration option. -When enabled, you can select the level of circuit partitionning, with **multi\_parameter\_strategy** in [configuration](../guides/configure.md#options). +When enabled, you can select the level of circuit partitioning, with **multi\_parameter\_strategy** in [configuration](../guides/configure.md#options). diff --git a/docs/core-features/rounding.md b/docs/core-features/rounding.md index 3f27c9b78e..92906c3c84 100644 --- a/docs/core-features/rounding.md +++ b/docs/core-features/rounding.md @@ -299,7 +299,7 @@ and displays: ## Exactness One use of rounding is doing faster computation by ignoring the lower significant bits. -For this usage, you can even get faster results if you accept the rounding it-self to be slighlty inexact. +For this usage, you can even get faster results if you accept the rounding it-self to be slightly inexact. The speedup is usually around 2x-3x but can be higher for big precision reduction. This also enable higher precisions values that are not possible otherwise. @@ -326,7 +326,7 @@ In approximate mode the rounding threshold up or down is not perfectly centered: The off-centering is: * is bounded, i.e. at worst an off-by-one on the reduced precision value compared to the exact result, * is pseudo-random, i.e. it will be different on each call, -* almost symetrically distributed, +* almost symmetrically distributed, * depends on cryptographic properties like the encryption mask, the encryption noise and the crypto-parameters. | ![approximate-off-by-one-error.png](../_static/rounding/approximate-off-by-one-error.png) | diff --git a/docs/dev/api/concrete.compiler.md b/docs/dev/api/concrete.compiler.md index e0d1a21091..3124a5eb93 100644 --- a/docs/dev/api/concrete.compiler.md +++ b/docs/dev/api/concrete.compiler.md @@ -74,7 +74,7 @@ init_dfr() Initialize dataflow parallelization. -It is not always required to initialize the dataflow runtime as it can be implicitely done during compilation. However, it is required in case no compilation has previously been done and the runtime is needed +It is not always required to initialize the dataflow runtime as it can be implicitly done during compilation. However, it is required in case no compilation has previously been done and the runtime is needed --- diff --git a/docs/dev/api/concrete.fhe.dtypes.integer.md b/docs/dev/api/concrete.fhe.dtypes.integer.md index 46d6848b51..a652a0d678 100644 --- a/docs/dev/api/concrete.fhe.dtypes.integer.md +++ b/docs/dev/api/concrete.fhe.dtypes.integer.md @@ -78,12 +78,12 @@ Get the maximum value that can be represented by the `Integer`. min() → int ``` -Get the minumum value that can be represented by the `Integer`. +Get the minimum value that can be represented by the `Integer`. **Returns:** - int: minumum value that can be represented by the `Integer` + int: minimum value that can be represented by the `Integer` --- diff --git a/docs/dev/api/concrete.fhe.extensions.array.md b/docs/dev/api/concrete.fhe.extensions.array.md index e01d84eabe..54d3005975 100644 --- a/docs/dev/api/concrete.fhe.extensions.array.md +++ b/docs/dev/api/concrete.fhe.extensions.array.md @@ -26,6 +26,6 @@ Create an encrypted array from either encrypted or clear values. **Returns:** - Union[np.ndarray, Tracer]: Tracer that respresents the operation during tracing ndarray with values otherwise + Union[np.ndarray, Tracer]: Tracer that represents the operation during tracing ndarray with values otherwise diff --git a/docs/dev/api/concrete.fhe.extensions.ones.md b/docs/dev/api/concrete.fhe.extensions.ones.md index 1eb0fae85c..bbde30bba8 100644 --- a/docs/dev/api/concrete.fhe.extensions.ones.md +++ b/docs/dev/api/concrete.fhe.extensions.ones.md @@ -26,7 +26,7 @@ Create an encrypted array of ones. **Returns:** - Union[np.ndarray, Tracer]: Tracer that respresents the operation during tracing ndarray filled with ones otherwise + Union[np.ndarray, Tracer]: Tracer that represents the operation during tracing ndarray filled with ones otherwise --- @@ -44,7 +44,7 @@ Create an encrypted scalar with the value of one. **Returns:** - Union[np.ndarray, Tracer]: Tracer that respresents the operation during tracing ndarray with one otherwise + Union[np.ndarray, Tracer]: Tracer that represents the operation during tracing ndarray with one otherwise --- diff --git a/docs/dev/api/concrete.fhe.extensions.round_bit_pattern.md b/docs/dev/api/concrete.fhe.extensions.round_bit_pattern.md index 3adf61b6de..a83dd21ebf 100644 --- a/docs/dev/api/concrete.fhe.extensions.round_bit_pattern.md +++ b/docs/dev/api/concrete.fhe.extensions.round_bit_pattern.md @@ -47,7 +47,7 @@ x = 0b_1011_1000 , lsbs_to_remove = 3 => 0b_1011_1000 x = 0b_1011_1001 , lsbs_to **Returns:** - Union[int, np.integer, np.ndarray, Tracer]: Tracer that respresents the operation during tracing rounded value(s) otherwise + Union[int, np.integer, np.ndarray, Tracer]: Tracer that represents the operation during tracing rounded value(s) otherwise --- @@ -78,7 +78,7 @@ __init__(rounder: 'AutoRounder', input_min: int, input_max: int) ## class `AutoRounder` -AutoRounder class, to optimize for number of msbs to keep druing round bit pattern operation. +AutoRounder class, to optimize for number of msbs to keep during round bit pattern operation. diff --git a/docs/dev/api/concrete.fhe.extensions.zeros.md b/docs/dev/api/concrete.fhe.extensions.zeros.md index 7d9c691c6d..e3d711c571 100644 --- a/docs/dev/api/concrete.fhe.extensions.zeros.md +++ b/docs/dev/api/concrete.fhe.extensions.zeros.md @@ -26,7 +26,7 @@ Create an encrypted array of zeros. **Returns:** - Union[np.ndarray, Tracer]: Tracer that respresents the operation during tracing ndarray filled with zeros otherwise + Union[np.ndarray, Tracer]: Tracer that represents the operation during tracing ndarray filled with zeros otherwise --- @@ -44,7 +44,7 @@ Create an encrypted scalar with the value of zero. **Returns:** - Union[np.ndarray, Tracer]: Tracer that respresents the operation during tracing ndarray with zero otherwise + Union[np.ndarray, Tracer]: Tracer that represents the operation during tracing ndarray with zero otherwise --- diff --git a/docs/explanations/backends/README.md b/docs/explanations/backends/README.md index df2968f921..2e93932baa 100644 --- a/docs/explanations/backends/README.md +++ b/docs/explanations/backends/README.md @@ -20,7 +20,7 @@ Server features are homomorphic operations on ciphertexts: There are currently 2 backends: - `concrete-cpu` which implements both client and server features targeting the CPU. -- `concrete-cuda` which implements only server features targeting GPUs to accelerate homomorphic circuit evalutation. +- `concrete-cuda` which implements only server features targeting GPUs to accelerate homomorphic circuit evaluation. The compiler uses `concrete-cpu` for the client and can use either `concrete-cpu` or `concrete-cuda` for the server. diff --git a/frontends/concrete-python/concrete/fhe/compilation/configuration.py b/frontends/concrete-python/concrete/fhe/compilation/configuration.py index 7a49954370..c1058ad958 100644 --- a/frontends/concrete-python/concrete/fhe/compilation/configuration.py +++ b/frontends/concrete-python/concrete/fhe/compilation/configuration.py @@ -104,7 +104,7 @@ class ApproximateRoundingConfig: """Actively avoid the overflow using a `k`-1 precision TLU. This is similar to logical clipping but less accurate and faster. Effect on: - * accuracy: the upper values of the rounding range are sligtly decreased, + * accuracy: the upper values of the rounding range are slightly decreased, * cost: adds an extra `k`-1 bits TLU to guarantee that the precision after rounding is `k`. This is usually a win when `k` >= 5 . This is enabled by default for `k` >= 5. diff --git a/frontends/concrete-python/concrete/fhe/dtypes/integer.py b/frontends/concrete-python/concrete/fhe/dtypes/integer.py index e244d53f11..872c94d7f2 100644 --- a/frontends/concrete-python/concrete/fhe/dtypes/integer.py +++ b/frontends/concrete-python/concrete/fhe/dtypes/integer.py @@ -114,11 +114,11 @@ def __str__(self) -> str: def min(self) -> int: """ - Get the minumum value that can be represented by the `Integer`. + Get the minimum value that can be represented by the `Integer`. Returns: int: - minumum value that can be represented by the `Integer` + minimum value that can be represented by the `Integer` """ return 0 if not self.is_signed else -(2 ** (self.bit_width - 1)) diff --git a/frontends/concrete-python/concrete/fhe/extensions/array.py b/frontends/concrete-python/concrete/fhe/extensions/array.py index c23604b4c0..c40d61bb28 100644 --- a/frontends/concrete-python/concrete/fhe/extensions/array.py +++ b/frontends/concrete-python/concrete/fhe/extensions/array.py @@ -23,7 +23,7 @@ def array(values: Any) -> Union[np.ndarray, Tracer]: Returns: Union[np.ndarray, Tracer]: - Tracer that respresents the operation during tracing + Tracer that represents the operation during tracing ndarray with values otherwise """ diff --git a/frontends/concrete-python/concrete/fhe/extensions/ones.py b/frontends/concrete-python/concrete/fhe/extensions/ones.py index 05c7635fdb..e8a3c20d12 100644 --- a/frontends/concrete-python/concrete/fhe/extensions/ones.py +++ b/frontends/concrete-python/concrete/fhe/extensions/ones.py @@ -21,7 +21,7 @@ def ones(shape: Union[int, Tuple[int, ...]]) -> Union[np.ndarray, Tracer]: Returns: Union[np.ndarray, Tracer]: - Tracer that respresents the operation during tracing + Tracer that represents the operation during tracing ndarray filled with ones otherwise """ @@ -49,7 +49,7 @@ def one() -> Union[np.ndarray, Tracer]: Returns: Union[np.ndarray, Tracer]: - Tracer that respresents the operation during tracing + Tracer that represents the operation during tracing ndarray with one otherwise """ diff --git a/frontends/concrete-python/concrete/fhe/extensions/round_bit_pattern.py b/frontends/concrete-python/concrete/fhe/extensions/round_bit_pattern.py index 932d947b99..35a31abccb 100644 --- a/frontends/concrete-python/concrete/fhe/extensions/round_bit_pattern.py +++ b/frontends/concrete-python/concrete/fhe/extensions/round_bit_pattern.py @@ -40,7 +40,7 @@ def __init__(self, rounder: "AutoRounder", input_min: int, input_max: int): class AutoRounder: """ - AutoRounder class, to optimize for number of msbs to keep druing round bit pattern operation. + AutoRounder class, to optimize for number of msbs to keep during round bit pattern operation. """ target_msbs: int @@ -221,7 +221,7 @@ def round_bit_pattern( Returns: Union[int, np.integer, np.ndarray, Tracer]: - Tracer that respresents the operation during tracing + Tracer that represents the operation during tracing rounded value(s) otherwise """ diff --git a/frontends/concrete-python/concrete/fhe/extensions/zeros.py b/frontends/concrete-python/concrete/fhe/extensions/zeros.py index a6a29ae798..ab4a4cd95d 100644 --- a/frontends/concrete-python/concrete/fhe/extensions/zeros.py +++ b/frontends/concrete-python/concrete/fhe/extensions/zeros.py @@ -21,7 +21,7 @@ def zeros(shape: Union[int, Tuple[int, ...]]) -> Union[np.ndarray, Tracer]: Returns: Union[np.ndarray, Tracer]: - Tracer that respresents the operation during tracing + Tracer that represents the operation during tracing ndarray filled with zeros otherwise """ diff --git a/frontends/concrete-python/concrete/fhe/mlir/context.py b/frontends/concrete-python/concrete/fhe/mlir/context.py index e98250afcc..ad553df280 100644 --- a/frontends/concrete-python/concrete/fhe/mlir/context.py +++ b/frontends/concrete-python/concrete/fhe/mlir/context.py @@ -3205,7 +3205,7 @@ def round_bit_pattern( if exactness is Exactness.APPROXIMATE: approx_conf = self.configuration.approximate_rounding_config # 1. Unskew TLU's futur error distribution on approximated value - # this balances agains all leading zeros in the noise (ignoring symetric noise) + # this balances agains all leading zeros in the noise (ignoring symmetric noise) unskewed = x if approx_conf.symetrize_deltas: highest_supported_precision = 62 diff --git a/frontends/concrete-python/concrete/fhe/mlir/utils.py b/frontends/concrete-python/concrete/fhe/mlir/utils.py index 7f96e79838..5e6d0397ec 100644 --- a/frontends/concrete-python/concrete/fhe/mlir/utils.py +++ b/frontends/concrete-python/concrete/fhe/mlir/utils.py @@ -257,7 +257,7 @@ def construct_table(node: Node, preds: List[Node], configuration: Configuration) ) except Exception: # pylint: disable=broad-except # here we try our best to fill the table - # if it fails, we append None and let flooding algoritm replace None values below + # if it fails, we append None and let flooding algorithm replace None values below table.append(None) np.seterr(divide="warn") diff --git a/frontends/concrete-python/tests/execution/test_compressions.py b/frontends/concrete-python/tests/execution/test_compressions.py index 9e6885cd83..93f447020d 100644 --- a/frontends/concrete-python/tests/execution/test_compressions.py +++ b/frontends/concrete-python/tests/execution/test_compressions.py @@ -7,7 +7,7 @@ def test_circuit_compress_input_ciphertexts(helpers): """ - Test running circuit with compressed inpu ciphertexts + Test running circuit with compressed input ciphertexts """ configuration = helpers.configuration() diff --git a/frontends/concrete-python/tests/execution/test_static_assignment.py b/frontends/concrete-python/tests/execution/test_static_assignment.py index d568d35932..eb959a46a5 100644 --- a/frontends/concrete-python/tests/execution/test_static_assignment.py +++ b/frontends/concrete-python/tests/execution/test_static_assignment.py @@ -510,7 +510,7 @@ def test_static_assignment(shape, function, helpers): def test_bad_static_assignment(helpers): """ - Test static assingment with bad parameters. + Test static assignment with bad parameters. """ configuration = helpers.configuration() diff --git a/tools/parameter-curves/lattice-scripts/compare_curves_and_estimator.py b/tools/parameter-curves/lattice-scripts/compare_curves_and_estimator.py index b915216ded..f7cff48868 100644 --- a/tools/parameter-curves/lattice-scripts/compare_curves_and_estimator.py +++ b/tools/parameter-curves/lattice-scripts/compare_curves_and_estimator.py @@ -71,7 +71,7 @@ def minimal_stddev(a, b, lwe_dim): def compare_curve_and_estimator(security_level, log_q, curves_dir): """ For a subset of every lwe dimension possibles, estimate the security of those lwe dimension - associated with the stddev recommanded by our current curve. + associated with the stddev recommended by our current curve. Test whether some (lwe_dimension, std dev) that are assumed to be secure with