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

[ minor ] bugfix in printing error log (model_commo_properties / LossScale) #2825

Merged
merged 1 commit into from
Dec 20, 2024

Conversation

EunjuYang
Copy link
Contributor

@EunjuYang EunjuYang commented Dec 11, 2024

  • This commit fixes a minor error to print error log.
  • This commit adds a condition to print the error log.

Relevant issue: #2826

Self evaluation:

  1. Build test: [x]Passed [ ]Failed [ ]Skipped
  2. Run test: [x]Passed [ ]Failed [ ]Skipped

Copy link
Member

@skykongkong8 skykongkong8 left a comment

Choose a reason for hiding this comment

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

LGTM, but in this case, how about comparing float with stricter standard?

something like:

if (std::fpclassify(value) == FP_ZERO)
...

@EunjuYang EunjuYang force-pushed the bugfix/loss_scale_error branch 2 times, most recently from 7fbf3ca to a421dc2 Compare December 11, 2024 05:34
Copy link
Contributor

@djeong20 djeong20 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@myungjoo myungjoo left a comment

Choose a reason for hiding this comment

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

Check the return.

@@ -43,7 +43,8 @@ ModelTensorDataType::ModelTensorDataType(ModelTensorDataTypeInfo::Enum value) {
LossScale::LossScale(float value) { set(value); }

bool LossScale::isValid(const float &value) const {
ml_loge("Loss scale cannot be 0");
if (std::fpclassify(value) == FP_ZERO)
ml_loge("Loss scale cannot be 0");
Copy link
Member

Choose a reason for hiding this comment

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

If it's FP_ZERO, return a proper value.

The current return (value != 0) is inappropriate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I missed it! Thank you for pointing it out. I updated the part. Thank you.

- This commit fixes a minor error to print error log.
- This commit adds a condition to print the error log.

Signed-off-by: Eunju Yang <[email protected]>
@EunjuYang EunjuYang force-pushed the bugfix/loss_scale_error branch from a421dc2 to e55ac2c Compare December 17, 2024 06:46
Copy link
Contributor

@baek2sm baek2sm left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@jijoongmoon jijoongmoon left a comment

Choose a reason for hiding this comment

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

LGTM

@myungjoo myungjoo merged commit 18635c2 into nnstreamer:main Dec 20, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants