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

Automatic precision comparison supports customizing the data type used in CPU calculations by operator. #52

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

zhaoguochun1995
Copy link
Collaborator

@zhaoguochun1995 zhaoguochun1995 commented Oct 8, 2024

自动精度对比时支持按算子自定义cpu计算使用的数据类型
Automatic precision comparison supports customizing the data type used in CPU calculations by operator.
更新算子工具使用文档

工具的数据类型已经设置好默认值,用户无需额外设置。
如果有特殊需求:
使用方法:

对于绝大多数算子:"torch.float16->torch.float32,torch.bfloat16->torch.float32" (默认值)
export OP_DTYPE_CAST_DICT="torch.float16->torch.float32,torch.bfloat16->torch.float32"
对于特殊算子,如linear
export LINEAR_OP_DTYPE_CAST_DICT="torch.float16->torch.float64,torch.bfloat16->torch.float64,torch.float32->torch.float64"
以下算子cpu精度较差,已经设置为用float64去计算
截屏2024-10-08 下午8 55 49

@zhaoguochun1995 zhaoguochun1995 force-pushed the zgc/ditorch_autocomare_cpu_dtype_promotion branch from 740fb2d to 5c25bd9 Compare October 8, 2024 12:23
@yangbofun yangbofun merged commit 9e50835 into main Oct 8, 2024
13 checks passed
@yangbofun yangbofun deleted the zgc/ditorch_autocomare_cpu_dtype_promotion branch October 8, 2024 12:45
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.

2 participants