Skip to content

Commit c7c0183

Browse files
authored
Use unsigned int to save memories
1 parent fa5e448 commit c7c0183

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

flame/data.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,12 @@ def __init__(
4040
self.world_size = world_size
4141
self.buffer_size = buffer_size
4242

43-
if tokenizer.vocab_size < torch.iinfo(torch.int16).max:
44-
self.dtype = torch.int16
45-
elif tokenizer.vocab_size < torch.iinfo(torch.int32).max:
46-
self.dtype = torch.int32
43+
if tokenizer.vocab_size < torch.iinfo(torch.uint16).max:
44+
self.dtype = torch.uint16
45+
elif tokenizer.vocab_size < torch.iinfo(torch.uint32).max:
46+
self.dtype = torch.uint32
4747
else:
48-
self.dtype = torch.int64
48+
self.dtype = torch.uint64
4949
self.states = None
5050
self.buffer = torch.tensor([], dtype=self.dtype)
5151
self.tokens = []

0 commit comments

Comments
 (0)