DeepSpeed icon indicating copy to clipboard operation
DeepSpeed copied to clipboard

[BUG] Lock file not being released, 2d, 4d kernel line .triton/autotune/Fp16Matmul_2d_kernel.pickle.lock

Open vyomakesh09 opened this issue 2 years ago • 4 comments

was just runing pytest on python 3.10

--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.10/logging/__init__.py", line 1103, in emit
    stream.write(msg + self.terminator)
ValueError: I/O operation on closed file.
Call stack:
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 444, in matmul_ext_update_autotune_table
    fp16_matmul._update_autotune_table()
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 421, in _update_autotune_table
    TritonMatmul._update_autotune_table(__class__.__name__ + "_2d_kernel", __class__._2d_kernel)
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 150, in _update_autotune_table
    cache_manager.put(autotune_table)
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 66, in put
    with FileLock(self.lock_path):
  File "/home/v/.local/lib/python3.10/site-packages/filelock/_api.py", line 262, in __enter__
    self.acquire()
  File "/home/v/.local/lib/python3.10/site-packages/filelock/_api.py", line 219, in acquire
    _LOGGER.debug("Attempting to acquire lock %s on %s", lock_id, lock_filename)
Message: 'Attempting to acquire lock %s on %s'
Arguments: (140563492973792, '/home/v/.triton/autotune/Fp16Matmul_2d_kernel.pickle.lock')
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.10/logging/__init__.py", line 1103, in emit
    stream.write(msg + self.terminator)
ValueError: I/O operation on closed file.
Call stack:
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 444, in matmul_ext_update_autotune_table
    fp16_matmul._update_autotune_table()
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 421, in _update_autotune_table
    TritonMatmul._update_autotune_table(__class__.__name__ + "_2d_kernel", __class__._2d_kernel)
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 150, in _update_autotune_table
    cache_manager.put(autotune_table)
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 66, in put
    with FileLock(self.lock_path):
  File "/home/v/.local/lib/python3.10/site-packages/filelock/_api.py", line 262, in __enter__
    self.acquire()
  File "/home/v/.local/lib/python3.10/site-packages/filelock/_api.py", line 222, in acquire
    _LOGGER.debug("Lock %s acquired on %s", lock_id, lock_filename)
Message: 'Lock %s acquired on %s'
Arguments: (140563492973792, '/home/v/.triton/autotune/Fp16Matmul_2d_kernel.pickle.lock')
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.10/logging/__init__.py", line 1103, in emit
    stream.write(msg + self.terminator)
ValueError: I/O operation on closed file.
Call stack:
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 444, in matmul_ext_update_autotune_table
    fp16_matmul._update_autotune_table()
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 421, in _update_autotune_table
    TritonMatmul._update_autotune_table(__class__.__name__ + "_2d_kernel", __class__._2d_kernel)
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 150, in _update_autotune_table
    cache_manager.put(autotune_table)
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 66, in put
    with FileLock(self.lock_path):
  File "/home/v/.local/lib/python3.10/site-packages/filelock/_api.py", line 278, in __exit__
    self.release()
  File "/home/v/.local/lib/python3.10/site-packages/filelock/_api.py", line 251, in release
    _LOGGER.debug("Attempting to release lock %s on %s", lock_id, lock_filename)
Message: 'Attempting to release lock %s on %s'
Arguments: (140563492973792, '/home/v/.triton/autotune/Fp16Matmul_2d_kernel.pickle.lock')
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.10/logging/__init__.py", line 1103, in emit
    stream.write(msg + self.terminator)
ValueError: I/O operation on closed file.
Call stack:
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 444, in matmul_ext_update_autotune_table
    fp16_matmul._update_autotune_table()
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 421, in _update_autotune_table
    TritonMatmul._update_autotune_table(__class__.__name__ + "_2d_kernel", __class__._2d_kernel)
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 150, in _update_autotune_table
    cache_manager.put(autotune_table)
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 66, in put
    with FileLock(self.lock_path):
  File "/home/v/.local/lib/python3.10/site-packages/filelock/_api.py", line 278, in __exit__
    self.release()
  File "/home/v/.local/lib/python3.10/site-packages/filelock/_api.py", line 254, in release
    _LOGGER.debug("Lock %s released on %s", lock_id, lock_filename)
Message: 'Lock %s released on %s'
Arguments: (140563492973792, '/home/v/.triton/autotune/Fp16Matmul_2d_kernel.pickle.lock')
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.10/logging/__init__.py", line 1103, in emit
    stream.write(msg + self.terminator)
