issue/545 nn::module::Rope and nn::module::Swiglu#546
Merged
Conversation
20479b2 to
b11983e
Compare
wooway777
reviewed
Nov 3, 2025
PanZezhong1725
requested changes
Nov 4, 2025
|
|
||
| protected: | ||
| // Parameters (sin and cos cache tables) | ||
| INFINICORE_NN_PARAMETER(sin_cache); |
PanZezhong1725
requested changes
Nov 4, 2025
| std::string extra_repr() const; | ||
|
|
||
| // Accessors for parameters | ||
| Tensor sin_cache() const { return sin_cache_; } |
Collaborator
There was a problem hiding this comment.
这个东西没必要有个接口暴露出去吧。如果能多个rope共享同一个cache,那是有意义的。
| RoPE(size_t head_dim, | ||
| size_t max_seq_len, | ||
| double theta = 10000.0, | ||
| infiniopRoPEAlgo_t algo = INFINIOP_ROPE_ALGO_GPT_J, |
Collaborator
There was a problem hiding this comment.
这里不要用 INFINIOP 的enum。重新定义一个,后端实现的时候如果用infiniop再用这个enum
|
|
||
| namespace infinicore::nn { | ||
|
|
||
| class SwiGLU : public Module { |
Collaborator
There was a problem hiding this comment.
SwiGLU既没有param也没有buffer,没必要做成module。要么作为op,要么nn::functional。和 @pengcheng888 对一下
66bf8f7 to
8d83173
Compare
PanZezhong1725
requested changes
Nov 7, 2025
| * | ||
| * For operations with parameters or state, use the corresponding Module classes. | ||
| */ | ||
| namespace functional { |
Collaborator
There was a problem hiding this comment.
C++ 不要 nn::functional 字段了,感觉没什么意义,保留op里的接口就行
Signed-off-by: Ceng23333 <441651826@qq.com>
PanZezhong1725
approved these changes
Nov 10, 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.
No description provided.