From e2fc52359619d2b2a89d91bb49e8eef9aa4990ad Mon Sep 17 00:00:00 2001 From: Arthur Meyre Date: Wed, 5 Jan 2022 12:40:01 +0100 Subject: [PATCH] chore: rename package --- .github/ISSUE_TEMPLATE/new_operator.md | 2 +- .github/workflows/continuous-integration.yaml | 48 +++++++++---------- .github/workflows/package-watcher.yaml | 2 +- Makefile | 12 ++--- README.md | 10 ++-- .../bounds_measurement/inputset_eval.py | 2 +- concrete/common/debugging/drawing.py | 2 +- concrete/common/optimization/topological.py | 2 +- .../common/representation/intermediate.py | 2 +- concrete/numpy/compile.py | 8 ++-- concrete/numpy/tracing.py | 2 +- ....concrete-framework-dev => Dockerfile.dev} | 2 +- ....concrete-framework-env => Dockerfile.env} | 4 +- ...ckerignore => Dockerfile.env.dockerignore} | 0 docker/build_release_image.sh | 2 +- docs/conf.py | 8 ++-- docs/dev/explanation/compilation.md | 4 +- .../explanation/terminology_and_structure.md | 2 +- docs/dev/howto/contributing.md | 4 +- docs/dev/howto/project_setup.md | 10 ++-- docs/dev/howto/releasing.md | 4 +- docs/index.rst | 2 +- .../FHEDecisionTreeClassifier.ipynb | 12 ++--- docs/user/advanced_examples/IrisFHE.ipynb | 4 +- .../QuantizedGeneralizedLinearModel.ipynb | 8 ++-- docs/user/basics/benchmarks.md | 2 +- docs/user/basics/compiling_and_executing.md | 2 +- docs/user/basics/installing.md | 20 ++++---- docs/user/basics/intro.md | 2 +- .../explanation/fhe_and_framework_limits.md | 10 ++-- docs/user/explanation/future_features.md | 4 +- docs/user/explanation/quantization.md | 6 +-- docs/user/howto/compiling_torch_model.md | 2 +- .../user/howto/debug_support_submit_issues.md | 2 +- docs/user/howto/faq.md | 6 +-- docs/user/howto/numpy_support.md | 2 +- docs/user/howto/printing_and_drawing.md | 4 +- docs/user/howto/reduce_needed_precision.md | 6 +-- docs/user/howto/use_quantization.md | 12 ++--- docs/user/tutorial/compilation_artifacts.md | 2 +- docs/user/tutorial/table_lookup.md | 6 +-- licenses/licenses_linux_user.txt | 36 +++++++------- poetry.lock | 6 +-- pyproject.toml | 4 +- ...check_compiler_package_update_container.sh | 2 +- .../timestamp_check_update_container.sh | 2 +- script/make_utils/licenses.sh | 4 +- .../bounds_measurement/test_inputset_eval.py | 2 +- tests/conftest.py | 6 +-- tests/numpy/test_compile.py | 6 +-- 50 files changed, 157 insertions(+), 157 deletions(-) rename docker/{Dockerfile.concrete-framework-dev => Dockerfile.dev} (97%) rename docker/{Dockerfile.concrete-framework-env => Dockerfile.env} (92%) rename docker/{Dockerfile.concrete-framework-env.dockerignore => Dockerfile.env.dockerignore} (100%) diff --git a/.github/ISSUE_TEMPLATE/new_operator.md b/.github/ISSUE_TEMPLATE/new_operator.md index de70d742c..d72c6aab2 100644 --- a/.github/ISSUE_TEMPLATE/new_operator.md +++ b/.github/ISSUE_TEMPLATE/new_operator.md @@ -2,7 +2,7 @@ name: New Operator about: Organise the support of a new operator or notion in the framework. labels: feature -title: Support of **please-fill** in Concrete Framework +title: Support of **please-fill** in Concrete Numpy --- ## Umbrella diff --git a/.github/workflows/continuous-integration.yaml b/.github/workflows/continuous-integration.yaml index a485fb5f4..777e765c0 100644 --- a/.github/workflows/continuous-integration.yaml +++ b/.github/workflows/continuous-integration.yaml @@ -1,4 +1,4 @@ -name: concrete-framework CI Pipeline +name: concrete-numpy CI Pipeline on: pull_request: push: @@ -28,10 +28,10 @@ on: env: FORCE_REBUILD_DOCKER: ${{ (github.event_name == 'workflow_dispatch' && fromJSON(github.event.inputs.rebuild-env-docker)) || (github.event_name == 'repository_dispatch' && github.event.action == 'rebuild-env-docker') }} - ENV_DOCKERFILE: docker/Dockerfile.concrete-framework-env - PREFLIGHT_IMAGE_BASE: ghcr.io/zama-ai/concrete-framework-env:preflight - LATEST_IMAGE: ghcr.io/zama-ai/concrete-framework-env:latest - BASE_IMAGE: ghcr.io/zama-ai/concrete-framework-env + ENV_DOCKERFILE: docker/Dockerfile.env + PREFLIGHT_IMAGE_BASE: ghcr.io/zama-ai/concrete-numpy-env:preflight + LATEST_IMAGE: ghcr.io/zama-ai/concrete-numpy-env:latest + BASE_IMAGE: ghcr.io/zama-ai/concrete-numpy-env ACTION_RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} IS_PR: ${{ github.event_name == 'pull_request' }} @@ -41,7 +41,7 @@ jobs: group: ${{ github.ref }} cancel-in-progress: true - name: Build & Push the concrete-framework-env preflight Docker Image + name: Build & Push the concrete-numpy-env preflight Docker Image runs-on: ubuntu-20.04 outputs: image: ${{ steps.set_image.outputs.image || env.LATEST_IMAGE }} @@ -91,7 +91,7 @@ jobs: echo "Docker image up to date." echo "BUILD_DOCKER=false" >> "$GITHUB_ENV" fi - # https://github.com/zama-ai/concrete-framework-internal/issues/809 + # https://github.com/zama-ai/concrete-numpy-internal/issues/809 # Remove gh_dl_release call once package is on PyPi - name: Set prefligh Docker image download compiler id: set_image @@ -124,7 +124,7 @@ jobs: registry: ghcr.io username: ${{ secrets.BOT_USERNAME }} password: ${{ secrets.BOT_TOKEN }} - - name: Build concrete-framework-env Image + - name: Build concrete-numpy-env Image if: ${{ success() && !cancelled() && fromJSON(env.BUILD_DOCKER) }} uses: docker/build-push-action@a66e35b9cbcf4ad0ea91ffcaf7bbad63ad9e0229 with: @@ -132,12 +132,12 @@ jobs: # builder: ${{ steps.buildx.outputs.name }} build-args: | WHEEL=${{ env.WHEEL }} - file: docker/Dockerfile.concrete-framework-env + file: docker/Dockerfile.env no-cache: true push: true tags: "${{ env.PREFLIGHT_IMAGE }}" labels: | - concrete_framework_sha=${{ env.LABEL_SHA1 }} + concrete_numpy_sha=${{ env.LABEL_SHA1 }} - name: Set notification report id: report if: ${{ always() }} @@ -443,7 +443,7 @@ jobs: echo "::set-output name=has-preprod::true" echo "::set-output name=aws-bucket::${{ secrets.AWS_REPO_PREPROD_DOCUMENTATION_BUCKET_NAME }}" echo "::set-output name=aws-distribution::${{ secrets.AWS_REPO_PREPROD_DOCUMENTATION_DISTRIBUTION_ID }}" - echo "::set-output name=dest-dir::concrete-framework/${REF_NAME}" + echo "::set-output name=dest-dir::concrete-numpy/${REF_NAME}" else echo "::set-output name=has-preprod::false" fi @@ -536,9 +536,9 @@ jobs: - name: Pull preflight image run: | docker pull "${PREFLIGHT_IMAGE}" - # https://github.com/zama-ai/concrete-framework-internal/issues/809 + # https://github.com/zama-ai/concrete-numpy-internal/issues/809 # update once release workflow is ok on the compiler side - - name: Retag to latest and concrete_compiler_version-concrete_framework_sha1 and push + - name: Retag to latest and concrete_compiler_version-concrete_numpy_sha1 and push run: | SHA1=$(git rev-parse HEAD) TAGGED_IMAGE="${BASE_IMAGE}:${COMPILER_TAG}-${SHA1}" @@ -584,7 +584,7 @@ jobs: runs-on: ubuntu-20.04 env: - RELEASE_IMAGE_BASE: ghcr.io/zama-ai/concrete-framework + RELEASE_IMAGE_BASE: ghcr.io/zama-ai/concrete-numpy steps: - uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 @@ -618,7 +618,7 @@ jobs: EXISTING_TAGS=$(curl \ -X GET \ -H "Authorization: Bearer $(echo ${{ secrets.BOT_TOKEN }} | base64)" \ - https://ghcr.io/v2/zama-ai/concrete-framework/tags/list | jq -rc '.tags | join(" ")') + https://ghcr.io/v2/zama-ai/concrete-numpy/tags/list | jq -rc '.tags | join(" ")') # We want the space separated list of versions to be expanded # shellcheck disable=SC2086 @@ -648,7 +648,7 @@ jobs: registry: ghcr.io username: ${{ secrets.BOT_USERNAME }} password: ${{ secrets.BOT_TOKEN }} - - name: Build concrete-framework Image + - name: Build concrete-numpy Image if: ${{ success() && !cancelled() }} uses: docker/build-push-action@a66e35b9cbcf4ad0ea91ffcaf7bbad63ad9e0229 with: @@ -730,7 +730,7 @@ jobs: aws s3api get-object \ --bucket ${{ steps.docs-push-infos.outputs.aws-bucket }} \ - --key concrete-framework/versions.json "${DOWNLOADED_VERSIONS_JSON_FILE}" + --key concrete-numpy/versions.json "${DOWNLOADED_VERSIONS_JSON_FILE}" # shellcheck disable=SC2086 poetry run python ./script/actions_utils/generate_versions_json.py \ @@ -765,7 +765,7 @@ jobs: cp ./script/actions_utils/RELEASE_TEMPLATE.md "${RELEASE_BODY_FILE}" { echo "Docker Image: ${RELEASE_IMG_GIT_TAG}"; - echo "Documentation: https://${{ steps.docs-push-infos.outputs.aws-bucket }}/concrete-framework/${PROJECT_VERSION}"; + echo "Documentation: https://${{ steps.docs-push-infos.outputs.aws-bucket }}/concrete-numpy/${PROJECT_VERSION}"; echo ""; } >> "${RELEASE_BODY_FILE}" cat "${RAW_CHANGELOG_DIR}"/* >> "${RELEASE_BODY_FILE}" @@ -778,7 +778,7 @@ jobs: env: AWS_S3_BUCKET: ${{ steps.docs-push-infos.outputs.aws-bucket }} SOURCE_DIR: ${{ steps.download-docs.outputs.download-path }} - DEST_DIR: 'concrete-framework/${{ env.PROJECT_VERSION }}' + DEST_DIR: 'concrete-numpy/${{ env.PROJECT_VERSION }}' run: | aws s3 sync "${SOURCE_DIR}" s3://"${AWS_S3_BUCKET}/${DEST_DIR}" --delete --acl public-read @@ -787,13 +787,13 @@ jobs: env: AWS_S3_BUCKET: ${{ steps.docs-push-infos.outputs.aws-bucket }} SOURCE_DIR: ${{ steps.download-docs.outputs.download-path }} - DEST_DIR: 'concrete-framework/stable' + DEST_DIR: 'concrete-numpy/stable' run: | aws s3 sync "${SOURCE_DIR}" s3://"${AWS_S3_BUCKET}/${DEST_DIR}" --delete --acl public-read - name: Invalidate CloudFront Cache for stable if: ${{ success() && !fromJSON(env.IS_PRERELEASE) && fromJSON(env.IS_LATEST) }} env: - SOURCE_PATH: "/concrete-framework/stable/*" + SOURCE_PATH: "/concrete-numpy/stable/*" DISTRIBUTION_ID: ${{ steps.docs-push-infos.outputs.aws-distribution }} run: | aws cloudfront create-invalidation \ @@ -811,18 +811,18 @@ jobs: tag_name: ${{ env.GIT_TAG }} fail_on_unmatched_files: true token: ${{ secrets.BOT_TOKEN }} - # TODO: https://github.com/zama-ai/concrete-framework-internal/issues/809 + # TODO: https://github.com/zama-ai/concrete-numpy-internal/issues/809 # Remove versions.html - name: Push updated versions.html if: ${{ success() }} run: | aws s3 cp "${OUTPUT_VERSIONS_HTML_FILE}" \ - s3://${{ steps.docs-push-infos.outputs.aws-bucket }}/concrete-framework/versions.html \ + s3://${{ steps.docs-push-infos.outputs.aws-bucket }}/concrete-numpy/versions.html \ --acl public-read aws cloudfront create-invalidation \ --distribution-id ${{ steps.docs-push-infos.outputs.aws-distribution }} \ - --paths /concrete-framework/versions.html + --paths /concrete-numpy/versions.html - name: Set notification report id: report if: ${{ always() }} diff --git a/.github/workflows/package-watcher.yaml b/.github/workflows/package-watcher.yaml index 8aea4f3a2..2106dcfd1 100644 --- a/.github/workflows/package-watcher.yaml +++ b/.github/workflows/package-watcher.yaml @@ -41,7 +41,7 @@ jobs: --compiler-release-endpoint-url \ https://api.github.com/repos/${{ secrets.COMPILER_REPO }}/releases \ --env_img_url \ - https://api.github.com/orgs/zama-ai/packages/container/concrete-framework-env/versions \ + https://api.github.com/orgs/zama-ai/packages/container/concrete-numpy-env/versions \ --file "${WHEEL_SPEC}" \ --token ${{ secrets.BOT_TOKEN }} \ --github-env "$GITHUB_ENV" diff --git a/Makefile b/Makefile index 57bf366dc..075a2a08b 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,9 @@ SHELL:=/bin/bash -DEV_DOCKER_IMG:=concrete-framework-dev -DEV_DOCKERFILE:=docker/Dockerfile.concrete-framework-dev -DEV_CONTAINER_VENV_VOLUME:=concrete-framework-internal-venv -DEV_CONTAINER_CACHE_VOLUME:=concrete-framework-internal-cache +DEV_DOCKER_IMG:=concrete-numpy-dev +DEV_DOCKERFILE:=docker/Dockerfile.dev +DEV_CONTAINER_VENV_VOLUME:=concrete-numpy-internal-venv +DEV_CONTAINER_CACHE_VOLUME:=concrete-numpy-internal-cache SRC_DIR:=concrete .PHONY: setup_env # Set up the environment @@ -12,7 +12,7 @@ setup_env: poetry run python -m pip install -U --force-reinstall setuptools poetry install --extras full @# This is required to be friendly in the docker and on bare systems until the package is on pip - @# https://github.com/zama-ai/concrete-framework-internal/issues/809 + @# https://github.com/zama-ai/concrete-numpy-internal/issues/809 if [[ -d /pkg ]]; then \ NUM_PKG=$$(ls /pkg | wc -l); \ if [[ "$${NUM_PKG}" != "0" ]]; then \ @@ -21,7 +21,7 @@ setup_env: fi; \ fi @# we need to pin a specific version of numpy to avoid having license conflicts - @# see https://github.com/zama-ai/concrete-framework-internal/runs/4455022611?check_suite_focus=true for details + @# see https://github.com/zama-ai/concrete-numpy-internal/runs/4455022611?check_suite_focus=true for details .PHONY: sync_env # Synchronise the environment sync_env: diff --git a/README.md b/README.md index 8a90099b5..2b3df32a5 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# concrete-framework +# concrete-numpy -Concrete Framework Python API - collection of tools to FHE all the things +Concrete Numpy Python API - collection of tools to FHE all the things -- [concrete-framework](#concrete-framework) +- [concrete-numpy](#concrete-numpy) - [For end users](#for-end-users) - [Using the project](#using-the-project) - [For developers](#for-developers) @@ -30,11 +30,11 @@ Information about how to use Docker for development are available in [DOCKER.md] ### Documenting -Some information about how to build the documentation of `concrete-framework` are available in [DOCUMENTING.md](docs/dev/howto/DOCUMENTING.md). Notably, our documentation is pushed to [https://docs.zama.ai/concrete-framework/](https://docs.zama.ai/concrete-framework/). +Some information about how to build the documentation of `concrete-numpy` are available in [DOCUMENTING.md](docs/dev/howto/DOCUMENTING.md). Notably, our documentation is pushed to [https://docs.zama.ai/concrete-numpy/](https://docs.zama.ai/concrete-numpy/). ### Developing -Some information about our terminology and the infrastructure of `concrete-framework` are available in [TERMINOLOGY_AND_STRUCTURE.md](docs/dev/explanation/TERMINOLOGY_AND_STRUCTURE.md). An in-depth look at what is done in `concrete-framework` is available in [COMPILATION.md](docs/dev/explanation/COMPILATION.md). +Some information about our terminology and the infrastructure of `concrete-numpy` are available in [TERMINOLOGY_AND_STRUCTURE.md](docs/dev/explanation/TERMINOLOGY_AND_STRUCTURE.md). An in-depth look at what is done in `concrete-numpy` is available in [COMPILATION.md](docs/dev/explanation/COMPILATION.md). ### Contributing diff --git a/concrete/common/bounds_measurement/inputset_eval.py b/concrete/common/bounds_measurement/inputset_eval.py index cfa41eb07..a50b98ca5 100644 --- a/concrete/common/bounds_measurement/inputset_eval.py +++ b/concrete/common/bounds_measurement/inputset_eval.py @@ -161,7 +161,7 @@ def eval_op_graph_bounds_on_inputset( def generate_input_values_dict(input_data) -> Dict[int, Any]: if num_input_nodes > 1: return dict(enumerate(input_data)) - # TODO: https://github.com/zama-ai/concrete-framework-internal/issues/772 + # TODO: https://github.com/zama-ai/concrete-numpy-internal/issues/772 # update this to support tuple in case of 1-input functions accepting tuples assert_true( not isinstance(input_data, tuple), diff --git a/concrete/common/debugging/drawing.py b/concrete/common/debugging/drawing.py index e08bdd85a..0a301943e 100644 --- a/concrete/common/debugging/drawing.py +++ b/concrete/common/debugging/drawing.py @@ -110,7 +110,7 @@ def draw_graph( f"{draw_graph.__name__} requires pygraphviz, install your OS graphviz distribution " "https://pygraphviz.github.io/documentation/stable/install.html " "and reinstall with extras: `pip install --force-reinstall " - "concrete-framework[full]`" + "concrete-numpy[full]`" ) raise ImportError(err_msg) from e agraph.graph_attr["rankdir"] = "TB" if vertical else "LR" diff --git a/concrete/common/optimization/topological.py b/concrete/common/optimization/topological.py index e2329a6ab..491855c68 100644 --- a/concrete/common/optimization/topological.py +++ b/concrete/common/optimization/topological.py @@ -477,7 +477,7 @@ def subgraph_nodes_and_values_allow_fusing( # There *may* be a way to manage the other case by simulating the broadcast of the smaller input # array and then concatenating/stacking the results. This is not currently doable as we don't # have a concatenate operator on the compiler side. - # TODO: #587 https://github.com/zama-ai/concrete-framework-internal/issues/587 + # TODO: #587 https://github.com/zama-ai/concrete-numpy-internal/issues/587 variable_input_node_output = cast(TensorValue, variable_input_node.outputs[0]) variable_input_node_output_size, variable_input_node_output_shape = ( diff --git a/concrete/common/representation/intermediate.py b/concrete/common/representation/intermediate.py index e145d8200..9504686cd 100644 --- a/concrete/common/representation/intermediate.py +++ b/concrete/common/representation/intermediate.py @@ -318,7 +318,7 @@ class GenericFunction(IntermediateNode): op_attributes: Dict[str, Any] _n_in: int - # TODO: https://github.com/zama-ai/concrete-framework-internal/issues/798 have a proper + # TODO: https://github.com/zama-ai/concrete-numpy-internal/issues/798 have a proper # attribute system DEFAULT_OP_ATTRIBUTES: Dict[str, Any] = {"fusable": True} diff --git a/concrete/numpy/compile.py b/concrete/numpy/compile.py index cd80a5650..f10e2ff24 100644 --- a/concrete/numpy/compile.py +++ b/concrete/numpy/compile.py @@ -524,8 +524,8 @@ def compile_numpy_function_into_op_graph_and_measure_bounds( # HACK # TODO: remove this ugly hack when -# https://github.com/zama-ai/concrete-framework-internal/issues/1001 is done -# TODO: https://github.com/zama-ai/concrete-framework-internal/issues/1015 +# https://github.com/zama-ai/concrete-numpy-internal/issues/1001 is done +# TODO: https://github.com/zama-ai/concrete-numpy-internal/issues/1015 def hack_offset_negative_inputs_to_lookup_tables(op_graph: OPGraph) -> None: """Hack the op_graph to add offsets to signed inputs to TLUs. @@ -606,8 +606,8 @@ def prepare_op_graph_for_mlir(op_graph: OPGraph): # HACK # TODO: remove this ugly hack when - # https://github.com/zama-ai/concrete-framework-internal/issues/1001 is done - # TODO: https://github.com/zama-ai/concrete-framework-internal/issues/1015 + # https://github.com/zama-ai/concrete-numpy-internal/issues/1001 is done + # TODO: https://github.com/zama-ai/concrete-numpy-internal/issues/1015 hack_offset_negative_inputs_to_lookup_tables(op_graph) diff --git a/concrete/numpy/tracing.py b/concrete/numpy/tracing.py index cecea4d4a..29e19880a 100644 --- a/concrete/numpy/tracing.py +++ b/concrete/numpy/tracing.py @@ -650,7 +650,7 @@ def _on_numpy_matmul(lhs: NPTracer, rhs: NPTracer): output_shape = common_output_dtypes_and_shapes[0][1] - # TODO: https://github.com/zama-ai/concrete-framework-internal/issues/1174 + # TODO: https://github.com/zama-ai/concrete-numpy-internal/issues/1174 # remove all the reshape logic once matmul supports more combinations of arguments if isinstance(lhs_output := lhs.output, TensorValue) and isinstance( rhs_output := rhs.output, TensorValue diff --git a/docker/Dockerfile.concrete-framework-dev b/docker/Dockerfile.dev similarity index 97% rename from docker/Dockerfile.concrete-framework-dev rename to docker/Dockerfile.dev index 163328cb7..48b070b04 100644 --- a/docker/Dockerfile.concrete-framework-dev +++ b/docker/Dockerfile.dev @@ -1,4 +1,4 @@ -FROM ghcr.io/zama-ai/concrete-framework-env +FROM ghcr.io/zama-ai/concrete-numpy-env ENV SRC_DIR=/src diff --git a/docker/Dockerfile.concrete-framework-env b/docker/Dockerfile.env similarity index 92% rename from docker/Dockerfile.concrete-framework-env rename to docker/Dockerfile.env index 4d1a0dd44..46561977b 100644 --- a/docker/Dockerfile.concrete-framework-env +++ b/docker/Dockerfile.env @@ -3,7 +3,7 @@ FROM ubuntu:20.04 # Do not change the line below it will be updated automatically when the docker is regenerated # compiler timestamp: 2022-01-04T16:08:11Z -# Remove once compiler is on PyPi https://github.com/zama-ai/concrete-framework-internal/issues/809 +# Remove once compiler is on PyPi https://github.com/zama-ai/concrete-numpy-internal/issues/809 ARG WHEEL ENV TZ=Europe/Paris RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone @@ -27,6 +27,6 @@ RUN apt-get update && apt-get upgrade --no-install-recommends -y && \ pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir poetry -# Remove once compiler is on PyPi https://github.com/zama-ai/concrete-framework-internal/issues/809 +# Remove once compiler is on PyPi https://github.com/zama-ai/concrete-numpy-internal/issues/809 WORKDIR /pkg COPY pkg/${WHEEL} . diff --git a/docker/Dockerfile.concrete-framework-env.dockerignore b/docker/Dockerfile.env.dockerignore similarity index 100% rename from docker/Dockerfile.concrete-framework-env.dockerignore rename to docker/Dockerfile.env.dockerignore diff --git a/docker/build_release_image.sh b/docker/build_release_image.sh index 28780408b..558f15aae 100755 --- a/docker/build_release_image.sh +++ b/docker/build_release_image.sh @@ -2,4 +2,4 @@ CURR_DIR=$(dirname "$0") DOCKER_BUILDKIT=1 docker build --pull --no-cache -f "$CURR_DIR/Dockerfile.release" \ --t concrete-framework-release "$CURR_DIR/.." +-t concrete-numpy-release "$CURR_DIR/.." diff --git a/docs/conf.py b/docs/conf.py index 1e6f1fa34..3e324e45c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,11 +17,11 @@ import os # -- Project information ----------------------------------------------------- -project = 'Concrete Framework' +project = 'Concrete Numpy' copyright = '2021, Zama' author = 'Zama' -description = 'Zama Concrete Framework' -root_url = os.environ.get("DOC_ROOT_URL", "/concrete-framework") +description = 'Zama Concrete Numpy' +root_url = os.environ.get("DOC_ROOT_URL", "/concrete-numpy") root_url = root_url if root_url.endswith('/') else root_url + '/' # The full version, including alpha/beta/rc tags @@ -71,7 +71,7 @@ html_theme = 'sphinx_zama_theme' # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] html_theme_options = { - "github_url": "https://github.com/zama-ai/concrete-framework", + "github_url": "https://github.com/zama-ai/concrete-numpy", "twitter_url": "https://twitter.com/zama_fhe", "icon_links": [{ "name": "Discourse", diff --git a/docs/dev/explanation/compilation.md b/docs/dev/explanation/compilation.md index a7eb1ca05..6f0f67666 100644 --- a/docs/dev/explanation/compilation.md +++ b/docs/dev/explanation/compilation.md @@ -1,8 +1,8 @@ # Compilation Pipeline In Depth -## What is **concrete-framework**? +## What is **concrete-numpy**? -**concrete-framework** is the python API of the **Concrete** framework for developing homomorphic applications. +**concrete-numpy** is the python API of the **Concrete** framework for developing homomorphic applications. One of its essential functionalities is to transform Python functions to their `MLIR` equivalent. Unfortunately, not all python functions can be converted due to the limits of current product (we are in the alpha stage), or sometimes due to inherent restrictions of FHE itself. However, you can already build interesting and impressing use cases, and more will be available in further versions of the framework. diff --git a/docs/dev/explanation/terminology_and_structure.md b/docs/dev/explanation/terminology_and_structure.md index 2172365f5..4a8ef8aaa 100644 --- a/docs/dev/explanation/terminology_and_structure.md +++ b/docs/dev/explanation/terminology_and_structure.md @@ -19,7 +19,7 @@ In this section we will go over some terms that we use throughout the project. ## Module structure -In this section, we will discuss the module structure of **concrete-framework** briefly. You are encouraged to check individual `.py` files to learn more! +In this section, we will discuss the module structure of **concrete-numpy** briefly. You are encouraged to check individual `.py` files to learn more! - concrete - common: types and utilities that can be used by multiple frontends (e.g., numpy, torch) diff --git a/docs/dev/howto/contributing.md b/docs/dev/howto/contributing.md index 1032aa4bb..12554dc9f 100644 --- a/docs/dev/howto/contributing.md +++ b/docs/dev/howto/contributing.md @@ -2,7 +2,7 @@ # Contributing ```{important} -There are two ways to contribute to **concrete-framework**: +There are two ways to contribute to **concrete-numpy**: - you can open issues to report bugs, typos and suggest ideas - you can ask to become an official contributor by emailing hello@zama.ai. Only approved contributors can send pull requests, so please make sure to get in touch before you do! ``` @@ -28,7 +28,7 @@ git checkout -b fix/tracing_indexing_42 ### Conformance -Each commit to **concrete-framework** should be conformant to the standards decided by the team. Conformance can be checked using the following command. +Each commit to **concrete-numpy** should be conformant to the standards decided by the team. Conformance can be checked using the following command. ```shell make pcc diff --git a/docs/dev/howto/project_setup.md b/docs/dev/howto/project_setup.md index 3d8204ba8..7fca7a1c0 100644 --- a/docs/dev/howto/project_setup.md +++ b/docs/dev/howto/project_setup.md @@ -1,14 +1,14 @@ # Project Setup ```{note} -It is strongly recommended to use the development docker (see the [docker](./docker.md) guide). However you can setup the project on bare macOS and Linux provided you install the required dependencies (check Dockerfile.concrete-framework-env for the required binary packages like make). +It is strongly recommended to use the development docker (see the [docker](./docker.md) guide). However you can setup the project on bare macOS and Linux provided you install the required dependencies (check Dockerfile.env for the required binary packages like make). The project targets Python 3.8 through 3.9 inclusive. ``` ## Installing Python -**concrete-framework** is a `Python` library, so `Python` should be installed to develop **concrete-framework**. `v3.8` and `v3.9` are the only supported versions. +**concrete-numpy** is a `Python` library, so `Python` should be installed to develop **concrete-numpy**. `v3.8` and `v3.9` are the only supported versions. You can follow [this](https://realpython.com/installing-python/) guide to install it (alternatively you can google `how to install python 3.8 (or 3.9)`). @@ -45,10 +45,10 @@ In the following sections, be sure to use the proper `make` tool for your system ## Cloning repository -Now, it's time to get the source code of **concrete-framework**. You can use the following command to do that. +Now, it's time to get the source code of **concrete-numpy**. You can use the following command to do that. ```shell -git clone https://github.com/zama-ai/concrete-framework-internal.git +git clone https://github.com/zama-ai/concrete-numpy-internal.git ``` ## Setting up environment on your host OS @@ -56,7 +56,7 @@ git clone https://github.com/zama-ai/concrete-framework-internal.git We are going to make use of virtual environments. This helps to keep the project isolated from other `Python` projects in the system. The following commands will create a new virtual environment under the project directory and install dependencies to it. ```shell -cd concrete-framework-internal +cd concrete-numpy-internal make setup_env ``` diff --git a/docs/dev/howto/releasing.md b/docs/dev/howto/releasing.md index 453e08a91..5f09d17a1 100644 --- a/docs/dev/howto/releasing.md +++ b/docs/dev/howto/releasing.md @@ -2,8 +2,8 @@ ## Release Candidate cycle -Before settling for a final release, we go through a Release Candidate (RC) cycle. The idea is that once the code base and documentations look ready for a release you create an RC Release by opening an issue with the release template [here](https://github.com/zama-ai/concrete-framework-internal/issues/new?assignees=&labels=&template=release.md), starting with version `vX.Y.Zrc1` and then with versions `vX.Y.Zrc2`, `vX.Y.Zrc3`... +Before settling for a final release, we go through a Release Candidate (RC) cycle. The idea is that once the code base and documentations look ready for a release you create an RC Release by opening an issue with the release template [here](https://github.com/zama-ai/concrete-numpy-internal/issues/new?assignees=&labels=&template=release.md), starting with version `vX.Y.Zrc1` and then with versions `vX.Y.Zrc2`, `vX.Y.Zrc3`... ## Proper release -Once the last RC is deemed ready, open an issue with the release template using the last RC version from which you remove the `rc?` part (i.e. `v12.67.19` if your last RC version was `v12.67.19-rc4`) on [github](https://github.com/zama-ai/concrete-framework-internal/issues/new?assignees=&labels=&template=release.md). +Once the last RC is deemed ready, open an issue with the release template using the last RC version from which you remove the `rc?` part (i.e. `v12.67.19` if your last RC version was `v12.67.19-rc4`) on [github](https://github.com/zama-ai/concrete-numpy-internal/issues/new?assignees=&labels=&template=release.md). diff --git a/docs/index.rst b/docs/index.rst index 0eff966ef..195c0003d 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,4 +1,4 @@ -Concrete Framework's documentation +Concrete Numpy's documentation ================================== diff --git a/docs/user/advanced_examples/FHEDecisionTreeClassifier.ipynb b/docs/user/advanced_examples/FHEDecisionTreeClassifier.ipynb index ba8ac56da..cec9cea38 100644 --- a/docs/user/advanced_examples/FHEDecisionTreeClassifier.ipynb +++ b/docs/user/advanced_examples/FHEDecisionTreeClassifier.ipynb @@ -11,11 +11,11 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "Trees are a popular class of algorithm in Machine Learning. In this notebook we build a simple Decision Tree Classifier using `scikit-learn` to show that they can be executed homomorphically using the Concrete Framework.\n", + "Trees are a popular class of algorithm in Machine Learning. In this notebook we build a simple Decision Tree Classifier using `scikit-learn` to show that they can be executed homomorphically using the Concrete Numpy.\n", "\n", "State of the art classifiers are generally a bit more complex than a single decision tree, here we wanted to demonstrate FHE decision trees so results may not compete with the best models out there!\n", "\n", - "Converting a tree working over quantized data to its FHE equivalent takes only a few lines of code thanks to the Concrete Framework.\n", + "Converting a tree working over quantized data to its FHE equivalent takes only a few lines of code thanks to the Concrete Numpy.\n", "\n", "Let's dive in!" ] @@ -138,7 +138,7 @@ "source": [ "We now quantize the features to train the tree directly on quantized data, this will make the trained tree FHE friendly by default which is a nice bonus, as well as allowing to see how both trees compare to each other.\n", "\n", - "The choice here is to compute the quantization parameters over the training set. We use 6 bits for each feature individually as the Concrete Framework precision for PBSes is better for 6 bits of precision." + "The choice here is to compute the quantization parameters over the training set. We use 6 bits for each feature individually as the Concrete Numpy precision for PBSes is better for 6 bits of precision." ] }, { @@ -252,7 +252,7 @@ "source": [ "Before we can do that we need to convert the tree to a form that is easy to run homomorphically.\n", "\n", - "The Hummingbird paper from Microsoft (https://scnakandala.github.io/papers/TR_2020_Hummingbird.pdf and https://github.com/microsoft/hummingbird) gives a method to convert tree evaluation to tensor operations which we support in Concrete Framework.\n", + "The Hummingbird paper from Microsoft (https://scnakandala.github.io/papers/TR_2020_Hummingbird.pdf and https://github.com/microsoft/hummingbird) gives a method to convert tree evaluation to tensor operations which we support in Concrete Numpy.\n", "\n", "The next few cells implement the functions necessary for the conversion. They are not optimized well so that they remain readable.\n" ] @@ -507,7 +507,7 @@ "source": [ "We now have a tensor equivalent of our `DecisionTreeClassifier`, pretty neat isn't it?\n", "\n", - "Last step is compiling the tensor equivalent to FHE using the Concrete Framework and it's nearly as easy as 1, 2, 3.\n", + "Last step is compiling the tensor equivalent to FHE using the Concrete Numpy and it's nearly as easy as 1, 2, 3.\n", "\n", "We use the training input data as well as some synthetic data to calibrate the circuit during compilation." ] @@ -616,7 +616,7 @@ "source": [ "In this notebook we showed how to quantize a dataset to train a tree directly on integer data so that it's FHE friendly. We saw that despite quantization and its smaller depth the quantized tree classification capabilities were close to a tree trained on the original real-valued dataset.\n", "\n", - "We then used the Hummingbird paper's algorithm to transform a tree evaluation to a few tensor operations which can be compiled by the Concrete Framework to an FHE circuit.\n", + "We then used the Hummingbird paper's algorithm to transform a tree evaluation to a few tensor operations which can be compiled by the Concrete Numpy to an FHE circuit.\n", "\n", "Finally we ran the compiled circuit on a few samples (because inference times are a bit high) to show that clear and FHE computations were the same." ] diff --git a/docs/user/advanced_examples/IrisFHE.ipynb b/docs/user/advanced_examples/IrisFHE.ipynb index bbdb2ac46..646596080 100644 --- a/docs/user/advanced_examples/IrisFHE.ipynb +++ b/docs/user/advanced_examples/IrisFHE.ipynb @@ -6,7 +6,7 @@ "source": [ "# Fully Connected Neural Network on Iris Dataset\n", "\n", - "In this example, we show how one can train a neural network on a specific task (here, Iris Classification) and use Concrete Framework to make the model work in FHE settings." + "In this example, we show how one can train a neural network on a specific task (here, Iris Classification) and use Concrete Numpy to make the model work in FHE settings." ] }, { @@ -382,7 +382,7 @@ "\n", "In this notebook, we presented a few steps to have a model (torch neural network) inference in over homomorphically encrypted data: \n", "- We first trained a fully connected neural network yielding ~100% accuracy\n", - "- Then, we quantized it using Concrete Framework. As we can see, the extreme post training quantization (only 3 bits of precision for weights, inputs and activations) made the neural network accuracy slightly drop (~97%).\n", + "- Then, we quantized it using Concrete Numpy. As we can see, the extreme post training quantization (only 3 bits of precision for weights, inputs and activations) made the neural network accuracy slightly drop (~97%).\n", "- We then used the compiled inference into its FHE equivalent to get our FHE predictions over the test set\n", "\n", "The Homomorphic inference achieves a similar accuracy as the quantized model inference.\n", diff --git a/docs/user/advanced_examples/QuantizedGeneralizedLinearModel.ipynb b/docs/user/advanced_examples/QuantizedGeneralizedLinearModel.ipynb index 92af7fe0a..b12711333 100644 --- a/docs/user/advanced_examples/QuantizedGeneralizedLinearModel.ipynb +++ b/docs/user/advanced_examples/QuantizedGeneralizedLinearModel.ipynb @@ -7,7 +7,7 @@ "source": [ "# Generalized Linear Model : Poisson Regression\n", "\n", - "This tutorial shows how to train several Generalized Linear Models (GLM) with scikit-learn, quantize them and run them in FHE using the Concrete Framework. We make use of strong quantization to insure the accumulator of the linear part does not overflow when computing in FHE (7-bit accumulator). We show that conversion to FHE does not degrade performance with respect to the quantized model working on values in the clear." + "This tutorial shows how to train several Generalized Linear Models (GLM) with scikit-learn, quantize them and run them in FHE using the Concrete Numpy. We make use of strong quantization to insure the accumulator of the linear part does not overflow when computing in FHE (7-bit accumulator). We show that conversion to FHE does not degrade performance with respect to the quantized model working on values in the clear." ] }, { @@ -17,7 +17,7 @@ "source": [ "### Import libraries\n", "\n", - "We import scikit-learn libraries and Concrete framework quantization tools:" + "We import scikit-learn libraries and Concrete Numpy quantization tools:" ] }, { @@ -870,11 +870,11 @@ "source": [ "### Conclusion\n", "\n", - "In this tutorial we have discussed how we can use the Concrete framework to convert a scikit-learn based Poisson regression model to FHE. \n", + "In this tutorial we have discussed how we can use Concrete Numpy to convert a scikit-learn based Poisson regression model to FHE. \n", "\n", "First of all, we have shown that, with the proper choice of pipeline and parameters, we can do the conversion with little loss of precision. This decrease in the quality of prediction is due to quantization of model weights and input data, and some minor noise can appear due to FHE. This noise is visible on the single variable FHE trend line as minor deviations of the blue curve with respect to the red one. \n", "\n", - "Finally, we have shown how conversion of a model to FHE can be done with a single line of code and how quantization is aided by the tools in the Concrete framework. \n" + "Finally, we have shown how conversion of a model to FHE can be done with a single line of code and how quantization is aided by the tools in Concrete Numpy. \n" ] } ], diff --git a/docs/user/basics/benchmarks.md b/docs/user/basics/benchmarks.md index 355fd1239..d12f324b1 100644 --- a/docs/user/basics/benchmarks.md +++ b/docs/user/basics/benchmarks.md @@ -9,7 +9,7 @@ To track our progress over time, we have created a [progress tracker](https://ml Note that we are not limited to these, and we'll certainly add more information (e.g., key generation time, encryption time, inference time, decryption time, etc.) once the explicit inference API is available. -Our public benchmarks can be used by competing frameworks or technologies for comparison with **Concrete Framework**. Notably, you can see: +Our public benchmarks can be used by competing frameworks or technologies for comparison with **Concrete Numpy**. Notably, you can see: - if the same functions can be compiled - what are the discrepancies in the exactness of the evaluations - how do evaluation times compare diff --git a/docs/user/basics/compiling_and_executing.md b/docs/user/basics/compiling_and_executing.md index c20fd1763..128585410 100644 --- a/docs/user/basics/compiling_and_executing.md +++ b/docs/user/basics/compiling_and_executing.md @@ -10,7 +10,7 @@ import concrete.numpy as hnp ## Defining a function to compile -You need to have a python function that follows the [limits](../explanation/fhe_and_framework_limits.md) of the **Concrete Framework**. Here is a simple example: +You need to have a python function that follows the [limits](../explanation/fhe_and_framework_limits.md) of the **Concrete Numpy**. Here is a simple example: ```python diff --git a/docs/user/basics/installing.md b/docs/user/basics/installing.md index 5a8db24e5..5579fc5be 100644 --- a/docs/user/basics/installing.md +++ b/docs/user/basics/installing.md @@ -5,11 +5,11 @@ To install **Concrete** from PyPi, run the following: ```shell -pip install concrete-framework +pip install concrete-numpy ``` ```{note} -Note that **concrete-framework** has `pygraphviz` as an optional dependency to draw graphs. +Note that **concrete-numpy** has `pygraphviz` as an optional dependency to draw graphs. ``` ```{WARNING} @@ -24,19 +24,19 @@ Do check "] packages = [ { include = "concrete" }, diff --git a/script/actions_utils/timestamp_check_compiler_package_update_container.sh b/script/actions_utils/timestamp_check_compiler_package_update_container.sh index a7f6ede6a..8f691a08e 100755 --- a/script/actions_utils/timestamp_check_compiler_package_update_container.sh +++ b/script/actions_utils/timestamp_check_compiler_package_update_container.sh @@ -6,7 +6,7 @@ FILE= COMPILER_RELEASE_ENDPOINT_URL= ENV_IMG_ENDPOINT_URL= TOKEN= -ENV_DOCKERFILE=./docker/Dockerfile.concrete-framework-env +ENV_DOCKERFILE=./docker/Dockerfile.env GITHUB_ENV_FILE=debug.txt while [ -n "$1" ] diff --git a/script/actions_utils/timestamp_check_update_container.sh b/script/actions_utils/timestamp_check_update_container.sh index 64958f93f..6619086f1 100755 --- a/script/actions_utils/timestamp_check_update_container.sh +++ b/script/actions_utils/timestamp_check_update_container.sh @@ -5,7 +5,7 @@ set -e BASE_IMG_ENDPOINT_URL= ENV_IMG_ENDPOINT_URL= TOKEN= -ENV_DOCKERFILE=./docker/Dockerfile.concrete-framework-env +ENV_DOCKERFILE=./docker/Dockerfile.env GITHUB_ENV_FILE=debug.txt while [ -n "$1" ] diff --git a/script/make_utils/licenses.sh b/script/make_utils/licenses.sh index 033cf64e9..b86ac8d4a 100755 --- a/script/make_utils/licenses.sh +++ b/script/make_utils/licenses.sh @@ -62,7 +62,7 @@ then python -m pip install -U --force-reinstall setuptools poetry install --no-dev --extras full python -m pip install pip-licenses - pip-licenses | grep -v "pkg\-resources\|concrete-framework" | tee "${NEW_LICENSES_FILENAME}" + pip-licenses | grep -v "pkg\-resources\|concrete-numpy" | tee "${NEW_LICENSES_FILENAME}" # Remove trailing whitespaces if [ "$UNAME" == "Darwin" ] @@ -99,7 +99,7 @@ then source $TMP_VENV_PATH/tmp_venv/bin/activate make setup_env - pip-licenses | grep -v "pkg\-resources\|concrete-framework" | tee "${NEW_LICENSES_FILENAME}" + pip-licenses | grep -v "pkg\-resources\|concrete-numpy" | tee "${NEW_LICENSES_FILENAME}" # Remove trailing whitespaces if [ "$UNAME" == "Darwin" ] diff --git a/tests/common/bounds_measurement/test_inputset_eval.py b/tests/common/bounds_measurement/test_inputset_eval.py index e51c8fa3b..c917a3434 100644 --- a/tests/common/bounds_measurement/test_inputset_eval.py +++ b/tests/common/bounds_measurement/test_inputset_eval.py @@ -506,7 +506,7 @@ def test_inpuset_eval_1_input(default_compilation_configuration): assert output_node.outputs[0] == EncryptedScalar(UnsignedInteger(6)) -# TODO: https://github.com/zama-ai/concrete-framework-internal/issues/772 +# TODO: https://github.com/zama-ai/concrete-numpy-internal/issues/772 # Remove once this issue is done def test_inpuset_eval_1_input_refuse_tuple(default_compilation_configuration): """Test case for a function with a single parameter and passing the inputset with tuples.""" diff --git a/tests/conftest.py b/tests/conftest.py index d15a58360..8be9a9b9c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -55,7 +55,7 @@ def pytest_addoption(parser): ) -DEFAULT_KEYRING_PATH = Path.home().resolve() / ".cache/concrete-framework_pytest" +DEFAULT_KEYRING_PATH = Path.home().resolve() / ".cache/concrete-numpy_pytest" def get_keyring_dir_from_session_or_default( @@ -404,7 +404,7 @@ def check_is_good_execution_impl( # >= if there are 8 bits signed integers allow_relaxed_tests_passing = max_bit_width >= ACCEPTABLE_MAXIMAL_BITWIDTH_FROM_CONCRETE_LIB - # FIXME: https://github.com/zama-ai/concrete-framework-internal/issues/1255 + # FIXME: https://github.com/zama-ai/concrete-numpy-internal/issues/1255 # Increased with compiler accuracy which dropped, make sure to remove once accuracy improves nb_tries = 10 @@ -432,7 +432,7 @@ def check_is_good_execution_impl( if verbose: print(f"Good computation after {i} tries") return - # FIXME: https://github.com/zama-ai/concrete-framework-internal/issues/1264 + # FIXME: https://github.com/zama-ai/concrete-numpy-internal/issues/1264 # Remove the relaxed tests once accuracy is good again for 7 bits if allow_relaxed_tests_passing and cells_were_properly_computed.all(): print( diff --git a/tests/numpy/test_compile.py b/tests/numpy/test_compile.py index 3fb0bc427..2016163be 100644 --- a/tests/numpy/test_compile.py +++ b/tests/numpy/test_compile.py @@ -242,7 +242,7 @@ def mix_x_and_y_and_call_f_with_integer_inputs(func, x, y): def mix_x_and_y_and_call_f_which_expects_small_inputs(func, x, y): """Create an upper function to test `func`, which expects small values to not use too much precision""" - # TODO: https://github.com/zama-ai/concrete-framework-internal/issues/993 + # TODO: https://github.com/zama-ai/concrete-numpy-internal/issues/993 # Understand why it's failing with 0.77 for numpy.arctanh a = numpy.abs(0.5 * numpy.sin(x)) z = numpy.abs(3 * func(a)) @@ -336,7 +336,7 @@ def subtest_compile_and_run_unary_ufunc_correctness( default_compilation_configuration, ) - # TODO: https://github.com/zama-ai/concrete-framework-internal/issues/910 + # TODO: https://github.com/zama-ai/concrete-numpy-internal/issues/910 args = [ numpy.random.randint(low, high, size=tensor_shape, dtype=numpy.uint8) if tensor_shape != () @@ -377,7 +377,7 @@ def subtest_compile_and_run_binary_ufunc_correctness( default_compilation_configuration, ) - # TODO: https://github.com/zama-ai/concrete-framework-internal/issues/910 + # TODO: https://github.com/zama-ai/concrete-numpy-internal/issues/910 args = [ numpy.random.randint(low, high, size=tensor_shape, dtype=numpy.uint8) if tensor_shape != ()