Open velezbeltran opened 10 months ago
Possibly the TransformerLens version you're using is different from the one that was used to save the hypothesis, so the hook names are different. What's the list of edges from exp.corr.all_edges().keys()
?
Thanks for your lighting fast response!
After the step function
I don't think the issue is that the TransformerLens versions are different because I can reproduce this all from the same notebook in colab.
Thank you
Turns out the explanation is: the ACDC algorithm literally removes edges (i.e. removes them from the correspondence dictionaries), as opposed to saying edge.present = False
. That makes it fail when loading.
The loading code should be changed to fix this.
@velezbeltran I'm curious if you would be so kind to share the working code for loading the subgraph weights edges.pth
for inference. I did not quite catch from @rhaps0dy what the modification should be and where. Thanks!
Hello!
I have been working on the
ACDC_Main_Demo.ipynb
repo and I am currently facing an issue where if I attempt to load the model from a subgraph I get an error. In particular I attempt the following steps.I run the notebook as is adding one additional line where I save the output of the subgraph using the command below
I run all of the cells except for the cell containing the code
exp.save_edges("another_final_edges.pkl")
if USING_WANDB: edges_fname = f"edges.pth" exp.save_edges(edges_fname) artifact = wandb.Artifact(edges_fname, type="dataset") artifact.add_file(edges_fname) wandb.log_artifact(artifact) os.remove(edges_fname) wandb.finish()
load using torch
circuit = t.load(subgraph_path) exp.load_subgraph(circuit)
AssertionError: Ensure that the dictionary includes exactly the correct keys... e.g missing [('blocks.1.hook_q_input', (None, None, 0), 'blocks.0.attn.hook_result', (None, None, 1))] and has excess stuff []