Open
Conversation
There was a problem hiding this comment.
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
EnableDynamicconfig knob and plumb it into the memory system setup. - Implement dynamic bank assignment logic in
double_buffered_scratchpad_memand runtime bank-topology updates inread_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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.