Hi, I’m training this public gluon example on a p2.16xl notebook https://github.com/awslabs/amazon-sagemaker-examples/tree/master/introduction_to_applying_machine_learning/gluon_recommender_system
I’m trying to adapt the notebook to run on multi-GPU. In order to do this, I did the following changes:
-
replace
ctx = mx.gpu()
byctx = [mx.gpu(i) for i in range(8)]
-
replace
user = user.as_in_context(ctx).reshape((batch_size,))
item = item.as_in_context(ctx).reshape((batch_size,))
label = label.as_in_context(ctx).reshape((batch_size,))
by
user = gluon.utils.split_and_load(user, ctx)
item = gluon.utils.split_and_load(item, ctx)
label = gluon.utils.split_and_load(label, ctx)
it throws the following error: AssertionError: HybridBlock requires the first argument to forward be either Symbol or NDArray, but got <class 'list'>
What am I missing?
thanks