From d5f8f6c4fa7ac65fcd4dcbaa183c4414b4892f91 Mon Sep 17 00:00:00 2001 From: Benoit Chevallier-Mames <64148533+bcm-at-zama@users.noreply.github.com> Date: Wed, 31 Jul 2024 14:35:36 +0200 Subject: [PATCH] fix: use correct torch version for intel mac (#798) --- Makefile | 20 +++---------------- deps_licenses/licenses_linux_user.txt.md5 | 2 +- deps_licenses/licenses_mac_intel_user.txt.md5 | 2 +- .../licenses_mac_silicon_user.txt.md5 | 2 +- script/make_utils/licenses.sh | 17 ++-------------- 5 files changed, 8 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index 7b55b4acb..39810c140 100644 --- a/Makefile +++ b/Makefile @@ -16,17 +16,6 @@ POETRY_VERSION:=1.7.1 APIDOCS_OUTPUT?="./docs/references/api" OPEN_PR="true" -# Force the installation of a Concrete Python version, which is very useful with nightly versions -# /!\ WARNING /!\: This version should NEVER be a wildcard as it might create some -# issues when trying to run it in the future. -CONCRETE_PYTHON_VERSION="concrete-python==2.7.0.dev20240731" - -# Force the installation of Concrete Python's latest version, release-candidates included -# CONCRETE_PYTHON_VERSION="$$(poetry run python \ -# ./script/make_utils/pyproject_version_parser_helper.py \ -# --pyproject-toml-file pyproject.toml \ -# --get-pip-install-spec-for-dependency concrete-python)" - # At the end of the command, we currently need to force an 'import skorch' in Python in order to # avoid an obscure bug that led to all pytest commands to fail when installing dependencies with # Poetry >= 1.3. It is however not very clear how this import fixes the issue, as the bug was @@ -53,8 +42,6 @@ setup_env: fi echo "Finished installing poetry lock." - echo "Installing $(CONCRETE_PYTHON_VERSION)" && \ - poetry run python -m pip install -U --pre --extra-index-url https://pypi.zama.ai/cpu "$(CONCRETE_PYTHON_VERSION)" "$(MAKE)" fix_omp_issues_for_intel_mac poetry run python -c "import skorch" || true # Details above poetry run python -c "from brevitas.core.scaling import AccumulatorAwareParameterPreScaling" || true # Details above @@ -566,17 +553,16 @@ show_commit_rules: .PHONY: licenses # Generate the list of licenses of dependencies licenses: - ./script/make_utils/licenses.sh --cp_version "$(CONCRETE_PYTHON_VERSION)" + ./script/make_utils/licenses.sh .PHONY: force_licenses # Generate the list of licenses of dependencies (force the regeneration) force_licenses: - ./script/make_utils/licenses.sh --cp_version "$(CONCRETE_PYTHON_VERSION)" --force_update + ./script/make_utils/licenses.sh --force_update .PHONY: check_licenses # Check if the licenses of dependencies have changed check_licenses: @TMP_OUT="$$(mktemp)" && \ - if ! poetry run env bash ./script/make_utils/licenses.sh --check \ - --cp_version "$(CONCRETE_PYTHON_VERSION)" > "$${TMP_OUT}"; then \ + if ! poetry run env bash ./script/make_utils/licenses.sh --check > "$${TMP_OUT}"; then \ cat "$${TMP_OUT}"; \ rm -f "$${TMP_OUT}"; \ echo "Error while checking licenses, see log above."; \ diff --git a/deps_licenses/licenses_linux_user.txt.md5 b/deps_licenses/licenses_linux_user.txt.md5 index b3c161349..c25fc321d 100644 --- a/deps_licenses/licenses_linux_user.txt.md5 +++ b/deps_licenses/licenses_linux_user.txt.md5 @@ -1 +1 @@ -4c5946ebf8d2349587bb18874b83606e +7fd944cd8040c63f357a50cd33da1ad8 diff --git a/deps_licenses/licenses_mac_intel_user.txt.md5 b/deps_licenses/licenses_mac_intel_user.txt.md5 index b3c161349..c25fc321d 100644 --- a/deps_licenses/licenses_mac_intel_user.txt.md5 +++ b/deps_licenses/licenses_mac_intel_user.txt.md5 @@ -1 +1 @@ -4c5946ebf8d2349587bb18874b83606e +7fd944cd8040c63f357a50cd33da1ad8 diff --git a/deps_licenses/licenses_mac_silicon_user.txt.md5 b/deps_licenses/licenses_mac_silicon_user.txt.md5 index b3c161349..c25fc321d 100644 --- a/deps_licenses/licenses_mac_silicon_user.txt.md5 +++ b/deps_licenses/licenses_mac_silicon_user.txt.md5 @@ -1 +1 @@ -4c5946ebf8d2349587bb18874b83606e +7fd944cd8040c63f357a50cd33da1ad8 diff --git a/script/make_utils/licenses.sh b/script/make_utils/licenses.sh index f18e83ff9..5167de510 100755 --- a/script/make_utils/licenses.sh +++ b/script/make_utils/licenses.sh @@ -11,7 +11,6 @@ DO_USER_LICENSES=1 OUTPUT_DIRECTORY="${LICENSE_DIRECTORY}" DO_FORCE_UPDATE=0 -CP_VERSION="concrete-python[full]" while [ -n "$1" ] do @@ -25,11 +24,6 @@ do DO_FORCE_UPDATE=1 ;; - "--cp_version" ) - shift - CP_VERSION="${1}" - ;; - *) echo "Unknown param : $1" exit 1 @@ -38,12 +32,6 @@ do shift done -# Temp file with CP version inside. We can't have a dynamic TMP_FILE_CP_VERSION filename, since it -# changes the md5 -TMP_FILE_CP_VERSION="/tmp/cp_version.txt" -rm -f TMP_FILE_CP_VERSION -echo "${CP_VERSION}" > ${TMP_FILE_CP_VERSION} - UNAME=$(uname) if [ "$UNAME" == "Darwin" ] then @@ -74,7 +62,7 @@ then # If the dependencies have not changed, don't do anything MD5_OLD_DEPENDENCIES=$(cat ${LICENSES_FILENAME}.md5) - MD5_NEW_DEPENDENCIES=$(openssl md5 poetry.lock ${TMP_FILE_CP_VERSION} | sed -e "s@(stdin)= @@g" | openssl md5 | sed -e "s@MD5@@g" | sed -e "s@(stdin)= @@g") + MD5_NEW_DEPENDENCIES=$(openssl md5 poetry.lock | sed -e "s@(stdin)= @@g" | openssl md5 | sed -e "s@MD5@@g" | sed -e "s@(stdin)= @@g") echo "MD5 of the poetry.lock for which dependencies have been listed: ${MD5_OLD_DEPENDENCIES}" echo "MD5 of the current poetry.lock: ${MD5_NEW_DEPENDENCIES}" @@ -131,7 +119,6 @@ then fi poetry install --only main - python -m pip install -U --pre --extra-index-url https://pypi.zama.ai/cpu "${CP_VERSION}" python -m pip install pip-licenses # In --format=csv such that the column length (and so, the diff) do not change with longer @@ -203,7 +190,7 @@ then echo "Success: no update in $LICENSES_FILENAME" else # Update the .md5 files - openssl md5 poetry.lock ${TMP_FILE_CP_VERSION} | sed -e "s@(stdin)= @@g" | openssl md5 | sed -e "s@MD5@@g" | sed -e "s@(stdin)= @@g" > ${LICENSES_FILENAME}.md5 + openssl md5 poetry.lock | sed -e "s@(stdin)= @@g" | openssl md5 | sed -e "s@MD5@@g" | sed -e "s@(stdin)= @@g" > ${LICENSES_FILENAME}.md5 fi fi