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

Add log sigmoid #408

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

AdvancedCompiler
Copy link
Contributor

PR Category

Operator

Type of Change

New Feature

Description

Implement log_sigmoid operator

Issue

#389

Progress

  • Change is properly reviewed (1 reviewer required, 2 recommended).
  • Change is responded to an issue.
  • Change is fully covered by a UT.

Performance

56c2767aebbe8bd4de67708c48d4324

@tongxin
Copy link
Contributor

tongxin commented Jan 10, 2025

Could you refer to pytorch/pytorch#1835 for better numerical stability?

@AdvancedCompiler
Copy link
Contributor Author

Could you refer to pytorch/pytorch#1835 for better numerical stability?

ok,i will try it

@tongxin
Copy link
Contributor

tongxin commented Jan 16, 2025

'-inf' was handled correctly. log_sigmoid(-inf) = -inf, but now it returns nan.

@shuailong616
Copy link
Contributor

shuailong616 commented Jan 16, 2025

Make it a torch.float32 and try again.

'-inf' was handled correctly. log_sigmoid(-inf) = -inf, but now it returns nan.

inf and -inf can get correct result , Could you provide your code?
1

@tongxin
Copy link
Contributor

tongxin commented Jan 17, 2025

Please also add '-inf', 'inf', -300, to UT.

@AdvancedCompiler
Copy link
Contributor Author

Please also add '-inf', 'inf', -300, to UT.

yes, -inf get 'nan' in UT, but in my test no problem , i don't konw why,

捕获

@tongxin
Copy link
Contributor

tongxin commented Jan 20, 2025

Please also add '-inf', 'inf', -300, to UT.

yes, -inf get 'nan' in UT, but in my test no problem , i don't konw why,

捕获

Can properly format and show the output? I didn't find the results in your last post.

@tongxin
Copy link
Contributor

tongxin commented Jan 20, 2025

Please check your results for input -inf, inf, -300, all in float16. They are expected to be -inf, 0, -300. Please verify. Thanks.

@AdvancedCompiler
Copy link
Contributor Author

Please also add '-inf', 'inf', -300, to UT.

yes, -inf get 'nan' in UT, but in my test no problem , i don't konw why,
捕获

Can properly format and show the output? I didn't find the results in your last post.

fixed

@AdvancedCompiler
Copy link
Contributor Author

Please check your results for input -inf, inf, -300, all in float16. They are expected to be -inf, 0, -300. Please verify. Thanks.

ok,fixed

Copy link
Contributor

@tongxin tongxin 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
Contributor

@tongxin tongxin left a comment

Choose a reason for hiding this comment

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

LGTM

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.

6 participants