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

[fix] Update layerwise.py: avoid forced type conversion #1282

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AndyVerne
Copy link

During layerwise model initialization, if both use_bf16 and use_fp16 are set to false, use_fp16 is forcibly converted to true. However, in some scenarios, the warning’s granularity does not propagate to the Python terminal, causing users to overlook this implicit behavior and potentially introducing unexpected bugs.

Therefore, I have committed a version of the code that explicitly notifies the user of incorrect input parameters, making it more aligned with everyday usage.


在layerwise模型相关初始化时,当use_bf16和 use_fp16都为false时,use_fp16会被强制转换成true;然而在一些场景,warning的告警粒度传递不到python terminal中,让人关注不到这一隐性的情况,从而可能产生预期之外的bug。

因此commit一版代码,强制告知user传入参数有误,更符合日常使用。

During layerwise model initialization, if both use_bf16 and use_fp16 are set to false, use_fp16 is forcibly converted to true. However, in some scenarios, the warning’s granularity does not propagate to the Python terminal, causing users to overlook this implicit behavior and potentially introducing unexpected bugs.

Therefore, I have committed a version of the code that explicitly notifies the user of incorrect input parameters, making it more aligned with everyday usage.

---

在layerwise模型相关初始化时,当use_bf16和 use_fp16都为false时,use_fp16会被强制转换成true;然而在一些场景,warning的告警粒度传递不到python terminal中,让人关注不到这一隐性的情况,从而可能产生预期之外的bug。

因此commit一版代码,强制告知user传入参数有误,更符合日常使用。
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.

1 participant