Browse Source

Make example name less confusing

tags/0.3.8-rc
haixuanTao 1 year ago
parent
commit
b6a278b785
4 changed files with 6 additions and 8 deletions
  1. +2
    -2
      examples/cuda-benchmark/cpu_bench.yml
  2. +2
    -2
      examples/cuda-benchmark/cuda_bench.yml
  3. +1
    -2
      examples/cuda-benchmark/receiver.py
  4. +1
    -2
      examples/cuda-benchmark/sender.py

+ 2
- 2
examples/cuda-benchmark/cpu_bench.yml View File

@@ -4,11 +4,11 @@ nodes:
next: node_2/next
outputs:
- latency
path: cuda_sender.py
path: sender.py
env:
DEVICE: cpu
- id: node_2
path: cuda_receiver.py
path: receiver.py
inputs:
next: node_1/latency
outputs:


+ 2
- 2
examples/cuda-benchmark/cuda_bench.yml View File

@@ -4,9 +4,9 @@ nodes:
next: node_2/next
outputs:
- latency
path: cuda_sender.py
path: sender.py
- id: node_2
path: cuda_receiver.py
path: receiver.py
inputs:
next: node_1/latency
outputs:


examples/cuda-benchmark/cuda_receiver.py → examples/cuda-benchmark/receiver.py View File

@@ -46,12 +46,10 @@ while True:
ipc_handle = ipc_buffer_to_ipc_handle(event["value"])
cudabuffer = ctx.open_ipc_buffer(ipc_handle)
torch_tensor = cudabuffer_to_torch(cudabuffer, event["metadata"]) # on cuda
print(torch_tensor[0])
else:
break
t_received = time.perf_counter_ns()
length = len(torch_tensor) * 8
pbar.update(1)

if length != current_size:
if n > 0:
@@ -64,6 +62,7 @@ while True:
start = time.perf_counter_ns()
latencies = []

pbar.update(1)
latencies.append((t_received - t_send) / 1000)
node.send_output("next", pa.array([]))


examples/cuda-benchmark/cuda_sender.py → examples/cuda-benchmark/sender.py View File

@@ -11,7 +11,7 @@ import torch

torch.tensor([], device="cuda")

SIZES = [512, 10 * 512, 100 * 512, 1000 * 512, 10000 * 512]
SIZES = [10000 * 512]

DEVICE = os.getenv("DEVICE", "cuda")

@@ -43,4 +43,3 @@ for size in SIZES:

# Wait before sending next output
node.next()
time.sleep(0.1)

Loading…
Cancel
Save