Skip to content

Commit 1565cf7

Browse files
superbobryGoogle-ML-Automation
authored andcommitted
[sc] Removed usages of "sc.persistent" in SparseCore kernels
The compiler does not need this attribute and can infer whether an argument is "persistent" by looking at buffer/window memory spaces. PiperOrigin-RevId: 903240164
1 parent cff7f1c commit 1565cf7

1 file changed

Lines changed: 0 additions & 9 deletions

File tree

src/maxtext/kernels/gather_reduce_sc.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1560,13 +1560,6 @@ def kernel_main(
15601560
ir.Attribute.parse("#tpu.dimension_semantics<parallel>"),
15611561
]
15621562
)
1563-
args_attributes = [
1564-
ir.DictAttr.get({}), # i
1565-
ir.DictAttr.get({}), # j
1566-
ir.DictAttr.get({"sc.persistent": ir.UnitAttr.get()}), # idx
1567-
ir.DictAttr.get({"sc.persistent": ir.UnitAttr.get()}), # op
1568-
ir.DictAttr.get({"sc.persistent": ir.UnitAttr.get()}), # out
1569-
]
15701563
window_params = [
15711564
ir.DictAttr.get(
15721565
{
@@ -1588,7 +1581,6 @@ def kernel_main(
15881581
if topk_weights is not None:
15891582
# Insert weights before output - we append here because it's the same
15901583
# attribute as output.
1591-
args_attributes.append(ir.DictAttr.get({"sc.persistent": ir.UnitAttr.get()}))
15921584
window_params.append(
15931585
ir.DictAttr.get(
15941586
{
@@ -1598,7 +1590,6 @@ def kernel_main(
15981590
)
15991591

16001592
f.attributes["window_params"] = ir.ArrayAttr.get(window_params)
1601-
f.arg_attrs = args_attributes
16021593
f.attributes["tpu.core_type"] = ir.Attribute.parse("#tpu.core_type<sc_vector_subcore>")
16031594
assert f.verify(), f
16041595
m = ir.Module.create()

0 commit comments

Comments
 (0)