Skip to content

[CodeStyle][F401] remove unused imports in python/paddle/distributed - #46758

Merged
luotao1 merged 17 commits into
PaddlePaddle:developfrom
cattidea:F401/fix/python-paddle-distributed
Oct 12, 2022
Merged

luotao1 merged 17 commits into
PaddlePaddle:developfrom
cattidea:F401/fix/python-paddle-distributed

Conversation

@SigureMo

@SigureMo SigureMo commented Oct 5, 2022 •

Copy link
Copy Markdown
Collaborator

PR types

Others

PR changes

Others

Describe

修复 python/paddle/fluid/tests/unittests/distributed/ 目录 F401 unused import 存量 python 代码

autoflake --in-place --remove-all-unused-imports --ignore-pass-after-docstring --exclude=__init__.py --recursive ./python/paddle/distributed

Related links

@paddle-bot

paddle-bot Bot commented Oct 5, 2022

Copy link
Copy Markdown

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册。
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot-old paddle-bot-old Bot added the contributor External developers label Oct 5, 2022
@SigureMo

This comment was marked as outdated.

@SigureMo SigureMo changed the title [WIP][CodeStyle][F401] remove unused imports in python/paddle/distributed [CodeStyle][F401] remove unused imports in python/paddle/distributed Oct 6, 2022
@luotao1 luotao1 self-assigned this Oct 10, 2022
@SigureMo SigureMo changed the title [CodeStyle][F401] remove unused imports in python/paddle/distributed [WIP][CodeStyle][F401] remove unused imports in python/paddle/distributed Oct 10, 2022
# limitations under the License.

from paddle.distributed.fleet.meta_optimizers.common import is_optimizer_op, OP_ROLE_KEY, OpRole
from paddle.distributed.fleet.meta_optimizers.sharding.utils import *

@SigureMo SigureMo Oct 10, 2022 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

image

由于这行的存在,导致暴露了 API add_sync_comm 在 paddle.distributed.fleet.meta_optimizers.sharding.fp16_helper.add_sync_comm 暴露(develop 下直接运行 python tools/count_api_without_core_ops.py -c paddle 即可看到本 API),但这个 API 的暴露应该并不是预期的,而删除本 import 后则会导致 API 路径变动为 paddle.distributed.fleet.meta_optimizers.sharding.utils.add_sync_comm,因此会被认为「新增」API,触发本 CI 拦截

@SigureMo SigureMo changed the title [WIP][CodeStyle][F401] remove unused imports in python/paddle/distributed [CodeStyle][F401] remove unused imports in python/paddle/distributed Oct 10, 2022

@raindrops2sea raindrops2sea left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@luotao1
luotao1 merged commit fe716a0 into PaddlePaddle:develop Oct 12, 2022
@SigureMo
SigureMo deleted the F401/fix/python-paddle-distributed branch October 12, 2022 03:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor External developers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[F401] python/paddle/distributed/

5 participants