Skip to content

Commit

Permalink
Fix travis build
Browse files Browse the repository at this point in the history
 - Install keops
 - catch modulenotfound error, since this will happen on cpu-only machines
 - pep8
  • Loading branch information
gmeanti committed Aug 31, 2020
1 parent 93d316c commit 1df1556
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ install:
- conda install -y flake8 codecov
# check manifest needs conda-forge:
- conda install -y -c conda-forge check-manifest
- pip install -e ./keops/
- pip install -e .
script:
- pytest --cov-report=term-missing --cov=falkon --cov-config setup.cfg
Expand Down
2 changes: 1 addition & 1 deletion falkon/ooc_ops/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
try:
from .ooc_lauum import gpu_lauum
from .ooc_potrf import gpu_cholesky
except OSError:
except (OSError, ModuleNotFoundError):
# No GPU
gpu_lauum = None
gpu_cholesky = None
Expand Down
2 changes: 1 addition & 1 deletion falkon/tests/test_chol_prec.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def test_cuda_start(self, mat, kernel, gram, dtype, order):

np.testing.assert_allclose(prec.dT.numpy(), gpu_prec.dT.cpu().numpy(), rtol=rtol)
np.testing.assert_allclose(prec.dA.numpy(), gpu_prec.dA.cpu().numpy(), rtol=rtol)
np.testing.assert_allclose(prec.fC.numpy(), gpu_prec.fC.cpu().numpy(), rtol=rtol*10)
np.testing.assert_allclose(prec.fC.numpy(), gpu_prec.fC.cpu().numpy(), rtol=rtol * 10)
assert gpu_prec.fC.device == gpu_mat.device, "Device changed unexpectedly"

assert_invariant_on_TT(gpu_prec, gpu_gram, tol=rtol)
Expand Down
6 changes: 3 additions & 3 deletions falkon/tests/test_fmmv.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
]



def choose_on_dtype(dtype):
if dtype == np.float64 or dtype == torch.float64:
return 1e-12
Expand Down Expand Up @@ -261,6 +260,7 @@ def test_incorrect_dev_setting(self, A, B, v, w, kernel, e_dfmmv1, expected_fmmv
class TestKeops:
basic_options = FalkonOptions(debug=True, compute_arch_speed=False, keops_active="force",
max_cpu_mem=max_mem_dense, max_gpu_mem=max_mem_dense)

@pytest.mark.parametrize("Ao,Adt,Bo,Bdt,vo,vdt", [
("C", np.float32, "C", np.float32, "C", np.float32),
("C", np.float64, "C", np.float64, "C", np.float64),
Expand Down Expand Up @@ -311,8 +311,8 @@ def test_gpu_inputs_fail(self, A, B, v, kernel, expected_fmmv):


class TestSparse:
basic_options = FalkonOptions(debug=True, compute_arch_speed=False,
max_cpu_mem=max_mem_sparse, max_gpu_mem=max_mem_sparse)
basic_options = FalkonOptions(debug=True, compute_arch_speed=False,
max_cpu_mem=max_mem_sparse, max_gpu_mem=max_mem_sparse)
# sparse_dim and sparse_density result in sparse matrices with m and n non-zero entries.
sparse_dim = 10_000
sparse_density = 1e-4
Expand Down
2 changes: 1 addition & 1 deletion falkon/tests/test_ooc_lauum.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
from falkon.utils import decide_cuda
from falkon.utils.helpers import sizeof_dtype
from falkon.utils.tensor_helpers import move_tensor
from falkon.ooc_ops.ooc_utils import calc_block_sizes3

if decide_cuda():
from falkon.ooc_ops.ooc_utils import calc_block_sizes3
from falkon.ooc_ops.ooc_lauum import gpu_lauum
# noinspection PyUnresolvedReferences
from falkon.ooc_ops.cuda import cuda_lauum_lower
Expand Down

0 comments on commit 1df1556

Please sign in to comment.