You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Currently, when creating numpy.ndarray within the dynamic-to-static function, both SOT-based and AST-based dynamic-to-static approaches encounter segmentation faults when processing numpy ndarrays.
--------------------------------------
C++ Traceback (most recent call last):
--------------------------------------
0 paddle::pybind::static_api_full(_object*, _object*, _object*)
1 paddle::pybind::PyObject_ToDouble(_object*)
----------------------
Error Message Summary:
----------------------
FatalError: `Segmentation fault` is detected by the operating system.
[TimeInfo: *** Aborted at 1740040223 (unix time) try "date -d @1740040223"if you are using GNU date ***]
[SignalInfo: *** SIGSEGV (@0x0) received by PID 35955 (TID 0x7fbdbd58d740) from PID 0 ***]
Segmentation fault (core dumped)
The solution involves splitting NumpyVariable handling into two distinct cases: numpy.Number (already supported in SOT) and numpy.ndarray (to be supported subsequently).
When encountering operations between paddle.Tensor and numpy.ndarray, it will fall back to dynamic graph execution.
This issue currently causes identical segmentation faults in the Co-Deformable-DETR-R50_CINN model of PaddleDetection.
# regression iou cost, defaultly giou is used in official DETR.bboxes=bbox_cxcywh_to_xyxy(bbox_pred) *factoriou_cost=self.iou_cost(bboxes, gt_bboxes)
# weighted sum of above three costscost=cls_cost+reg_cost+iou_cost# <---------------- 这里报错 iou_cost 是 numpy array# 3. do Hungarian matching on CPU using linear_sum_assignmentcost=cost.detach().cpu()
iflinear_sum_assignmentisNone:
raiseImportError('Please run "pip install scipy" '
[EXECUTOR RUN] Start execute opcode: <code object $resume_51@assign_218fe at 0x7f5fc7fe0190, file "/workspace/tmp/PaddleX/paddlex/repo_manager/repos/PaddleDetection/ppdet/modeling/assigners/hungarian_assigner.py", line 344>
[Translate Executor]: (line 415) LOAD_FAST cls_cost, stack is []
[Translate Executor]: (line 415) LOAD_FAST reg_cost, stack is [TensorVariable([300, 1], float32, False, var_2485, None, cls_cost, object_72417)]
[Translate Executor]: (line 415) BINARY_ADD None, stack is [TensorVariable([300, 1], float32, False, var_2485, None, cls_cost, object_72417), TensorVariable([300, 1], float32, False, var_2486, None, reg_cost, object_72421)]
inputs : ((var_2485, var_2486), {})
[Translate Executor]: (line 415) LOAD_FAST resume_51_stack_0, stack is [TensorVariable([300, 1], float32, False, var_2490, None, tmp_var_cls_cost_reg_cost, object_72611)]
[Translate Executor]: (line 415) BINARY_ADD None, stack is [TensorVariable([300, 1], float32, False, var_2490, None, tmp_var_cls_cost_reg_cost, object_72611), NumpyArrVariable([[-1.15825517]
[-1.23576199]
[-1.28707552]
[ 0.27751816]], resume_51_stack_0, object_72416)]
--------------------------------------
C++ Traceback (most recent call last):
--------------------------------------
0 paddle::pybind::static_api_full(_object*, _object*, _object*)
1 paddle::pybind::PyObject_ToDouble(_object*)
----------------------
Error Message Summary:
----------------------
FatalError: `Segmentation fault` is detected by the operating system.
[TimeInfo: *** Aborted at 1740040843 (unix time) try "date -d @1740040843" if you are using GNU date ***]
[SignalInfo: *** SIGSEGV (@0x0) received by PID 8417 (TID 0x7f5fe5bd2740) from PID 0 ***]
你的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.
SigureMo
changed the title
[SOT] Split NumpyVariable for separate array/number handling
[SOT][3.13] Split NumpyVariable for separate array/number handling
Feb 20, 2025
The reason will be displayed to describe this comment to others. Learn more.
这行用不到,后面可以删了
SigureMo
changed the title
[SOT][3.13] Split NumpyVariable for separate array/number handling
[SOT] Split NumpyVariable for separate array/number handling
Feb 20, 2025
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Category
Execute Infrastructure
PR Types
Bug fixes
Description
Currently, when creating
numpy.ndarray
within the dynamic-to-static function, both SOT-based and AST-based dynamic-to-static approaches encounter segmentation faults when processing numpy ndarrays.The solution involves splitting
NumpyVariable
handling into two distinct cases:numpy.Number
(already supported in SOT) andnumpy.ndarray
(to be supported subsequently).When encountering operations between paddle.Tensor and numpy.ndarray, it will fall back to dynamic graph execution.
This issue currently causes identical segmentation faults in the
Co-Deformable-DETR-R50_CINN
model ofPaddleDetection
.https://github.com/PaddlePaddle/PaddleDetection/blob/59d5f5ebebc2a380f5f07dd413a056b75af01f2a/ppdet/modeling/assigners/hungarian_assigner.py#L415
This PR is under @SigureMo ’s guidance.
PCard-66972