ValueError: I/O operation on closed file.
Call stack:
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 444, in matmul_ext_update_autotune_table
    fp16_matmul._update_autotune_table()
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 422, in _update_autotune_table
    TritonMatmul._update_autotune_table(__class__.__name__ + "_4d_kernel", __class__._4d_kernel)
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 150, in _update_autotune_table
    cache_manager.put(autotune_table)
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 66, in put
    with FileLock(self.lock_path):
  File "/home/v/.local/lib/python3.10/site-packages/filelock/_api.py", line 262, in __enter__
    self.acquire()
  File "/home/v/.local/lib/python3.10/site-packages/filelock/_api.py", line 219, in acquire
    _LOGGER.debug("Attempting to acquire lock %s on %s", lock_id, lock_filename)
Message: 'Attempting to acquire lock %s on %s'
Arguments: (140563492973792, '/home/v/.triton/autotune/Fp16Matmul_4d_kernel.pickle.lock')
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.10/logging/__init__.py", line 1103, in emit
    stream.write(msg + self.terminator)
ValueError: I/O operation on closed file.
Call stack:
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 444, in matmul_ext_update_autotune_table
    fp16_matmul._update_autotune_table()
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 422, in _update_autotune_table
    TritonMatmul._update_autotune_table(__class__.__name__ + "_4d_kernel", __class__._4d_kernel)
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 150, in _update_autotune_table
    cache_manager.put(autotune_table)
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 66, in put
    with FileLock(self.lock_path):
  File "/home/v/.local/lib/python3.10/site-packages/filelock/_api.py", line 262, in __enter__
    self.acquire()
  File "/home/v/.local/lib/python3.10/site-packages/filelock/_api.py", line 222, in acquire
    _LOGGER.debug("Lock %s acquired on %s", lock_id, lock_filename)
Message: 'Lock %s acquired on %s'
Arguments: (140563492973792, '/home/v/.triton/autotune/Fp16Matmul_4d_kernel.pickle.lock')
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.10/logging/__init__.py", line 1103, in emit
    stream.write(msg + self.terminator)
ValueError: I/O operation on closed file.
Call stack:
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 444, in matmul_ext_update_autotune_table
    fp16_matmul._update_autotune_table()
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 422, in _update_autotune_table
    TritonMatmul._update_autotune_table(__class__.__name__ + "_4d_kernel", __class__._4d_kernel)
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 150, in _update_autotune_table
    cache_manager.put(autotune_table)
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 66, in put
    with FileLock(self.lock_path):
  File "/home/v/.local/lib/python3.10/site-packages/filelock/_api.py", line 278, in __exit__
    self.release()
  File "/home/v/.local/lib/python3.10/site-packages/filelock/_api.py", line 251, in release
    _LOGGER.debug("Attempting to release lock %s on %s", lock_id, lock_filename)
Message: 'Attempting to release lock %s on %s'
Arguments: (140563492973792, '/home/v/.triton/autotune/Fp16Matmul_4d_kernel.pickle.lock')
--- Logging error ---
Traceback (most recent call last):
  File "/usr/lib/python3.10/logging/__init__.py", line 1103, in emit
    stream.write(msg + self.terminator)
ValueError: I/O operation on closed file.
Call stack:
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 444, in matmul_ext_update_autotune_table
    fp16_matmul._update_autotune_table()
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 422, in _update_autotune_table
    TritonMatmul._update_autotune_table(__class__.__name__ + "_4d_kernel", __class__._4d_kernel)
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 150, in _update_autotune_table
    cache_manager.put(autotune_table)
  File "/home/v/.local/lib/python3.10/site-packages/deepspeed/ops/transformer/inference/triton/matmul_ext.py", line 66, in put
    with FileLock(self.lock_path):
  File "/home/v/.local/lib/python3.10/site-packages/filelock/_api.py", line 278, in __exit__
    self.release()
  File "/home/v/.local/lib/python3.10/site-packages/filelock/_api.py", line 254, in release
    _LOGGER.debug("Lock %s released on %s", lock_id, lock_filename)
Message: 'Lock %s released on %s'
Arguments: (140563492973792, '/home/v/.triton/autotune/Fp16Matmul_4d_kernel.pickle.lock')

vyomakesh09 avatar Dec 25 '23 22:12 vyomakesh09

Hi @vyomakesh09 can you provide a script and instructions for how to reproduce this error? Thanks

mrwyattii avatar Jan 05 '24 22:01 mrwyattii

Thank you for reaching back but the issue was resolved

vyomakesh09 avatar Jan 06 '24 01:01 vyomakesh09

Hi, same issues, how you resolve this issue? @vyomakesh09

jiashu-zhu avatar Feb 02 '24 09:02 jiashu-zhu

just re-cloned my repo

vyomakesh09 avatar Feb 03 '24 04:02 vyomakesh09