Skip to content

Commit

Permalink
Merge branch 'master' into copy_unroll_sdpa_to_npuw_llm_comp_model
Browse files Browse the repository at this point in the history
  • Loading branch information
AsyaPronina authored Dec 24, 2024
2 parents 6a7c3c6 + ae1fbbe commit 8964fa3
Show file tree
Hide file tree
Showing 16 changed files with 210 additions and 23 deletions.
133 changes: 133 additions & 0 deletions .github/workflows/job_jax_layer_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,133 @@
name: JAX Layer Tests

on:
workflow_call:
inputs:
runner:
description: 'Machine on which the tests would run'
type: string
required: true
container:
description: 'JSON to be converted to the value of the "container" configuration for the job'
type: string
required: false
default: '{"image": null}'
affected-components:
description: 'Components that are affected by changes in the commit defined by the Smart CI Action'
type: string
required: true
python-version:
description: 'Python version to setup. E.g., "3.11"'
type: string
required: true

permissions: read-all

env:
PIP_CACHE_PATH_LINUX: /mount/caches/pip/linux
PIP_CACHE_PATH_WIN: "C:\\mount\\caches\\pip\\win"

jobs:
JAX_Layer_Tests:
name: JAX Layer Tests
timeout-minutes: 40
runs-on: ${{ inputs.runner }}
container: ${{ fromJSON(inputs.container) }}
defaults:
run:
shell: ${{ contains(inputs.runner, 'win') && 'pwsh' || 'bash' }}
env:
DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input
OPENVINO_REPO: ${{ github.workspace }}/openvino
INSTALL_DIR: ${{ github.workspace }}/install
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests
INSTALL_WHEELS_DIR: ${{ github.workspace }}/install/wheels
LAYER_TESTS_INSTALL_DIR: ${{ github.workspace }}/install/tests/layer_tests
steps:
- name: Download OpenVINO artifacts (tarballs)
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
pattern: openvino_[tests]*
path: ${{ env.INSTALL_DIR }}
merge-multiple: true

- name: Download OpenVINO artifacts (wheels)
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
pattern: openvino_[wheels]*
path: ${{ env.INSTALL_WHEELS_DIR }}
merge-multiple: true

# Needed as ${{ github.workspace }} is not working correctly when using Docker
- name: Setup Variables
if: runner.os != 'Windows'
run: |
echo "OPENVINO_REPO=$GITHUB_WORKSPACE/openvino" >> "$GITHUB_ENV"
echo "INSTALL_DIR=$GITHUB_WORKSPACE/install" >> "$GITHUB_ENV"
echo "INSTALL_TEST_DIR=$GITHUB_WORKSPACE/install/tests" >> "$GITHUB_ENV"
echo "INSTALL_WHEELS_DIR=$GITHUB_WORKSPACE/install/wheels" >> "$GITHUB_ENV"
echo "LAYER_TESTS_INSTALL_DIR=$GITHUB_WORKSPACE/install/tests/layer_tests" >> "$GITHUB_ENV"
- name: Install OpenVINO dependencies (mac)
if: runner.os == 'macOS'
run: brew install pigz

- name: Extract OpenVINO packages (Linux, macOS)
if: runner.os != 'Windows'
run: |
pigz -dc openvino_tests.tar.gz | tar -xf - -C ${INSTALL_DIR}
working-directory: ${{ env.INSTALL_DIR }}

- name: Extract OpenVINO artifacts (Windows)
if: runner.os == 'Windows'
run: |
Expand-Archive openvino_tests.zip -DestinationPath ${{ env.INSTALL_DIR }}
working-directory: ${{ env.INSTALL_DIR }}

- name: Fetch setup_python and install wheels actions
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
timeout-minutes: 15
with:
sparse-checkout: |
.github/actions/setup_python/action.yml
.github/actions/install_ov_wheels/action.yml
sparse-checkout-cone-mode: false
path: 'openvino'

- name: Setup Python ${{ inputs.python-version }}
uses: ./openvino/.github/actions/setup_python
with:
version: ${{ inputs.python-version }}
pip-cache-path: ${{ runner.os == 'Linux' && env.PIP_CACHE_PATH_LINUX || env.PIP_CACHE_PATH_WIN }}
should-setup-pip-paths: ${{ runner.os != 'macOS' }}
self-hosted-runner: ${{ runner.os != 'macOS' }}

- name: Install OpenVINO Python wheels
uses: ./openvino/.github/actions/install_ov_wheels
with:
wheels-dir-path: ${{ env.INSTALL_WHEELS_DIR }}
wheels-to-install: 'openvino'

- name: Install JAX Layer tests dependencies
run: |
# jax test requirements
python3 -m pip install -r ${{ env.INSTALL_TEST_DIR }}/requirements_jax
- name: JAX Layer Tests
if: ${{ fromJSON(inputs.affected-components).JAX_FE.test && runner.arch != 'ARM64' }} # Ticket: 126287, 142196
run: python3 -m pytest ${{ env.LAYER_TESTS_INSTALL_DIR }}/jax_tests ${PARALLEL} -m precommit_jax_fe --junitxml=${{ env.INSTALL_TEST_DIR }}/TEST-jax.xml
env:
TEST_DEVICE: CPU
TEST_PRECISION: FP16
JAX_TRACE_MODE: JAXPR
PARALLEL: ${{ runner.os == 'Windows' && ' ' || '-n logical'}}

- name: Upload Test Results
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
if: ${{ !cancelled() }}
with:
name: test-results-python-jax-layers
path: |
${{ env.INSTALL_TEST_DIR }}/TEST*.html
${{ env.INSTALL_TEST_DIR }}/TEST*.xml
if-no-files-found: 'warn'
2 changes: 1 addition & 1 deletion .github/workflows/job_jax_models_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ jobs:

- name: Install JAX tests requirements for precommit
run: |
python3 -m pip install -r ${MODEL_HUB_TESTS_INSTALL_DIR}/jax/requirements.txt
python3 -m pip install -r ${{ env.INSTALL_TEST_DIR }}/requirements_jax
- name: JAX/Flax Models Tests from Hugging Face
if: ${{ inputs.model_scope == 'precommit' || inputs.model_scope == 'nightly' }}
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/job_python_unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,14 +162,6 @@ jobs:
export LD_LIBRARY_PATH=${PIP_INSTALL_PATH}/openvino/libs:$LD_LIBRARY_PATH
python3 -m pytest ${LAYER_TESTS_INSTALL_DIR}/py_frontend_tests --junitxml=${INSTALL_TEST_DIR}/TEST-test_py_fontend.xml
- name: JAX Layer Tests - JAX FE
if: ${{ fromJSON(inputs.affected-components).JAX_FE.test && runner.arch != 'ARM64' && runner.os != 'macOS' }}
run: python3 -m pytest ${LAYER_TESTS_INSTALL_DIR}/jax_tests/ -m precommit_jax_fe --junitxml=${INSTALL_TEST_DIR}/TEST-jax_fe.xml
env:
TEST_DEVICE: CPU
TEST_PRECISION: FP16
JAX_TRACE_MODE: JAXPR

- name: TensorFlow Lite Layer Tests - TFL FE
if: fromJSON(inputs.affected-components).TFL_FE.test
run: python3 -m pytest ${LAYER_TESTS_INSTALL_DIR}/tensorflow_lite_tests/ -n logical --junitxml=${INSTALL_TEST_DIR}/TEST-tfl_fe.xml
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/linux_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,16 @@ jobs:
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
python-version: '3.11'

JAX_Layer_Tests:
name: JAX Layer Tests
needs: [ Build, Docker, Smart_CI ]
uses: ./.github/workflows/job_jax_layer_tests.yml
with:
runner: 'aks-linux-16-cores-32gb-arm'
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_20_04_arm64 }}", "volumes": ["/mount:/mount"]}'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
python-version: '3.11'

CPU_Functional_Tests:
name: CPU functional tests
if: fromJSON(needs.smart_ci.outputs.affected_components).CPU.test
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/mac.yml
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,15 @@ jobs:
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
python-version: '3.11'

JAX_Layer_Tests:
name: JAX Layer Tests
needs: [ Build, Smart_CI ]
uses: ./.github/workflows/job_jax_layer_tests.yml
with:
runner: 'macos-13'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
python-version: '3.11'

CPU_Functional_Tests:
name: CPU functional tests
# if: fromJSON(needs.smart_ci.outputs.affected_components).CPU.test
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/mac_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,15 @@ jobs:
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
python-version: '3.11'

JAX_Layer_Tests:
name: JAX Layer Tests
needs: [ Build, Smart_CI ]
uses: ./.github/workflows/job_jax_layer_tests.yml
with:
runner: 'macos-13-xlarge'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
python-version: '3.11'

CPU_Functional_Tests:
name: CPU functional tests
if: fromJSON(needs.smart_ci.outputs.affected_components).CPU.test
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/ubuntu_22.yml
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,16 @@ jobs:
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
python-version: '3.11'

JAX_Layer_Tests:
name: JAX Layer Tests
needs: [ Docker, Build, Smart_CI ]
uses: ./.github/workflows/job_jax_layer_tests.yml
with:
runner: 'aks-linux-4-cores-16gb'
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_22_04_x64 }}", "volumes": ["/mount:/mount"]}'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
python-version: '3.11'

CPU_Functional_Tests:
name: CPU functional tests
if: fromJSON(needs.smart_ci.outputs.affected_components).CPU.test
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/ubuntu_24.yml
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,16 @@ jobs:
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
python-version: '3.12'

JAX_Layer_Tests:
name: JAX Layer Tests
needs: [ Docker, Build, Smart_CI ]
uses: ./.github/workflows/job_jax_layer_tests.yml
with:
runner: 'aks-linux-4-cores-16gb'
container: '{"image": "${{ fromJSON(needs.docker.outputs.images).ov_test.ubuntu_24_04_x64 }}", "volumes": ["/mount:/mount"]}'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
python-version: '3.12'

