Skip to content

Commit

Permalink
Merge branch 'main' into dace-fieldview-transformations
Browse files Browse the repository at this point in the history
  • Loading branch information
philip-paul-mueller authored Sep 5, 2024
2 parents a0866a7 + 20082e9 commit 71c6681
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 11 additions & 3 deletions src/gt4py/cartesian/gtc/dace/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,17 @@ def to_json(self, obj):

@classmethod
def from_json(cls, d, sdfg=None):
b64string = d["pickle"]
byte_repr = base64.b64decode(b64string)
return pickle.loads(byte_repr)
# DaCe won't serialize attr with default values by default
# which would lead the deserializer to push a default in the
# wrong format (non pickle).
# Best mitigation is to give back the object plain if it does
# not contain any pickling information
if isinstance(d, dict) and "pickle" in d.keys():
b64string = d["pickle"]
byte_repr = base64.b64decode(b64string)
return pickle.loads(byte_repr)

return d


class PickledDataclassProperty(PickledProperty, dace.properties.DataclassProperty):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,6 @@ def dace_env():
dace.config.Config.set("compiler", "cpu", "args", value="")
dace.config.Config.set("compiler", "allow_view_arguments", value=True)
dace.config.Config.set("default_build_folder", value=str(gt_cache_path))
# Need to serialize `StencilComputation` library nodes because they contain OIR for `VerticalLoop`
dace.config.Config.set("testing", "serialize_all_fields", value=True)
yield


Expand Down

0 comments on commit 71c6681

Please sign in to comment.