You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/08/21 06:59:22 UTC

[GitHub] [incubator-mxnet] szha commented on issue #18942: Floating point exception in mxnet.ndarray.Correlation

szha commented on issue #18942:
URL: https://github.com/apache/incubator-mxnet/issues/18942#issuecomment-678078797


   So here's the problem:
   ```
   % DMLC_LOG_STACK_TRACE_DEPTH=150 MXNET_ENGINE_TYPE=NaiveEngine lldb python3.7 -- test_18942.py
   (lldb) target create "python3.7"
   Current executable set to 'python3.7' (x86_64).
   (lldb) settings set -- target.run-args  "test_18942.py"
   (lldb) run
   Process 82919 launched: '/usr/local/bin/python3.7' (x86_64)
   Process 82919 stopped
   * thread #2, stop reason = exec
       frame #0: 0x0000000100006000 dyld`_dyld_start
   dyld`_dyld_start:
   ->  0x100006000 <+0>: popq   %rdi
       0x100006001 <+1>: pushq  $0x0
       0x100006003 <+3>: movq   %rsp, %rbp
       0x100006006 <+6>: andq   $-0x10, %rsp
   (lldb) cont
   Process 82919 resuming
   [23:55:46] ../src/engine/engine.cc:55: MXNet start using engine: NaiveEngine
   [23:55:46] ../src/storage/storage.cc:198: Using Pooled (Naive) StorageManager for CPU
   Process 82919 stopped
   * thread #2, queue = 'com.apple.main-thread', stop reason = EXC_ARITHMETIC (code=EXC_I386_DIV, subcode=0x0)
       frame #0: 0x0000000112b06279 libmxnet.dylib`mxnet::op::CorrelationProp::InferShape(this=0x000000010056ffa0, in_shape=0x00007ffeefbfc1d0, out_shape=0x00000001005baeb0, aux_shape=0x00007ffeefbfc1b0) const at correlation-inl.h:219
      216 	     / static_cast<float>(stride1));
      217 	    top_height_ = std::ceil(static_cast<float>(paddedbottomheight - border_size_ * 2)\
      218 	     / static_cast<float>(stride1));
   -> 219 	    neighborhood_grid_radius_ = param_.max_displacement / stride2;
      220 	    neighborhood_grid_width_ = neighborhood_grid_radius_ * 2 + 1;
      221 	    top_channels_ = neighborhood_grid_width_ * neighborhood_grid_width_;
      222 	    CHECK_GE(top_width_, 1U) <<
   ```
   
   https://github.com/apache/incubator-mxnet/blob/9bdd4d6347c284770ee5bfe5ae98f1dabc283829/src/operator/correlation-inl.h#L219
   
   The code needs to guard against zero-size array for right operand of `/`, and we should add a smoke test to guard against such problem in this op, similar to https://github.com/apache/incubator-mxnet/pull/18972/files


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org