more debug

This commit is contained in:
Philip Meier
2022-10-23 22:03:33 +02:00
parent 966345722e
commit 79d323d3ae
7 changed files with 7 additions and 369 deletions

View File

@@ -1,62 +0,0 @@
name: check-available-pytorch-dists
on:
pull_request:
paths:
- ".github/workflows/check-available-pytorch-dists.yml"
- ".github/incorrect_pytorch_dists_issue_template.md"
- "scripts/check_available_pytorch_dists.py"
schedule:
- cron: "0 4 * * *"
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup development environment
uses: ./.github/actions/setup-dev-env
- name: Check available PyTorch distributions
id: pytorch-dists
run: |
PYTORCH_DISTS=`python scripts/check_available_pytorch_dists.py`
echo "::set-output name=pytorch-dists::${PYTORCH_DISTS}"
if [[ -n "${PYTORCH_DISTS}" ]]; then { echo "${PYTORCH_DISTS}"; exit 1; }; fi
- name: Check template
if: failure() && github.event_name != 'schedule'
shell: python
env:
PYTORCH_DISTRIBUTIONS: ${{ steps.pytorch-dists.outputs.pytorch-dists }}
run: |
import os
import pathlib
import jinja2
path = pathlib.Path.cwd() / ".github"
loader = jinja2.FileSystemLoader(searchpath=path)
env = jinja2.Environment(loader=loader)
template = env.get_template("incorrect_pytorch_dists_issue_template.md")
print(
template.render(
env={"PYTORCH_DISTRIBUTIONS": os.environ["PYTORCH_DISTRIBUTIONS"]},
)
)
- uses: JasonEtco/create-an-issue@v2.6.0
if: failure() && github.event_name == 'schedule'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PYTORCH_DISTRIBUTIONS: ${{ steps.pytorch-dists.outputs.pytorch-dists }}
with:
filename: .github/incorrect_pytorch_dists_issue_template.md
update_existing: false

View File

@@ -1,139 +0,0 @@
name: install
on:
pull_request:
jobs:
channel:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
pytorch-channel:
- stable
- test
- nightly
- lts
exclude:
- os: macos-latest
pytorch-channel: lts
- python-version: "3.10"
pytorch-channel: lts
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup development environment
uses: ./.github/actions/setup-dev-env
with:
python-version: ${{ matrix.python-version }}
- name: Collect environment information
run: python scripts/collect_env.py
- name: Install PyTorch distributions
run:
ltt install --pytorch-channel=${{ matrix.pytorch-channel }} torch torchvision
torchaudio
- name: Check if CPU only
shell: python
run: |
import sys
import torch
cuda = torch.version.cuda
print(f"cuda = {cuda}")
hip = torch.version.hip
print(f"hip = {hip}")
sys.exit(cuda or hip)
computation-backend:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
pytorch-computation-backend:
- cpu
- cu113
- cu116
exclude:
- os: macos-latest
pytorch-computation-backend: cu113
- os: macos-latest
pytorch-computation-backend: cu116
include:
- os: ubuntu-latest
pytorch-computation-backend: cu102
# TODO: find a way to test this
# - os: ubuntu-latest
# pytorch-computation-backend: rocm5.1.1
fail-fast: false
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup development environment
uses: ./.github/actions/setup-dev-env
with:
python-version: ${{ matrix.python-version }}
- name: Collect environment information
run: python scripts/collect_env.py
- name: Install torch
run:
ltt install --pytorch-computation-backend=${{
matrix.pytorch-computation-backend }} torch==1.12.1
- name: Check computation backend
shell: python
run: |
import sys
import torch
from light_the_torch._cb import ComputationBackend, CUDABackend, ROCmBackend, CPUBackend
expected = ComputationBackend.from_str("${{ matrix.pytorch-computation-backend }}")
cuda = torch.version.cuda
print(f"cuda = {cuda}")
hip = torch.version.hip
print(f"hip = {hip}")
if cuda:
actual = CUDABackend.from_str(f"cu{torch.version.cuda}")
elif hip:
rocm = ".".join(torch.version.hip.split(".")[:2])
actual = ROCmBackend.from_str(f"rocm{rocm}")
else:
actual = CPUBackend()
sys.exit(actual != expected)

View File

@@ -1,33 +0,0 @@
name: lint
on:
push:
branches:
- main
- releases/*
pull_request:
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup development environment
uses: ./.github/actions/setup-dev-env
- name: Restore pre-commit cache
uses: actions/cache@v2
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
restore-keys: |
pre-commit-
- name: Run lint
run: doit lint

View File

@@ -1,28 +0,0 @@
name: publish
on:
release:
types:
- published
jobs:
pypi:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup development environment
uses: ./.github/actions/setup-dev-env
with:
python-version: "3.7"
- name: Publish to PyPI
env:
TWINE_REPOSITORY: pypi
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: doit publish

View File

@@ -1,38 +0,0 @@
name: publishable
on:
push:
branches:
- main
- releases/*
pull_request:
paths:
- ".github/workflows/publishable.yml"
- ".github/actions/setup-dev-env/**"
- "light_the_torch/**"
- ".gitignore"
- "CONTRIBUTING.rst"
- "dodo.py"
- "LICENSE"
- "MANIFEST.in"
- "pyproject.toml"
- "README.rst"
- "requirements-dev.txt"
- "setup.cfg"
jobs:
pypi:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup development environment
uses: ./.github/actions/setup-dev-env
- name: Check if publishable
run: doit publishable

View File

@@ -66,13 +66,13 @@ jobs:
update_existing: false
- name: test failure
if:
failure() && github.event_name == 'schedule' && steps.tests.outcome ==
'failure'
if: failure() && steps.tests.outcome == 'failure'
run: echo "failure with latest pip"
- uses: JasonEtco/create-an-issue@v2.6.0
if: failure() && steps.tests.outcome == 'success' && matrix.release == 'stable'
if:
failure() && github.event_name == 'schedule' && steps.tests.outcome ==
'success' && matrix.release == 'stable'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: ${{ github.repository }}
@@ -82,6 +82,6 @@ jobs:
filename: .github/pip_latest_success_issue_template.md
update_existing: false
- name: test failure
if: failure() && steps.tests.outcome == 'failure'
run: echo "success with latest pip"
- name: test success
if: failure() && steps.tests.outcome == 'success' && matrix.release == 'stable'
run: echo "success with latest stable pip"

View File

@@ -1,62 +0,0 @@
name: tests
on:
push:
branches:
- main
- releases/*
pull_request:
paths:
- ".github/workflows/tests.yml"
- ".github/actions/setup-dev-env/**"
- "light_the_torch/**"
- "tests/**"
- ".coveragerc"
- "codecov.yml"
- "dodo.py"
- "pytest.ini"
- "requirements-dev.txt"
- "setup.cfg"
schedule:
- cron: "0 4 * * *"
jobs:
unit:
strategy:
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
python-version:
- "3.7"
- "3.8"
- "3.9"
- "3.10"
runs-on: ${{ matrix.os }}
env:
OS: ${{ matrix.os }}
PYTHON_VERSION: ${{ matrix.python-version }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup development environment
uses: ./.github/actions/setup-dev-env
with:
python-version: ${{ matrix.python-version }}
- name: Run unit tests
run: doit test
- name: Upload coverage
uses: codecov/codecov-action@v2.1.0
with:
flags: unit
env_vars: OS,PYTHON_VERSION