Skip to content

[quantization] Fix QuantGELU to preserve nn.GELU approximate mode#734

Merged
mhs4670go merged 1 commit into
Samsung:mainfrom
mhs4670go:fi2
May 27, 2026
Merged

[quantization] Fix QuantGELU to preserve nn.GELU approximate mode#734
mhs4670go merged 1 commit into
Samsung:mainfrom
mhs4670go:fi2

Conversation

@mhs4670go

Copy link
Copy Markdown
Contributor

QuantGELU previously called _gelu(x) without forwarding the original nn.GELU.approximate setting, so nn.GELU(approximate="tanh") was executed as exact GELU. Store the original approximate mode and use it in forward. Add NO_QUANT parity coverage for tanh GELU.

TICO-DCO-1.0-Signed-off-by: seongwoo mhs4670go@naver.com

QuantGELU previously called _gelu(x) without forwarding the original
nn.GELU.approximate setting, so nn.GELU(approximate="tanh") was executed
as exact GELU. Store the original approximate mode and use it in forward.
Add NO_QUANT parity coverage for tanh GELU.

TICO-DCO-1.0-Signed-off-by: seongwoo <mhs4670go@naver.com>
@mhs4670go mhs4670go requested a review from stamalakhov May 27, 2026 12:27

@stamalakhov stamalakhov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@mhs4670go mhs4670go merged commit 04a19fa into Samsung:main May 27, 2026
7 checks passed
@mhs4670go mhs4670go deleted the fi2 branch May 27, 2026 22:50
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