Skip to content

Conversation

zeroRains
Copy link
Contributor

@zeroRains zeroRains commented Apr 22, 2024

PR Category

Others

PR Types

Others

Description

需先Merge前置PR:#63732

move fake_quantize_dequantize_moving_average_abs_max to phi

Copy link

paddle-bot bot commented Apr 22, 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.

@zeroRains
Copy link
Contributor Author

感觉应该是梯度计算出问题了,我试过将fluid中的方法改写成phi的格式,并将functor迁移到phi下,是可以通过CI中报错的单测的,但是将整个op迁移到phi下就产生了错误,需要老师帮忙看一下怎么解决。

@yuanlehome

Comment on lines 316 to 318
self.check_grad(
['X'], 'Out', user_defined_grads=gradient, check_dygraph=False
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

感觉和这里有点关系,因为还在fluid下的op测试是不需要设置check_dygraph=False的选项的,在迁移到phi下会出现下图的问题,我是不是漏配置了什么东西,也需要老师帮忙看一下。

image

Copy link
Contributor

Choose a reason for hiding this comment

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

ci上看到这个单测通过了,你重新提交一个commit过下所有CI再观察下

@zeroRains zeroRains changed the title 【Hackathon 6th No.55】move fake_quantize_dequantize_moving_average_abs_max to phi - part 【Hackathon 6th No.55】move fake_quantize_dequantize_moving_average_abs_max/fake_quantize_dequantize_moving_average_abs_max op to phi - part May 6, 2024
_C_ops.assign_out_(out2, self._scale)
_C_ops.assign_out_(out3, state)
_C_ops.assign_out_(out4, accum)
return quant_out
Copy link
Contributor Author

Choose a reason for hiding this comment

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

按照提供的解决方案给对应原本ouput的变量进行赋值,但是由于原本的self._scale是一个可选参数,可能导致没有初始化,从而产生了这个问题,请问应该如何修改呢?

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@YuanRisheng 麻烦老师帮忙看下_(:з」∠)_

Copy link
Contributor

Choose a reason for hiding this comment

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

试试用_is_initialized方法先判断一下out,再选择看是否assign

Copy link
Contributor Author

Choose a reason for hiding this comment

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

image

emmm,如果能进入这个分支应该已经init了,但是还是报错,(:з」∠)

Copy link
Contributor

Choose a reason for hiding this comment

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

试试用_is_initialized方法先判断一下out,再选择看是否assign

判断out2,不是判断_scale

@zeroRains
Copy link
Contributor Author

CI通过了~

@yuanlehome @YuanRisheng

@luotao1 luotao1 merged commit 1f6682a into PaddlePaddle:develop May 22, 2024
@luotao1 luotao1 changed the title 【Hackathon 6th No.55】move fake_quantize_dequantize_moving_average_abs_max/fake_quantize_dequantize_moving_average_abs_max op to phi - part 【Hackathon 6th No.55】move fake_quantize_dequantize_moving_average_abs_max/fake_quantize_dequantize_moving_average_abs_max op to phi May 22, 2024
@zeroRains zeroRains changed the title 【Hackathon 6th No.55】move fake_quantize_dequantize_moving_average_abs_max/fake_quantize_dequantize_moving_average_abs_max op to phi 【Hackathon 6th No.55】move fake_quantize_dequantize_moving_average_abs_max/fake_quantize_dequantize_abs_max op to phi May 22, 2024
co63oc pushed a commit to co63oc/Paddle that referenced this pull request May 23, 2024
…_max/fake_quantize_dequantize_moving_average_abs_max op to phi - part (PaddlePaddle#63737)

* move functor to phi

* fix namespace

* modify to phi method and fix the bug in dequantize_log op when set the pir

* move fake_quantize_dequantize_moving_average_abs_max to phi

* fix bug

* move fake_quantize_dequantize_abs_max to phi

* roback

* modify the dynamic graph function  call

* fix dynamic modify

* still have bug

* add the assign

* roback

* merge

* merge

* fix bug

* fix merge bug

* fix bug

* fix bug

* fix bug
@zeroRains zeroRains deleted the 55_2 branch May 27, 2024 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants