Skip to content

issue/142:添加rms_norm算子测例 #146

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

JYMiracle305
Copy link
Collaborator

image
image

@JYMiracle305 JYMiracle305 self-assigned this Apr 3, 2025
@JYMiracle305 JYMiracle305 changed the title 添加rms_norm算子测例 issue/142 添加rms_norm算子测例 Apr 3, 2025
@JYMiracle305 JYMiracle305 changed the title issue/142 添加rms_norm算子测例 issue/142:添加rms_norm算子测例 Apr 3, 2025
return normalized * weight

class RMSNormTestCase(InfiniopTestCase):
def __init__(
Copy link
Collaborator

Choose a reason for hiding this comment

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

第一维不连续的情况怎么测?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

新增生成第一维不连续张量的参数

atype: np.dtype,
wtype: np.dtype,
epsilon: float = 1e-5,
input_non_contiguous: bool = False,
Copy link
Collaborator

Choose a reason for hiding this comment

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

直接传入input stride吧

self.weight = random_tensor(weight_shape, wtype)
self.epsilon = epsilon
self.result = np.zeros_like(self.input)
self.ans = rms_norm(self.input, self.weight, self.epsilon).astype(atype)
Copy link
Collaborator

Choose a reason for hiding this comment

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

答案用f64计算

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants