Commit 0077f3e
authored
[ci] feat: Add CI for checking irregular device api usage (#2089)
### Checklist Before Starting
- [x] Searched for similar PR(s).
- [x] Checked PR Title format
- In format of: [modules] type: Title
- modules are in `fsdp, megatron, sglang, vllm, rollout, trainer, ci,
training_utils, recipe, hardware, deployment, ray, worker,
single_controller, misc, perf, model, algo, env, tool, ckpt, doc, data`
- type is in `feat, fix, refactor, chore, test`
- can involve multiple modules, seperated by `,` or space, like
`[megatron, fsdp, doc] feat: xxx`
### What does this PR do?
Add CI for checking irregular device api usage, suggest using api in
`verl/utils/device.py` to get device name or object.
Besides, this CI test case is friendly for non-linux system (e.g.
windows), which is easier to debug and find out the problem.
### Test
Not related.
### High-Level Design
Not related.
### Specific Changes
Add a new CI test case for checking irregular device api usage, suggest
using api in `verl/utils/device.py`.
### API
Not related.
### Usage Example
```shell
python tests\special_sanity\check_device_api_usage.py --directory ./recipe`
[CHECK] File D:\workspace\verl\recipe\char_count\create_dataset.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\char_count\reward_function.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\dapo\dapo_ray_trainer.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\dapo\main_dapo.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\prime\main_prime.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\prime\prime_core_algos.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\prime\prime_dp_rm.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\prime\prime_fsdp_workers.py is detected for device api usage check, check result: success.
[SKIP] File D:\workspace\verl\recipe\prime\prime_ray_trainer.py is in device api usage check whitelist, checking is skipped.
[CHECK] File D:\workspace\verl\recipe\prime\__init__.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\r1\data_process.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\r1\main_eval.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\r1\reward_score.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\r1\__init__.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\r1\tasks\gpqa.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\r1\tasks\livecodebench.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\r1\tasks\math.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\r1\tasks\__init__.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\retool\retool_multi_turn_sft_preprocess.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\spin\core_algos.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\spin\dp_actor.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\spin\fsdp_workers.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\spin\main_spin.py is detected for device api usage check, check result: success.
[SKIP] File D:\workspace\verl\recipe\spin\spin_trainer.py is in device api usage check whitelist, checking is skipped.
[CHECK] File D:\workspace\verl\recipe\sppo\dp_actor.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\sppo\main_sppo.py is detected for device api usage check, check result: success.
[SKIP] File D:\workspace\verl\recipe\sppo\sppo_ray_trainer.py is in device api usage check whitelist, checking is skipped.
[CHECK] File D:\workspace\verl\recipe\sppo\sppo_worker.py is detected for device api usage check, check result: success.
[CHECK] File D:\workspace\verl\recipe\sppo\__init__.py is detected for device api usage check, check result: success.
```
### Checklist Before Submitting
- [x] Read the [Contribute
Guide](https://github.com/volcengine/verl?tab=readme-ov-file#contribution-guide).
- [x] Apply [pre-commit
checks](https://github.com/volcengine/verl?tab=readme-ov-file#code-linting-and-formatting).
- [x] Add `[BREAKING]` to the PR title `description` if it breaks any
API.
- [x] Update the documentation about your changes in the
[docs](https://github.com/volcengine/verl/tree/main/docs).
- [x] New CI unit test(s) are added to cover the code path.
- [x] Rely on existing unit tests on CI that covers the code path.1 parent a44b83c commit 0077f3e
File tree
5 files changed
+105
-22
lines changed- .github/workflows
- tests/special_sanity
- verl
- utils/checkpoint
- workers/rollout/vllm_rollout
5 files changed
+105
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
| 172 | + | |
| 173 | + | |
176 | 174 | | |
177 | 175 | | |
178 | 176 | | |
| |||
182 | 180 | | |
183 | 181 | | |
184 | 182 | | |
185 | | - | |
186 | | - | |
187 | | - | |
188 | | - | |
| 183 | + | |
| 184 | + | |
189 | 185 | | |
190 | 186 | | |
191 | 187 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 114 | + | |
| 115 | + | |
118 | 116 | | |
119 | 117 | | |
120 | 118 | | |
| |||
203 | 201 | | |
204 | 202 | | |
205 | 203 | | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
| 204 | + | |
| 205 | + | |
210 | 206 | | |
211 | 207 | | |
212 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | 32 | | |
37 | 33 | | |
38 | 34 | | |
| |||
0 commit comments