Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

The custom operator not supported for group context? #8914

Closed
mg0880gm opened this issue Dec 1, 2017 · 4 comments
Closed

The custom operator not supported for group context? #8914

mg0880gm opened this issue Dec 1, 2017 · 4 comments

Comments

@mg0880gm
Copy link
Contributor

mg0880gm commented Dec 1, 2017

Description

The group context was used for model parallelism of neural network train. The mx.sym.LogisticRegressionOutput works when it's been used for loss calculation, but not customized operator.

Environment info (Required)

OS: Ubuntu 14.04.5 LTS
Python: 2.7.13
mxnet: 0.12.1, pulled from master branch and built from source

Package used (Python/R/Scala/Julia):
Python: mxnet, numpy, scipy

Build info (Required if built from source)

Bulit from command line by following https://mxnet.incubator.apache.org/get_started/install.html

MXNet commit hash:
2f8c1e8

Build config:
Only change is to enable the profiler.

Error Message:

Traceback (most recent call last):
File "_ctypes/callbacks.c", line 315, in 'calling callback function'
File "/git/mxnet/python/mxnet/operator.py", line 621, in creator
op_prop = prop_cls(**kwargs)
TypeError: init() got an unexpected keyword argument 'ctx_group'

Minimum reproducible example

The script to generate the network, which works:

...
fc2 = mx.symbol.FullyConnected(data=concat, name='fcout_'+str(gpu), num_hidden=out_dim/num_gpus)
loss = mx.sym.LogisticRegressionOutput(data=fc2, label=labs)

The script to generate the network which used customized operator, and didn't work:

...
fc2 = mx.symbol.FullyConnected(data=concat, name='fcout_'+str(gpu), num_hidden=out_dim/num_gpus)
act2 = mx.sym.Activation(data=fc2, name='acout_'+str(gpu), act_type='sigmoid')
loss = mx.sym.Custom(data=act2, label=label, name='ce_'+str(gpu), op_type='CrossEntropyLoss')

Is this because the custom op is not support yet for group context?

@piiswrong piiswrong self-assigned this Dec 5, 2017
@eric-haibin-lin
Copy link
Member

@mg0880gm could you try latest version of MXNet and update the __init__ function of your XXCustomOpProp from

def __init__(self):

to

def __init__(self, **kwargs):

And see if it works?

@mbaijal
Copy link
Contributor

mbaijal commented Mar 10, 2018

Can you please add the labels - "Operator", "Bug", "Question", "Pending Requester Info"

@anirudh2290
Copy link
Member

@mg0880gm are you still seeing this issue with the latest version of mxnet ?

@eric-haibin-lin
Copy link
Member

Verified on my end that the fix works.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants