Skip to content

Commit

Permalink
Fix broken imports in test
Browse files Browse the repository at this point in the history
  • Loading branch information
pomonam committed Mar 19, 2024
1 parent 210b90e commit da1646c
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion tests/factors/test_covariances.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from kronfluence.analyzer import Analyzer, prepare_model
from kronfluence.arguments import FactorArguments
from kronfluence.module.constants import (
from kronfluence.utils.constants import (
ACTIVATION_COVARIANCE_MATRIX_NAME,
COVARIANCE_FACTOR_NAMES,
GRADIENT_COVARIANCE_MATRIX_NAME,
Expand Down
2 changes: 1 addition & 1 deletion tests/factors/test_eigens.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from kronfluence.analyzer import Analyzer, prepare_model
from kronfluence.arguments import FactorArguments
from kronfluence.module.constants import (
from kronfluence.utils.constants import (
ACTIVATION_EIGENVECTORS_NAME,
EIGENDECOMPOSITION_FACTOR_NAMES,
GRADIENT_EIGENVECTORS_NAME,
Expand Down
2 changes: 1 addition & 1 deletion tests/gpu_tests/compile_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from kronfluence.analyzer import Analyzer, prepare_model
from kronfluence.arguments import FactorArguments, ScoreArguments
from kronfluence.module.constants import (
from kronfluence.utils.constants import (
ALL_MODULE_NAME,
COVARIANCE_FACTOR_NAMES,
LAMBDA_FACTOR_NAMES,
Expand Down
2 changes: 1 addition & 1 deletion tests/gpu_tests/cpu_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from kronfluence.analyzer import Analyzer, prepare_model
from kronfluence.arguments import FactorArguments, ScoreArguments
from kronfluence.module.constants import (
from kronfluence.utils.constants import (
ALL_MODULE_NAME,
COVARIANCE_FACTOR_NAMES,
LAMBDA_FACTOR_NAMES,
Expand Down
2 changes: 1 addition & 1 deletion tests/gpu_tests/ddp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

from kronfluence.analyzer import Analyzer, prepare_model
from kronfluence.arguments import FactorArguments, ScoreArguments
from kronfluence.module.constants import (
from kronfluence.utils.constants import (
ALL_MODULE_NAME,
COVARIANCE_FACTOR_NAMES,
LAMBDA_FACTOR_NAMES,
Expand Down
2 changes: 1 addition & 1 deletion tests/gpu_tests/fsdp_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

from kronfluence.analyzer import Analyzer, prepare_model
from kronfluence.arguments import FactorArguments, ScoreArguments
from kronfluence.module.constants import (
from kronfluence.utils.constants import (
ALL_MODULE_NAME,
COVARIANCE_FACTOR_NAMES,
LAMBDA_FACTOR_NAMES,
Expand Down
2 changes: 1 addition & 1 deletion tests/gpu_tests/test_offload_cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from kronfluence.analyzer import Analyzer, prepare_model
from kronfluence.arguments import FactorArguments, ScoreArguments
from kronfluence.module.constants import ALL_MODULE_NAME
from kronfluence.utils.constants import ALL_MODULE_NAME
from kronfluence.utils.dataset import DataLoaderKwargs
from tests.utils import prepare_test

Expand Down
2 changes: 1 addition & 1 deletion tests/scores/test_pairwise_scores.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from kronfluence.analyzer import Analyzer, prepare_model
from kronfluence.arguments import FactorArguments, ScoreArguments
from kronfluence.module.constants import ALL_MODULE_NAME
from kronfluence.utils.constants import ALL_MODULE_NAME
from kronfluence.task import Task
from kronfluence.utils.dataset import DataLoaderKwargs
from tests.utils import ATOL, RTOL, check_tensor_dict_equivalence, prepare_test
Expand Down
2 changes: 1 addition & 1 deletion tests/scores/test_self_scores.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

from kronfluence.analyzer import Analyzer, prepare_model
from kronfluence.arguments import FactorArguments, ScoreArguments
from kronfluence.module.constants import ALL_MODULE_NAME
from kronfluence.utils.constants import ALL_MODULE_NAME
from kronfluence.task import Task
from kronfluence.utils.dataset import DataLoaderKwargs
from tests.utils import ATOL, RTOL, check_tensor_dict_equivalence, prepare_test
Expand Down
2 changes: 1 addition & 1 deletion tests/test_per_sample_gradients.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from kronfluence.analyzer import Analyzer, prepare_model
from kronfluence.arguments import FactorArguments
from kronfluence.module.constants import (
from kronfluence.utils.constants import (
LAMBDA_MATRIX_NAME,
PRECONDITIONED_GRADIENT_NAME,
)
Expand Down
2 changes: 1 addition & 1 deletion tests/testable_tasks/classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import torch.nn.functional as F
import torchvision
from accelerate.utils import set_seed
from task import Task
from kronfluence.task import Task
from torch import nn
from torch.utils import data

Expand Down
2 changes: 1 addition & 1 deletion tests/testable_tasks/language_modeling.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import torch
import torch.nn.functional as F
from datasets import load_dataset
from task import Task
from kronfluence.task import Task
from torch import nn
from torch.utils import data
from transformers import AutoConfig, AutoModelForCausalLM, AutoTokenizer, Conv1D
Expand Down
2 changes: 1 addition & 1 deletion tests/testable_tasks/regression.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pylint: skip-file

import math
from typing import Dict, Tuple
from typing import Tuple

import torch
import torch.nn.functional as F
Expand Down
2 changes: 1 addition & 1 deletion tests/testable_tasks/text_classification.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import torch
import torch.nn.functional as F
from datasets import load_dataset
from task import Task
from kronfluence.task import Task
from torch import nn
from torch.utils import data
from transformers import AutoConfig, AutoModelForSequenceClassification, AutoTokenizer
Expand Down

0 comments on commit da1646c

Please sign in to comment.