Unverified Commit b03b3ae9 authored by Frank Lee's avatar Frank Lee Committed by GitHub
Browse files

fixed mem monitor device (#433)

fixed mem monitor device
parent 14a70942
......@@ -52,7 +52,12 @@ class AsyncMemoryMonitor:
def __init__(self, power: int = 10):
self.keep_measuring = False
self.executor = ThreadPoolExecutor(max_workers=1)
current_device = get_current_device()
def _set_cuda_device():
torch.cuda.set_device(current_device)
self.executor = ThreadPoolExecutor(max_workers=1, initializer=_set_cuda_device)
self.monitor_thread = None
self.interval = 1 / (10**power)
self.time_stamps = []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment