Skip to content

mindtorch_v2/mps: real Metal GPU compute backend for 30+ ops (#2755) #4883

mindtorch_v2/mps: real Metal GPU compute backend for 30+ ops (#2755)

mindtorch_v2/mps: real Metal GPU compute backend for 30+ ops (#2755) #4883

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: CI Pipe
on:
pull_request:
branches: [ "master" ]
paths:
- 'src/mindtorch_v2/**'
- 'tests/mindtorch_v2/**'
- '.github/workflows/**'
push:
branches: [ "master" ]
paths:
- 'src/mindtorch_v2/**'
- 'tests/mindtorch_v2/**'
- '.github/workflows/**'
permissions:
contents: read
jobs:
pylint-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip==24.0
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -r requirements/pylint_requirements.txt
# - name: Install MindSpore
# shell: bash
# env:
# OS: ubuntu-latest
# PYTHON: 3.11
# run: |
# python .github/install_mindspore.py
# pip install -r download.txt
- name: Analysing the mindtorch_v2 code with pylint
run: |
pylint --jobs=1 src/mindtorch_v2 --rcfile=.github/pylint.conf
# ut-test:
# needs: pylint-check
# strategy:
# matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
# python: [3.11]
# runs-on: ${{ matrix.os }}
# steps:
# - uses: actions/checkout@v3
# - name: avoid macos error
# if: matrix.os == 'macos-latest'
# run: rm -rf $RUNNER_TOOL_CACHE/Python/3.8.17
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python }}
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip==24.0
# pip install -r requirements/requirements.txt
# # - name: Install MindSpore
# # shell: bash
# # env:
# # OS: ${{ matrix.os }}
# # PYTHON: ${{ matrix.python }}
# # run: |
# # python .github/install_mindspore.py
# # pip install -r download.txt
# - name: Test with pytest
# run: |
# pytest -c pytest.ini -m 'not download and not gpu_only' --ignore=tests/transformers tests
# release-test:
# needs: pylint-check
# strategy:
# matrix:
# ms_version: ['2.5.0', '2.6.0', '2.7.0']
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: 3.11
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip==24.0
# pip install -r requirements/requirements.txt
# # - name: Install MindSpore
# # shell: bash
# # run: |
# # pip install https://ms-release.obs.cn-north-4.myhuaweicloud.com/${{matrix.ms_version}}/MindSpore/unified/x86_64/mindspore-${{matrix.ms_version}}-cp39-cp39-linux_x86_64.whl --trusted-host ms-release.obs.cn-north-4.myhuaweicloud.com
# - name: Test with pytest
# run: |
# pytest -c pytest.ini -m 'not download and not gpu_only' --ignore=tests/transformers tests
# # pytest -c pytest.ini -m 'not download and not gpu_only' tests
# transformers-model-test:
# needs: pylint-check
# strategy:
# matrix:
# alpha: ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y']
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v3
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: 3.11
# - name: Install dependencies
# run: |
# python -m pip install --upgrade pip==24.0
# pip install torch --index-url https://download.pytorch.org/whl/cpu
# pip install -r requirements/requirements.txt
# - name: Install MindSpore
# shell: bash
# env:
# OS: ubuntu-latest
# PYTHON: 3.11
# run: |
# pip install mindspore
# - name: Test with pytest
# run: |
# pip install transformers
# TRANSFORMERS_VERSION=$(python -c "import transformers; print(transformers.__version__)")
# echo "Installed transformers version: $TRANSFORMERS_VERSION"
# cd tests
# git clone -b v${TRANSFORMERS_VERSION} https://github.com/huggingface/transformers
# cd ..
# bash scripts/build_and_reinstall.sh
# python tests/run_test.py -vs tests/transformers/tests/models/${{ matrix.alpha }}*/test_modeling*
mindtorch-v2-test:
needs: pylint-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip==24.0
pip install torch --index-url https://download.pytorch.org/whl/cpu
pip install -r requirements/requirements.txt
- name: Install MindSpore
shell: bash
env:
OS: ubuntu-latest
PYTHON: 3.11
run: |
pip install mindspore
- name: Test mindtorch_v2
run: |
cd tests/mindtorch_v2
pytest . -v --tb=short \
--ignore=test_ops_npu.py \
--ignore=test_ddp.py \
--ignore=test_ddp_cpu.py \
--ignore=test_ddp_builtin_hooks.py \
--ignore=test_ddp_comm_hook.py \
--ignore=test_ddp_unused_params.py \
--ignore=test_ddp_static_graph.py \
--ignore=test_ddp_bucket_view.py \
--ignore=test_gloo_ddp.py \
--ignore=test_hccl_all_to_all_multicard.py
kaggle-gpu-test:
needs: pylint-check
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.repository_owner == 'mindspore-lab'
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: 3.11
- uses: "lvyufeng/action-kaggle-gpu-test@latest"
with:
kaggle_username: "${{ secrets.KAGGLE_USERNAME }}"
kaggle_key: "${{ secrets.KAGGLE_API_KEY }}"
kernel_name: mindnlp
kernel_job_file: .github/kaggle_gpu_test.py