Skip to content

Commit

Permalink
[dicp][ascend] bug fix for llama finetune (#626)
Browse files Browse the repository at this point in the history
  • Loading branch information
tangzhiyi11 authored Jan 14, 2024
1 parent b77713f commit 6b76f2e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions dicp/dicp/vendor/AscendGraph/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,11 @@ def binary_cmp_cast_input(self, x, y):
y = self.get_param_proxy(y, const_dtype, y_shape)
if x_dtype == torch.float16:
y = self.get_proxy(ascend_op.Cast, (y, "FLOAT16"))
else:
x_dtype = x.node.meta["val"].dtype
y_dtype = y.node.meta["val"].dtype
if x_dtype != y_dtype:
y = self.get_proxy(ascend_op.Cast, (y, get_ascend_dtype(x_dtype)))
return x, y

def shape_prod(self, shape):
Expand Down

0 comments on commit 6b76f2e

Please sign in to comment.