ray-project / ray

Ray is an AI compute engine. Ray consists of a core distributed runtime and a set of AI Libraries for accelerating ML workloads.
https://ray.io
Apache License 2.0
33.61k stars 5.71k forks source link

[Core] timeline doesn't show all infos. #28320

Open hellofinch opened 2 years ago

hellofinch commented 2 years ago

What happened + What you expected to happen

I try to use ray.timeline to follow the script. I want to how ray works. I review the coda about ray.get and ray.put and ray.remote. There is profiling in there. But when I run the script shown below, no events about them are shown. The timeline shows below. Some inter events show out which made me confused. I can't combinate them with my workflow. There are many blanks between events in the timeline. What are they? image

I hope the timeline contains the info about get, put, remote, and something about public API. And those inter events can combinate with my script. I hope the timeline can help me figure out what happened when the script is running.

Versions / Dependencies

ray 1.13.0 python 3.8.13 ubuntu 18.04

Reproduction script

import ray
import ray._private.profiling as profiling
import time
import os

os.environ['RAY_PROFILING']='1'

ray.init(num_cpus=1)

@ray.remote
def f(x):
    # with profiling.profile("compute", extra_data={'key': 'val'}):
    #     time.perf_counter()
    r=x*x
    return r
# with profiling.profile("remote", extra_data={'key': 'val'}):
for _ in range(5):
    future = f.remote(2.0)
    # with profiling.profile("get"):
    value = ray.get(future)
    print(value)
    y=ray.put('xxx')
    print(ray.get(y))
import time
time.sleep(1)
ray.timeline(filename="./ray_timeline.json")

Issue Severity

High: It blocks me from completing my task.

rkooo567 commented 1 year ago

We are planning to improve it in a couple of versions (likely around ray 2.4). If you have other feedback, please leave comments here!

scottsun94 commented 1 year ago

Keep it open for tracking