Skip to content

add dynamic in scalesim#159

Open
Mikemy666 wants to merge 3 commits intoscalesim-project:mainfrom
Mikemy666:clean
Open

add dynamic in scalesim#159
Mikemy666 wants to merge 3 commits intoscalesim-project:mainfrom
Mikemy666:clean

Conversation

@Mikemy666
Copy link

No description provided.

Copilot AI review requested due to automatic review settings March 16, 2026 09:55
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an optional “dynamic IFMAP/FILTER SRAM bank allocation” mode to Scale-Sim’s memory system, exposing the toggle via config and surfacing the final bank split in the compute report output.

Changes:

  • Add EnableDynamic config knob and plumb it into the memory system setup.
  • Implement dynamic bank assignment logic in double_buffered_scratchpad_mem and runtime bank-topology updates in read_buffer.
  • Extend compute reporting to include final IFMAP/FILTER bank allocation (CSV header + per-layer item).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
scalesim/single_layer_sim.py Passes dynamic-allocation enable flag into memory system; records final bank split for reporting.
scalesim/simulator.py Updates compute report CSV header to include final bank allocation column.
scalesim/scale_config.py Adds EnableDynamic parsing/writing and a getter to expose the feature toggle.
scalesim/memory/read_buffer.py Adds runtime-updatable bank topology and adjusts bank-id handling for layout conflict modeling.
scalesim/memory/double_buffered_scratchpad_mem.py Implements the dynamic bank allocator and applies topology changes during request servicing.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -140,6 +140,33 @@ def reset(self): # TODO: check if all resets are working propoerly
self.hashed_buffer_valid = False
self.trace_valid = False
self.use_ramulator_trace = False
# In (contiguous mapping), such multi-bank mapping would result in more bank conflict slowdown.
bank_id = column_addr // self.bw_per_bank
bank_id = min(bank_id, self.num_bank - 1)
assert bank_id < self.num_bank, f"bank id = {bank_id} for column_addr = {column_addr} needs to be smaller than total number of bank = {self.num_bank}"
Comment on lines +274 to +283
if len(self.dynamic_unassigned_banks) == 0:
return False

bank_id = self.dynamic_unassigned_banks.pop(0)
if assign_to_ifmap:
self.dynamic_ifmap_banks.add(bank_id)
else:
self.dynamic_filter_banks.add(bank_id)

self._apply_dynamic_bank_topology()
Comment on lines +365 to +368
else:
ifmap_reqs = int(np.count_nonzero(ifmap_demand_line != -1))
filter_reqs = int(np.count_nonzero(filter_demand_line != -1))
self._assign_one_dynamic_bank(assign_to_ifmap=(ifmap_reqs >= filter_reqs))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants