tqchen opened a new pull request, #654:
URL: https://github.com/apache/tvm-ffi/pull/654
## Rationale
The Python test suite runs serially today. Running it in parallel with
`pytest-xdist` (`-n auto`) across multiple worker processes cuts wall-clock
time substantially. The one obstacle is the single machine-local GPU: tests
that execute device work cannot run concurrently on it safely.
## Changes
- Add a `tvm_ffi.testing.run_with_gpu_lock` helper that serializes device
work
through an advisory file lock shared across all worker processes (built on
`tvm_ffi.utils.FileLock`). The lock lives under the system temp dir by
default and can be redirected with the `TVM_FFI_TEST_LOCK_DIR` environment
variable.
- Wrap the device-executing regions of the GPU-touching tests with the helper
so they serialize on the shared lock, while source compilation stays
outside
the lock and continues to run in parallel.
- Add `pytest-xdist` to the `test` dependency group and enable `-n auto` via
`addopts`. Pass `-n0` to opt out of parallelism.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]