Add run_with_cache_until and offload_params_after method to transformer_lens.hook_point.HookedRootModule to do early stopping & remove unnecessary parameters.
Replace run_with_cache in activation caching with run_with_cache_until to improve speed of activation generation.
This PR includes:
run_with_cache_until
andoffload_params_after
method totransformer_lens.hook_point.HookedRootModule
to do early stopping & remove unnecessary parameters.run_with_cache
in activation caching withrun_with_cache_until
to improve speed of activation generation.