Skip to content

We double simplify the Plan.readable_plan object, making the plan quite large #2412

@iamtrask

Description

@iamtrask

Describe the bug
At present, when we serialize a plan, we simplify the .readable_plan object, which has already been simplified. This leads to a much larger serialization than is necessary. We should modify the simplifier for plans to simply take the readable_plan object as is.

To Reproduce

@sy.func2plan()
def plan_double_abs(x):
    x = x + x
    x = torch.abs(x)
    return x

plan_double_abs.build(torch.tensor([1., -2.]))

print("This plan is clearly already simplified...")

print(plan_double_abs.readable_plan)

print("...which we can verify by detailing it...")

print(sy.serde._detail(sy.local_worker, plan_double_abs.readable_plan[0]))

print("and when we simplify again (as the serializer does, it gets HUGE")

print(sy.serde._simplify(plan_double_abs))

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good first issue 🎓Perfect for beginners, welcome to OpenMined!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions