Skip to content

Commit

Permalink
[mpact][compiler] only import what you need in tests (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
aartbik authored Jul 10, 2024
1 parent 13c317b commit 466aed6
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion test/python/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import torch
import numpy as np

from mpact.mpactbackend import mpact_jit, mpact_jit_compile, mpact_jit_run
from mpact.mpactbackend import mpact_jit

from mpact.models.kernels import AddNet

Expand Down
2 changes: 1 addition & 1 deletion test/python/gat.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import torch
import numpy as np

from mpact.mpactbackend import mpact_jit, mpact_jit_compile, mpact_jit_run
from mpact.mpactbackend import mpact_jit

from mpact.models.gat import gat_4_64_8_3

Expand Down
2 changes: 1 addition & 1 deletion test/python/lif.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import torch

from mpact.mpactbackend import mpact_jit, mpact_jit_compile, mpact_jit_run
from mpact.mpactbackend import mpact_jit

from mpact.models.lif import LIFSumOfSq

Expand Down
2 changes: 1 addition & 1 deletion test/python/mm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import torch
import numpy as np

from mpact.mpactbackend import mpact_jit, mpact_jit_compile, mpact_jit_run
from mpact.mpactbackend import mpact_jit

from mpact.models.kernels import MMNet

Expand Down
2 changes: 1 addition & 1 deletion test/python/mul.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import torch
import numpy as np

from mpact.mpactbackend import mpact_jit, mpact_jit_compile, mpact_jit_run
from mpact.mpactbackend import mpact_jit

from mpact.models.kernels import MulNet

Expand Down
2 changes: 1 addition & 1 deletion test/python/norm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import torch
import numpy as np

from mpact.mpactbackend import mpact_jit, mpact_jit_compile, mpact_jit_run
from mpact.mpactbackend import mpact_jit

from mpact.models.kernels import Normalization

Expand Down
2 changes: 1 addition & 1 deletion test/python/resnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import torch
import numpy as np

from mpact.mpactbackend import mpact_jit, mpact_jit_compile, mpact_jit_run
from mpact.mpactbackend import mpact_jit

from mpact.models.resnet import resnet_20

Expand Down
2 changes: 1 addition & 1 deletion test/python/scale.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import torch
import numpy as np

from mpact.mpactbackend import mpact_jit, mpact_jit_compile, mpact_jit_run
from mpact.mpactbackend import mpact_jit

from mpact.models.kernels import FeatureScale

Expand Down
2 changes: 1 addition & 1 deletion test/python/spmv.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import torch

from mpact.mpactbackend import mpact_jit, mpact_jit_compile, mpact_jit_run
from mpact.mpactbackend import mpact_jit

from mpact.models.kernels import MVNet

Expand Down
2 changes: 1 addition & 1 deletion test/python/sqsum.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import torch
import numpy as np

from mpact.mpactbackend import mpact_jit, mpact_jit_compile, mpact_jit_run
from mpact.mpactbackend import mpact_jit

from mpact.models.kernels import SqSum

Expand Down
5 changes: 2 additions & 3 deletions test/python/train_simple.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,9 @@ def __getitem__(self, index):

# Run it with PyTorch.
# CHECK-LABEL: pytorch
# CHECK: Epoch 99
# CHECK-SAME: Accuracy = 1.00
# CHECK: Epoch 9
print("pytorch")
training_loop(net, optimizer, loss_function, train, validation, epochs=100)
training_loop(net, optimizer, loss_function, train, validation, epochs=10)

# Run it with MPACT.
# CHECK-LABEL: mpact
Expand Down

0 comments on commit 466aed6

Please sign in to comment.