Comments (11)
结果不一致的问题已经解决了,不是模型结构不一致的问题,是pytorch的参数矩阵转置问题。
from lightseq.
您指的max_step应该是位置向量的最大长度吧,这改成100,的确能扩大vocab size到50257,感谢 !
from lightseq.
结果不一致的问题已经解决了,不是模型结构不一致的问题,是pytorch的参数矩阵转置问题。
@bigprince97 您好,我也遇到了lightseq预测结果和pytorch版本的gpt2(https://github.com/yangjianxin1/GPT2-chitchat)
不一致的问题,百思不解中幸运地找到了您的解释,请问您说的pytorch的参数矩阵转置的问题,是出现在torch.load()中的吗?能否给一些详细的信息呢?感谢
@Majokiki pytorch的weight很多都是[out_dim, in_dim]的方式存储的,lightseq中需要[in_dim, out_dim]的方式存储
from lightseq.
@bigprince97 感谢你使用lightseq并成功应用在自己的模型上面。回答一下你提出的两个问题:
1.vocab设置过大显存会爆。
显存占用除了vocab size会影响之外,max_batch_size和max_step的设置也会影响到显存的占用。建议可以适当调小这两个参数来提供更多的空间给更大的vocab size。
2.3090使用lightseq。
目前的使用并没有限制显卡的具体型号,只限制了cuda>=10.1,所以理论上是可以在3090上成功使用的。方便分享更多的信息以查看具体原因吗,包括报错,cuda版本等信息。
from lightseq.
cuda版本是11.0
在创建容器时会提示tensorrt server的提示3090不支持该容器。
运行实例代码时,报错如下:
from lightseq.
另外我将pytorch版本的gpt2的参数根据proto转换成了对应的模型文件,lightseq可以正常推理,但是预测结果和pytorch版本的gpt2有很大差异,pytorch版本是按照gpt2论文的结构,可能和lightseq里面的gpt模型结构有细微差异,这一块具体的模型结构,能够麻烦提供具体的pytorch或者tf版本的实现吗?
from lightseq.
很高兴看到你的问题得到解决,剩下一个是3090上的运行。这个问题的主要原因在于build所依赖的Nvidia Triton inference server镜像不支持3090。
我们前几天更新了CMake的编译方法,解决了对Triton inference server镜像的依赖,欢迎你尝试一下doc/build.md里提到的方法进行编译,应该可以解决在3090或者说是cuda11下的运行问题。
from lightseq.
from lightseq.
项目里有submodule,尝试git submodule update --init
from lightseq.
结果不一致的问题已经解决了,不是模型结构不一致的问题,是pytorch的参数矩阵转置问题。
@bigprince97 您好,我也遇到了lightseq预测结果和pytorch版本的gpt2(https://github.com/yangjianxin1/GPT2-chitchat)
不一致的问题,百思不解中幸运地找到了您的解释,请问您说的pytorch的参数矩阵转置的问题,是出现在torch.load()中的吗?能否给一些详细的信息呢?感谢
from lightseq.
结果不一致的问题已经解决了,不是模型结构不一致的问题,是pytorch的参数矩阵转置问题。
@bigprince97 您好,我也遇到了lightseq预测结果和pytorch版本的gpt2(https://github.com/yangjianxin1/GPT2-chitchat)
不一致的问题,百思不解中幸运地找到了您的解释,请问您说的pytorch的参数矩阵转置的问题,是出现在torch.load()中的吗?能否给一些详细的信息呢?感谢@Majokiki pytorch的weight很多都是[out_dim, in_dim]的方式存储的,lightseq中需要[in_dim, out_dim]的方式存储
您好,我也遇到了pytorch和lightseq的gpt2不一致的问题,请问具体是怎么解决的呢?在pytorch模型转化之前做什么吗?
from lightseq.
Related Issues (20)
- How to get output scores for each output tokens of LightSeq BART model when inference
- Do you consider supporting the chatglm model?
- ls_torch_hf_quant_gpt2_export.py的使用问题
- lightseq' Transformer expects an extra layer_norm on both encoder and decoder level
- LLaMA example 结果验证
- 请问lightseq在推理流程中有gemm调参这一步吗?
- Is llama inference available now? HOT 1
- Do you have plans to support token_type_ids?
- llama inference test HOT 3
- 请问lightseq可以支持segmentAnyting的推理优化吗 HOT 1
- 为什么连给的example也有bug? HOT 4
- [Question] gptj, mpt support.
- question about environment
- how to resolve xlm-roberta convert fail
- Can int8 in pre-training large model ???
- lightseq是否支持clip模型的int8量化?
- Is it normal that A10 inference speed is lower than 2080ti? HOT 1
- identifier "__hisnan" is undefined HOT 4
- 要求C++ 17 HOT 1
- Exception: Installed CUDA version 12.3 does not match the version torch was compiled with 12.1, unable to compile cuda/cpp extensions without a matching cuda version.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lightseq.