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

module 'jittor.nn' has no attribute 'SiLU' #197

Open
lzg188 opened this issue Feb 24, 2025 · 1 comment
Open

module 'jittor.nn' has no attribute 'SiLU' #197

lzg188 opened this issue Feb 24, 2025 · 1 comment

Comments

@lzg188
Copy link

lzg188 commented Feb 24, 2025

python JittorLLMs/models/qwen2/main.py 报错。

[i 0224 11:34:33.960974 56 compiler.py:956] Jittor(1.3.8.5) src: /opt/conda/envs/jittor/lib/python3.10/site-packages/jittor
[i 0224 11:34:33.982588 56 compiler.py:957] g++ at /usr/bin/g++(9.4.0)
[i 0224 11:34:33.982730 56 compiler.py:958] cache_path: /root/.cache/jittor/jt1.3.8/g++9.4.0/py3.10.16/Linux-5.15.0-1x25/IntelRXeonRGolx38/default
[i 0224 11:34:34.002127 56 init.py:411] Found nvcc(11.8.89) at /usr/local/cuda/bin/nvcc.
[i 0224 11:34:34.019441 56 init.py:411] Found addr2line(2.34) at /usr/bin/addr2line.
[i 0224 11:34:34.475528 56 compiler.py:1011] cuda key:cu11.8.89_sm_75_89
[i 0224 11:34:35.005984 56 init.py:227] Total mem: 991.77GB, using 16 procs for compiling.
[i 0224 11:34:35.136715 56 jit_compiler.cc:28] Load cc_path: /usr/bin/g++
[i 0224 11:34:35.400391 56 init.cc:62] Found cuda archs: [89,75,]
[i 0224 11:34:35.527280 56 init.py:411] Found mpicc(4.1.5) at /usr/local/mpi/bin/mpicc.
[w 0224 11:34:35.689088 56 compile_extern.py:203] CUDA related path found in LD_LIBRARY_PATH or PATH(['/opt/conda/lib/python3.8/site-packages/torch/lib', '/opt/conda/lib/python3.8/site-packages/torch_tensorrt/lib', '/usr/local/cuda/compat/lib', '/usr/local/nvidia/lib', '/usr/local/nvidia/lib64', '/usr/local/nvm/versions/node/v16.15.1/bin', '/usr/local/nvm/versions/node/v16.15.1/bin', '/root/.vscode-server/bin/33fc5a94a3f99ebe7087e8fe79fbe1d37a251016/bin/remote-cli', '/opt/conda/envs/jittor/bin', '/opt/conda/condabin', '/usr/local/nvm/versions/node/v16.15.1/bin', '/opt/conda/lib/python3.8/site-packages/torch_tensorrt/bin', '/opt/conda/bin', '/usr/local/mpi/bin', '/usr/local/nvidia/bin', '/usr/local/cuda/bin', '/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', '/usr/local/ucx/bin', '/opt/tensorrt/bin', '/root/.vscode-server/bin/33fc5a94a3f99ebe7087e8fe79fbe1d37a251016/bin/remote-cli', '/opt/conda/bin', '/opt/conda/condabin', '/usr/local/nvm/versions/node/v16.15.1/bin', '/opt/conda/lib/python3.8/site-packages/torch_tensorrt/bin', '/opt/conda/bin', '/usr/local/mpi/bin', '/usr/local/nvidia/bin', '/usr/local/cuda/bin', '/usr/local/sbin', '/usr/local/bin', '/usr/sbin', '/usr/bin', '/sbin', '/bin', '/usr/local/ucx/bin', '/opt/tensorrt/bin']), This path may cause jittor found the wrong libs, please unset LD_LIBRARY_PATH and remove cuda lib path in Path.
Or you can let jittor install cuda for you: python3.x -m jittor_utils.install_cuda
[i 0224 11:34:36.040282 56 cuda_flags.cc:49] CUDA enabled.
Traceback (most recent call last):
File "/LocalRun/zhiguo.li/JittorLLMs/./models/qwen2/main.py", line 70, in
main()
File "/LocalRun/zhiguo.li/JittorLLMs/./models/qwen2/main.py", line 13, in main
model = Qwen2ForCausalLM()
File "/LocalRun/zhiguo.li/JittorLLMs/models/qwen2/qwen2_jt/modeling_qwen2.py", line 476, in init
self.model = Qwen2Model(config)
File "/LocalRun/zhiguo.li/JittorLLMs/models/qwen2/qwen2_jt/modeling_qwen2.py", line 411, in init
[Qwen2DecoderLayer(config, layer_idx) for layer_idx in range(config.num_hidden_layers)]
File "/LocalRun/zhiguo.li/JittorLLMs/models/qwen2/qwen2_jt/modeling_qwen2.py", line 411, in
[Qwen2DecoderLayer(config, layer_idx) for layer_idx in range(config.num_hidden_layers)]
File "/LocalRun/zhiguo.li/JittorLLMs/models/qwen2/qwen2_jt/modeling_qwen2.py", line 257, in init
self.mlp = Qwen2MLP(config)
File "/LocalRun/zhiguo.li/JittorLLMs/models/qwen2/qwen2_jt/modeling_qwen2.py", line 130, in init
self.act_fn = nn.SiLU()
AttributeError: module 'jittor.nn' has no attribute 'SiLU'

@lzg188
Copy link
Author

lzg188 commented Feb 24, 2025

依赖的环境都已安装
pip list | grep torch
jtorch 0.1.7
torch 2.0.0
torchvision 0.15

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