Skip to content

【Docathon】删除被弃用的API #7238

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

Closed
Echo-Nie opened this issue Apr 7, 2025 · 13 comments
Closed

【Docathon】删除被弃用的API #7238

Echo-Nie opened this issue Apr 7, 2025 · 13 comments
Assignees

Comments

@Echo-Nie
Copy link
Contributor

Echo-Nie commented Apr 7, 2025

Note

Motivation: #7127 by @ooooo-create (o 师傅)

背景

飞桨官网的 API 文档采用 ReStructuredText (.rst) 格式编写,经渲染后以 HTML 格式呈现。.rst 文件对缩进、空行等格式非常敏感,稍有不当便可能导致渲染异常。目前,飞桨 API 文档中广泛使用 COPY-FROM: 的注解语法,目的是展示 API 的代码样例。然而,部分文档中 COPY-FROM: 的 API 已被弃用,导致用户在调用时出现错误。

NPUPlace 为例,官网显示的注解效果如下图红框所示:

Image

对应的 .rst 源码如下:

.. _cn_api_paddle_NPUPlace:

NPUPlace
-------------------------------

.. py:class:: paddle.NPUPlace

``NPUPlace`` 是一个设备描述符,表示一个分配或将要分配 ``Tensor`` 的 NPU 设备。
每个 ``NPUPlace`` 有一个 ``dev_id`` (设备 id)来表明当前的 ``NPUPlace`` 所代表的显卡编号,编号从 0 开始。
``dev_id`` 不同的 ``NPUPlace`` 所对应的内存不可相互访问。
这里编号指的是显卡实际的编号,而不是显卡的逻辑编号。

参数
::::::::::::

  - **id** (int,可选) - NPU 的设备 ID。

代码示例
::::::::::::

COPY-FROM: paddle.NPUPlace

问题

目前,部分 API 已被废弃。例如:

impory paddle
paddle.NPUPlace

运行时会抛出以下错误:

Attribute Error : module 'paddle' has no attribute 'NPUPlace'

经排查发现以下文件均存在类似问题,需要统一修正,直接删除该文档即可。

docs\api\paddle\NPUPlace_cn.rst
docs\api\paddle\device\is_compiled_with_mlu_cn.rst
docs\api\paddle\device\is_compiled_with_npu_cn.rst
docs\api\paddle\device\MLUPlace_cn.rst
docs\api\paddle\incubate\nn\FusedEcMoe_cn.rst
docs\api\paddle\incubate\nn\functional\fused_ec_moe_cn.rst
docs\api\paddle\nn\functional\flash_attention_with_sparse_mask_cn.rst
docs\api\paddle\static\mlu_places_cn.rst
docs\api\paddle\static\npu_places_cn.rst
docs\api\paddle\static\nn\multi_box_head_cn.rst
docs\api\paddle\static\nn\sequence_concat_cn.rst
docs\api\paddle\static\nn\sequence_enumerate_cn.rst
docs\api\paddle\static\nn\sequence_expand_as_cn.rst
docs\api\paddle\static\nn\sequence_pad_cn.rst
docs\api\paddle\static\nn\sequence_reshape_cn.rst
docs\api\paddle\static\nn\sequence_reverse_cn.rst
docs\api\paddle\static\nn\sequence_scatter_cn.rst
docs\api\paddle\static\nn\sequence_slice_cn.rst
docs\api\paddle\static\nn\sequence_unpad_cn.rst

任务描述

