Commit cd99740
authored
[Fix] Lib with small
This PR fixes an issue introduced by #780, which broke our intended
behavior to make the cos/sin shape independent of the max sequence
length, so that no matter what max sequence length people use, they
can always use a same set of prebuilt weight and do not need to
clone different weight repositories. This intended behavior is broken
by #780.
However, it is true that the needs for larger max sequence length are
growing. Prior to #780, when the max sequence length is larger than
2048, the cached cos/sin do not work anymore and break. To be compatible
as much as possible, this PR changes the behavior to "taking the
maximum value of 2048 and the specified max sequence length when
building the model lib".
With this fix, when the maximum sequence length is smaller than 2048,
we are still able to use the prebuilt weights. And when it is larger
than 2048, we will only be able to use the weight converted along the
build.max_seq_len incompatible with prebuilt weight (#840)1 parent 8bd6918 commit cd99740
File tree
2 files changed
+7
-5
lines changed- mlc_llm
- relax_model
- transform
2 files changed
+7
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
577 | 577 | | |
578 | 578 | | |
579 | 579 | | |
580 | | - | |
| 580 | + | |
581 | 581 | | |
582 | 582 | | |
583 | | - | |
| 583 | + | |
584 | 584 | | |
585 | 585 | | |
586 | | - | |
| 586 | + | |
587 | 587 | | |
588 | 588 | | |
589 | 589 | | |
| |||
892 | 892 | | |
893 | 893 | | |
894 | 894 | | |
895 | | - | |
| 895 | + | |
896 | 896 | | |
897 | | - | |
| 897 | + | |
898 | 898 | | |
899 | 899 | | |
900 | 900 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
77 | 78 | | |
78 | 79 | | |
79 | 80 | | |
| 81 | + | |
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| |||
0 commit comments