Skip to content

Commit

Permalink
fix: convert decoder bias to local tensor while using tensor parallel
Browse files Browse the repository at this point in the history
  • Loading branch information
Frankstein73 committed Jul 18, 2024
1 parent 6b0ba69 commit d040d21
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lm_saes/sae.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def encode(
label = x

if self.cfg.use_decoder_bias and self.cfg.apply_decoder_bias_to_pre_encoder:
x = x - self.decoder.bias
x = x - self.decoder.bias.to_local() if self.cfg.tp_size > 1 else x - self.decoder.bias

x = x * self.compute_norm_factor(x, hook_point="in")

Expand Down

0 comments on commit d040d21

Please sign in to comment.