name: AMD GPU

# AMD runners are currently unavailable, so this suite is manual-only
# (mirrors NVIDIA GPU, but without a schedule). Removing the push / pull_request /
# merge_group triggers keeps it out of PR checks and the merge queue until the
# runners are healthy again; only Checkstyle runs in the merge queue for now.
on:
  workflow_dispatch:  # Enables manual trigger

concurrency:
  # This causes it to cancel previous in-progress actions on the same PR / branch,
  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.event.merge_group.head_ref || github.ref }}
  cancel-in-progress: true

jobs:
  tests:
    runs-on: linux-mi300-gpu-1
    strategy:
      matrix:
        rocm_version: ['7.1']

    steps:
    - name: Checkout code
      uses: actions/checkout@v6

    - name: Set up Python
      uses: actions/setup-python@v6
      with:
        python-version: '3.10'

    - name: Setup Dependencies
      run: |
        rocm-smi
        python -m pip install --upgrade pip
        pip3 install torch torchvision --index-url https://download.pytorch.org/whl/rocm${{ matrix.rocm_version }}
        pip install -e ".[dev]"
    
    - name: List Python Environments
      run: python -m pip list
    
    - name: Run Unit Tests
      run: |
        make test
        make test-convergence
