Skip to content

Migrate platform/device_event.h [fluid_ops] #67036

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

Merged
merged 1 commit into from
Aug 8, 2024

Conversation

co63oc
Copy link
Contributor

@co63oc co63oc commented Aug 5, 2024

PR Category

Operator Mechanism

PR Types

Others

Description

迁移platform下部分文件到PHI,修改头文件路径
platform/device_context.h
platform/profiler_helper.h
platform/device/xpu/xpu_resource_pool.h
platform/device/xpu/xpu_resource_pool.cc
platform/device/custom/custom_device_resource_pool.cc
platform/device/custom/custom_device_resource_pool.h
platform/device/gpu/gpu_types.h
platform/device/gpu/gpu_dnn.h
platform/device_context.cc
platform/device_event_custom_device.cc
platform/cuda_graph_with_memory_pool.h
platform/resource_pool.h
platform/device_event_gpu.cc
platform/cuda_graph_with_memory_pool.cc
platform/cuda_device_guard.h
platform/device_event_cpu.h
platform/device_event_base.h
platform/device_event.h
platform/device_event_base.cc

Copy link

paddle-bot bot commented Aug 5, 2024

你的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 paddle-bot bot added the contributor External developers label Aug 5, 2024
@co63oc co63oc changed the title CI 测试不review [fluid_ops] header Migrate platform/device_event.h [fluid_ops] Aug 7, 2024
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Aug 7, 2024
@luotao1 luotao1 self-assigned this Aug 7, 2024
@luotao1 luotao1 merged commit 52c0917 into PaddlePaddle:develop Aug 8, 2024
31 checks passed
@co63oc co63oc deleted the fix_platform2 branch August 9, 2024 04:42
@risemeup1
Copy link
Contributor

paddle/phi/core/platform/device_event_base.h 这个里面include了fluid的头文件,不太符合规范

@risemeup1
Copy link
Contributor

可以看看收否不依赖这两个头文件,或者把这两个迁移下来成本多大,或者没办法,把这个算子暂时迁移回去?

@co63oc
Copy link
Contributor Author

co63oc commented Jun 13, 2025

可以看看收否不依赖这两个头文件,或者把这两个迁移下来成本多大,或者没办法,把这个算子暂时迁移回去?

这部分是比较复杂的,不然也没必要迁移到phi, profiler 依赖device event, memory 依赖 profiler, paddle/phi/backends/gpu/gpu_context.cc 包含了memory,需要先看下paddle/phi/core/memory/allocation 这部分要怎么拆分

@luotao1
Copy link
Contributor

luotao1 commented Jun 13, 2025

comment by @wanghuancoder :
处理原则:

  1. 有些phi下有自己的include,比如:paddle/fluid/platform/enforce.h可以替换为paddle/phi/core/enforce.h
  2. 有些根本不需要include的可以直接删掉,比如:paddle/phi/common/type_promotion.h里的fluid include就可以删掉
  3. 有些必须移回fluid,比如paddle/phi/core/platform/device_event_base.h,他使用了paddle/fluid/framework/op_registry.h,必须移回fluid去

@co63oc
Copy link
Contributor Author

co63oc commented Jun 13, 2025

comment by @wanghuancoder : 处理原则:

  1. 有些phi下有自己的include,比如:paddle/fluid/platform/enforce.h可以替换为paddle/phi/core/enforce.h
  2. 有些根本不需要include的可以直接删掉,比如:paddle/phi/common/type_promotion.h里的fluid include就可以删掉
  3. 有些必须移回fluid,比如paddle/phi/core/platform/device_event_base.h,他使用了paddle/fluid/framework/op_registry.h,必须移回fluid去

paddle/phi/core/platform/device_context.cc 这里面有部分是IPU的代码,IPU模块在 paddle/fluid/platform/device/ipu/
image
这部分怎么处理

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants