Closed dtch1997 closed 3 months ago
The primary adjustments involve renaming nodes and edges to use more generalized types like TensorNode
and AttentionNode
, while also consolidating and streamlining type aliases and functionality across multiple files for improved clarity and maintainability. Some test fixtures were updated to align with these changes, ensuring consistency throughout the codebase.
File Paths | Change Summaries |
---|---|
sae_eap/attribute.py | Updated imports and type aliases related to the graph module, e.g., changed AttributionScores to EdgeAttributionScores . |
sae_eap/graph/init.py | Replaced SrcNode and DestNode with AttentionNode , added EdgeName class to imports. |
sae_eap/graph/build.py | Refactored node classes, changing function returns to use TensorNode and AttentionNode . |
sae_eap/graph/edge.py | Introduced generic Edge class, specific TensorEdge class, and adjusted node type dependencies. |
sae_eap/graph/graph.py | Added node property methods, updated type hints, and modified serialization methods. |
sae_eap/graph/index.py | Refactored TensorGraphIndexer class, updating dictionary types to use TensorNode . |
sae_eap/graph/node.py | Introduced as_src and as_dest methods, and refactored node classes including AttentionNode . |
sae_eap/graph/prune.py | Renamed nodes in method signatures and updated associated logic to reflect new names. |
sae_eap/runner.py | Changed import and return type from AttributionScores to EdgeAttributionScores . |
tests/integration/runner/test_run_ablate.py | Removed pytest import and test failure expectation decorator. |
tests/unit/graph/test_graph.py | Updated Node object creation to use named arguments in fixtures. |
tests/unit/graph/test_node.py | Updated Node instantiation to use named arguments in test function. |
Changes to the control flow do not necessitate new sequence diagrams due to their straightforward refactoring nature.
In fields of code where functions play, A rabbit smiles at end of day 🐇 Nodes reshaped, edges aligned, A clearer graph now intertwined. With tensors and attention grand, Our project flourishes, just as planned. 🎉
[!WARNING]
Review ran into problems
Problems (1)
* Git: Failed to clone repository. Please contact CodeRabbit support.
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Unify SrcNode and DestNode, as in principle, a node can be both a SrcNode and a DestNode
Summary by CodeRabbit
Refactor
TensorNode
andAttentionNode
.Bug Fixes
Tests
@pytest.mark.xfail
fromtest_run_ablation
to reevaluate test expectations.Chores