diff --git a/.github/workflows/link_checker.yml b/.github/workflows/link_checker.yml index 4ef2c1435..cfe681591 100644 --- a/.github/workflows/link_checker.yml +++ b/.github/workflows/link_checker.yml @@ -14,9 +14,9 @@ jobs: link-checker: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Python 3 - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: 3.10.* - name: Install dependencies diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index d0a31d5d5..6311eb887 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -9,9 +9,9 @@ jobs: if: github.repository == 'sony/model_optimization' # Don't do this in forks runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Python 3 - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: 3.8 diff --git a/.github/workflows/publish_release.yml b/.github/workflows/publish_release.yml index 1ad00ed48..632aeaefc 100644 --- a/.github/workflows/publish_release.yml +++ b/.github/workflows/publish_release.yml @@ -6,9 +6,9 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Python 3 - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: 3.8 - name: Install dependencies diff --git a/.github/workflows/run_keras_sony_custom_layers.yml b/.github/workflows/run_keras_sony_custom_layers.yml index 8047c70fb..92c0a6d7b 100644 --- a/.github/workflows/run_keras_sony_custom_layers.yml +++ b/.github/workflows/run_keras_sony_custom_layers.yml @@ -15,9 +15,9 @@ jobs: run-tensorflow-tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Python 3 - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: "3.10" - name: Install dependencies diff --git a/.github/workflows/run_keras_tests.yml b/.github/workflows/run_keras_tests.yml index fd4498139..073a72bb3 100644 --- a/.github/workflows/run_keras_tests.yml +++ b/.github/workflows/run_keras_tests.yml @@ -14,9 +14,9 @@ jobs: run-tensorflow-tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Python 3 - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ inputs.python-version }} - name: Install dependencies diff --git a/.github/workflows/run_pytorch_tests.yml b/.github/workflows/run_pytorch_tests.yml index a62572b6c..f976d2d31 100644 --- a/.github/workflows/run_pytorch_tests.yml +++ b/.github/workflows/run_pytorch_tests.yml @@ -14,9 +14,9 @@ jobs: run-pytorch-tests: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Python 3 - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ inputs.python-version }} - name: Install dependencies diff --git a/.github/workflows/run_tests_python310_pytorch25.yml b/.github/workflows/run_tests_python310_pytorch25.yml new file mode 100644 index 000000000..31e63c5e8 --- /dev/null +++ b/.github/workflows/run_tests_python310_pytorch25.yml @@ -0,0 +1,19 @@ +name: Python 3.10, Pytorch 2.5 +on: + workflow_dispatch: # Allow manual triggers + schedule: + - cron: 0 0 * * * + pull_request: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + run-tests: + uses: ./.github/workflows/run_pytorch_tests.yml + with: + python-version: "3.10" + torch-version: "2.5.*" \ No newline at end of file diff --git a/.github/workflows/run_tests_python311_pytorch25.yml b/.github/workflows/run_tests_python311_pytorch25.yml new file mode 100644 index 000000000..72dd479e8 --- /dev/null +++ b/.github/workflows/run_tests_python311_pytorch25.yml @@ -0,0 +1,19 @@ +name: Python 3.11, Pytorch 2.5 +on: + workflow_dispatch: # Allow manual triggers + schedule: + - cron: 0 0 * * * + pull_request: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + run-tests: + uses: ./.github/workflows/run_pytorch_tests.yml + with: + python-version: "3.11" + torch-version: "2.5.*" \ No newline at end of file diff --git a/.github/workflows/run_tests_python312_pytorch22.yml b/.github/workflows/run_tests_python312_pytorch22.yml new file mode 100644 index 000000000..e40fb32b5 --- /dev/null +++ b/.github/workflows/run_tests_python312_pytorch22.yml @@ -0,0 +1,19 @@ +name: Python 3.12, Pytorch 2.2 +on: + workflow_dispatch: # Allow manual triggers + schedule: + - cron: 0 0 * * * + pull_request: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + run-tests: + uses: ./.github/workflows/run_pytorch_tests.yml + with: + python-version: "3.12" + torch-version: "2.2.*" \ No newline at end of file diff --git a/.github/workflows/run_tests_python312_pytorch23.yml b/.github/workflows/run_tests_python312_pytorch23.yml new file mode 100644 index 000000000..c261924d0 --- /dev/null +++ b/.github/workflows/run_tests_python312_pytorch23.yml @@ -0,0 +1,19 @@ +name: Python 3.12, Pytorch 2.3 +on: + workflow_dispatch: # Allow manual triggers + schedule: + - cron: 0 0 * * * + pull_request: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + run-tests: + uses: ./.github/workflows/run_pytorch_tests.yml + with: + python-version: "3.12" + torch-version: "2.3.*" \ No newline at end of file diff --git a/.github/workflows/run_tests_python312_pytorch24.yml b/.github/workflows/run_tests_python312_pytorch24.yml new file mode 100644 index 000000000..abf35ba87 --- /dev/null +++ b/.github/workflows/run_tests_python312_pytorch24.yml @@ -0,0 +1,19 @@ +name: Python 3.12, Pytorch 2.4 +on: + workflow_dispatch: # Allow manual triggers + schedule: + - cron: 0 0 * * * + pull_request: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + run-tests: + uses: ./.github/workflows/run_pytorch_tests.yml + with: + python-version: "3.12" + torch-version: "2.4.*" \ No newline at end of file diff --git a/.github/workflows/run_tests_python312_pytorch25.yml b/.github/workflows/run_tests_python312_pytorch25.yml new file mode 100644 index 000000000..9c75338ce --- /dev/null +++ b/.github/workflows/run_tests_python312_pytorch25.yml @@ -0,0 +1,19 @@ +name: Python 3.2, Pytorch 2.5 +on: + workflow_dispatch: # Allow manual triggers + schedule: + - cron: 0 0 * * * + pull_request: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + run-tests: + uses: ./.github/workflows/run_pytorch_tests.yml + with: + python-version: "3.12" + torch-version: "2.5.*" \ No newline at end of file diff --git a/.github/workflows/run_tests_python39_pytorch25.yml b/.github/workflows/run_tests_python39_pytorch25.yml new file mode 100644 index 000000000..78f9a6bd2 --- /dev/null +++ b/.github/workflows/run_tests_python39_pytorch25.yml @@ -0,0 +1,19 @@ +name: Python 3.9, Pytorch 2.5 +on: + workflow_dispatch: # Allow manual triggers + schedule: + - cron: 0 0 * * * + pull_request: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + run-tests: + uses: ./.github/workflows/run_pytorch_tests.yml + with: + python-version: "3.9" + torch-version: "2.5.*" \ No newline at end of file diff --git a/.github/workflows/run_tests_suite_coverage.yml b/.github/workflows/run_tests_suite_coverage.yml index ef7e6e7ba..287854741 100644 --- a/.github/workflows/run_tests_suite_coverage.yml +++ b/.github/workflows/run_tests_suite_coverage.yml @@ -18,9 +18,9 @@ jobs: env: COVERAGE_THRESHOLD: 98 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Python 3 - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: '3.10' diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 595ca175a..d3cf32eaf 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -18,7 +18,7 @@ jobs: pull-requests: write steps: - - uses: actions/stale@v3 + - uses: actions/stale@v9 with: repo-token: ${{ secrets.GITHUB_TOKEN }} stale-issue-message: 'Stale issue message' diff --git a/.github/workflows/test_whl_install.yml b/.github/workflows/test_whl_install.yml index 3df651911..32ae5a736 100644 --- a/.github/workflows/test_whl_install.yml +++ b/.github/workflows/test_whl_install.yml @@ -11,11 +11,11 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Install Python 3 - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: ${{ inputs.python_version }} - name: Install dependencies diff --git a/.github/workflows/tests_common.yml b/.github/workflows/tests_common.yml index 0a716da04..89090d949 100644 --- a/.github/workflows/tests_common.yml +++ b/.github/workflows/tests_common.yml @@ -15,9 +15,9 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install Python 3 - uses: actions/setup-python@v1 + uses: actions/setup-python@v5 with: python-version: 3.11 - name: Install dependencies diff --git a/README.md b/README.md index 8c3479381..6b898678e 100644 --- a/README.md +++ b/README.md @@ -51,16 +51,19 @@ for hands-on learning. For example: Currently, MCT is being tested on various Python, Pytorch and TensorFlow versions: -| | PyTorch 2.1 | PyTorch 2.2 | PyTorch 2.3 | PyTorch 2.4 | -|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| Python 3.9 | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch21.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch21.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch22.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch22.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch23.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch23.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch24.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch24.yml) | -| Python 3.10 | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch21.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch21.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch22.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch22.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch23.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch23.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch24.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch24.yml) | -| Python 3.11 | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch21.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch21.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch22.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch22.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch23.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch23.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch24.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch24.yml) | +| | PyTorch 2.1 | PyTorch 2.2 | PyTorch 2.3 | PyTorch 2.4 | PyTorch 2.5 | +|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| Python 3.9 | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch21.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch21.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch22.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch22.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch23.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch23.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch24.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch24.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch25.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_pytorch25.yml) | +| Python 3.10 | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch21.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch21.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch22.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch22.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch23.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch23.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch24.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch24.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch25.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_pytorch25.yml) | +| Python 3.11 | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch21.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch21.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch22.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch22.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch23.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch23.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch24.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch24.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch25.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_pytorch25.yml) | +| Python 3.12 | | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python312_pytorch22.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python312_pytorch22.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python312_pytorch23.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python312_pytorch23.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python312_pytorch24.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python312_pytorch24.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python312_pytorch25.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python312_pytorch25.yml) | -| | TensorFlow 2.12 | TensorFlow 2.13 | TensorFlow 2.14 | TensorFlow 2.15 | -|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| + + +| | TensorFlow 2.12 | TensorFlow 2.13 | TensorFlow 2.14 | TensorFlow 2.15 | +|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | Python 3.9 | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_keras212.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_keras212.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_keras213.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_keras213.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_keras214.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_keras214.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_keras215.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python39_keras215.yml) | | Python 3.10 | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_keras212.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_keras212.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_keras213.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_keras213.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_keras214.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_keras214.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_keras215.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python310_keras215.yml) | | Python 3.11 | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_keras212.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_keras212.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_keras213.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_keras213.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_keras214.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_keras214.yml) | [![Run Tests](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_keras215.yml/badge.svg)](https://github.com/sony/model_optimization/actions/workflows/run_tests_python311_keras215.yml) | diff --git a/tests/keras_tests/function_tests/test_hessian_info_calculator.py b/tests/keras_tests/function_tests/test_hessian_info_calculator.py index 62202a057..6ab6a58fb 100644 --- a/tests/keras_tests/function_tests/test_hessian_info_calculator.py +++ b/tests/keras_tests/function_tests/test_hessian_info_calculator.py @@ -127,7 +127,7 @@ def _test_hessian_scores(self, hessian_info, target_nodes, repr_dataset, granula info = hessian_info.fetch_hessian(request) self.assertTrue(isinstance(info, dict)) - self.assertEquals(set(info.keys()), {n.name for n in target_nodes}) + self.assertEqual(set(info.keys()), {n.name for n in target_nodes}) for target_node in target_nodes: node_score = info[target_node.name] kernel_attr_name = [w for w in target_node.weights if KERNEL in w] diff --git a/tests/pytorch_tests/function_tests/test_activation_quantization_holder_gptq.py b/tests/pytorch_tests/function_tests/test_activation_quantization_holder_gptq.py index 1746de6ec..15a8835f0 100644 --- a/tests/pytorch_tests/function_tests/test_activation_quantization_holder_gptq.py +++ b/tests/pytorch_tests/function_tests/test_activation_quantization_holder_gptq.py @@ -75,10 +75,10 @@ def test_adding_holder_instead_quantize_wrapper(self): activation_quantization_holders_in_model = self._get_holders_with_validation(gptq_model, exp_n_holders=3) for a in activation_quantization_holders_in_model: self.assertTrue(isinstance(a.activation_holder_quantizer, STESymmetricActivationTrainableQuantizer)) - self.assertEquals(a.activation_holder_quantizer.identifier, TrainingMethod.STE) + self.assertEqual(a.activation_holder_quantizer.identifier, TrainingMethod.STE) # activation quantization params for gptq should be frozen (non-learnable) self.assertTrue(a.activation_holder_quantizer.freeze_quant_params is True) - self.assertEquals(a.activation_holder_quantizer.get_trainable_variables(VariableGroup.QPARAMS), []) + self.assertEqual(a.activation_holder_quantizer.get_trainable_variables(VariableGroup.QPARAMS), []) for name, module in gptq_model.named_modules(): if isinstance(module, PytorchQuantizationWrapper): @@ -129,7 +129,7 @@ def test_adding_holder_with_gradual_act_quantization(self): quantizer = a.activation_holder_quantizer.quantizer self.assertTrue(isinstance(quantizer, STESymmetricActivationTrainableQuantizer)) self.assertTrue(quantizer.freeze_quant_params is True) - self.assertEquals(quantizer.get_trainable_variables(VariableGroup.QPARAMS), []) + self.assertEqual(quantizer.get_trainable_variables(VariableGroup.QPARAMS), []) def _get_holders_with_validation(self, gptq_model, exp_n_holders): last_module = list(gptq_model.named_modules())[-1][1]