Skip to content

Commit d3e7edd

Browse files
committed
release v0.2.2
1 parent 5cf3a5a commit d3e7edd

27 files changed

+639
-84
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ Change log
33

44
Here list all notable changes in GraphVite library.
55

6+
v0.2.2 - 2020-03-11
7+
-------------------
8+
- New model QuatE and its benchmarks on 5 knowledge graph datasets.
9+
- Add an option to skip `faiss` in compilation.
10+
- Fix instructions for conda installation.
11+
612
v0.2.1 - 2019-11-12
713
-------------------
814
- New dataset `Wikidata5m` and its benchmarks,

CMakeLists.txt

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -89,21 +89,23 @@ endif()
8989

9090
# faiss
9191
if (NOT FAISS_PATH)
92-
ExternalProject_Add(faiss
93-
GIT_REPOSITORY https://github.com/facebookresearch/faiss.git
94-
UPDATE_DISCONNECTED ${SKIP_UPDATE}
95-
PREFIX faiss
96-
SOURCE_DIR ${EXTERNAL_DIR}/faiss
97-
BINARY_DIR ${EXTERNAL_DIR}/faiss
98-
INSTALL_DIR ${PROJECT_BINARY_DIR}/faiss
99-
CONFIGURE_COMMAND test -e makefile.inc ||
100-
${EXTERNAL_DIR}/faiss/configure --with-cuda=${CUDA_ROOT} --with-cuda-arch=${CUDA_ARCH}
101-
BUILD_COMMAND test -e libfaiss.so || make -j
102-
INSTALL_COMMAND test -e ${PROJECT_BINARY_DIR}/faiss/include/faiss/gpu/GpuIndexFlat.h ||
103-
make install prefix=${PROJECT_BINARY_DIR}/faiss)
104-
include_directories(${PROJECT_BINARY_DIR}/faiss/include)
105-
link_directories(${PROJECT_BINARY_DIR}/faiss/lib)
106-
set(FAISS_LIBRARY ${PROJECT_BINARY_DIR}/faiss/lib/libfaiss.so)
92+
if (NOT NO_FAISS)
93+
ExternalProject_Add(faiss
94+
GIT_REPOSITORY https://github.com/facebookresearch/faiss.git
95+
UPDATE_DISCONNECTED ${SKIP_UPDATE}
96+
PREFIX faiss
97+
SOURCE_DIR ${EXTERNAL_DIR}/faiss
98+
BINARY_DIR ${EXTERNAL_DIR}/faiss
99+
INSTALL_DIR ${PROJECT_BINARY_DIR}/faiss
100+
CONFIGURE_COMMAND test -e makefile.inc ||
101+
${EXTERNAL_DIR}/faiss/configure --with-cuda=${CUDA_ROOT} --with-cuda-arch=${CUDA_ARCH}
102+
BUILD_COMMAND test -e libfaiss.so || make -j
103+
INSTALL_COMMAND test -e ${PROJECT_BINARY_DIR}/faiss/include/faiss/gpu/GpuIndexFlat.h ||
104+
make install prefix=${PROJECT_BINARY_DIR}/faiss)
105+
include_directories(${PROJECT_BINARY_DIR}/faiss/include)
106+
link_directories(${PROJECT_BINARY_DIR}/faiss/lib)
107+
set(FAISS_LIBRARY ${PROJECT_BINARY_DIR}/faiss/lib/libfaiss.so)
108+
endif()
107109
else()
108110
get_filename_component(FAISS_PARENT ${FAISS_PATH} DIRECTORY)
109111
include_directories(${FAISS_PARENT})
@@ -125,10 +127,12 @@ set(CMAKE_CUDA_FLAGS_DEBUG "-g -G")
125127
set(CMAKE_CUDA_FLAGS_RELEASE "-O3")
126128
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} ${CUDA_ARCH}")
127129

128-
if (FAST_COMPILE)
129-
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DFAST_COMPILE")
130-
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -DFAST_COMPILE")
131-
endif()
130+
foreach (MACRO FAST_COMPILE NO_FAISS)
131+
if (${${MACRO}})
132+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D${MACRO}")
133+
set(CMAKE_CUDA_FLAGS "${CMAKE_CUDA_FLAGS} -D${MACRO}")
134+
endif()
135+
endforeach()
132136

133137
# output directory
134138
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@ GraphVite - graph embedding at high speed and large scale
55

