Commit a98786e
authored
[feat] Support lazy init when calling TQ API (Ascend#33)
Previously, when integrating TransferQueue (TQ) with VERL, `tq.init()`
is eagerly called to creat the global `_TRANSFER_QUEUE_CLIENT` variable
to enable subsequent operations like `tq.async_kv_batch_get()` to access
the TQ client instances easily.
However, this eager initialization caused Ray to be started and
initialized before VERL launches the training cluster with its runtime
environment. As a result, runtime environment configurations specified
by the VERL PPO trainer were ignored during Ray cluster initialization.
To avoid this issue, we now support lazy initialization: the TQ client
is instantiated on-demand upon the first invocation of a TQ API,
ensuring Ray is initialized only when VERL is fully prepared to
configure the cluster environment correctly.
---------
Signed-off-by: MissLittleFish <yhuang@smail.nju.edu.cn>1 parent ea8f7cf commit a98786e
1 file changed
Lines changed: 26 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
| |||
88 | 93 | | |
89 | 94 | | |
90 | 95 | | |
91 | | - | |
92 | | - | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
93 | 108 | | |
94 | | - | |
95 | 109 | | |
96 | 110 | | |
97 | 111 | | |
98 | 112 | | |
99 | | - | |
100 | | - | |
101 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
102 | 116 | | |
103 | | - | |
| 117 | + | |
104 | 118 | | |
105 | 119 | | |
106 | 120 | | |
107 | 121 | | |
| 122 | + | |
| 123 | + | |
108 | 124 | | |
109 | 125 | | |
110 | 126 | | |
| |||
138 | 154 | | |
139 | 155 | | |
140 | 156 | | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
| 157 | + | |
146 | 158 | | |
147 | 159 | | |
148 | 160 | | |
| 161 | + | |
149 | 162 | | |
150 | 163 | | |
151 | 164 | | |
| |||
0 commit comments