Skip to content

Commit 1157c30

Browse files
committed
move source model to cuda?
1 parent 914301f commit 1157c30

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sparse_autoencoder/train/pipeline.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,7 @@ def generate_activations(self, store_size: PositiveInt) -> TensorActivationStore
188188

189189
# Setup the store
190190
source_model_device: torch.device = get_model_device(self.source_model)
191+
print("Source model device:", source_model_device)
191192
store = TensorActivationStore(
192193
store_size, self.n_input_features, n_components=self.n_components
193194
)
@@ -349,7 +350,9 @@ def validate_sae(self, validation_n_activations: PositiveInt) -> None:
349350
validation_n_activations // self.source_data_batch_size,
350351
self.n_components,
351352
)
353+
self.source_model = self.source_model.to(device='cuda')
352354
source_model_device: torch.device = get_model_device(self.source_model)
355+
print("Source model device:", source_model_device)
353356

354357
# Create the metric data stores
355358
losses: Float[Tensor, Axis.names(Axis.ITEMS, Axis.COMPONENT)] = torch.empty(

0 commit comments

Comments
 (0)