Skip to content

Commit be58224

Browse files
authored
[CI] enable tutorial test in CI. (#631)
* enable tutorial test in CI. * reduce overhead.
1 parent 7d61936 commit be58224

File tree

2 files changed

+17
-12
lines changed

2 files changed

+17
-12
lines changed

Jenkinsfile

+10-10
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,11 @@ pipeline {
217217
// unit_test_linux("pytorch", "cpu")
218218
// }
219219
//}
220-
//stage("Tutorial test") {
221-
// steps {
222-
// tutorial_test_linux("mxnet")
223-
// }
224-
//}
220+
stage("Tutorial test") {
221+
steps {
222+
tutorial_test_linux("mxnet")
223+
}
224+
}
225225
}
226226
}
227227
stage("MXNet GPU") {
@@ -243,11 +243,11 @@ pipeline {
243243
// unit_test_linux("pytorch", "cpu")
244244
// }
245245
//}
246-
//stage("Tutorial test") {
247-
// steps {
248-
// tutorial_test_linux("mxnet")
249-
// }
250-
//}
246+
stage("Tutorial test") {
247+
steps {
248+
tutorial_test_linux("mxnet")
249+
}
250+
}
251251
}
252252
}
253253
}

tutorials/models/5_giant_graph/1_sampling_mx.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -250,9 +250,9 @@ def forward(self, nf):
250250
# dropout probability
251251
dropout = 0.2
252252
# batch size
253-
batch_size = 10000
253+
batch_size = 1000
254254
# number of neighbors to sample
255-
num_neighbors = 8
255+
num_neighbors = 4
256256
# number of epochs
257257
num_epochs = 1
258258

@@ -267,6 +267,7 @@ def forward(self, nf):
267267
{'learning_rate': 0.03, 'wd': 0})
268268

269269
for epoch in range(num_epochs):
270+
i = 0
270271
for nf in dgl.contrib.sampling.NeighborSampler(g, batch_size,
271272
num_neighbors,
272273
neighbor_type='in',
@@ -291,6 +292,10 @@ def forward(self, nf):
291292
# optimization
292293
trainer.step(batch_size=1)
293294
print("Epoch[{}]: loss {}".format(epoch, loss.asscalar()))
295+
i += 1
296+
# We only train the model with 32 mini-batches just for demonstration.
297+
if i >= 32:
298+
break
294299

295300
##############################################################################
296301
# Control Variate

0 commit comments

Comments
 (0)