任务背景
此次任务为 为 Paddle 框架 API 添加类型提示(Type Hints) 以及 Python 版本退场中 Ruff 升级部分的联合企划。
Python 3.8 EOL 在即1,是时候开始考虑 Python 3.8 退场的一些事情了。但是先别急,正式退场还需要一段时间,但我们可以考虑一些现阶段可以做的事情了~
自引入 Ruff 以来,每退场一个旧版本时必做的事情就是调整 target-version
了,我们现在所使用的 target-version
是 py38
,也就是表明我们最低支持的 Python 版本是 3.8。当然,在我们正式退场 3.8 时需要将其调整为 py39
。
经过简单的测试,我们发现升级 py39 居然有 1000 多个问题需要修复,这么庞大的数量对于我们退场 3.8 来说是有一点小小的阻力的
$ ruff check . --statistics --output-format concise --target-version=py39
691 UP006 [*] non-pep585-annotation
375 UP035 [ ] deprecated-import
3 UP036 [*] outdated-version-block
一般来说,只有真正能退场 3.8 的时候才可以修复这些问题,因为这些问题是 3.9 引入了一些新特性,而 3.8 并不支持……但我们这次的报错是有一些不同的,这里的报错基本都是 PEP 585 的升级问题,即使用类似 list
、 collections.abc.Sequence
这种标准泛型来替代 typing.List
、 typing.Sequence
这种泛型,虽然直接使用仍然会报错,但是 PEP 585 明确提到了,如果使用 PEP 563 (即 from __future__ import annotations
),那么我们是可以在「类型注解语义」下使用这些标准泛型的。而刚好,我们的类型提示本就是将使用 PEP 563 作为规范的一部分的,因此我们完全可以在当前还支持 3.8 的情况下,通过使用 PEP 563,在「类型注解语义」的 case 下,来修复 PEP 585 弃用掉的类型
因此本次希望与大家一起推动 PEP 585 升级,退场掉大部分弃用的 typing 泛型使用
任务目标
让我们来看看具体要怎么做吧~
示例一
from typing import List
def code_block(self, lang: str, block: List[str]):
...
修改为
from __future__ import annotations
def code_block(self, lang: str, block: list[str]):
...
Note
一定要在文件开头加上 from __future__ import annotations
,否则如上所述,这在 3.8 下会报错的哦~
如果不清楚使用方式, 请搜索仓库中存量的 from __future__ import annotations
来查看使用方法。
示例二
from typing import Sequence
def transpose(
x: Tensor, perm: Sequence[int], name: str | None = None
) -> Tensor:
...
修改为
from __future__ import annotations
from collections.abc import Sequence
def transpose(
x: Tensor, perm: Sequence[int], name: str | None = None
) -> Tensor:
...
示例三
如果需要替换的对象出现在 「非类型注解语义」 的场景下不能进行修改, 如果一个文件所有 case 都处于「非类型注解语义」下,请在本 issue 评论区留言或在提交 PR 时指出即可。
from __future__ import annotations
from collections.abc import Iterable
IterableInt = Iterable[int] # 非类型注解语义,这里运行时会执行
class Foo(Iterable[int]): ... # 非类型注解语义,同样会执行
def foo() -> Iterable[int]: ... # 类型注解语义,PEP 563 下会延迟计算
def foo(input: Iterable[int]): ... # 类型注解语义,PEP 563 下会延迟计算
当然我们大多数类型提示都是在「类型注解语义」下使用的,「非类型注解语义」下使用的很少,所以大多数可以放心替换~
你也可以参考 PR #66941 来查看一个完整的 PR 大概要如何修改
实施步骤
安装 ruff v0.5.0
首先我们需要能够复现这 1000 多个问题,首先就需要自己安装一下 Ruff
目前 paddle 所使用的 ruff 版本为 0.5.0,请使用相同版本确保问题的可复现性:
$ pip install ruff==0.5.0
问题复现
以 python/paddle/tensor/linalg.py
为例
$ ruff check python/paddle/tensor/linalg.py --target-version=py39
python/paddle/tensor/linalg.py:16:1: UP035 [*] Import from `collections.abc` instead: `Sequence`
|
14 | from __future__ import annotations
15 |
16 | from typing import TYPE_CHECKING, Literal, Sequence, overload
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ UP035
17 |
18 | import numpy as np
|
= help: Import from `collections.abc`
Found 1 error.
[*] 1 fixable with the `--fix` option.
UP035 为错误码,可以参考「示例二」进行修改,也可以在 ruff rules 查找错误码对应的规则。
Note
PEP 585 只对应 UP006 和 UP035 两条 rule,如果遇到 UP036 则直接跳过,当前 Python 3.8 未退场的情况下无法提前修复 UP036
任务列表
序号 | 文件 | 认领人 Github id | PR 链接 |
---|---|---|---|
✅1 | paddle/fluid/ir_adaptor/translator/op_compat_gen.py | ✅@enkilee | #66965 |
🟢2 | paddle/fluid/operators/generator/filters.py | 🟢@enkilee | #66968 |
🟢3 | paddle/fluid/operators/generator/parse_utils.py | 🟢@enkilee | #66968 |
🙋4 | paddle/fluid/pir/dialect/op_generator/ops_onednn_extra_parser.py | 🙋@Caogration | |
🙋5 | paddle/phi/api/generator/api_base.py | 🙋@Caogration | |
🙋6 | paddle/phi/kernels/fusion/cutlass/memory_efficient_attention/generate_kernels.py | 🙋@Caogration | |
🙋7 | paddle/phi/kernels/fusion/cutlass/memory_efficient_attention/generate_variable_forward_kernels.py | 🙋@Caogration | |
🙋8 | python/paddle/amp/auto_cast.py | 🙋@Caogration | |
🙋9 | python/paddle/amp/debugging.py | 🙋@Caogration | |
🙋10 | python/paddle/audio/backends/backend.py | 🙋@Caogration | |
🙋11 | python/paddle/audio/backends/init_backend.py | 🙋@Caogration | |
🙋12 | python/paddle/audio/backends/wave_backend.py | 🙋@Caogration | |
🙋13 | python/paddle/audio/datasets/dataset.py | 🙋@Caogration | |
🙋14 | python/paddle/audio/datasets/esc50.py | 🙋@Caogration | |
🙋15 | python/paddle/audio/datasets/tess.py | 🙋@Caogration | |
🙋16 | python/paddle/audio/functional/window.py | 🙋@Caogration | |
🙋17 | python/paddle/autograd/autograd.py | 🙋@Caogration | |
🙋18 | python/paddle/autograd/backward_mode.py | 🙋@Caogration | |
🙋19 | python/paddle/autograd/py_layer.py | 🙋@Caogration | |
🙋20 | python/paddle/base/dygraph/base.py | 🙋@Caogration | |
🙋21 | python/paddle/base/framework.py | 🙋@Caogration | |
🙋22 | python/paddle/batch.py | 🙋@Caogration | |
🙋23 | python/paddle/decomposition/recompute.py | 🙋@Caogration | |
🙋24 | python/paddle/distributed/auto_parallel/api.py | 🙋@Caogration | |
🙋25 | python/paddle/distributed/auto_parallel/interface.py | 🙋@Caogration | |
🙋26 | python/paddle/distributed/auto_tuner/recorder.py | 🙋@Caogration | |
🙋27 | python/paddle/distributed/auto_tuner/utils.py | 🙋@Caogration | |
🙋28 | python/paddle/distributed/checkpoint/load_state_dict.py | 🙋@Caogration | |
🙋29 | python/paddle/distributed/checkpoint/metadata.py | 🙋@Caogration | |
🙋30 | python/paddle/distributed/checkpoint/utils.py | 🙋@Caogration | |
🙋31 | python/paddle/distributed/fleet/meta_parallel/pipeline_parallel.py | 🙋@Caogration | |
🙋32 | python/paddle/distributed/parallel.py | 🙋@Caogration | |
🙋33 | python/paddle/distributed/passes/auto_parallel_gradient_merge.py | 🙋@Caogration | |
🙋34 | python/paddle/distributed/passes/auto_parallel_master_grad.py | 🙋@Caogration | |
🙋35 | python/paddle/distribution/bernoulli.py | 🙋@Caogration | |
🙋36 | python/paddle/distribution/beta.py | 🙋@Caogration | |
🙋37 | python/paddle/distribution/categorical.py | 🙋@Caogration | |
🙋38 | python/paddle/distribution/cauchy.py | 🙋@Caogration | |
🙋39 | python/paddle/distribution/dirichlet.py | 🙋@Caogration | |
🙋40 | python/paddle/distribution/distribution.py | 🙋@Caogration | |
🙋41 | python/paddle/distribution/exponential.py | 🙋@Caogration | |
🙋42 | python/paddle/distribution/gamma.py | 🙋@Caogration | |
🙋43 | python/paddle/distribution/geometric.py | 🙋@Caogration | |
🙋44 | python/paddle/distribution/gumbel.py | 🙋@Caogration | |
🙋45 | python/paddle/distribution/independent.py | 🙋@Caogration | |
🙋46 | python/paddle/distribution/laplace.py | 🙋@Caogration | |
🙋47 | python/paddle/distribution/lognormal.py | 🙋@Caogration | |
🙋48 | python/paddle/distribution/normal.py | 🙋@Caogration | |
🙋49 | python/paddle/distribution/transform.py | 🙋@Caogration | |
🙋50 | python/paddle/distribution/transformed_distribution.py | 🙋@Caogration | |
🙋51 | python/paddle/distribution/uniform.py | 🙋@Fripping | |
🙋52 | python/paddle/distribution/variable.py | 🙋@Fripping | |
🙋53 | python/paddle/fft.py | 🙋@Fripping | |
🙋54 | python/paddle/framework/random.py | 🙋@Fripping | |
🙋55 | python/paddle/hapi/callbacks.py | 🙋@Fripping | |
🙋56 | python/paddle/hapi/hub.py | 🙋@Fripping | |
🙋57 | python/paddle/hapi/model.py | 🙋@Fripping | |
🙋58 | python/paddle/hapi/model_summary.py | 🙋@Fripping | |
🙋59 | python/paddle/incubate/asp/asp.py | 🙋@Fripping | |
🙋60 | python/paddle/incubate/autograd/functional.py | 🙋@Fripping | |
🙋61 | python/paddle/incubate/autograd/primapi.py | 🙋@Fripping | |
🙋62 | python/paddle/incubate/autograd/primx.py | 🙋@Fripping | |
🙋63 | python/paddle/incubate/framework/random.py | 🙋@Fripping | |
🙋64 | python/paddle/incubate/nn/attn_bias.py | 🙋@Fripping | |
🙋65 | python/paddle/inference/wrapper.py | 🙋@Fripping | |
🙋66 | python/paddle/io/dataloader/batch_sampler.py | 🙋@Fripping | |
🙋67 | python/paddle/io/dataloader/dataset.py | 🙋@Fripping | |
🙋68 | python/paddle/io/dataloader/sampler.py | 🙋@Fripping | |
🙋69 | python/paddle/io/reader.py | 🙋@Fripping | |
🙋70 | python/paddle/jit/dy2static/ast_utils.py | 🙋@Fripping | |
🙋71 | python/paddle/jit/sot/opcode_translator/executor/dispatcher.py | 🙋@Fripping | |
🙋72 | python/paddle/jit/sot/opcode_translator/executor/executor_cache.py | 🙋@Fripping | |
🙋73 | python/paddle/jit/sot/opcode_translator/executor/function_graph.py | 🙋@Fripping | |
🙋74 | python/paddle/jit/sot/opcode_translator/executor/tracker.py | 🙋@Fripping | |
🙋75 | python/paddle/jit/sot/opcode_translator/executor/variables/iter.py | 🙋@Fripping | |
🙋76 | python/paddle/jit/utils.py | 🙋@Fripping | |
🙋77 | python/paddle/metric/metrics.py | 🙋@Fripping | |
🙋78 | python/paddle/nn/functional/conv.py | 🙋@Fripping | |
🙋79 | python/paddle/nn/functional/flash_attention.py | 🙋@Fripping | |
🙋80 | python/paddle/nn/functional/loss.py | 🙋@Fripping | |
🙋81 | python/paddle/nn/functional/norm.py | 🙋@Fripping | |
🙋82 | python/paddle/nn/functional/pooling.py | 🙋@Fripping | |
🙋83 | python/paddle/nn/initializer/assign.py | 🙋@Fripping | |
🙋84 | python/paddle/nn/layer/container.py | 🙋@Fripping | |
🙋85 | python/paddle/nn/layer/conv.py | 🙋@Fripping | |
🙋86 | python/paddle/nn/layer/layers.py | 🙋@Fripping | |
🙋87 | python/paddle/nn/layer/norm.py | 🙋@Fripping | |
🙋88 | python/paddle/nn/layer/pooling.py | 🙋@Fripping | |
🙋89 | python/paddle/nn/layer/transformer.py | 🙋@Fripping | |
🙋90 | python/paddle/nn/quant/format.py | 🙋@Fripping | |
🙋91 | python/paddle/nn/utils/clip_grad_norm_.py | 🙋@Fripping | |
🙋92 | python/paddle/nn/utils/clip_grad_value_.py | 🙋@Fripping | |
🙋93 | python/paddle/nn/utils/transform_parameters.py | 🙋@Fripping | |
🙋94 | python/paddle/optimizer/adadelta.py | 🙋@Fripping | |
🙋95 | python/paddle/optimizer/adagrad.py | 🙋@Fripping | |
🙋96 | python/paddle/optimizer/adam.py | 🙋@Fripping | |
🙋97 | python/paddle/optimizer/adamax.py | 🙋@Fripping | |
🙋98 | python/paddle/optimizer/adamw.py | 🙋@Fripping | |
🙋99 | python/paddle/optimizer/asgd.py | 🙋@Fripping | |
🙋100 | python/paddle/optimizer/lamb.py | 🙋@Fripping🙋@Whsjrczr | |
🙋101 | python/paddle/optimizer/lbfgs.py | 🙋@Whsjrczr | |
🙋102 | python/paddle/optimizer/lr.py | 🙋@Whsjrczr | |
🙋103 | python/paddle/optimizer/momentum.py | 🙋@Whsjrczr | |
🙋104 | python/paddle/optimizer/nadam.py | 🙋@Whsjrczr | |
🙋105 | python/paddle/optimizer/optimizer.py | 🙋@Whsjrczr | |
🙋106 | python/paddle/optimizer/radam.py | 🙋@Whsjrczr | |
🙋107 | python/paddle/optimizer/rmsprop.py | 🙋@Whsjrczr | |
🙋108 | python/paddle/optimizer/rprop.py | 🙋@Whsjrczr | |
🙋109 | python/paddle/optimizer/sgd.py | 🙋@Whsjrczr | |
🙋110 | python/paddle/profiler/profiler.py | 🙋@Whsjrczr | |
🙋111 | python/paddle/quantization/config.py | 🙋@Whsjrczr | |
🙋112 | python/paddle/reader/decorator.py | 🙋@Whsjrczr | |
🙋113 | python/paddle/sparse/nn/functional/conv.py | 🙋@Whsjrczr | |
🙋114 | python/paddle/sparse/nn/layer/conv.py | 🙋@Whsjrczr | |
🙋115 | python/paddle/sparse/unary.py | 🙋@Whsjrczr | |
🙋116 | python/paddle/tensor/array.py | 🙋@Whsjrczr | |
🙋117 | python/paddle/tensor/creation.py | 🙋@Whsjrczr | |
🙋118 | python/paddle/tensor/einsum.py | 🙋@Whsjrczr | |
🙋119 | python/paddle/tensor/linalg.py | 🙋@Whsjrczr | |
🙋120 | python/paddle/tensor/manipulation.py | 🙋@Whsjrczr | |
🙋121 | python/paddle/tensor/math.py | 🙋@Whsjrczr | |
🙋122 | python/paddle/tensor/stat.py | 🙋@Whsjrczr | |
🙋123 | python/paddle/utils/cpp_extension/cpp_extension.py | 🙋@Whsjrczr | |
🙋124 | python/paddle/vision/datasets/cifar.py | 🙋@Whsjrczr | |
🙋125 | python/paddle/vision/datasets/flowers.py | 🙋@Whsjrczr | |
🙋126 | python/paddle/vision/datasets/folder.py | 🙋@Whsjrczr | |
🙋127 | python/paddle/vision/datasets/mnist.py | 🙋@Whsjrczr | |
🙋128 | python/paddle/vision/datasets/voc2012.py | 🙋@Whsjrczr | |
🙋129 | python/paddle/vision/models/_utils.py | 🙋@Whsjrczr | |
✅130 | python/paddle/vision/ops.py | 🙋@Whsjrczr✅@SigureMo | #66941 |
🙋131 | test/auto_parallel/hybrid_strategy/semi_auto_parallel_llama_model.py | 🙋@Whsjrczr | |
🙋132 | test/deprecated/legacy_test/auto_parallel_op_test.py | 🙋@Whsjrczr | |
🙋133 | test/dygraph_to_static/check_approval.py | 🙋@Whsjrczr | |
🙋134 | test/dygraph_to_static/test_dynamic_shape_infermeta.py | 🙋@Whsjrczr | |
🙋135 | test/dygraph_to_static/test_typehint.py | 🙋@Whsjrczr | |
🙋136 | test/dygraph_to_static/test_typing.py | 🙋@Whsjrczr | |
🙋137 | test/ipu/op_test_ipu.py | 🙋@Whsjrczr | |
🙋138 | test/ir/inference/auto_scan_test.py | 🙋@Whsjrczr | |
🙋139 | test/ir/inference/program_config.py | 🙋@Whsjrczr | |
🙋140 | test/ir/inference/test_trt_convert_activation.py | 🙋@Whsjrczr | |
🙋141 | test/ir/inference/test_trt_convert_affine_channel.py | 🙋@Whsjrczr | |
🙋142 | test/ir/inference/test_trt_convert_anchor_generator.py | 🙋@Whsjrczr | |
🙋143 | test/ir/inference/test_trt_convert_arg_max.py | 🙋@Whsjrczr | |
🙋144 | test/ir/inference/test_trt_convert_arg_min.py | 🙋@Whsjrczr | |
🙋145 | test/ir/inference/test_trt_convert_argsort.py | 🙋@Whsjrczr | |
🙋146 | test/ir/inference/test_trt_convert_assign.py | 🙋@Whsjrczr | |
🙋147 | test/ir/inference/test_trt_convert_batch_norm.py | 🙋@Whsjrczr | |
🙋148 | test/ir/inference/test_trt_convert_bilinear_interp_v2.py | 🙋@Whsjrczr | |
🙋149 | test/ir/inference/test_trt_convert_bitwise_and.py | 🙋@Whsjrczr | |
🙋150 | test/ir/inference/test_trt_convert_bitwise_not.py | 🙋@Whsjrczr | |
🙋151 | test/ir/inference/test_trt_convert_bitwise_or.py | 🙋@BHmingyang | |
🙋152 | test/ir/inference/test_trt_convert_bmm.py | 🙋@BHmingyang | |
🙋153 | test/ir/inference/test_trt_convert_cast.py | 🙋@BHmingyang | |
🙋154 | test/ir/inference/test_trt_convert_clip.py | 🙋@BHmingyang | |
🙋155 | test/ir/inference/test_trt_convert_compare_and_logical.py | 🙋@BHmingyang | |
🙋156 | test/ir/inference/test_trt_convert_concat.py | 🙋@BHmingyang | |
🙋157 | test/ir/inference/test_trt_convert_conv2d.py | 🙋@BHmingyang | |
🙋158 | test/ir/inference/test_trt_convert_conv2d_transpose.py | 🙋@BHmingyang | |
🙋159 | test/ir/inference/test_trt_convert_conv3d_transpose.py | 🙋@BHmingyang | |
🙋160 | test/ir/inference/test_trt_convert_cross_multihead_matmul.py | 🙋@BHmingyang | |
🙋161 | test/ir/inference/test_trt_convert_cumsum.py | 🙋@BHmingyang | |
🙋162 | test/ir/inference/test_trt_convert_deformable_conv.py | 🙋@BHmingyang | |
🙋163 | test/ir/inference/test_trt_convert_depthwise_conv2d.py | 🙋@BHmingyang | |
🙋164 | test/ir/inference/test_trt_convert_depthwise_conv2d_transpose.py | 🙋@BHmingyang | |
🙋165 | test/ir/inference/test_trt_convert_dropout.py | 🙋@BHmingyang | |
🙋166 | test/ir/inference/test_trt_convert_einsum.py | 🙋@BHmingyang | |
🙋167 | test/ir/inference/test_trt_convert_elementwise.py | 🙋@BHmingyang | |
🙋168 | test/ir/inference/test_trt_convert_elementwiseadd_transpose.py | 🙋@BHmingyang | |
🙋169 | test/ir/inference/test_trt_convert_emb_eltwise_layernorm.py | 🙋@BHmingyang | |
🙋170 | test/ir/inference/test_trt_convert_equal.py | 🙋@BHmingyang | |
🙋171 | test/ir/inference/test_trt_convert_expand_as_v2.py | 🙋@BHmingyang | |
🙋172 | test/ir/inference/test_trt_convert_expand_v2.py | 🙋@BHmingyang | |
🙋173 | test/ir/inference/test_trt_convert_fill_any_like.py | 🙋@BHmingyang | |
🙋174 | test/ir/inference/test_trt_convert_fill_constant.py | 🙋@BHmingyang | |
🙋175 | test/ir/inference/test_trt_convert_flash_multihead_matmul.py | 🙋@BHmingyang | |
🙋176 | test/ir/inference/test_trt_convert_flatten_contiguous_range.py | 🙋@BHmingyang | |
🙋177 | test/ir/inference/test_trt_convert_flip.py | 🙋@BHmingyang | |
🙋178 | test/ir/inference/test_trt_convert_fused_conv2d_add_act.py | 🙋@BHmingyang | |
🙋179 | test/ir/inference/test_trt_convert_fused_token_prune.py | 🙋@BHmingyang | |
🙋180 | test/ir/inference/test_trt_convert_gather.py | 🙋@BHmingyang | |
🙋181 | test/ir/inference/test_trt_convert_gather_nd.py | 🙋@BHmingyang | |
🙋182 | test/ir/inference/test_trt_convert_gelu.py | 🙋@BHmingyang | |
🙋183 | test/ir/inference/test_trt_convert_grid_sampler.py | 🙋@BHmingyang | |
🙋184 | test/ir/inference/test_trt_convert_group_norm.py | 🙋@BHmingyang | |
🙋185 | test/ir/inference/test_trt_convert_hard_sigmoid.py | 🙋@BHmingyang | |
🙋186 | test/ir/inference/test_trt_convert_hard_swish.py | 🙋@BHmingyang | |
🙋187 | test/ir/inference/test_trt_convert_index_select.py | 🙋@BHmingyang | |
🙋188 | test/ir/inference/test_trt_convert_instance_norm.py | 🙋@BHmingyang | |
🙋189 | test/ir/inference/test_trt_convert_inverse.py | 🙋@BHmingyang | |
🙋190 | test/ir/inference/test_trt_convert_layer_norm.py | 🙋@BHmingyang | |
🙋191 | test/ir/inference/test_trt_convert_leaky_relu.py | 🙋@BHmingyang | |
🙋192 | test/ir/inference/test_trt_convert_lookup_table.py | 🙋@BHmingyang | |
🙋193 | test/ir/inference/test_trt_convert_lookup_table_v2.py | 🙋@BHmingyang | |
🙋194 | test/ir/inference/test_trt_convert_matmul.py | 🙋@BHmingyang | |
🙋195 | test/ir/inference/test_trt_convert_matmul_v2.py | 🙋@BHmingyang | |
🙋196 | test/ir/inference/test_trt_convert_multiclass_nms.py | 🙋@BHmingyang | |
🙋197 | test/ir/inference/test_trt_convert_multiclass_nms3.py | 🙋@BHmingyang | |
🙋198 | test/ir/inference/test_trt_convert_multihead_matmul.py | 🙋@BHmingyang | |
🙋199 | test/ir/inference/test_trt_convert_multihead_matmul_roformer.py | 🙋@BHmingyang | |
🙋200 | test/ir/inference/test_trt_convert_nearest_interp.py | 🙋@BHmingyang | |
🚧201 | test/ir/inference/test_trt_convert_nearest_interp_v2.py | 🚧@MufanColin | #66972 |
🚧202 | test/ir/inference/test_trt_convert_one_hot.py | 🚧@MufanColin | #66975 |
🚧203 | test/ir/inference/test_trt_convert_p_norm.py | 🚧@MufanColin | #66975 |
🚧204 | test/ir/inference/test_trt_convert_pad.py | 🚧@MufanColin | #66975 |
🚧205 | test/ir/inference/test_trt_convert_pad3d.py | 🚧@MufanColin | #66975 |
🚧206 | test/ir/inference/test_trt_convert_pool2d.py | 🚧@MufanColin | #66975 |
🙋207 | test/ir/inference/test_trt_convert_preln_residual_bias.py | 🙋@MufanColin | |
🙋208 | test/ir/inference/test_trt_convert_preln_residual_no_bias.py | 🙋@MufanColin | |
🙋209 | test/ir/inference/test_trt_convert_prelu.py | 🙋@MufanColin | |
🙋210 | test/ir/inference/test_trt_convert_qk_multihead_matmul.py | 🙋@MufanColin | |
🙋211 | test/ir/inference/test_trt_convert_quantize_dequantize_linear.py | 🙋@MufanColin | |
🙋212 | test/ir/inference/test_trt_convert_range.py | 🙋@MufanColin | |
🙋213 | test/ir/inference/test_trt_convert_reduce.py | 🙋@MufanColin | |
🙋214 | test/ir/inference/test_trt_convert_reshape.py | 🙋@MufanColin | |
🙋215 | test/ir/inference/test_trt_convert_rnn.py | 🙋@MufanColin | |
🙋216 | test/ir/inference/test_trt_convert_roi_align.py | 🙋@MufanColin | |
🙋217 | test/ir/inference/test_trt_convert_roll.py | 🙋@MufanColin | |
🙋218 | test/ir/inference/test_trt_convert_scale.py | 🙋@MufanColin | |
🙋219 | test/ir/inference/test_trt_convert_scatter.py | 🙋@MufanColin | |
🙋220 | test/ir/inference/test_trt_convert_scatter_nd_add.py | 🙋@MufanColin | |
🙋221 | test/ir/inference/test_trt_convert_shape.py | 🙋@MufanColin | |
🙋222 | test/ir/inference/test_trt_convert_share_data.py | 🙋@MufanColin | |
🙋223 | test/ir/inference/test_trt_convert_shuffle_channel.py | 🙋@MufanColin | |
🙋224 | test/ir/inference/test_trt_convert_size.py | 🙋@MufanColin | |
🙋225 | test/ir/inference/test_trt_convert_slice.py | 🙋@MufanColin | |
🙋226 | test/ir/inference/test_trt_convert_softmax.py | 🙋@MufanColin | |
🙋227 | test/ir/inference/test_trt_convert_solve.py | 🙋@MufanColin | |
🙋228 | test/ir/inference/test_trt_convert_split.py | 🙋@MufanColin | |
🙋229 | test/ir/inference/test_trt_convert_square.py | 🙋@MufanColin | |
🙋230 | test/ir/inference/test_trt_convert_squeeze2.py | 🙋@MufanColin | |
🙋231 | test/ir/inference/test_trt_convert_stack.py | 🙋@MufanColin | |
🙋232 | test/ir/inference/test_trt_convert_strided_slice.py | 🙋@MufanColin | |
🙋233 | test/ir/inference/test_trt_convert_sum.py | 🙋@MufanColin | |
🙋234 | test/ir/inference/test_trt_convert_swish.py | 🙋@MufanColin | |
🙋235 | test/ir/inference/test_trt_convert_take_along_axis.py | 🙋@MufanColin | |
🙋236 | test/ir/inference/test_trt_convert_temporal_shift.py | 🙋@MufanColin | |
🙋237 | test/ir/inference/test_trt_convert_tile.py | 🙋@MufanColin | |
🙋238 | test/ir/inference/test_trt_convert_top_k.py | 🙋@MufanColin | |
🙋239 | test/ir/inference/test_trt_convert_top_k_v2.py | 🙋@MufanColin | |
🙋240 | test/ir/inference/test_trt_convert_trans_layernorm.py | 🙋@MufanColin | |
🙋241 | test/ir/inference/test_trt_convert_transpose.py | 🙋@MufanColin | |
🙋242 | test/ir/inference/test_trt_convert_unary.py | 🙋@MufanColin | |
🙋243 | test/ir/inference/test_trt_convert_unbind.py | 🙋@MufanColin | |
🙋244 | test/ir/inference/test_trt_convert_unfold.py | 🙋@MufanColin | |
🙋245 | test/ir/inference/test_trt_convert_unsqueeze2.py | 🙋@MufanColin | |
🙋246 | test/ir/inference/test_trt_convert_where.py | 🙋@MufanColin | |
🙋247 | test/ir/inference/test_trt_convert_yolo_box.py | 🙋@MufanColin | |
🙋248 | test/ir/inference/test_trt_convert_yolo_box_head.py | 🙋@MufanColin | |
🙋249 | test/ir/inference/test_trt_float64.py | 🙋@MufanColin | |
🙋250 | test/ir/inference/test_trt_int64.py | 🙋@MufanColin | |
🙋251 | test/ir/inference/test_trt_ops_fp32_mix_precision.py | 🙋@MufanColin | |
🙋252 | test/ir/pir/cinn/llama_test_model.py | 🙋@MufanColin | |
🙋253 | test/legacy_test/auto_parallel_op_test.py | 🙋@MufanColin | |
🙋254 | test/legacy_test/test_gast_with_compatibility.py | 🙋@MufanColin | |
🙋255 | test/legacy_test/test_memory_efficient_attention.py | 🙋@MufanColin | |
🙋256 | test/legacy_test/utils.py | 🙋@MufanColin | |
🙋257 | test/prim/model/bert.py | 🙋@MufanColin | |
🙋258 | test/quantization/test_customized_quanter.py | 🙋@MufanColin | |
🙋259 | test/sot/test_builtin_map.py | 🙋@MufanColin | |
🙋260 | tools/cinn/gen_c++_tutorial.py | 🙋@MufanColin | |
✅261 | tools/sampcd_processor.py | ✅@SigureMo | #66941 |
任务认领方式
⭐️ 提交PR 模版 ⭐️:
- // ------- PR 标题 --------
[Typing][PEP585 Upgrade][261] Use stardand collections for type hints in `python/paddle/distribution/beta.py`
或者多个任务:
[Typing][PEP585 Upgrade][1-3] Use stardand collections for type hints in `test/ir/inference/*`
Note
北航同学请注意在任务标题中添加 [BUAA]
,如:
[Typing][PEP585 Upgrade][BUAA][261] Use stardand collections for type hints in `python/paddle/distribution/beta.py`
[Typing][PEP585 Upgrade][BUAA][1-3] Use stardand collections for type hints in `test/ir/inference/*`
⭐️ 认领方式 ⭐️:
请大家以 comment 的形式认领任务,如:
【报名】:1、3、5-7
Note
建议前期先只提 1 个 PR 熟悉流程,如果被 reviewer approve 了,那么后续可以每个 PR 修改 5-10 个文件,避免提交太多 PR, 以避免重复问题。
Warning
单个 PR 提交禁止修改超过 10 个文件, 否则会被 reviewer close。
提交 PR 模版
<!-- TemplateReference: https://github.com/PaddlePaddle/Paddle/wiki/PULL-REQUEST-TEMPLATE--REFERENCE -->
<!-- Demo: https://github.com/PaddlePaddle/Paddle/pull/24810 -->
### PR Category
<!-- One of [ User Experience | Execute Infrastructure | Operator Mechanism | CINN | Custom Device | Performance Optimization | Distributed Strategy | Parameter Server | Communication Library | Auto Parallel | Inference | Environment Adaptation ] -->
User Experience
### PR Types
<!-- One of [ New features | Bug fixes | Improvements | Performance | BC Breaking | Deprecations | Docs | Devs | Not User Facing | Security | Deprecations | Others ] -->
Devs
### Description
<!-- Describe what you’ve done -->
为如下文件添加 PEP 563,并进行 PEP 585 升级:
- xxx.py
- xxx.py
### Related links
- #66936
@gouzil
状态介绍:
✅:已经完全迁移,所有单测都OK!
🙋: 报名
🟢:审核完毕待合入,合入之后完成!
🔵:可认领!
🟡:当前阶段不需要人力继续跟进,下阶段推进
🚧:迁移中,单测还没有过,还没有审核完。
大致正常流程为:
🔵 -> 🙋 -> 🚧 -> 🟢 -> ✅
异常流程为:
🔵 -> 🙋 -> 🚧 -> 🟡
看板信息
任务数量 | 🔵可认领 | 🚧迁移中 | 🟢待合入 | ✅完成 | 🟡下阶段推进 | 🏁完成率 |
---|---|---|---|---|---|---|
261 | 0 | 6 | 2 | 3 | 0 | 1.1% |
排名不分先后 @enkilee(1) @SigureMo(2)
拓展延伸
感兴趣的同学可以了解下 PEP 649 和 PEP 749 ,看看未来 Python(3.14+)又是使用了什么方案来替代 PEP 563 的~
7条答案
按热度按时间w8biq8rn1#
python 3.8 至 python 3.9 类型标注映射表
关联 #65008 (comment)
xsuvu9jc2#
【报名】:1
bbuxkriu3#
【报名】:100-150
zwghvu4y4#
【报名】:151-200
js81xvg65#
【报名】:201-260
zkure5ic6#
【报名】:51-100
mwecs4sa7#
【报名】:4-50