mxnet icon indicating copy to clipboard operation
mxnet copied to clipboard

Raising num_args bound ?

Open Kublai-Jing opened this issue 11 years ago • 10 comments

When I try to compile LSTM with quite a long time steps (200), following error occurs,

     71     """
     72     if ret != 0:
---> 73         raise MXNetError(py_str(_LIB.MXGetLastError()))
     74 
     75 def c_str(string):

MXNetError: value 100for Parameter num_args exceed bound [1,100)

It seems that for whatever reason, 100 is a hard limit on the number of args that can be compiled ? I wonder whether we can change this bound (if we have more memory)

Thanks !

Kublai-Jing avatar Nov 02 '15 17:11 Kublai-Jing

Please submit a PR for this, this was due to some choices in the parameters side. You should be able to locate the num_args in the operators you performed. Instead of using DECLARE_PARAMETER(num_args).set_range(1,100) change it to DECLARE_PARAMETER(num_args).set_lower_bound(1)

tqchen avatar Nov 02 '15 17:11 tqchen

cc @antinucleon

tqchen avatar Nov 02 '15 17:11 tqchen

Thx ! Given that we can set this using that command, what you suggest the PR is for ?

Kublai-Jing avatar Nov 02 '15 17:11 Kublai-Jing

Oh, this is the code on C++ side, not python. for example https://github.com/dmlc/mxnet/blob/master/src/operator/concat-inl.h#L31

tqchen avatar Nov 02 '15 17:11 tqchen

This being said, I do not know in which specific operator this num_args constraint sits, so will need a bit of your help in catching it:)

tqchen avatar Nov 02 '15 17:11 tqchen

Can we treat it as a global environment variable ?

Kublai-Jing avatar Nov 02 '15 17:11 Kublai-Jing

The idea is by default we should have no limit in num_args. The previous settings are quite arbitrary and should be corrected

tqchen avatar Nov 02 '15 17:11 tqchen

seems that the only place where this hard limit is placed is

struct ElementWiseSumParam : public dmlc::Parameter<ElementWiseSumParam> {
30    int num_args;
31    DMLC_DECLARE_PARAMETER(ElementWiseSumParam) {
32      DMLC_DECLARE_FIELD(num_args).set_range(1, 100)

in src/operator/elementwise_sum-inl.h

It seems suffices to just remove that constraint there

Kublai-Jing avatar Nov 02 '15 20:11 Kublai-Jing

Yes, pls go ahead to do so On Mon, Nov 2, 2015 at 12:32 PM Kublai-Jing [email protected] wrote:

seems that the only place where this hard limit is placed is

struct ElementWiseSumParam : public dmlc::Parameter { 30 int num_args; 31 DMLC_DECLARE_PARAMETER(ElementWiseSumParam) { 32 DMLC_DECLARE_FIELD(num_args).set_range(1, 100)

in src/operator/elementwise_sum-inl.h

It seems suffices to just remove that constraint there

— Reply to this email directly or view it on GitHub https://github.com/dmlc/mxnet/issues/467#issuecomment-153148076.

tqchen avatar Nov 02 '15 20:11 tqchen

Thanks to @Kublai-Jing fixed by #469

tqchen avatar Nov 04 '15 06:11 tqchen