Skip to content

Commit

Permalink
caching fixes
Browse files Browse the repository at this point in the history
Signed-off-by: bamsumit <bam_sumit@hotmail.com>
  • Loading branch information
bamsumit committed Feb 22, 2024
1 parent 9ead6ec commit e223c0a
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lava/magma/compiler/compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,11 @@ def _compile_proc_groups(
for proc_name, pb in proc_builders_values.items():
proc = procname_to_proc_map[proc_name]
proc_builders[proc] = pb
pb.proc_params = proc.proc_params

channel_map.read_from_cache(cache_object, procname_to_proc_map)
print(f"\nBuilders and Channel Map loaded from " \
f"Cache {cache_dir}\n")
return proc_builders, channel_map

# Create the global ChannelMap that is passed between
Expand Down Expand Up @@ -286,10 +289,14 @@ def _compile_proc_groups(
f"Violation Name: {p.name=}"
raise Exception(msg)
procname_to_proc_builder[p.name] = pb
pb.proc_params = None
cache_object["procname_to_proc_builder"] = procname_to_proc_builder
channel_map.write_to_cache(cache_object, proc_to_procname_map)
with open(os.path.join(cache_dir, "cache"), "wb") as cache_file:
pickle.dump(cache_object, cache_file)
for p, pb in proc_builders.items():
pb.proc_params = p.proc_params
print(f"\nBuilders and Channel Map stored to Cache {cache_dir}\n")
return proc_builders, channel_map

@staticmethod
Expand Down

0 comments on commit e223c0a

Please sign in to comment.