diff --git a/.github/workflows/test_basic.yaml b/.github/workflows/test_basic.yaml index 398cb039..99868f09 100644 --- a/.github/workflows/test_basic.yaml +++ b/.github/workflows/test_basic.yaml @@ -11,12 +11,15 @@ jobs: github.event.pull_request.user.login == 'dop-amin' || github.event.pull_request.user.login == 'mkannwischer' }} - runs-on: ubuntu-latest - strategy: - matrix: + runs-on: macos-latest + strategy: + matrix: target: [slothy.targets.arm_v7m.cortex_m7,slothy.targets.arm_v81m.cortex_m55r1, slothy.targets.arm_v81m.cortex_m85r1, slothy.targets.aarch64.cortex_a55, slothy.targets.aarch64.cortex_a72_frontend, slothy.targets.aarch64.apple_m1_firestorm_experimental, slothy.targets.aarch64.apple_m1_icestorm_experimental] steps: - uses: actions/checkout@v3 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' - name: Install python dependencies run: | python3 -m venv venv @@ -31,9 +34,12 @@ jobs: github.event.pull_request.user.login == 'dop-amin' || github.event.pull_request.user.login == 'mkannwischer' }} - runs-on: ubuntu-latest + runs-on: macos-latest steps: - uses: actions/checkout@v3 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' - name: Install python dependencies run: | python3 -m venv venv @@ -48,9 +54,12 @@ jobs: github.event.pull_request.user.login == 'dop-amin' || github.event.pull_request.user.login == 'mkannwischer' }} - runs-on: ubuntu-latest + runs-on: macos-latest steps: - uses: actions/checkout@v3 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' - name: Install python dependencies run: | python3 -m venv venv @@ -65,9 +74,12 @@ jobs: github.event.pull_request.user.login == 'dop-amin' || github.event.pull_request.user.login == 'mkannwischer' }} - runs-on: ubuntu-latest + runs-on: macos-latest steps: - uses: actions/checkout@v3 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' - name: Install python dependencies run: | python3 -m venv venv @@ -75,16 +87,19 @@ jobs: echo BASH_ENV="./venv/bin/activate" >> $GITHUB_ENV - name: Run examples run: | - python3 example.py --examples ntt_kyber_1_23_45_67_m55,ntt_dilithium_12_34_56_78_m55 --timeout=300 + python3 example.py --examples ntt_kyber_1_23_45_67_m55,ntt_dilithium_12_34_56_78_m55 --timeout=1200 examples_ntt_kyber_dilithium_neon_core: if: ${{ github.event.label.name == 'needs-ci' || github.event.pull_request.user.login == 'hanno-becker' || github.event.pull_request.user.login == 'dop-amin' || github.event.pull_request.user.login == 'mkannwischer' }} - runs-on: ubuntu-latest + runs-on: macos-latest steps: - uses: actions/checkout@v3 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' - name: Install python dependencies run: | python3 -m venv venv @@ -92,16 +107,19 @@ jobs: echo BASH_ENV="./venv/bin/activate" >> $GITHUB_ENV - name: Run examples run: | - python3 example.py --examples ntt_kyber_123_4567_a55,ntt_dilithium_123_45678_a55 --timeout=300 + python3 example.py --examples ntt_kyber_123_4567_a55,ntt_dilithium_123_45678_a55 --timeout=1200 sqmag: if: ${{ github.event.label.name == 'needs-ci' || github.event.pull_request.user.login == 'hanno-becker' || github.event.pull_request.user.login == 'dop-amin' || github.event.pull_request.user.login == 'mkannwischer' }} - runs-on: ubuntu-latest + runs-on: macos-latest steps: - uses: actions/checkout@v3 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' - name: Install python dependencies run: | python3 -m venv venv @@ -116,9 +134,12 @@ jobs: github.event.pull_request.user.login == 'dop-amin' || github.event.pull_request.user.login == 'mkannwischer' }} - runs-on: ubuntu-latest + runs-on: macos-latest steps: - uses: actions/checkout@v3 + - uses: actions/setup-python@v5 + with: + python-version: '3.12' - name: Install python dependencies run: | python3 -m venv venv diff --git a/requirements.txt b/requirements.txt index b1f405e9..a6f8c9cd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ numpy==1.26.4 -ortools==9.7.2996 +ortools==9.11.4210 pandas==2.1.1 sympy==1.12 diff --git a/slothy/core/core.py b/slothy/core/core.py index bfbaeab4..8055d221 100644 --- a/slothy/core/core.py +++ b/slothy/core/core.py @@ -3322,6 +3322,8 @@ def _init_external_model_and_solver(self): self._model.cp_solver = cp_model.CpSolver() self._model.cp_solver.random_seed = self.config.solver_random_seed + self._model.cp_solver.parameters.num_workers = 16 + def _NewIntVar(self, minval, maxval, name=""): # pylint:disable=invalid-name r = self._model.cp_model.NewIntVar(minval,maxval, name) self._model.variables.append(r) @@ -3413,7 +3415,7 @@ def is_good_enough( cur, bound ): cur <= self.config.objective_lower_bound: self.logger.info("Reached user-defined objective_lower_bound ... stop") return True - return False + return True solution_cb = SlothyBase.CpSatSolutionCb(self.logger,self._model.objective_name, self.config.max_solutions,