Commit 9f86f27
🚀 Scaling GRPO to 70B+ Models and Multi-Node Training with vLLM Server & NCCL Communication (huggingface#3094)
* 🚀allow GRPO to connect to VLLM in remote/local node with NCCL communication
* Update trl/extras/remote_vllm_helper.py
Co-authored-by: Kashif Rasul <[email protected]>
* use argparse for options
* add imports for remote vllm helper
* formatting
* fix arguments
* use cli options
* vllm serve
* clean server
* better naming
* client
* style
* new params in generate
* this method is the new default
* update config
* do not use asserts
* update config
* separate host and post
* proper deprectation
* deprecated arg in the vllm server
* simplify moving
* document host and port
* style
* update trainer
* new generate args
* update doc
* Fix for zero3
* Better naming
* Remove remote_vllm_helper
* remove grpo_with_remote_vllm
* remove cloudpickle from deps
* Some consistency
* Update docs/source/grpo_trainer.md
Co-authored-by: lewtun <[email protected]>
* Update setup.py
Co-authored-by: lewtun <[email protected]>
* add revision argument to vllm server
* Update docs/source/grpo_trainer.md
Co-authored-by: lewtun <[email protected]>
* Update docs/source/grpo_trainer.md
Co-authored-by: lewtun <[email protected]>
* Reset the prefix cache after updating weights
* Update vllm_client.py
* Update vllm_client.py
* Update vllm_serve.py
* Add health check endpoint to vLLM server
* connection timeout
* style
* fix doc langauge hint
* move reset_prefix_cache to its own endpoint
* async
* merge peft adaptor to send to vllm
* Looks simple. Wasn't.
* Peft compatibility
* Update docs/source/speeding_up_training.md
Co-authored-by: lewtun <[email protected]>
* Update docs/source/speeding_up_training.md
Co-authored-by: lewtun <[email protected]>
* Update trl/extras/vllm_client.py
Co-authored-by: lewtun <[email protected]>
* GatheredParameters can be disabled
* gather and ungather peft weights within the same deepseed context
* use is_vllm_available
* minor consistency fixes
* fix error when deepspeed is not installed
* fix deepspeed import when not peft
* simpler
* multinode doc
* minor code and comments changes
* style
* optional deps
* vllm_server_timeout as arg
* small refinement in doc
* update deps
* Fix VLLMClient argument in grpo_trainer; Add zero3+peft vllm transfer solution
* Revert "Fix VLLMClient argument in grpo_trainer; Add zero3+peft vllm transfer solution"
This reverts commit d759c9c.
* log num_tokens
* disable vllm test (in the future we'll add a mock for vllm server for them)
* style
* fix ds3_gather_for_generation
---------
Co-authored-by: Kashif Rasul <[email protected]>
Co-authored-by: Quentin Gallouédec <[email protected]>
Co-authored-by: Quentin Gallouédec <[email protected]>
Co-authored-by: lewtun <[email protected]>1 parent fd79ea2 commit 9f86f27
File tree
10 files changed
+1067
-233
lines changed- docs/source
- tests
- trl
- extras
- scripts
- trainer
10 files changed
+1067
-233
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
92 | | - | |
| 92 | + | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
112 | 112 | | |
113 | 113 | | |
114 | 114 | | |
115 | | - | |
| 115 | + | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
118 | 130 | | |
119 | 131 | | |
120 | 132 | | |
121 | 133 | | |
122 | 134 | | |
123 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
124 | 148 | | |
125 | | - | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
126 | 212 | | |
127 | 213 | | |
128 | 214 | | |
| |||
247 | 333 | | |
248 | 334 | | |
249 | 335 | | |
250 | | - | |
| 336 | + | |
251 | 337 | | |
252 | 338 | | |
253 | 339 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
46 | 52 | | |
47 | 53 | | |
48 | | - | |
| 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 | + | |
49 | 85 | | |
50 | 86 | | |
51 | 87 | | |
52 | | - | |
| 88 | + | |
53 | 89 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
58 | 94 | | |
59 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
60 | 99 | | |
61 | 100 | | |
62 | 101 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | 102 | | |
74 | 103 | | |
75 | 104 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | | - | |
| 94 | + | |
96 | 95 | | |
97 | 96 | | |
98 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| |||
631 | 631 | | |
632 | 632 | | |
633 | 633 | | |
634 | | - | |
| 634 | + | |
635 | 635 | | |
636 | 636 | | |
637 | 637 | | |
| |||
645 | 645 | | |
646 | 646 | | |
647 | 647 | | |
648 | | - | |
649 | | - | |
650 | 648 | | |
651 | 649 | | |
652 | 650 | | |
| |||
761 | 759 | | |
762 | 760 | | |
763 | 761 | | |
764 | | - | |
| 762 | + | |
765 | 763 | | |
766 | 764 | | |
767 | 765 | | |
| |||
778 | 776 | | |
779 | 777 | | |
780 | 778 | | |
781 | | - | |
782 | | - | |
783 | 779 | | |
784 | 780 | | |
785 | 781 | | |
| |||
810 | 806 | | |
811 | 807 | | |
812 | 808 | | |
813 | | - | |
| 809 | + | |
814 | 810 | | |
815 | 811 | | |
816 | 812 | | |
| |||
824 | 820 | | |
825 | 821 | | |
826 | 822 | | |
827 | | - | |
828 | | - | |
829 | 823 | | |
830 | 824 | | |
831 | 825 | | |
| |||
883 | 877 | | |
884 | 878 | | |
885 | 879 | | |
886 | | - | |
| 880 | + | |
887 | 881 | | |
888 | 882 | | |
889 | 883 | | |
| |||
897 | 891 | | |
898 | 892 | | |
899 | 893 | | |
900 | | - | |
901 | | - | |
902 | 894 | | |
903 | 895 | | |
904 | 896 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
28 | 30 | | |
29 | 31 | | |
30 | 32 | | |
| |||
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
| 45 | + | |
43 | 46 | | |
44 | 47 | | |
45 | 48 | | |
| |||
87 | 90 | | |
88 | 91 | | |
89 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
90 | 97 | | |
91 | 98 | | |
92 | 99 | | |
0 commit comments