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

Check failed in jt.linalg.pinv/jt.linalg.svd/jt.squeeze #615

Open
x0w3n opened this issue Dec 3, 2024 · 0 comments
Open

Check failed in jt.linalg.pinv/jt.linalg.svd/jt.squeeze #615

x0w3n opened this issue Dec 3, 2024 · 0 comments

Comments

@x0w3n
Copy link

x0w3n commented Dec 3, 2024

Describe the bug

a Check failed is triggered when jt.linalg.pinv/jt.linalg.svd/jt.squeeze process empty input.
The error log suggests reporting this issue.

Full Log

jt.linalg.pinv

[i 1203 10:27:05.763588 64 compiler.py:956] Jittor(1.3.9.10) src: /home/miniconda3/envs/jittor/lib/python3.9/site-packages/jittor
[i 1203 10:27:05.772747 64 compiler.py:957] g++ at /usr/bin/g++(11.2.0)
[i 1203 10:27:05.773275 64 compiler.py:958] cache_path: /home/.cache/jittor/jt1.3.9/g++11.2.0/py3.9.12/Linux-5.15.0-1x30/INTELRXEONRGOLx51/ef26/default
[i 1203 10:27:05.836869 64 install_cuda.py:93] cuda_driver_version: [12, 2]
[i 1203 10:27:05.848001 64 __init__.py:412] Found /home/.cache/jittor/jtcuda/cuda12.2_cudnn8_linux/bin/nvcc(12.2.140) at /home/.cache/jittor/jtcuda/cuda12.2_cudnn8_linux/bin/nvcc.
[i 1203 10:27:06.282845 64 __init__.py:412] Found gdb(12.0.90) at /usr/bin/gdb.
[i 1203 10:27:06.285543 64 __init__.py:412] Found addr2line(2.38) at /usr/bin/addr2line.
[i 1203 10:27:06.606813 64 compiler.py:1013] cuda key:cu12.2.140_sm_89
[i 1203 10:27:07.461870 64 __init__.py:227] Total mem: 251.50GB, using 16 procs for compiling.
[i 1203 10:27:07.692982 64 jit_compiler.cc:28] Load cc_path: /usr/bin/g++
[i 1203 10:27:07.955490 64 init.cc:63] Found cuda archs: [89,]
Traceback (most recent call last):
  File "test.py", line 10, in <module>
    y = jt.linalg.pinv(x)
  File "/home/miniconda3/envs/jittor/lib/python3.9/site-packages/jittor/linalg.py", line 428, in pinv
    sw = list(x.shape[:-2]) + [x.shape[-1]] + [x.shape[-2]]
RuntimeError: Wrong inputs arguments, Please refer to examples(help(jt.NanoVector.__map_getitem__)).

Types of your inputs are:
 self   = NanoVector,
 arg0   = int,

The function declarations are:
 inline int64 at(int i)
 inline NanoVector slice(Slice slice)

Failed reason:[f 1203 10:27:08.815261 64 nano_vector.h:116] Check failed: i>=0 && i<size()  Something wrong... Could you please report this issue?

jt.linalg.svd

[i 1203 10:29:50.036728 40 compiler.py:956] Jittor(1.3.9.10) src: /home/miniconda3/envs/jittor/lib/python3.9/site-packages/jittor
[i 1203 10:29:50.047661 40 compiler.py:957] g++ at /usr/bin/g++(11.2.0)
[i 1203 10:29:50.048145 40 compiler.py:958] cache_path: /home/.cache/jittor/jt1.3.9/g++11.2.0/py3.9.12/Linux-5.15.0-1x30/INTELRXEONRGOLx51/ef26/default
[i 1203 10:29:50.115843 40 install_cuda.py:93] cuda_driver_version: [12, 2]
[i 1203 10:29:50.130764 40 __init__.py:412] Found /home/.cache/jittor/jtcuda/cuda12.2_cudnn8_linux/bin/nvcc(12.2.140) at /home/.cache/jittor/jtcuda/cuda12.2_cudnn8_linux/bin/nvcc.
[i 1203 10:29:50.575382 40 __init__.py:412] Found gdb(12.0.90) at /usr/bin/gdb.
[i 1203 10:29:50.577777 40 __init__.py:412] Found addr2line(2.38) at /usr/bin/addr2line.
[i 1203 10:29:50.971275 40 compiler.py:1013] cuda key:cu12.2.140_sm_89
[i 1203 10:29:52.241770 40 __init__.py:227] Total mem: 251.50GB, using 16 procs for compiling.
[i 1203 10:29:52.412161 40 jit_compiler.cc:28] Load cc_path: /usr/bin/g++
[i 1203 10:29:52.638114 40 init.cc:63] Found cuda archs: [89,]
Traceback (most recent call last):
  File "test.py", line 6, in <module>
    _, _, _ = jt.linalg.svd(zero_dim_array)
  File "/home/miniconda3/envs/jittor/lib/python3.9/site-packages/jittor/linalg.py", line 288, in svd
    m, n = x.shape[-2:]
RuntimeError: Wrong inputs arguments, Please refer to examples(help(jt.NanoVector.__map_getitem__)).

Types of your inputs are:
 self   = NanoVector,
 arg0   = slice,

The function declarations are:
 inline int64 at(int i)
 inline NanoVector slice(Slice slice)

Failed reason:[f 1203 10:29:53.429273 40 nano_vector.h:32] Check failed: start==stop || (start>=0 && stop>=-1 && start<size && stop<=size)  Something wrong... Could you please report this issue?
 slice overflow: -1 1 1

jt.squeeze

[i 1203 15:35:42.749199 08 compiler.py:956] Jittor(1.3.9.10) src: /home/miniconda3/envs/jittor/lib/python3.9/site-packages/jittor
[i 1203 15:35:42.758586 08 compiler.py:957] g++ at /usr/bin/g++(11.2.0)
[i 1203 15:35:42.758647 08 compiler.py:958] cache_path: /home/.cache/jittor/jt1.3.9/g++11.2.0/py3.9.12/Linux-5.15.0-1x30/INTELRXEONRGOLx51/ef26/default
[i 1203 15:35:42.826473 08 install_cuda.py:93] cuda_driver_version: [12, 2]
[i 1203 15:35:42.840034 08 __init__.py:412] Found /home/.cache/jittor/jtcuda/cuda12.2_cudnn8_linux/bin/nvcc(12.2.140) at /home/.cache/jittor/jtcuda/cuda12.2_cudnn8_linux/bin/nvcc.
[i 1203 15:35:43.271473 08 __init__.py:412] Found gdb(12.0.90) at /usr/bin/gdb.
[i 1203 15:35:43.274165 08 __init__.py:412] Found addr2line(2.38) at /usr/bin/addr2line.
[i 1203 15:35:43.756776 08 compiler.py:1013] cuda key:cu12.2.140_sm_89
[i 1203 15:35:44.812470 08 __init__.py:227] Total mem: 251.50GB, using 16 procs for compiling.
[i 1203 15:35:45.017860 08 jit_compiler.cc:28] Load cc_path: /usr/bin/g++
[i 1203 15:35:45.230310 08 init.cc:63] Found cuda archs: [89,]
Traceback (most recent call last):
  File "test.py", line 5, in <module>
    y = jt.squeeze(x)
  File "/home/miniconda3/envs/jittor/lib/python3.9/site-packages/jittor/__init__.py", line 736, in squeeze
    return x.reshape(new_shape)
  File "/home/miniconda3/envs/jittor/lib/python3.9/site-packages/jittor/__init__.py", line 686, in reshape
    return origin_reshape(x, shape)
RuntimeError: Wrong inputs arguments, Please refer to examples(help(jt.ops.reshape)).

Types of your inputs are:
 self   = module,
 args   = (Var, list, ),

The function declarations are:
 VarHolder* reshape(VarHolder* x,  NanoVector shape)

Failed reason:[f 1203 15:35:45.987937 08 reshape_op.cc:25] Check failed: shape.size() > 0  Something wrong... Could you please report this issue?
 input target shape of reshape can't be empty.

Minimal Reproduce

import jittor as jt

zero_dim_array = jt.array([])
_, _, _ = jt.linalg.svd(zero_dim_array)

import jittor as jt

x = jt.array([])
y = jt.linalg.pinv(x)
print(y)
import jittor as jt

x = jt.ones(())
y = jt.squeeze(x)

Expected behavior

The input needs to be checked.

@x0w3n x0w3n changed the title Check failed in jt.linalg.pinv/jt.linalg.svd Check failed in jt.linalg.pinv/jt.linalg.svd/jt.squeeze Dec 3, 2024
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

1 participant