Skip to content

Bugfix of svtr when the input is FP16 or FP32 for MindSpore r2.3rc1 #686

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
Mar 29, 2024

Conversation

Bourn3z
Copy link
Collaborator

@Bourn3z Bourn3z commented Mar 29, 2024

Thank you for your contribution to the MindOCR repo.
Before submitting this PR, please make sure:

Motivation

解决已知问题:当amp_level = 'O2'时,即网络输入为FP16时,grid_sample有计算问题。因此将算子输入手动转换到FP64计算。
临时规避方案,待r2.3.0修复grid_sample计算问题后,应回退该PR。
Solve known issues: When amp_level = 'O2', that is, when the network input is FP16, grid_sample has calculation problems. Therefore, the input is manually cast to FP64.

(Write your motivation for proposed changes here.)

Test Plan

(How should this PR be tested? Do you require special setup to run the test or repro the fixed bug?)

Related Issues and PRs

(Is this PR part of a group of changes? Link the other relevant PRs and Issues here. Use https://help.github.com/en/articles/closing-issues-using-keywords for help on GitHub syntax)

@panshaowu panshaowu changed the title Bugfix of GridSample when the input is FP16 for svtr Bugfix of svtr when the input is FP16 for MindSpore r2.3rc1 Mar 29, 2024
@Bourn3z Bourn3z force-pushed the bugfix_svtr_gridsample branch from 87b8ca7 to 262dc07 Compare March 29, 2024 12:06
@@ -129,3 +130,4 @@ def construct(
grid = 2.0 * grid - 1.0
output_maps = grid_sample(input, grid, canvas=None)
return output_maps, source_coordinate
np.gridsample
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个是啥

Copy link
Collaborator

Choose a reason for hiding this comment

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

已删除

@chengtianwu chengtianwu merged commit b18a4f3 into mindspore-lab:main Mar 29, 2024
@Bourn3z Bourn3z changed the title Bugfix of svtr when the input is FP16 for MindSpore r2.3rc1 Bugfix of svtr when the input is FP16 or FP32 for MindSpore r2.3rc1 Mar 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants