Commit c04c345
[rollout,docs] fix: improve error message (volcengine#4682) and docstrings (volcengine#1345) (volcengine#4729)
## Summary
This PR contains two contributions:
### 1. Fix for Issue volcengine#4682 - Informative error message for
`generate_sequences`
- **Problem:** `vLLMAsyncRollout.generate_sequences()` raised a bare
`NotImplementedError`, leaving users confused when running generation
scripts
- **Root cause:** The vLLM SPMD (sync) mode was retired in PR volcengine#4411, but
the generation workflow (`main_generation.py`) still expects a
synchronous `generate_sequences()` method
- **Fix:** Added an informative error message explaining:
- Sync mode was retired in PR volcengine#4411
- Users should use the async server interface (`vLLMReplica`,
`AsyncLLMServerManager`)
- Alternative: use `HFRollout` for synchronous generation
- Links to issue volcengine#4682 for details
- Also updated `generation.yaml` config comments to document the
limitation
### 2. Documentation improvement for Issue volcengine#1345 - Google-style
docstrings in `device.py`
Standardized all function docstrings in `verl/utils/device.py` to follow
Google-style documentation format:
- `is_torch_npu_available()`: Added detailed description and return type
- `get_visible_devices_keyword()`: Clarified purpose and return values
- `get_device_name()`: Improved description of supported devices
- `get_torch_device()`: Documented fallback behavior
- `get_device_id()`: Concise description with example
- `get_nccl_backend()`: Explained HCCL vs NCCL selection
- `set_expandable_segments()`: Added OOM context and Note section
- `auto_set_ascend_device_name()`: Documented NPU auto-configuration
- `get_device_capability()`: Added proper type hints and description
## Test plan
- [x] Python syntax verification passed for all modified files
- [ ] CI tests should pass (no functional changes, only error messages
and docstrings)
Fixes volcengine#4682
Contributes to volcengine#1345
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: yurekami <[email protected]>
Co-authored-by: Claude Opus 4.5 <[email protected]>1 parent da4e43a commit c04c345
File tree
3 files changed
+89
-20
lines changed- verl
- trainer/config
- utils
- workers/rollout/vllm_rollout
3 files changed
+89
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
20 | 24 | | |
21 | 25 | | |
22 | 26 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
20 | 27 | | |
21 | 28 | | |
22 | 29 | | |
| |||
30 | 37 | | |
31 | 38 | | |
32 | 39 | | |
33 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
34 | 45 | | |
35 | | - | |
| 46 | + | |
| 47 | + | |
36 | 48 | | |
37 | 49 | | |
38 | 50 | | |
39 | 51 | | |
40 | 52 | | |
41 | | - | |
42 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
43 | 58 | | |
44 | | - | |
| 59 | + | |
45 | 60 | | |
46 | 61 | | |
47 | 62 | | |
| |||
52 | 67 | | |
53 | 68 | | |
54 | 69 | | |
55 | | - | |
56 | | - | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
57 | 77 | | |
58 | | - | |
| 78 | + | |
59 | 79 | | |
60 | 80 | | |
61 | 81 | | |
| |||
66 | 86 | | |
67 | 87 | | |
68 | 88 | | |
69 | | - | |
| 89 | + | |
| 90 | + | |
70 | 91 | | |
71 | | - | |
| 92 | + | |
72 | 93 | | |
73 | 94 | | |
74 | 95 | | |
75 | 96 | | |
76 | 97 | | |
77 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
78 | 103 | | |
79 | | - | |
| 104 | + | |
80 | 105 | | |
81 | 106 | | |
82 | 107 | | |
| |||
86 | 111 | | |
87 | 112 | | |
88 | 113 | | |
89 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
90 | 120 | | |
91 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
92 | 125 | | |
93 | 126 | | |
94 | 127 | | |
95 | 128 | | |
96 | 129 | | |
97 | | - | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
98 | 140 | | |
99 | 141 | | |
100 | 142 | | |
| |||
106 | 148 | | |
107 | 149 | | |
108 | 150 | | |
109 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
110 | 161 | | |
111 | 162 | | |
112 | 163 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
270 | 270 | | |
271 | 271 | | |
272 | 272 | | |
273 | | - | |
274 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
275 | 289 | | |
276 | 290 | | |
277 | 291 | | |
| |||
0 commit comments