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

【PaddlePaddle Hackathon 4】No.63 add fp16 and bf16 for eye and frame #51819

Merged
merged 12 commits into from
Apr 6, 2023

Conversation

longranger2
Copy link
Contributor

PR types

Others

PR changes

APIs

Describe

  • add eye fp16 test and bfp16 support
  • add frame fp16 test and bfp16 support

相关链接:
#51281
原来的PR:#51531

@paddle-bot paddle-bot bot added the contributor External developers label Mar 18, 2023
@longranger2 longranger2 changed the title 【PaddlePaddle Hackathon 4】No.63 fix eye and frameadd fp16 and bf16 for eye and frame 【PaddlePaddle Hackathon 4】No.63 add fp16 and bf16 for eye and frame Mar 19, 2023
@longranger2
Copy link
Contributor Author

@ZzSean ,辛苦review下~,旧的PR是这个 #51531

@longranger2
Copy link
Contributor Author

还有想问下CI-Windows-Inference的报错应该如何解决呢?

image

or not core.is_bfloat16_supported(core.CUDAPlace(0)),
"core is not complied with CUDA and not support the bfloat16",
)
class TestEyeBF16(OpTest):
Copy link
Contributor

Choose a reason for hiding this comment

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

修改类名TestEyeBF16为TestEyeBF16OP

or not core.is_bfloat16_supported(core.CUDAPlace(0)),
"core is not complied with CUDA and not support the bfloat16",
)
class TestFrameBF16(OpTest):
Copy link
Contributor

Choose a reason for hiding this comment

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

修改类名TestFrameBF16为TestFrameBF16OP

def setUp(self):
self.op_type = "frame"
self.python_api = paddle.signal.frame
self.__class__.op_type = self.op_type
Copy link
Contributor

Choose a reason for hiding this comment

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

这个应该不用在这里设置,OpTest框架里有对应的设置

@longranger2
Copy link
Contributor Author

@Vvsmile 好的,还想问下这个报错需要解决吗?

image

@Vvsmile
Copy link
Contributor

Vvsmile commented Mar 23, 2023

@Vvsmile 好的,还想问下这个报错需要解决吗?

image

这个是前向精度问题,请看一下相关实现里有没有需要转换FP32计算的地方,目前ReRun也可以显示前向差异大小,可用做参考

'num_rows': 219,
'num_columns': 319,
}
self.outputs = {'Out': convert_float_to_uint16(np.eye(219, 319))}
Copy link
Contributor

@ZzSean ZzSean Mar 28, 2023

Choose a reason for hiding this comment

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

这个我看报错,应该也没必要convert了

def setUp(self):
self.op_type = "frame"
self.python_api = paddle.signal.frame
self.shape, self.dtype, self.attrs = self.initTestCase()
Copy link
Contributor

Choose a reason for hiding this comment

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

这个好像没设置self.dtype=uint16?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ZzSean 有的,initTestCase()会返回 np.uint16

image

self.python_api = paddle.signal.frame
self.shape, self.dtype, self.attrs = self.initTestCase()
x = np.random.random(size=self.shape).astype(np.float32)
out = frame_from_librosa(x, **self.attrs)
Copy link
Contributor

Choose a reason for hiding this comment

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

与diagonal问题类似,这里也需要加个.copy()

Copy link
Contributor

@ZzSean ZzSean left a comment

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 ae10133 into PaddlePaddle:develop Apr 6, 2023
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.

5 participants