Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torch-sparse
Commits
76379f8b
Commit
76379f8b
authored
Feb 20, 2020
by
rusty1s
Browse files
try to build with metis
parent
76ccc51d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
25 additions
and
0 deletions
+25
-0
.travis.yml
.travis.yml
+1
-0
script/metis.sh
script/metis.sh
+11
-0
test/test_metis.py
test/test_metis.py
+13
-0
No files found.
.travis.yml
View file @
76379f8b
...
@@ -60,6 +60,7 @@ jobs:
...
@@ -60,6 +60,7 @@ jobs:
install
:
install
:
-
source script/cuda.sh
-
source script/cuda.sh
-
source script/conda.sh
-
source script/conda.sh
-
source script/metis.sh
-
conda create --yes -n test python="${PYTHON_VERSION}"
-
conda create --yes -n test python="${PYTHON_VERSION}"
-
source activate test
-
source activate test
-
conda install pytorch=${TORCH_VERSION} ${TOOLKIT} -c pytorch --yes
-
conda install pytorch=${TORCH_VERSION} ${TOOLKIT} -c pytorch --yes
...
...
script/metis.sh
0 → 100755
View file @
76379f8b
#!/bin/bash
METIS
=
metis-5.1.0
wget
-nv
http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/
${
METIS
}
.tar.gz
tar
-xvzf
${
METIS
}
.tar.gz
cd
${
METIS
}
||
exit
sed
-i
.bak
-e
's/IDXTYPEWIDTH 32/IDXTYPEWIDTH 64/g'
include/metis.h
make config
make
make
install
test/test_metis.py
0 → 100644
View file @
76379f8b
import
pytest
import
torch
from
torch_sparse.tensor
import
SparseTensor
from
.utils
import
devices
@
pytest
.
mark
.
parametrize
(
'device'
,
devices
)
def
test_metis
(
device
):
mat
=
SparseTensor
.
from_dense
(
torch
.
randn
((
6
,
6
),
device
=
device
))
mat
,
partptr
,
perm
=
mat
.
partition_kway
(
num_parts
=
2
)
assert
partptr
.
tolist
()
==
[
0
,
3
,
6
]
assert
perm
.
tolist
()
==
[
0
,
1
,
2
,
3
,
4
,
5
]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment