Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash with error happend during compilatio in jt.contrib.argmax_pool #529

Closed
x0w3n opened this issue May 12, 2024 · 0 comments
Closed

Crash with error happend during compilatio in jt.contrib.argmax_pool #529

x0w3n opened this issue May 12, 2024 · 0 comments

Comments

@x0w3n
Copy link

x0w3n commented May 12, 2024

Describe the bug

When input some boundary values to the parameter jt.contrib.argmax_pool, it causes a crash.

Full Log

[i 0512 08:06:46.005275 92 compiler.py:956] Jittor(1.3.9.6) src: /jittor/python/jittor
[i 0512 08:06:46.007794 92 compiler.py:957] g++ at /usr/bin/g++(8.3.0)
[i 0512 08:06:46.007902 92 compiler.py:958] cache_path: /root/.cache/jittor/jt1.3.9/g++8.3.0/py3.7.4/Linux-5.15.153x56/13thGenIntelRCx56/8c5a/master
[i 0512 08:06:46.011709 92 __init__.py:412] Found addr2line(2.31.1) at /usr/bin/addr2line.
[i 0512 08:06:46.229068 92 __init__.py:227] Total mem: 15.43GB, using 5 procs for compiling.
[i 0512 08:06:46.298353 92 jit_compiler.cc:28] Load cc_path: /usr/bin/g++
Traceback (most recent call last):
  File "test.py", line 78, in <module>
    jt.contrib.argmax_pool(x,size=0,stride=-1)
  File "/jittor/python/jittor/contrib.py", line 18, in argmax_pool
    return pool.pool(x, size, 'maximum', padding, stride)
  File "/jittor/python/jittor/pool.py", line 512, in pool
    return Pool(kernel_size, stride, padding, op=op)(x)
  File "/jittor/python/jittor/__init__.py", line 1184, in __call__
    return self.execute(*args, **kw)
  File "/jittor/python/jittor/pool.py", line 176, in execute
    '''])
RuntimeError: Wrong inputs arguments, Please refer to examples(help(jt.ops.code)).

Types of your inputs are:
 self   = module,
 args   = (list, NanoString, list, ),
 kwargs = {cuda_header=str, cuda_src=str, cuda_grad_src=list, cpu_header=str, cpu_src=str, cpu_grad_src=list, },

The function declarations are:
 VarHolder* code(NanoVector shape,  NanoString dtype, vector<VarHolder*>&& inputs={},  string&& cpu_src="",  vector<string>&& cpu_grad_src={},  string&& cpu_header="",  string&& cuda_src="",  vector<string>&& cuda_grad_src={},  string&& cuda_header="",  DataMap&& data={})
 vector_to_tuple<VarHolder*> code_(vector<NanoVector>&& shapes,  vector<NanoString>&& dtypes, vector<VarHolder*>&& inputs={},  string&& cpu_src="",  vector<string>&& cpu_grad_src={},  string&& cpu_header="",  string&& cuda_src="",  vector<string>&& cuda_grad_src={},  string&& cuda_header="",  DataMap&& data={})
 vector_to_tuple<VarHolder*> code__(vector<VarHolder*>&& inputs, vector<VarHolder*>&& outputs,  string&& cpu_src="",  vector<string>&& cpu_grad_src={},  string&& cpu_header="",  string&& cuda_src="",  vector<string>&& cuda_grad_src={},  string&& cuda_header="",  DataMap&& data={})

Failed reason:[f 0512 08:06:46.415548 92 code_op.cc:25] Check failed: (i == 0) ^ (v[i] >= 0)  Something wrong... Could you please report this issue?
 Vary shape should only occur in the first dimension: [2,3,-3,-4,]

Minimal Reproduce

import jittor as jt
from jittor import *
x = jt.randn(2,3,4,5)
jt.contrib.argmax_pool(x,size=0,stride=-1)

Expected behavior

The stride parameter to jt.contrib.argmax_pool should not be negative and should be replaced with runtime error instead of direct crash.

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

No branches or pull requests

2 participants