feat(data_classes): add BufferLog subclass and BufferAccessor#83
Merged
johnmarktaylor91 merged 1 commit intomainfrom Mar 2, 2026
Merged
feat(data_classes): add BufferLog subclass and BufferAccessor#83johnmarktaylor91 merged 1 commit intomainfrom
johnmarktaylor91 merged 1 commit intomainfrom
Conversation
…st-class buffer support Buffers now get their own dedicated class (BufferLog) that subclasses TensorLog, giving them focused repr, convenience properties (name, module_address), and ergonomic access via BufferAccessor on both ModelLog and ModuleLog. - BufferLog(TensorLog) subclass with clean __repr__ and computed properties - BufferAccessor with indexing by address, short name, or ordinal position - Scoped mh.modules["addr"].buffers for per-module buffer access - Fix vis.py type(node) == TensorLog checks to use isinstance (supports subclasses) - Fix TensorLog.copy() to preserve subclass type via type(self)(fields_dict) - Fix cleanup.py property-before-callable check order to prevent AttributeError - Add buffer repr sections to aesthetic test reports (text + PDF) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
johnmarktaylor91
added a commit
that referenced
this pull request
Mar 4, 2026
- #95: fix mixed LayerLog/LayerPassLog format in vis module containment check - #83: LayerLog.parent_layer_arg_locs returns strings (not sets) for consistency - #99: warn on tensor shape mismatch in fast-path source tensor logging - #23: add case-insensitive exact match and substring lookup for layers/modules - #85: confirmed not-a-bug (any special arg correctly explains output invariance) - #39, #41, #42: confirmed already fixed or correct as-is - Add 6 regression tests for the above fixes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
3 tasks
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.
Summary
__repr__,nameandmodule_addressproperties, while remaining full graph nodes (isinstance(buf, TensorLog)still True)mh.buffers["addr"],mh.buffers[0],mh.buffers["running_mean"]— modeled on ParamAccessormh.modules["layer1.0.bn1"].buffersreturns only that module's bufferstype(node) == TensorLogchecks in vis.py to useisinstanceTensorLog.copy()to preserve subclass typecleanup.pyproperty-before-callable check orderTest plan
isinstance(buffer, BufferLog)andisinstance(buffer, TensorLog)both Truemh.modules[addr].buffersreturns correct subset