Skip to content
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

[eager][utils] fix GRAD_SLOT_META_TEMPLATE fmt error #63345

Merged
merged 1 commit into from
Apr 10, 2024

Conversation

gouzil
Copy link
Member

@gouzil gouzil commented Apr 9, 2024

PR Category

User Experience

PR Types

Bug fixes

Description

修复 GLOG_v>=6 下格式化输出的错误

在 log_v 6 下 const char* GRAD_SLOT_META_TEMPLATE = " {SlotSize: [%d]: %s} "; 需要传大小和内容,而修复前只传了内容

I0409 13:34:50.035048 3900504768 eager_op_function.cc:28054] Running Eager Final State API: arange
I0409 13:34:50.035063 3900504768 eager_op_function.cc:28056] args count: 2
I0409 13:34:50.035090 3900504768 dygraph_functions.cc:56816] Running AD API: arange
I0409 13:34:50.035135 3900504768 dygraph_functions.cc:56840]  No Type Promotion for arange_ad_func api.
I0409 13:34:50.035171 3900504768 dygraph_functions.cc:56862] Running C++ API: arange
Assertion failed: (0 && "tinyformat: Too many conversion specifiers in format string"), function formatImpl, file tinyformat.h, line 816.
[1]    12681 abort      python test/dygraph_to_static/test_no_gradient.py

修复后

I0409 14:24:41.228745 3900504768 eager_op_function.cc:28054] Running Eager Final State API: arange
I0409 14:24:41.228746 3900504768 eager_op_function.cc:28056] args count: 2
I0409 14:24:41.228751 3900504768 dygraph_functions.cc:56816] Running AD API: arange
I0409 14:24:41.228753 3900504768 dygraph_functions.cc:56840]  No Type Promotion for arange_ad_func api.
I0409 14:24:41.228755 3900504768 dygraph_functions.cc:56862] Running C++ API: arange
I0409 14:24:41.228794 3900504768 dygraph_functions.cc:56879] { Input: [
( start , [{Name: None, Initialized: 1, Ptr: 0x12f4864d8,TensorInfo: [ Type: DenseTensor, Dtype: int32, Place: Place(cpu), Shape: 1, DistAttr: Unknown ], ADInfo:[ Grad: [ {Name: None, Initialized: 0, Ptr: 0x0,TensorInfo: [ Unknown ], ADInfo:[ None ]} ],  GradNode: [ BackwardOutMeta: [  {SlotSize: [1]: SlotID: 0, StopGradients: 0, , Edges[ { NULL Edge } ]}  ], BackwardInMeta: [  {SlotSize: [1]: SlotID: 0, StopGradients: 0, , Edges[ { NULL Edge } ]}  ] ], StopGradient: [ 1 ] ]}]),
( end , [{Name: None, Initialized: 1, Ptr: 0x12f4fcf68,TensorInfo: [ Type: DenseTensor, Dtype: int32, Place: Place(cpu), Shape: 1, DistAttr: Unknown ], ADInfo:[ Grad: [ {Name: None, Initialized: 0, Ptr: 0x0,TensorInfo: [ Unknown ], ADInfo:[ None ]} ],  GradNode: [ BackwardOutMeta: [  {SlotSize: [1]: SlotID: 0, StopGradients: 0, , Edges[ { NULL Edge } ]}  ], BackwardInMeta: [  {SlotSize: [1]: SlotID: 0, StopGradients: 0, , Edges[ { NULL Edge } ]}  ] ], StopGradient: [ 1 ] ]}]),
( step , [{Name: None, Initialized: 1, Ptr: 0x12f4dca28,TensorInfo: [ Type: DenseTensor, Dtype: int32, Place: Place(cpu), Shape: 1, DistAttr: Unknown ], ADInfo:[ Grad: [ {Name: None, Initialized: 0, Ptr: 0x0,TensorInfo: [ Unknown ], ADInfo:[ None ]} ],  GradNode: [ BackwardOutMeta: [  {SlotSize: [1]: SlotID: 0, StopGradients: 0, , Edges[ { NULL Edge } ]}  ], BackwardInMeta: [  {SlotSize: [1]: SlotID: 0, StopGradients: 0, , Edges[ { NULL Edge } ]}  ] ], StopGradient: [ 1 ] ]}]), ]}

@gouzil gouzil requested a review from SigureMo April 9, 2024 06:34
Copy link

paddle-bot bot commented Apr 9, 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 Apr 9, 2024
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

LGTMeow 🐾

@SigureMo SigureMo merged commit 12888a3 into PaddlePaddle:develop Apr 10, 2024
29 of 30 checks passed
co63oc pushed a commit to co63oc/Paddle that referenced this pull request Apr 10, 2024
@gouzil gouzil deleted the fix_eager_utils branch May 9, 2024 00:42
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.

2 participants