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
dgl
Commits
6d048853
Unverified
Commit
6d048853
authored
May 11, 2020
by
Jinjing Zhou
Committed by
GitHub
May 11, 2020
Browse files
[Backend] Turn to official dlpack for Tensorflow (#1511)
* Turn to official dlpack * fix * fix
parent
02850212
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16 additions
and
8 deletions
+16
-8
Jenkinsfile
Jenkinsfile
+11
-1
docker/install/conda_env/tensorflow_cpu.yml
docker/install/conda_env/tensorflow_cpu.yml
+1
-2
docker/install/conda_env/tensorflow_gpu.yml
docker/install/conda_env/tensorflow_gpu.yml
+1
-2
python/dgl/backend/tensorflow/tensor.py
python/dgl/backend/tensorflow/tensor.py
+2
-2
tests/scripts/build_dgl.sh
tests/scripts/build_dgl.sh
+1
-1
No files found.
Jenkinsfile
View file @
6d048853
...
@@ -101,7 +101,8 @@ pipeline {
...
@@ -101,7 +101,8 @@ pipeline {
agent
{
agent
{
docker
{
docker
{
label
"linux-c52x-node"
label
"linux-c52x-node"
image
"dgllib/dgl-ci-lint"
image
"dgllib/dgl-ci-lint"
alwaysPull
true
}
}
}
}
steps
{
steps
{
...
@@ -121,6 +122,7 @@ pipeline {
...
@@ -121,6 +122,7 @@ pipeline {
docker
{
docker
{
label
"linux-c52x-node"
label
"linux-c52x-node"
image
"dgllib/dgl-ci-cpu:conda"
image
"dgllib/dgl-ci-cpu:conda"
alwaysPull
true
}
}
}
}
steps
{
steps
{
...
@@ -138,6 +140,7 @@ pipeline {
...
@@ -138,6 +140,7 @@ pipeline {
label
"linux-c52x-node"
label
"linux-c52x-node"
image
"dgllib/dgl-ci-gpu:conda"
image
"dgllib/dgl-ci-gpu:conda"
args
"-u root"
args
"-u root"
alwaysPull
true
}
}
}
}
steps
{
steps
{
...
@@ -173,6 +176,7 @@ pipeline {
...
@@ -173,6 +176,7 @@ pipeline {
docker
{
docker
{
label
"linux-c52x-node"
label
"linux-c52x-node"
image
"dgllib/dgl-ci-cpu:conda"
image
"dgllib/dgl-ci-cpu:conda"
alwaysPull
true
}
}
}
}
steps
{
steps
{
...
@@ -200,6 +204,7 @@ pipeline {
...
@@ -200,6 +204,7 @@ pipeline {
docker
{
docker
{
label
"linux-c52x-node"
label
"linux-c52x-node"
image
"dgllib/dgl-ci-cpu:conda"
image
"dgllib/dgl-ci-cpu:conda"
alwaysPull
true
}
}
}
}
stages
{
stages
{
...
@@ -221,6 +226,7 @@ pipeline {
...
@@ -221,6 +226,7 @@ pipeline {
label
"linux-gpu-node"
label
"linux-gpu-node"
image
"dgllib/dgl-ci-gpu:conda"
image
"dgllib/dgl-ci-gpu:conda"
args
"--runtime nvidia"
args
"--runtime nvidia"
alwaysPull
true
}
}
}
}
stages
{
stages
{
...
@@ -241,6 +247,7 @@ pipeline {
...
@@ -241,6 +247,7 @@ pipeline {
docker
{
docker
{
label
"linux-c52x-node"
label
"linux-c52x-node"
image
"dgllib/dgl-ci-cpu:conda"
image
"dgllib/dgl-ci-cpu:conda"
alwaysPull
true
}
}
}
}
stages
{
stages
{
...
@@ -292,6 +299,7 @@ pipeline {
...
@@ -292,6 +299,7 @@ pipeline {
label
"linux-gpu-node"
label
"linux-gpu-node"
image
"dgllib/dgl-ci-gpu:conda"
image
"dgllib/dgl-ci-gpu:conda"
args
"--runtime nvidia"
args
"--runtime nvidia"
alwaysPull
true
}
}
}
}
stages
{
stages
{
...
@@ -318,6 +326,7 @@ pipeline {
...
@@ -318,6 +326,7 @@ pipeline {
docker
{
docker
{
label
"linux-c52x-node"
label
"linux-c52x-node"
image
"dgllib/dgl-ci-cpu:conda"
image
"dgllib/dgl-ci-cpu:conda"
alwaysPull
true
}
}
}
}
stages
{
stages
{
...
@@ -344,6 +353,7 @@ pipeline {
...
@@ -344,6 +353,7 @@ pipeline {
label
"linux-gpu-node"
label
"linux-gpu-node"
image
"dgllib/dgl-ci-gpu:conda"
image
"dgllib/dgl-ci-gpu:conda"
args
"--runtime nvidia"
args
"--runtime nvidia"
alwaysPull
true
}
}
}
}
stages
{
stages
{
...
...
docker/install/conda_env/tensorflow_cpu.yml
View file @
6d048853
...
@@ -3,8 +3,7 @@ dependencies:
...
@@ -3,8 +3,7 @@ dependencies:
-
python=3.6.9
-
python=3.6.9
-
pip
-
pip
-
pip
:
-
pip
:
-
tensorflow==2.2.0rc1
-
tensorflow==2.2.0
# - tf-nightly==2.2.0.dev20200327
-
tfdlpack
-
tfdlpack
-
pytest
-
pytest
-
nose
-
nose
...
...
docker/install/conda_env/tensorflow_gpu.yml
View file @
6d048853
...
@@ -3,8 +3,7 @@ dependencies:
...
@@ -3,8 +3,7 @@ dependencies:
-
python=3.6.9
-
python=3.6.9
-
pip
-
pip
-
pip
:
-
pip
:
-
tensorflow==2.2.0rc1
-
tensorflow==2.2.0
# - tf-nightly==2.2.0.dev20200327
-
tfdlpack-gpu
-
tfdlpack-gpu
-
pytest
-
pytest
-
nose
-
nose
...
...
python/dgl/backend/tensorflow/tensor.py
View file @
6d048853
...
@@ -13,7 +13,7 @@ from ... import ndarray as nd
...
@@ -13,7 +13,7 @@ from ... import ndarray as nd
from
...
import
kernel
as
K
from
...
import
kernel
as
K
from
...function.base
import
TargetCode
from
...function.base
import
TargetCode
if
os
.
getenv
(
"USE_
OFFICIAL_
TFDLPACK"
,
False
):
if
not
os
.
getenv
(
"USE_TFDLPACK"
,
False
):
if
LooseVersion
(
tf
.
__version__
)
<
LooseVersion
(
"2.2.0"
):
if
LooseVersion
(
tf
.
__version__
)
<
LooseVersion
(
"2.2.0"
):
raise
RuntimeError
(
"DGL requires tensorflow>=2.2.0 for the official DLPack support."
)
raise
RuntimeError
(
"DGL requires tensorflow>=2.2.0 for the official DLPack support."
)
...
@@ -21,7 +21,7 @@ if os.getenv("USE_OFFICIAL_TFDLPACK", False):
...
@@ -21,7 +21,7 @@ if os.getenv("USE_OFFICIAL_TFDLPACK", False):
return
tf
.
experimental
.
dlpack
.
to_dlpack
(
input
)
return
tf
.
experimental
.
dlpack
.
to_dlpack
(
input
)
def
zerocopy_from_dlpack
(
dlpack_tensor
):
def
zerocopy_from_dlpack
(
dlpack_tensor
):
# TODO(Jinjing): Tensorflow requires memory to be 64-b
it
aligned. We check the
# TODO(Jinjing): Tensorflow requires memory to be 64-b
ytes
aligned. We check the
# alignment and make a copy if needed. The functionality is better in TF's main repo.
# alignment and make a copy if needed. The functionality is better in TF's main repo.
aligned
=
nd
.
from_dlpack
(
dlpack_tensor
).
to_dlpack
(
64
)
aligned
=
nd
.
from_dlpack
(
dlpack_tensor
).
to_dlpack
(
64
)
return
tf
.
experimental
.
dlpack
.
from_dlpack
(
aligned
)
return
tf
.
experimental
.
dlpack
.
from_dlpack
(
aligned
)
...
...
tests/scripts/build_dgl.sh
View file @
6d048853
...
@@ -22,7 +22,7 @@ rm -rf _download
...
@@ -22,7 +22,7 @@ rm -rf _download
pushd
build
pushd
build
cmake
$CMAKE_VARS
..
cmake
$CMAKE_VARS
..
make
-j
4
make
-j
8
popd
popd
pushd
python
pushd
python
...
...
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