-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
[Typing][C-68,C-77][BUAA] Add type annotations for python/paddle/nn/* #67186
Conversation
你的PR提交成功,感谢你对开源项目的贡献! |
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.
请遵守 #65008 对于 PR 的书写要求,不然无法 review
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.
#67178 已经合入了,这里删掉吧
quant_round_type: int = 1, | ||
quant_max_bound: float = 127.0, | ||
quant_min_bound: float = -127.0, | ||
out_scale: Tensor = -1, |
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.
out_scale: Tensor = -1, | |
out_scale: float = -1, |
quant_min_bound: float = -127.0, | ||
out_scale: Tensor = -1, | ||
compute_dtype: str = "default", | ||
) -> Tensor: |
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.
) -> Tensor: | |
) -> tuple[Tensor, Tensor, Tensor, Tensor]: |
out_scale: int = -1, | ||
compute_dtype: str = "default", | ||
) -> Tensor: |
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.
同上
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.
CI 报错,需要编译选项,参考 https://github.com/PaddlePaddle/Paddle/pull/67178/files 在示例中添加
>>> # doctest: +SKIP('Need compile flash attention')
>>> # doctest: +REQUIRES(env:GPU)
dropout1_rate: float | None = 0.5, | ||
dropout2_rate: float | None = 0.5, | ||
activation: str | None = "relu", | ||
ln1_epsilon: float | None = 1e-5, | ||
ln2_epsilon: float | None = 1e-5, | ||
pre_layer_norm: bool | None = False, | ||
training: bool | None = True, | ||
mode: str | None = 'upscale_in_train', | ||
ring_id: int | None = -1, | ||
add_residual: bool | None = True, | ||
name: str | None = None, |
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.
为什么有 None
?
ln2_epsilon: float | None = 1e-5, | ||
pre_layer_norm: bool | None = False, | ||
training: bool | None = True, | ||
mode: str | None = 'upscale_in_train', |
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.
用 Literal
dropout_rate: float | None = 0.5, | ||
ln_epsilon: float | None = 1e-5, | ||
training: bool | None = True, | ||
mode: str | None = 'upscale_in_train', | ||
name: str | None = None, |
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.
同上
dropout_rate: float | None = 0.5, | ||
attn_dropout_rate: float | None = 0.5, | ||
ln_epsilon: float | None = 1e-05, | ||
training: bool | None = True, | ||
mode: str | None = 'upscale_in_train', | ||
ring_id: int | None = -1, | ||
add_residual: bool | None = True, | ||
num_heads: int | None = -1, | ||
transpose_qkv_wb: bool | None = False, |
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.
同上
@@ -962,41 +969,41 @@ def fused_multi_head_attention( | |||
|
|||
|
|||
def fused_multi_transformer( |
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.
几个问题
list[Tensor]|tuple[Tensor]
统一用Sequence[Tensor]
- 默认值没有
None
或者没有说明可以使用的,不要加None
Literal
的使用- 这个函数根据
cache_kvs
的值需要使用overload
Sorry to inform you that 21229fd's CIs have passed for more than 7 days. To prevent PR conflicts, you need to re-run all CIs manually. |
PR Category
User Experience
PR Types
Others
Description
Add type annotations for python/paddle/nn/*