verl icon indicating copy to clipboard operation
verl copied to clipboard

How to print at only one worker???

Open 1benwu1 opened this issue 1 year ago • 4 comments

怎么样只print一次呢?调试的时候想看一下数据结构,但是每次都会所有worker一起print,太乱了 how to perform "print" on only one worker??? everytime try to print something to check out the data structure, all the ray workers start to print. SO MESSSSSSYYYYYYY!!! :(

1benwu1 avatar Jun 19 '25 07:06 1benwu1

You may try export RAY_DEDUP_LOGS=1 before running the experiment.

hiyuchang avatar Jun 19 '25 08:06 hiyuchang

If dedup does not work, I think you could do something like

if distributed.get_rank() == 0:
    # do something

Alternatively you could use Ray distributed debugger to look at the data during runtime.

arvyanh avatar Jun 20 '25 02:06 arvyanh

You may try export RAY_DEDUP_LOGS=1 before running the experiment. i tried but no good qwq perhaps i did sth wrong.. but thank u for ur kindness

1benwu1 avatar Jun 20 '25 03:06 1benwu1

If dedup does not work, I think you could do something like

if distributed.get_rank() == 0:
    # do something

Alternatively you could use Ray distributed debugger to look at the data during runtime.

it works!! really helpful

1benwu1 avatar Jun 20 '25 03:06 1benwu1