Skip to content

Commit

Permalink
Revert "[DICP]add ge/logical_or/repeat/tril for ascendgraph" (#659)
Browse files Browse the repository at this point in the history
  • Loading branch information
jinminxi104 authored Jan 22, 2024
1 parent 2d67a4d commit fcd6919
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 189 deletions.
15 changes: 0 additions & 15 deletions dicp/dicp/vendor/AscendGraph/ascend_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -909,21 +909,6 @@ def __init__(self):
super().__init__("PadV3")


class LogicalOr(Operator):
def __init__(self):
super().__init__("LogicalOr")


class Tril(Operator):
def __init__(self):
super().__init__("Tril")


class Tile(Operator):
def __init__(self):
super().__init__("Tile")


def ret_triple(a, b, c) -> Tuple[torch.Tensor, torch.Tensor, torch.Tensor]:
return a, b, c

Expand Down
21 changes: 0 additions & 21 deletions dicp/dicp/vendor/AscendGraph/codegen/ascend.py
Original file line number Diff line number Diff line change
Expand Up @@ -1531,24 +1531,3 @@ def GatherElements(name, x, index, dim):
op.set_input("index", index)
op.set_attr_int("dim", dim)
return op.to_node()

@staticmethod
def Tril(name, x, diagonal=0):
op = OP(name, "Tril")
op.set_input("x", x)
op.set_attr_int("diagonal", diagonal)
return op.to_node()

@staticmethod
def Tile(name, x, repeats):
op = OP(name, "Tile")
op.set_input("x", x)
op.set_input("multiples", repeats)
return op.to_node()

@staticmethod
def LogicalOr(name, x, y):
op = OP(name, "LogicalOr")
op.set_input("x1", x)
op.set_input("x2", y)
return op.to_node()
22 changes: 0 additions & 22 deletions dicp/dicp/vendor/AscendGraph/conversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -1268,25 +1268,3 @@ def NativeDropoutBackward(self, grad_output, mask, scale):
p = 1. - scale
prob_op = self.get_const_proxy(float(p), dtype)
return self.get_proxy(ascend_op.DropOutDoMaskV3, (grad_output, mask, prob_op))

@register_conversion(torch.ops.aten.tril.default)
def Tril(self, x, diagonal=0):
return self.get_proxy(ascend_op.Tril, (x, diagonal))

@register_conversion(torch.ops.aten.repeat.default)
def Repeat(self, x, repeats):
if not isinstance(repeats, torch.fx.proxy.Proxy):
assert isinstance(repeats, list)
repeats = self.get_const_proxy(repeats, torch.int32)
return self.get_proxy(ascend_op.Tile, (x, repeats))

@register_conversion([torch.ops.aten.ge.Scalar, torch.ops.aten.ge.Tensor])
def Ge(self, x, y):
if not isinstance(y, torch.fx.proxy.Proxy):
dtype = x.node.meta['val'].dtype
y = self.get_const_proxy(y, dtype)
return self.get_proxy(ascend_op.GreaterEqual, (x, y))

@register_conversion(torch.ops.aten.logical_or.default)
def LogicalOr(self, x, y):
return self.get_proxy(ascend_op.LogicalOr, (x, y))
4 changes: 0 additions & 4 deletions dicp/test/ascend_scripts/ops/static.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,11 @@ python_files =
test_full_like.py
; test_full.py
test_gather.py
test_ge.py
test_getitem.py
test_index.py
test_le.py
; test_lift_fresh_copy.py
; test_log.py
test_logical_or.py
test_lt.py
test_masked_fill.py
; test_max_pool2d_with_indices.py
Expand All @@ -49,7 +47,6 @@ python_files =
; test_permute.py
test_pow.py
test_relu.py
test_repeat.py
test_rsqrt.py
test_scatter.py
test_select.py
Expand All @@ -60,7 +57,6 @@ python_files =
test_sub.py
test_sum.py
; test_transpose.py
test_tril.py
test_unsqueeze.py
test_view_as_complex.py
test_view_as_real.py
Expand Down
44 changes: 0 additions & 44 deletions dicp/test/op/test_ge.py

This file was deleted.

41 changes: 0 additions & 41 deletions dicp/test/op/test_logical_or.py

This file was deleted.

42 changes: 0 additions & 42 deletions dicp/test/op/test_tril.py

This file was deleted.

0 comments on commit fcd6919

Please sign in to comment.