diff --git a/deepnvme/file_access/aio_load_cpu_tensor.py b/deepnvme/file_access/aio_load_cpu_tensor.py index 3fdc624ed..c75d1ba7c 100644 --- a/deepnvme/file_access/aio_load_cpu_tensor.py +++ b/deepnvme/file_access/aio_load_cpu_tensor.py @@ -3,8 +3,8 @@ from deepspeed.ops.op_builder import AsyncIOBuilder from utils import parse_read_arguments, GIGA_UNIT -def file_read(inp_f, h, bounce_buffer): - h.sync_pread(bounce_buffer, inp_f) +def file_read(inp_f, handle, bounce_buffer): + handle.sync_pread(bounce_buffer, inp_f) return bounce_buffer.cpu() def main(): diff --git a/deepnvme/file_access/aio_load_gpu_tensor.py b/deepnvme/file_access/aio_load_gpu_tensor.py index adf67c4be..5720676a6 100644 --- a/deepnvme/file_access/aio_load_gpu_tensor.py +++ b/deepnvme/file_access/aio_load_gpu_tensor.py @@ -3,8 +3,8 @@ from deepspeed.ops.op_builder import AsyncIOBuilder from utils import parse_read_arguments, GIGA_UNIT -def file_read(inp_f, h, bounce_buffer): - h.sync_pread(bounce_buffer, inp_f) +def file_read(inp_f, handle, bounce_buffer): + handle.sync_pread(bounce_buffer, inp_f) return bounce_buffer.cuda() diff --git a/deepnvme/file_access/aio_store_cpu_tensor.py b/deepnvme/file_access/aio_store_cpu_tensor.py index 90d21e7c4..6f257e5a2 100644 --- a/deepnvme/file_access/aio_store_cpu_tensor.py +++ b/deepnvme/file_access/aio_store_cpu_tensor.py @@ -3,9 +3,9 @@ from deepspeed.ops.op_builder import AsyncIOBuilder from utils import parse_write_arguments, GIGA_UNIT -def file_write(out_f, t, h, bounce_buffer): - bounce_buffer.copy_(t) - h.sync_pwrite(bounce_buffer, out_f) +def file_write(out_f, tensor, handle, bounce_buffer): + bounce_buffer.copy_(tensor) + handle.sync_pwrite(bounce_buffer, out_f) def main(): args = parse_write_arguments() diff --git a/deepnvme/file_access/aio_store_gpu_tensor.py b/deepnvme/file_access/aio_store_gpu_tensor.py index d67ec4ff4..d00ee17c3 100644 --- a/deepnvme/file_access/aio_store_gpu_tensor.py +++ b/deepnvme/file_access/aio_store_gpu_tensor.py @@ -3,9 +3,9 @@ from deepspeed.ops.op_builder import AsyncIOBuilder from utils import parse_write_arguments, GIGA_UNIT -def file_write(out_f, t, h, bounce_buffer): - bounce_buffer.copy_(t) - h.sync_pwrite(bounce_buffer, out_f) +def file_write(out_f, tensor, handle, bounce_buffer): + bounce_buffer.copy_(tensor) + handle.sync_pwrite(bounce_buffer, out_f) def main(): args = parse_write_arguments() diff --git a/deepnvme/file_access/gds_load_gpu_tensor.py b/deepnvme/file_access/gds_load_gpu_tensor.py index 1fd440b75..a9220517f 100644 --- a/deepnvme/file_access/gds_load_gpu_tensor.py +++ b/deepnvme/file_access/gds_load_gpu_tensor.py @@ -3,8 +3,8 @@ from utils import parse_read_arguments, GIGA_UNIT from deepspeed.ops.op_builder import GDSBuilder -def file_read(inp_f, h, gpu_buffer): - h.sync_pread(gpu_buffer, inp_f) +def file_read(inp_f, handle, gpu_buffer): + handle.sync_pread(gpu_buffer, inp_f) return gpu_buffer.cuda() def main(): diff --git a/deepnvme/file_access/gds_store_gpu_tensor.py b/deepnvme/file_access/gds_store_gpu_tensor.py index e369e2237..0b1b9a542 100644 --- a/deepnvme/file_access/gds_store_gpu_tensor.py +++ b/deepnvme/file_access/gds_store_gpu_tensor.py @@ -3,9 +3,9 @@ from deepspeed.ops.op_builder import GDSBuilder from utils import parse_write_arguments, GIGA_UNIT -def file_write(out_f, t, h, gpu_buffer): - gpu_buffer.copy_(t) - h.sync_pwrite(gpu_buffer, out_f) +def file_write(out_f, tensor, handle, gpu_buffer): + gpu_buffer.copy_(tensor) + handle.sync_pwrite(gpu_buffer, out_f) def main(): args = parse_write_arguments() diff --git a/deepnvme/file_access/py_load_cpu_tensor.py b/deepnvme/file_access/py_load_cpu_tensor.py index 9270c31b4..0650848f0 100644 --- a/deepnvme/file_access/py_load_cpu_tensor.py +++ b/deepnvme/file_access/py_load_cpu_tensor.py @@ -4,8 +4,8 @@ def file_read(inp_f): with open(inp_f, 'rb') as f: - t = torch.frombuffer(f.read(), dtype=torch.uint8) - return t + tensor = torch.frombuffer(f.read(), dtype=torch.uint8) + return tensor def main(): args = parse_read_arguments() diff --git a/deepnvme/file_access/py_load_gpu_tensor.py b/deepnvme/file_access/py_load_gpu_tensor.py index 57eca16f6..976967dca 100644 --- a/deepnvme/file_access/py_load_gpu_tensor.py +++ b/deepnvme/file_access/py_load_gpu_tensor.py @@ -4,8 +4,8 @@ def file_read(inp_f): with open(inp_f, 'rb') as f: - t = torch.frombuffer(f.read(), dtype=torch.uint8) - return t.cuda() + tensor = torch.frombuffer(f.read(), dtype=torch.uint8) + return tensor.cuda() def main(): args = parse_read_arguments() diff --git a/deepnvme/file_access/py_store_cpu_tensor.py b/deepnvme/file_access/py_store_cpu_tensor.py index f6a0d6c88..50e477186 100644 --- a/deepnvme/file_access/py_store_cpu_tensor.py +++ b/deepnvme/file_access/py_store_cpu_tensor.py @@ -3,9 +3,9 @@ import pathlib from utils import parse_write_arguments, GIGA_UNIT -def file_write(out_f, t): +def file_write(out_f, tensor): with open(out_f, 'wb') as f: - f.write(t.numpy(force=True)) + f.write(tensor.numpy(force=True)) def main(): args = parse_write_arguments() diff --git a/deepnvme/file_access/py_store_gpu_tensor.py b/deepnvme/file_access/py_store_gpu_tensor.py index b0f6fa387..a64209a12 100644 --- a/deepnvme/file_access/py_store_gpu_tensor.py +++ b/deepnvme/file_access/py_store_gpu_tensor.py @@ -3,9 +3,9 @@ import pathlib from utils import parse_write_arguments, GIGA_UNIT -def file_write(out_f, t): +def file_write(out_f, tensor): with open(out_f, 'wb') as f: - f.write(t.numpy(force=True)) + f.write(tensor.numpy(force=True)) def main(): args = parse_write_arguments()