Issue/517 InfiniCore 添加 nn::module c++接口 &&线性层实现#531
Merged
Conversation
PanZezhong1725
requested changes
Oct 29, 2025
PanZezhong1725
requested changes
Oct 29, 2025
Collaborator
|
@wooway777 @pengcheng888 这个测试里用到all close了,我觉得这应该是在tensor级别甚至时op级别需要实现的功能,而不应该测试框架单独实现,哪怕先数据全copy到cpu糊一个 |
PanZezhong1725
requested changes
Oct 29, 2025
3981559 to
e3c69ee
Compare
PanZezhong1725
requested changes
Oct 31, 2025
| size_t embedding_dim, | ||
| std::optional<int64_t> padding_idx, | ||
| const Device &device) | ||
| : weight_(Parameter({num_embeddings, embedding_dim}, DataType::F32, device)), |
Collaborator
There was a problem hiding this comment.
Embedding的初始化中,固定了权重参数weight_的数据类型是 DataType::F32, 如果safetensor中的数据类型是bf16能处理吗
- Implement core modules: Linear, Embedding, RMSNorm - Add PyTorch-like macros for module and parameter definition - INFINICORE_NN_MODULE for single module declaration - INFINICORE_NN_MODULE_VEC for module vectors - INFINICORE_NN_PARAMETER for parameter declaration - Corresponding INIT macros for initialization - Implement hierarchical module system with dynamic path generation - Add state_dict() and load_state_dict() support - Refactor module design: protected registration methods, removed path_ member - Add comprehensive test suite including TinyLlama integration - All parameters are protected with public accessors
Signed-off-by: Ceng23333 <441651826@qq.com>
PanZezhong1725
approved these changes
Oct 31, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#517