Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
538 changes: 538 additions & 0 deletions python/pypto/ir/op/block_ops.py

Large diffs are not rendered by default.

56 changes: 56 additions & 0 deletions python/pypto/language/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ def scalar_func(x: pl.Scalar[pl.FP32]) -> pl.Scalar[pl.FP32]:
from .op import tensor_ops as tensor
from .op.block_ops import (
abs,
addc,
addsc,
and_,
ands,
cmp,
cmps,
col_expand,
Expand All @@ -55,27 +59,51 @@ def scalar_func(x: pl.Scalar[pl.FP32]) -> pl.Scalar[pl.FP32]:
col_expand_sub,
create_tile,
expands,
gemv,
gemv_acc,
gemv_bias,
l0c_store,
load,
log,
lrelu,
matmul_acc,
matmul_bias,
max,
maxs,
min,
minimum,
mins,
move,
neg,
not_,
or_,
ors,
prelu,
recip,
relu,
rem,
rems,
row_expand,
row_expand_add,
row_expand_div,
row_expand_mul,
row_expand_sub,
row_min,
rsqrt,
sel,
sels,
shl,
shls,
shr,
shrs,
sqrt,
store,
subc,
subsc,
sum,
ub_copy,
xor,
xors,
)
from .op.tensor_ops import assemble, create_tensor, dim
from .op.unified_ops import (
Expand Down Expand Up @@ -170,13 +198,18 @@ def scalar_func(x: pl.Scalar[pl.FP32]) -> pl.Scalar[pl.FP32]:
"abs",
"relu",
"matmul_acc",
"matmul_bias",
"gemv",
"gemv_acc",
"gemv_bias",
"minimum",
"min",
"sum",
"max",
"cmp",
"cmps",
"row_min",
"row_expand",
"row_expand_add",
"row_expand_sub",
"row_expand_mul",
Expand All @@ -186,6 +219,29 @@ def scalar_func(x: pl.Scalar[pl.FP32]) -> pl.Scalar[pl.FP32]:
"col_expand_div",
"col_expand_sub",
"expands",
"rem",
"rems",
"and_",
"ands",
"or_",
"ors",
"xor",
"xors",
"shl",
"shls",
"shr",
"shrs",
"maxs",
"mins",
"prelu",
"not_",
"addc",
"subc",
"addsc",
"subsc",
"lrelu",
"sel",
"sels",
# Promoted tensor-only
"create_tensor",
"assemble",
Expand Down
56 changes: 56 additions & 0 deletions python/pypto/language/op/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
# Promoted block-only ops (accessible as pl.load, etc.)
from .block_ops import (
abs,
addc,
addsc,
and_,
ands,
cmp,
cmps,
col_expand,
Expand All @@ -34,27 +38,51 @@
col_expand_sub,
create_tile,
expands,
gemv,
gemv_acc,
gemv_bias,
l0c_store,
load,
log,
lrelu,
matmul_acc,
matmul_bias,
max,
maxs,
min,
minimum,
mins,
move,
neg,
not_,
or_,
ors,
prelu,
recip,
relu,
rem,
rems,
row_expand,
row_expand_add,
row_expand_div,
row_expand_mul,
row_expand_sub,
row_min,
rsqrt,
sel,
sels,
shl,
shls,
shr,
shrs,
sqrt,
store,
subc,
subsc,
sum,
ub_copy,
xor,
xors,
)

# Promoted tensor-only ops (accessible as pl.create_tensor, etc.)
Expand Down Expand Up @@ -112,10 +140,15 @@
"abs",
"relu",
"matmul_acc",
"matmul_bias",
"gemv",
"gemv_acc",
"gemv_bias",
"minimum",
"cmp",
"cmps",
"row_min",
"row_expand",
"row_expand_add",
"row_expand_sub",
"row_expand_mul",
Expand All @@ -125,6 +158,29 @@
"col_expand_div",
"col_expand_sub",
"expands",
"rem",
"rems",
"and_",
"ands",
"or_",
"ors",
"xor",
"xors",
"shl",
"shls",
"shr",
"shrs",
"maxs",
"mins",
"prelu",
"not_",
"addc",
"subc",
"addsc",
"subsc",
"lrelu",
"sel",
"sels",
# Promoted tensor-only
"create_tensor",
"assemble",
Expand Down
Loading