-
Notifications
You must be signed in to change notification settings - Fork 682
revise noaux_tc #3164
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
revise noaux_tc #3164
Conversation
|
Thanks for your contribution! |
| auto input_type = scores_with_bias.dtype(); | ||
| auto place = scores_with_bias.place(); | ||
| auto group_scores = paddle::empty({num_tokens, n_group}, input_type, place); | ||
| auto topk_values = paddle::empty({num_tokens, topk}, input_type, place); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noaux_tc算子能否补充一个单测监控起来这里精度,有一个散op的形式也便于理解和对精度🧐
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
| try: | ||
| from fastdeploy.model_executor.ops.gpu import noaux_tc | ||
| except: | ||
| logger.warning("import noaux_tc Failed!") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这种import方式从哪里学到的,try的原因是啥
| False, | ||
| ) | ||
| if layer.topk_method == "noaux_tc" and gate_out.size > 0: | ||
| score, topk_idx, topk_weights = get_moe_scores( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里的score和topk_weights分别是什么含义,routed_scaling_factor是作用在哪一个上面的。而且上面的返回值不是scores, topk_values, topk_idx。这里解包之后是score, topk_idx, topk_weights
| auto input_type = scores_with_bias.dtype(); | ||
| auto place = scores_with_bias.place(); | ||
| auto group_scores = paddle::empty({num_tokens, n_group}, input_type, place); | ||
| auto topk_values = paddle::empty({num_tokens, topk}, input_type, place); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
revise noaux_tc function to get topk_ids and topk_weight