Skip to content

Conversation

SevenSamon
Copy link
Contributor

PR types

New features

PR changes

[Models]

Description

add pp for chatglmv2

Copy link

paddle-bot bot commented Aug 29, 2024

Thanks for your contribution!

Copy link

codecov bot commented Aug 29, 2024

Codecov Report

Attention: Patch coverage is 27.64706% with 123 lines in your changes missing coverage. Please review.

Project coverage is 53.21%. Comparing base (907ad20) to head (8fc4c8a).
Report is 191 commits behind head on develop.

Files with missing lines Patch % Lines
paddlenlp/transformers/chatglm_v2/modeling_pp.py 21.33% 118 Missing ⚠️
paddlenlp/transformers/chatglm_v2/modeling.py 78.57% 3 Missing ⚠️
...p/experimental/transformers/chatglm_v2/modeling.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9043      +/-   ##
===========================================
- Coverage    53.26%   53.21%   -0.05%     
===========================================
  Files          652      654       +2     
  Lines       105615   105775     +160     
===========================================
+ Hits         56254    56293      +39     
- Misses       49361    49482     +121     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

LayerNormFunc = RMSNorm if config.rmsnorm else nn.LayerNorm
# Final layer norm before output.
self.final_layernorm = LayerNormFunc(config.hidden_size, epsilon=config.layernorm_epsilon)
self.final_layernorm = LayerNormFunc(config.hidden_size, epsilon=config.layernorm_epsilon, config=config)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why we need change this?


class RMSNorm(nn.Layer):
def __init__(self, hidden_size, epsilon=None):
def __init__(self, hidden_size, config: ChatGLMv2Config, epsilon=None):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
def __init__(self, hidden_size, config: ChatGLMv2Config, epsilon=None):
def __init__(self, config: ChatGLMv2Config):
hidden_size = config.hidden_size
eps = config.eps

LayerNormFunc = RMSNorm if config.rmsnorm else nn.LayerNorm
# Final layer norm before output.
self.final_layernorm = LayerNormFunc(config.hidden_size, epsilon=config.layernorm_epsilon)
self.final_layernorm = LayerNormFunc(config.hidden_size, epsilon=config.layernorm_epsilon, config=config)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if config.rmsnorm:
RMSNorm(config)
else:
nn.LayerNorm(xxx,xx)

self.config = config
self.fp32_residual_connection = config.fp32_residual_connection

LayerNormFunc = RMSNorm if config.rmsnorm else nn.LayerNorm
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

class LayerNorm(nn.LayerNorm):
     def __init__(self, config):
            self.config = config
            super().__init__(config.hidde_size, xx)

@CLAassistant
Copy link

CLAassistant commented Sep 20, 2024

CLA assistant check
All committers have signed the CLA.

Copy link

github-actions bot commented Dec 9, 2024

This Pull Request is stale because it has been open for 60 days with no activity. 当前Pull Request 60天内无活动,被标记为stale。

@github-actions github-actions bot added the stale label Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants