Skip to content
Merged
Changes from all commits
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
10 changes: 9 additions & 1 deletion opt_prime/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@

opt_prime.accel targets transformers 5.x. On an older transformers, tests that need a model family or config
attribute it does not have are skipped instead of failing.

An installed NPU torch backend (furiosa-torch) autoloads with torch as the PrivateUse1 accelerator; torch then keeps
no CUDA streams for autograd and every CUDA backward hits the engine.cpp stream assert (#114). Tests run on CUDA or
the CPU, so autoloading is off here; code that needs the rngd device imports furiosa.torch, which still registers it.
"""
import pytest
import os

os.environ.setdefault("TORCH_DEVICE_BACKEND_AUTOLOAD", "0") # before anything imports torch

import pytest # noqa: E402

try:
import transformers
Expand Down
Loading