MasterMonster

Results 10 comments of MasterMonster

直接使用[这个方式](https://github.com/THUDM/ChatGLM-6B/issues/162#issuecomment-1475575156)会提示 ```bash # gcc -pthread -fopenmp -std=c99 quantization_kernels_parallel.c -shared -o quantization_kernels_parallel.so /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld: /tmp/ccFoxb3u.o: relocation R_X86_64_32 against `.text' can not be used when making a shared object; recompile with -fPIC /usr/lib64/gcc/x86_64-suse-linux/7/../../../../x86_64-suse-linux/bin/ld:...

``` > gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib64/gcc/x86_64-suse-linux/7/lto-wrapper OFFLOAD_TARGET_NAMES=hsa:nvptx-none Target: x86_64-suse-linux Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,ada,go --enable-offload-targets=hsa,nvptx-none, --without-cuda-driver --enable-checking=release --disable-werror --with-gxx-include-dir=/usr/include/c++/7 --enable-ssp --disable-libssp --disable-libvtv --disable-libcc1...

放弃openmp的话,这样可以加载,先编译`quantization_kernels.so`,之后`model.quantize` ```bash gcc -fPIC -std=c99 quantization_kernels.c -shared -o quantization_kernels.so model = model.quantize(bits=4, kernel_file="xxxxxxx/quantization_kernels.so") ``` 但是咋openmp就有问题呢,哭

这样编译就可以了! ```bash gcc -fPIC -pthread -fopenmp -std=c99 quantization_kernels_parallel.c -shared -o quantization_kernels_parallel.so ``` 之后模型加载时重新`model.quantize`一下 ```python model = model.quantize(bits=4, kernel_file="xxxxxx/quantization_kernels_parallel.so") ```

`-fPIC`是为了让目标文件生成的位置无关,可以在不同的地址空间使用。 `-O3`是指优化级别为3级,可以优化代码大小和执行时间。 这两个参数是可以同时使用,在这次编译动态链接库时,同时使用这两个参数可以提高代码的执行效率和节省内存。 > 虽然不懂为啥吧……

同问,使用Yi-34B-chat已经lora精调完了,最好能再不用再次训练的基础上适当外推到8k就可以,那就太好了!

查了一些资料,说是使用`rope_scaling`参数可以开启`ntk-rope`

May I ask, at least what gpu can run torch==2.1.0? I'm working on 2080ti and torch==2.1.0