-
-
Notifications
You must be signed in to change notification settings - Fork 780
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix pytorch 2.1.0 build, add multipack docs (#722)
- Loading branch information
Showing
3 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Multipack | ||
|
||
4k context, bsz =4, | ||
each character represents 256 tokens | ||
X represents a padding token | ||
|
||
``` | ||
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 | ||
[[ A A A A A A A A A A A ] | ||
B B B B B B ] | ||
C C C C C C C ] | ||
D D D D ]] | ||
[[ E E E E E E E E ] | ||
[ F F F F ] | ||
[ G G G ] | ||
[ H H H H ]] | ||
[[ I I I ] | ||
[ J J J ] | ||
[ K K K K K] | ||
[ L L L ]] | ||
``` | ||
|
||
after padding to longest input in each step | ||
``` | ||
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 | ||
[[ A A A A A A A A A A A ] | ||
B B B B B B X X X X X X ] | ||
C C C C C C C X X X X ] | ||
D D D D X X X X X X X ]] | ||
[[ E E E E E E E E ] | ||
[ F F F F X X X X ] | ||
[ G G G X X X X X ] | ||
[ H H H H X X X X ]] | ||
[[ I I I X X ] | ||
[ J J J X X ] | ||
[ K K K K K ] | ||
[ L L L X X ]] | ||
``` | ||
|
||
w packing ( note it's the same effective number of tokens per step, but a true bsz of 1) | ||
``` | ||
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 | ||
[[ A A A A A A A A A A A B B B B B | ||
B C C C C C C C D D D D E E E E | ||
E E E E F F F F F G G G H H H H | ||
I I I J J J J K K K K K L L L X ]] | ||
``` |