Skip to content

Commit

Permalink
Synchronize batch size for cpu test
Browse files Browse the repository at this point in the history
  • Loading branch information
pomonam committed Mar 12, 2024
1 parent 7c59820 commit 34fef57
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 2 deletions.
37 changes: 37 additions & 0 deletions examples/uci/tutorial.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"id": "initial_id",
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
""
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
3 changes: 2 additions & 1 deletion tests/gpu_tests/cpu_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ def setUpClass(cls) -> None:
cls.model = cls.model.double()

cls.train_dataset = get_mnist_dataset(split="train", data_path="data")
cls.train_dataset = data.Subset(cls.train_dataset, indices=list(range(TRAIN_INDICES)))
cls.eval_dataset = get_mnist_dataset(split="valid", data_path="data")
cls.eval_dataset = data.Subset(cls.eval_dataset, indices=list(range(QUERY_INDICES)))

cls.task = ClassificationTask()
cls.model = prepare_model(cls.model, cls.task)
Expand Down Expand Up @@ -122,7 +124,6 @@ def test_pairwise_scores(self) -> None:
)
new_pairwise_scores = self.analyzer.load_pairwise_scores(scores_name=NEW_SCORE_NAME)

torch.set_printoptions(threshold=30_000)
print(f"Previous score: {pairwise_scores[ALL_MODULE_NAME][10]}")
print(f"Previous shape: {pairwise_scores[ALL_MODULE_NAME].shape}")
print(f"New score: {new_pairwise_scores[ALL_MODULE_NAME][10]}")
Expand Down
1 change: 0 additions & 1 deletion tests/gpu_tests/prepare_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,6 @@ def run_analysis() -> None:
activation_covariance_dtype=torch.float64,
gradient_covariance_dtype=torch.float64,
lambda_dtype=torch.float64,
lambda_iterative_aggregate=False,
)
analyzer.fit_all_factors(
factors_name="single_gpu",
Expand Down

0 comments on commit 34fef57

Please sign in to comment.