66
[![Install with conda](https://anaconda.org/milagraph/graphvite/badges/installer/conda.svg)][conda]
77
[![License](https://anaconda.org/milagraph/graphvite/badges/license.svg)][license]
8+
[![Downloads](https://anaconda.org/milagraph/graphvite/badges/downloads.svg)][conda]
89

910
[conda]: https://anaconda.org/milagraph/graphvite
1011
[license]: LICENSE
1112

12-
[Docs] | [Tutorials] | [Benchmarks] | [Pre-trained models]
13+
[Docs] | [Tutorials] | [Benchmarks] | [Pre-trained Models]
1314

1415
[Docs]: https://graphvite.io/docs/latest/api/application
1516
[Tutorials]: https://graphvite.io/tutorials
@@ -93,14 +94,14 @@ Installation
9394
### From Conda ###
9495

9596
```bash
96-
conda install -c milagraph graphvite cudatoolkit=$(nvcc -V | grep -Po "(?<=V)\d+.\d+")
97+
conda install -c milagraph -c conda-forge graphvite cudatoolkit=$(nvcc -V | grep -Po "(?<=V)\d+.\d+")
9798
```
9899

99100
If you only need embedding training without evaluation, you can use the following
100101
alternative with minimal dependencies.
101102

102103
```bash
103-
conda install -c milagraph graphvite-mini cudatoolkit=$(nvcc -V | grep -Po "(?<=V)\d+.\d+")
104+
conda install -c milagraph -c conda-forge graphvite-mini cudatoolkit=$(nvcc -V | grep -Po "(?<=V)\d+.\d+")
104105
```
105106

106107
### From Source ###

conda/conda_build_config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ numpy:
1212
cudatoolkit:
1313
- 9.2
1414
- 10.0
15+
- 10.1
1516

1617
pin_run_as_build:
1718
cudatoolkit:

conda/graphvite-mini/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package:
22
name: graphvite-mini
3-
version: 0.2.1
3+
version: 0.2.2
44

55
source:
66
path: ../..

conda/graphvite/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package:
22
name: graphvite
3-
version: 0.2.1
3+
version: 0.2.2
44

55
source:
66
path: ../..
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
application:
2+
knowledge graph
3+
4+
resource:
5+
gpus: []
6+
cpu_per_gpu: auto
7+
dim: 2048
8+
9+
graph:
10+
file_name: <fb15k237.train>
11+
12+
build:
13+
optimizer:
14+
type: Adam
15+
lr: 1.0e-5
16+
weight_decay: 0
17+
num_partition: auto
18+
num_negative: 64
19+
batch_size: 100000
20+
episode_size: 1
21+
22+
train:
23+
model: QuatE
24+
num_epoch: 1000
25+
l3_regularization: 5.0e-2
26+
sample_batch_size: 2000
27+
adversarial_temperature: 2
28+
log_frequency: 100
29+
30+
evaluate:
31+
task: link prediction
32+
file_name: <fb15k237.test>
33+
filter_files:
34+
- <fb15k237.train>
35+
- <fb15k237.valid>
36+
- <fb15k237.test>
37+
# fast_mode: 3000
38+
39+
save:
40+
file_name: quate_fb15k-237.pkl
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
application:
2+
knowledge graph
3+
4+
resource:
5+
gpus: []
6+
cpu_per_gpu: auto
7+
dim: 2048
8+
9+
graph:
10+
file_name: <fb15k.train>
11+
12+
build:
13+
optimizer:
14+
type: Adam
15+
lr: 5.0e-5
16+
weight_decay: 0
17+
num_partition: auto
18+
num_negative: 64
19+
batch_size: 100000
20+
episode_size: 1
21+
22+
train:
23+
model: QuatE
24+
num_epoch: 1000
25+
l3_regularization: 1.0e-2
26+
sample_batch_size: 2000
27+
adversarial_temperature: 2
28+
log_frequency: 100
29+
30+
evaluate:
31+
task: link prediction
32+
file_name: <fb15k.test>
33+
filter_files:
34+
- <fb15k.train>
35+
- <fb15k.valid>
36+
- <fb15k.test>
37+
# fast_mode: 3000
38+
39+
save:
40+
file_name: quate_fb15k.pkl
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
application:
2+
knowledge graph
3+
4+
resource:
5+
gpus: []
6+
cpu_per_gpu: auto
7+
dim: 512
8+
9+
graph:
10+
file_name: <wikidata5m.train>
11+
normalization: true
12+
13+
build:
14+
optimizer:
15+
type: SGD
16+
lr: 1.0
17+
weight_decay: 0
18+
num_partition: auto
19+
num_negative: 64
20+
batch_size: 100000
21+
episode_size: 200
22+
23+
train:
24+
model: QuatE
25+
num_epoch: 2000
26+
l3_regularization: 5.0e-3
27+
sample_batch_size: 2000
28+
adversarial_temperature: 10
29+
relation_lr_multiplier: 1.0e-4
30+
log_frequency: 500
31+
32+
evaluate:
33+
task: link prediction
34+
file_name: <wikidata5m.test>
35+
filter_files:
36+
- <wikidata5m.train>
37+
- <wikidata5m.valid>
38+
- <wikidata5m.test>
39+
# fast_mode: 1000
40+
41+
save:
42+
file_name: quate_wikidata5m.pkl
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
application:
2+
knowledge graph
3+
4+
resource:
5+
gpus: []
6+
cpu_per_gpu: auto
7+
dim: 1024
8+
9+
graph:
10+
file_name: <wn18.train>
11+
12+
build:
13+
optimizer:
14+
type: Adam
15+
lr: 1.0e-5
16+
weight_decay: 0
17+
num_partition: auto
18+
num_negative: 64
19+
batch_size: 100000
20+
episode_size: 1
21+
22+
train:
23+
model: QuatE
24+
num_epoch: 4000
25+
l3_regularization: 1.0e-2
26+
sample_batch_size: 2000
27+
adversarial_temperature: 2
28+
log_frequency: 100
29+
30+
evaluate:
31+
task: link prediction
32+
file_name: <wn18.test>
33+
filter_files:
34+
- <wn18.train>
35+
- <wn18.valid>
36+
- <wn18.test>
37+
# fast_mode: 3000
38+
39+
save:
40+
file_name: quate_wn18.pkl

0 commit comments

Comments
 (0)