Skip to content

Commit

Permalink
Address renaming feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
tjruwase committed Aug 13, 2024
1 parent fd6086f commit 31b62e8
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 23 deletions.
4 changes: 2 additions & 2 deletions deepnvme/file_access/aio_load_cpu_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
4 changes: 2 additions & 2 deletions deepnvme/file_access/aio_load_gpu_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()


Expand Down
6 changes: 3 additions & 3 deletions deepnvme/file_access/aio_store_cpu_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
6 changes: 3 additions & 3 deletions deepnvme/file_access/aio_store_gpu_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions deepnvme/file_access/gds_load_gpu_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
6 changes: 3 additions & 3 deletions deepnvme/file_access/gds_store_gpu_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions deepnvme/file_access/py_load_cpu_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions deepnvme/file_access/py_load_gpu_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions deepnvme/file_access/py_store_cpu_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions deepnvme/file_access/py_store_gpu_tensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 31b62e8

Please sign in to comment.