Repository navigation
Make table_ptrs_dev persistent - #356
Conversation
Greptile SummaryThis PR caches the table-pointer tensor as Confidence Score: 5/5Safe to merge — change is a straightforward performance optimization with correct refresh ordering and no remaining issues. All existing call sites are updated, the persistent tensor is refreshed at the only location where data_ptr() can change (_expand_tables_impl after all extend() calls), and the refresh is correctly ordered before the migration loop. No P0/P1 issues found; the previous thread concern about refresh ordering has been addressed. No files require special attention. Important Files Changed
Sequence DiagramsequenceDiagram
participant C as create_table_state
participant E as _expand_tables_impl
participant F as load/store_from_flat*
participant B as backward (fused_update)
C->>C: get_table_ptrs(tables, device)
C-->>S: state.table_ptrs_dev = tensor
note over E: expand triggered
E->>E: tables[i].extend(...)
E->>E: state.table_ptrs_dev.copy_(get_table_ptrs(...))
E->>F: load_from_flat_single_table (uses table_ptrs_dev)
E->>F: store_to_flat_single_table (uses table_ptrs_dev)
B->>B: fused_update_for_flat_table (uses state.table_ptrs_dev)
Reviews (2): Last reviewed commit: "update table ptrs once table extended" | Re-trigger Greptile |
Description
Checklist