Skip to content

Commit

Permalink
Comment explaining a decision (ggerganov#6531)
Browse files Browse the repository at this point in the history
  • Loading branch information
kunnis authored Apr 8, 2024
1 parent b73e564 commit cecd8d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ def type_for_tensor(self, name: str, tensor: LazyTensor) -> DataType:
dt = GGML_FILE_TYPE_TO_DATA_TYPE.get(self)
if dt is None:
raise ValueError(self)
# 1D tensors are always F32.
# Convert all 1D tensors to F32. Most of the codebase that takes in 1D tensors only handles F32 tensors, and most of the outputs tensors are F32.
# Also The 1d tensors aren't much of a performance/size issue. So instead of having to have separate F32 and F16 implementations of both, just convert everything to F32 for now.
return dt if len(tensor.shape) > 1 else DT_F32


Expand Down

0 comments on commit cecd8d3

Please sign in to comment.