Importing from AWQ triggers CUDA context initialization, which can be problematic in some circumstances (see #1877). This PR moves the import so that it's local, preventing this issue.
To test this, run this script:
import multiprocessing
from torch import nn
import peft # noqa F401
def func():
nn.Linear(2, 3).cuda(0)
if __name__ == "__main__":
proc = multiprocessing.Process(target=func)
proc.start()
proc.join()
Ideally, we can add this to our nightly GPU tests, but running this from the pytest runner does not work (IIRC) so some extra steps are required.
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.
Importing from AWQ triggers CUDA context initialization, which can be problematic in some circumstances (see #1877). This PR moves the import so that it's local, preventing this issue.
To test this, run this script:
Ideally, we can add this to our nightly GPU tests, but running this from the pytest runner does not work (IIRC) so some extra steps are required.