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
4b265390
Unverified
Commit
4b265390
authored
Feb 05, 2024
by
Muhammed Fatih BALIN
Committed by
GitHub
Feb 05, 2024
Browse files
[GraphBolt][CUDA] Fix link prediction early-stop. (#7083)
parent
f3af2a9f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
6 deletions
+3
-6
examples/sampling/graphbolt/link_prediction.py
examples/sampling/graphbolt/link_prediction.py
+2
-0
python/dgl/graphbolt/feature_fetcher.py
python/dgl/graphbolt/feature_fetcher.py
+1
-6
No files found.
examples/sampling/graphbolt/link_prediction.py
View file @
4b265390
...
@@ -332,6 +332,8 @@ def train(args, model, graph, features, train_set):
...
@@ -332,6 +332,8 @@ def train(args, model, graph, features, train_set):
total_loss
+=
loss
.
item
()
total_loss
+=
loss
.
item
()
if
step
+
1
==
args
.
early_stop
:
if
step
+
1
==
args
.
early_stop
:
# Early stopping requires a new dataloader to reset its state.
dataloader
=
create_dataloader
(
args
,
graph
,
features
,
train_set
)
break
break
end_epoch_time
=
time
.
time
()
end_epoch_time
=
time
.
time
()
...
...
python/dgl/graphbolt/feature_fetcher.py
View file @
4b265390
...
@@ -174,10 +174,5 @@ class FeatureFetcher(MiniBatchTransformer):
...
@@ -174,10 +174,5 @@ class FeatureFetcher(MiniBatchTransformer):
with
torch
.
cuda
.
stream
(
self
.
stream
):
with
torch
.
cuda
.
stream
(
self
.
stream
):
data
=
self
.
_read_data
(
data
,
current_stream
)
data
=
self
.
_read_data
(
data
,
current_stream
)
if
self
.
stream
is
not
None
:
if
self
.
stream
is
not
None
:
event
=
torch
.
cuda
.
current_stream
().
record_event
()
data
.
wait
=
torch
.
cuda
.
current_stream
().
record_event
().
wait
def
_wait
():
event
.
wait
()
data
.
wait
=
_wait
return
data
return
data
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