请直接删除以下的 .rst 文件,并且提交PR(在 PR 描述中附上主框架删除相关源码的 PR,如 #52378),同时@Echo-Nie @sunzhongkai588 进行review。

待修复文档清单:

序号 文档路径 认领人/状态/PR
1 docs\api\paddle\NPUPlace_cn.rst @VVX94 #7241
@Echo-Nie #7251
2 docs\api\paddle\device\is_compiled_with_mlu_cn.rst @VVX94 #7241
@Echo-Nie #7251
3 docs\api\paddle\device\is_compiled_with_npu_cn.rst @Jacoblincc
@Echo-Nie #7283
4 docs\api\paddle\device\MLUPlace_cn.rst @Jacoblincc
@Echo-Nie #7283
5 docs\api\paddle\incubate\nn\FusedEcMoe_cn.rst @Redamancy8013 #7287 #7290
6 docs\api\paddle\incubate\nn\functional\fused_ec_moe_cn.rst @APPARENT1
@Echo-Nie #7284
7 docs\api\paddle\nn\functional\flash_attention_with_sparse_mask_cn.rst @APPARENT1
@Echo-Nie #7284
8 docs\api\paddle\static\mlu_places_cn.rst @ZMS-PNG #7266 #7267
9 docs\api\paddle\static\npu_places_cn.rst @ZMS-PNG #7266 #7267
10 docs\api\paddle\static\nn\multi_box_head_cn.rst @Alex-Yanggg #7269
11 docs\api\paddle\static\nn\sequence_concat_cn.rst @Alex-Yanggg #7269
12 docs\api\paddle\static\nn\sequence_enumerate_cn.rst @QuarryFlow #7270
@Dipan112233 #7272
13 docs\api\paddle\static\nn\sequence_expand_as_cn.rst @QuarryFlow #7270
@Dipan112233 #7272
14 docs\api\paddle\static\nn\sequence_pad_cn.rst @Dipan112233 #7274
15 docs\api\paddle\static\nn\sequence_reshape_cn.rst @rigidwill666 #7280 #7281
16 docs\api\paddle\static\nn\sequence_reverse_cn.rst @rigidwill666 #7280 #7281
17 docs\api\paddle\static\nn\sequence_scatter_cn.rst @Dipan112233 #7274
18 docs\api\paddle\static\nn\sequence_slice_cn.rst @hanlintang #7273
19 docs\api\paddle\static\nn\sequence_unpad_cn.rst @hanlintang #7273

修复步骤

  1. PaddlePaddle/docs 仓库下找到对应的 .rst 文件,删除整个文件。
  2. 找到对应文件夹下的Overview文件,删除里面的相关API引用内容。
  3. 在PR中@该issue,如: #7238
  4. 在PR描述中添加Paddle主框架 Paddle 里删除API源码的PR,如下图:

Image

  1. 提交PR并@对应人员进行review希望这能帮助你清晰地描述问题并推动修复任务,参与修复的开发者将获得官网贡献者展示机会🎉

任务认领

Note

  1. Issue 回复格式:
    为了自动填写报名信息,需要在 issue 下回复报名信息,如果报名格式不正确,则会在 comment 区提示报名不正确,格式如下:
【报名】:2、3、6-10

其中【报名】后直接是报名的赛题序号,多个赛题之间需要用中文顿号 分隔,多个连续赛题可以用横线 - 表示。

Note

2. PR 标题格式:

[Docathon][Delete Deprecated API Doc No.2、3、6-10]

Note

3. PR 内容:
描述删除了哪个文件,并 @sunzhongkai588 @Echo-Nie review

参考资料

文档贡献指南
API文档书写规范


看板信息

任务方向 任务数量 提交作品 / 任务认领 提交率 完成 完成率
删除被弃用的API 19 19 / 19 100.0% 19 100.0%

统计信息

排名不分先后 @VVX94 (2) @Echo-Nie (4) @Redamancy8013 (1) @ZMS-PNG (2) @Alex-Yanggg (2) @QuarryFlow (2) @Dipan112233 (2) @rigidwill666 (2) @hanlintang (2)

@VVX94
Copy link
Contributor

VVX94 commented Apr 7, 2025

【报名】:1-2

@APPARENT1
Copy link
Contributor

【报名】:6-7

@Jacoblincc
Copy link

【报名】:3、4

@ZMS-PNG
Copy link
Contributor

ZMS-PNG commented Apr 16, 2025

【报名】:8-9

@hanlintang
Copy link
Contributor

【报名】:18-19

@rigidwill666
Copy link
Contributor

【报名】:15-16

@Alex-Yanggg
Copy link
Contributor

【报名】:10-11

@QuarryFlow
Copy link
Contributor

【报名】:12-13

1 similar comment
@Dipan112233
Copy link
Contributor

Dipan112233 commented Apr 20, 2025

【报名】:12-13

@Dipan112233
Copy link
Contributor

【报名】:14、17

@Redamancy8013
Copy link
Contributor

【报名】:5

@Echo-Nie
Copy link
Contributor Author

Echo-Nie commented Apr 22, 2025

【报名】:3、4、6、7

@luotao1
Copy link
Collaborator

luotao1 commented Apr 24, 2025

【Docathon】删除被弃用的API 已全部完成,感谢参与的小伙伴们!

排名不分先后 @VVX94 (2) @Echo-Nie (4) @Redamancy8013 (1) @ZMS-PNG (2) @Alex-Yanggg (2) @QuarryFlow (2) @Dipan112233 (2) @rigidwill666 (2) @hanlintang (2)

欢迎继续参与 Call for Contributions

@luotao1 luotao1 closed this as completed Apr 24, 2025
@github-project-automation github-project-automation bot moved this from In Progress to Done in Call for Contributions Apr 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

No branches or pull requests