Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load libpyg.so first to let torch.library.register_fake find custom operators #329

Merged
merged 11 commits into from
Jul 25, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
testing
  • Loading branch information
akihironitta committed Jul 20, 2024
commit e12b5beff038d2e5c8bd94f16ecb6447f9029375
29 changes: 29 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,27 @@ repos:
name: Check packaging
args: [--min=10, .]

- repo: https://github.com/asottile/pyupgrade
rev: v3.16.0
hooks:
- id: pyupgrade
name: Upgrade Python syntax
args: [--py38-plus]

# TODO
# - repo: https://github.com/PyCQA/autoflake
# rev: v2.3.1
# hooks:
# - id: autoflake
# name: Remove unused imports and variables
# args: [
# --remove-all-unused-imports,
# --remove-unused-variables,
# --remove-duplicate-keys,
# --ignore-init-module-imports,
# --in-place,
# ]

- repo: https://github.com/google/yapf
rev: v0.40.2
hooks:
Expand All @@ -37,6 +58,14 @@ repos:
- id: isort
name: Sort imports

# TODO
# - repo: https://github.com/astral-sh/ruff-pre-commit
# rev: v0.5.3
# hooks:
# - id: ruff
# name: Ruff formatting
# args: [--fix, --exit-non-zero-on-fix]

- repo: https://github.com/PyCQA/flake8
rev: 7.1.0
hooks:
Expand Down
4 changes: 2 additions & 2 deletions pyg_lib/testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ def onlyTriton(func: Callable) -> Callable:
def withCUDA(func: Callable) -> Callable:
import pytest

devices = [torch.device('cpu')]
devices = [pytest.param(torch.device('cpu'), id='cpu')]
if torch.cuda.is_available():
devices.append(torch.device('cuda:0'))
devices.append(pytest.param(torch.device('cuda:0'), id='cuda:0'))

return pytest.mark.parametrize('device', devices)(func)

Expand Down