TensorFlow_Layer_Tests:
name: TensorFlow Layer Tests
needs: [ Docker, Build, Smart_CI, Openvino_tokenizers ]
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/windows_vs2019_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,15 @@ jobs:
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
python-version: '3.11'

JAX_Layer_Tests:
name: JAX Layer Tests
needs: [ Build, Smart_CI ]
uses: ./.github/workflows/job_jax_layer_tests.yml
with:
runner: 'aks-win-8-cores-16gb'
affected-components: ${{ needs.smart_ci.outputs.affected_components }}
python-version: '3.11'

CXX_Unit_Tests:
name: C++ unit tests
needs: [ Build, Smart_CI ]
Expand Down
1 change: 1 addition & 0 deletions src/inference/src/os/lin/lin_system_conf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ CPU::CPU() {
} else if (valid_cpu_mapping_table.size() == (unsigned)_processors) {
return 0;
} else {
std::lock_guard<std::mutex> lock{_cpu_mutex};
_processors = valid_cpu_mapping_table.size();
_cpu_mapping_table.swap(valid_cpu_mapping_table);
update_valid_processor_linux(std::move(phy_core_list),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ DQMatMulCWi::DQMatMulCWi(Context::Ref ctx) {
auto qcoeff_shape = matched_node_qcoeff->output(0).get_shape();

if ((ov::element::i4 == matched_qweight->get_element_type() ||
ov::element::i8 == matched_qweight->get_element_type()) &&
ov::element::i8 == matched_qweight->get_element_type() ||
ov::element::nf4 == matched_qweight->get_element_type()) &&
(ov::op::util::is_parameter(matched_node_qcoeff) || ov::op::util::is_constant(matched_node_qcoeff)) &&
qcoeff_shape[1] == 1 && !matched_matmul->get_transpose_a() && matched_matmul->get_transpose_b()) {
auto matched_node_cvtw = node_to_output.at(qcvtw).get_node_shared_ptr();
Expand Down
2 changes: 1 addition & 1 deletion tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ add_subdirectory(model_hub_tests)
add_subdirectory(samples_tests)
add_subdirectory(e2e_tests)

install(FILES requirements_pytorch requirements_tensorflow requirements_onnx
install(FILES requirements_pytorch requirements_tensorflow requirements_onnx requirements_jax
DESTINATION tests COMPONENT tests EXCLUDE_FROM_ALL)
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,4 @@ def test_unary_ops(self, input_shape, input_type, op_type,
pytest.skip("159585: accuracy error on ARM")
self._test(*self.create_unary_net(input_shape, input_type, op_type),
ie_device, precision, ir_version, temp_dir=temp_dir,
use_legacy_frontend=use_legacy_frontend, custom_eps=1e-3)
use_legacy_frontend=use_legacy_frontend, custom_eps=3 * 1e-3)
10 changes: 0 additions & 10 deletions tests/model_hub_tests/jax/requirements.txt

This file was deleted.

13 changes: 13 additions & 0 deletions tests/requirements_jax
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
numpy==1.26.4; python_version < "3.12" or platform_system == "Darwin" and platform_machine == "x86_64"
numpy==2.2.1; python_version >= "3.12" and (platform_system != "Darwin" or platform_machine != "x86_64")
pytest==7.0.1
pytest-xdist[psutil]==3.6.1
pytest-html==4.1.1
jax==0.4.38; (platform_system != "Darwin" or platform_machine != "x86_64") and python_version > "3.9"
# tensorflow 2.16.2 depends on ml-dtypes~=0.3.1 and jax 0.4.35 depends on ml-dtypes>=0.4.0
jax==0.4.33; (platform_system == "Darwin" and platform_machine == "x86_64") and python_version > "3.9"
jax==0.4.30; python_version <= "3.9"
flax==0.10.2
transformers==4.47.1
defusedxml
pillow
2 changes: 1 addition & 1 deletion tests/requirements_tensorflow
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ wrapt==1.15.0; python_version >= "3.12"
# tensorflow-text is not available for both Windows and ARM platforms
tensorflow-text==2.18.0; python_version < "3.12" and platform_system == "Linux" and platform_machine == "x86_64"
tensorflow-hub==0.16.1
jax==0.4.35; (platform_system != "Darwin" or platform_machine != "x86_64") and python_version > "3.9"
jax==0.4.38; (platform_system != "Darwin" or platform_machine != "x86_64") and python_version > "3.9"
# tensorflow 2.16.2 depends on ml-dtypes~=0.3.1 and jax 0.4.35 depends on ml-dtypes>=0.4.0
jax==0.4.33; (platform_system == "Darwin" and platform_machine == "x86_64") and python_version > "3.9"
jax==0.4.30; python_version <= "3.9"
Expand Down

0 comments on commit 8964fa3

Please sign in to comment.