Commit 1449c19
fix: Fix llava (#743)
## Summary
<!--- This is a required section; please describe the main purpose of
this proposed code change. --->
Resolve a part of #723
<!---
## Details
This is an optional section; is there anything specific that reviewers
should be aware of?
--->
## Testing Done
<!--- This is a required section; please describe how this change was
tested. --->
Convergence Test:
bf16/test_mini_models:
```
python -m pytest test/convergence/bf16/test_mini_models.py -k llava
===================================================================================== test session starts =====================================================================================
platform linux -- Python 3.10.14, pytest-8.3.5, pluggy-1.5.0
rootdir: /home/jobuser/Liger-Kernel
configfile: pyproject.toml
plugins: xdist-3.7.0, rerunfailures-15.1, anyio-4.9.0, lipy-config-base-32.9.0, lipy-fabric-36.1.5, lipy-test-9.1.34, datadir-1.6.1
collecting ...
------------------------------------------------------------------------------------- live log collection -------------------------------------------------------------------------------------
INFO datasets:config.py:54 PyTorch version 2.7.0 available.
collected 16 items / 15 deselected / 1 selected
test/convergence/bf16/test_mini_models.py::test_mini_model[mini_llava-32-0.0001-dtype1-0.001-0.01-0.1-0.01-0.01-0.01] PASSED [100%]
```
bf16/test_mini_models_multimodal:
```
python -m pytest test/convergence/bf16/test_mini_models_multimodal.py -k llava
===================================================================================== test session starts =====================================================================================
platform linux -- Python 3.10.14, pytest-8.3.5, pluggy-1.5.0
rootdir: /home/jobuser/Liger-Kernel
configfile: pyproject.toml
plugins: xdist-3.7.0, rerunfailures-15.1, anyio-4.9.0, lipy-config-base-32.9.0, lipy-fabric-36.1.5, lipy-test-9.1.34, datadir-1.6.1
collecting ...
------------------------------------------------------------------------------------- live log collection -------------------------------------------------------------------------------------
INFO datasets:config.py:54 PyTorch version 2.7.0 available.
collected 7 items / 6 deselected / 1 selected
test/convergence/bf16/test_mini_models_multimodal.py::test_mini_model_multimodal[mini_llava-32-0.0001-dtype1-0.001-0.01-0.1-0.01-0.01-0.01] PASSED
```
fp32/test_mini_models:
```
python -m pytest test/convergence/fp32/test_mini_models.py -k llava
===================================================================================== test session starts =====================================================================================
platform linux -- Python 3.10.14, pytest-8.3.5, pluggy-1.5.0
rootdir: /home/jobuser/Liger-Kernel
configfile: pyproject.toml
plugins: xdist-3.7.0, rerunfailures-15.1, anyio-4.9.0, lipy-config-base-32.9.0, lipy-fabric-36.1.5, lipy-test-9.1.34, datadir-1.6.1
collecting ...
------------------------------------------------------------------------------------- live log collection -------------------------------------------------------------------------------------
INFO datasets:config.py:54 PyTorch version 2.7.0 available.
collected 17 items / 16 deselected / 1 selected
test/convergence/fp32/test_mini_models.py::test_mini_model[mini_llava-32-0.0001-dtype1-1e-08-1e-05-0.005-1e-05-0.005-1e-05] PASSED [100%]
```
fp32/test_mini_models_multimodal:
```
python -m pytest test/convergence/fp32/test_mini_models_multimodal.py -k llava
===================================================================================== test session starts =====================================================================================
platform linux -- Python 3.10.14, pytest-8.3.5, pluggy-1.5.0
rootdir: /home/jobuser/Liger-Kernel
configfile: pyproject.toml
plugins: xdist-3.7.0, rerunfailures-15.1, anyio-4.9.0, lipy-config-base-32.9.0, lipy-fabric-36.1.5, lipy-test-9.1.34, datadir-1.6.1
collecting ...
------------------------------------------------------------------------------------- live log collection -------------------------------------------------------------------------------------
INFO datasets:config.py:54 PyTorch version 2.7.0 available.
collected 7 items / 6 deselected / 1 selected
test/convergence/fp32/test_mini_models_multimodal.py::test_mini_model_multimodal[mini_llava-32-0.0001-dtype1-1e-08-1e-05-0.005-1e-05-0.005-1e-05] PASSED [100%]
```
<!--
Replace BLANK with your device type. For example, A100-80G-PCIe
Complete the following tasks before sending your PR, and replace `[ ]`
with
`[x]` to indicate you have done them.
-->
- Hardware Type: <BLANK>
- [ ] run `make test` to ensure correctness
- [ ] run `make checkstyle` to ensure code style
- [ ] run `make test-convergence` to ensure convergence
---------
Co-authored-by: Shao Tang <[email protected]>
Co-authored-by: Vaibhav Jindal <[email protected]>1 parent ca04cad commit 1449c19
File tree
2 files changed
+87
-156
lines changed- src/liger_kernel/transformers
- model
2 files changed
+87
-156
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | | - | |
12 | 10 | | |
13 | 11 | | |
| 12 | + | |
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
| |||
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
| |||
36 | 40 | | |
37 | 41 | | |
38 | 42 | | |
39 | | - | |
40 | | - | |
| 43 | + | |
| 44 | + | |
41 | 45 | | |
42 | 46 | | |
| 47 | + | |
| 48 | + | |
43 | 49 | | |
44 | 50 | | |
45 | 51 | | |
| |||
65 | 71 | | |
66 | 72 | | |
67 | 73 | | |
68 | | - | |
69 | 74 | | |
70 | 75 | | |
71 | 76 | | |
| |||
89 | 94 | | |
90 | 95 | | |
91 | 96 | | |
92 | | - | |
93 | 97 | | |
94 | 98 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | | - | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
151 | 106 | | |
152 | | - | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
153 | 112 | | |
154 | 113 | | |
155 | 114 | | |
156 | | - | |
157 | | - | |
158 | | - | |
159 | 115 | | |
160 | 116 | | |
161 | 117 | | |
| |||
168 | 124 | | |
169 | 125 | | |
170 | 126 | | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
171 | 130 | | |
172 | 131 | | |
173 | 132 | | |
174 | 133 | | |
175 | 134 | | |
176 | 135 | | |
177 | | - | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
178 | 140 | | |
179 | 141 | | |
180 | 142 | | |
| |||
189 | 151 | | |
190 | 152 | | |
191 | 153 | | |
192 | | - | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
193 | 159 | | |
194 | 160 | | |
195 | 161 | | |
196 | | - | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
197 | 166 | | |
198 | | - | |
199 | | - | |
200 | | - | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
201 | 172 | | |
202 | | - | |
203 | | - | |
| 173 | + | |
| 174 | + | |
204 | 175 | | |
205 | 176 | | |
206 | | - | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
207 | 182 | | |
208 | 183 | | |
209 | 184 | | |
| |||
215 | 190 | | |
216 | 191 | | |
217 | 192 | | |
| 193 | + | |
218 | 194 | | |
219 | 195 | | |
220 | | - | |
221 | | - | |
222 | 196 | | |
223 | 197 | | |
224 | 198 | | |
| |||
292 | 266 | | |
293 | 267 | | |
294 | 268 | | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
326 | 272 | | |
327 | 273 | | |
328 | 274 | | |
329 | 275 | | |
| 276 | + | |
| 277 | + | |
330 | 278 | | |
331 | 279 | | |
332 | 280 | | |
333 | | - | |
| 281 | + | |
334 | 282 | | |
335 | | - | |
| 283 | + | |
336 | 284 | | |
337 | 285 | | |
338 | 286 | | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
339 | 290 | | |
340 | | - | |
| 291 | + | |
341 | 292 | | |
| 293 | + | |
342 | 294 | | |
343 | | - | |
344 | | - | |
| 295 | + | |
| 296 | + | |
345 | 297 | | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
359 | 301 | | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
365 | 310 | | |
| 311 | + | |
366 | 312 | | |
367 | | - | |
| 313 | + | |
368 | 314 | | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
384 | 318 | | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | 319 | | |
389 | 320 | | |
390 | | - | |
391 | | - | |
| 321 | + | |
392 | 322 | | |
393 | 323 | | |
394 | 324 | | |
| |||
397 | 327 | | |
398 | 328 | | |
399 | 329 | | |
400 | | - | |
| 330 | + | |
401 | 331 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
317 | | - | |
| 317 | + | |
318 | 318 | | |
| 319 | + | |
| 320 | + | |
319 | 321 | | |
320 | 322 | | |
321 | | - | |
| 323 | + | |
322 | 324 | | |
323 | | - | |
324 | 325 | | |
325 | 326 | | |
326 | 327 | | |
| |||
0 commit comments