Skip to content

Commit

Permalink
[GraphBolt][CUDA] Fix link prediction early-stop.
Browse files Browse the repository at this point in the history
  • Loading branch information
mfbalin committed Feb 3, 2024
1 parent 15695ed commit ba4ee3b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 2 additions & 0 deletions examples/sampling/graphbolt/link_prediction.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ def train(args, model, graph, features, train_set):

total_loss += loss.item()
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

end_epoch_time = time.time()
Expand Down
7 changes: 1 addition & 6 deletions python/dgl/graphbolt/feature_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,5 @@ def _read(self, data):
with torch.cuda.stream(self.stream):
data = self._read_data(data, current_stream)
if self.stream is not None:
event = torch.cuda.current_stream().record_event()

def _wait():
event.wait()

data.wait = _wait
data.wait = torch.cuda.current_stream().record_event().wait
return data

0 comments on commit ba4ee3b

Please sign in to comment.