Skip to content

Conversation

@adrianlizarraga
Copy link
Contributor

@adrianlizarraga adrianlizarraga commented Apr 29, 2024

Description

  • Adds support for float32/float16 HardSigmoid on HTP backend. Decomposes HardSigmoid(X) into max(0, min(1, alpha * X + beta)).
  • Fuses the sequence X * HardSigmoid<alpha=1/6, beta=0.5>(X) into a single HardSwish(x). Only applies to non-quantized HardSigmoid/Mul.

Motivation and Context

QNN does not natively support HardSigmoid. These changes expand model support on QNN EP.

@jywu-msft jywu-msft added the ep:QNN issues related to QNN exeution provider label Apr 30, 2024
@adrianlizarraga adrianlizarraga changed the title [QNN EP] Fuse HardSigmoid sequence to HardSwish [QNN EP] Support HardSigmoid May 1, 2024
@adrianlizarraga adrianlizarraga marked this pull request as ready for review May 1, 2024 05:46
jywu-msft
jywu-msft previously approved these changes May 1, 2024
@adrianlizarraga adrianlizarraga requested a review from jywu-msft May 2, 2024 07:56
Copy link
Contributor

@HectorSVC HectorSVC left a comment

Choose a reason for hiding this comment

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

:shipit:

@adrianlizarraga adrianlizarraga merged commit 7211eab into main May 2, 2024
@adrianlizarraga adrianlizarraga deleted the adrianl/qnn-hardsigmoid-to-hardswish-fusion branch May 2, 2024 22:36
@sophies927 sophies927 added the triage:approved Approved for cherrypicks for release label May 3, 2024
@yihonglyu yihonglyu added the cherry-picked Cherry-picked for a cherrypicks branch label May 4, 2024
yihonglyu pushed a commit that referenced this pull request May 4, 2024
### Description
- Adds support for float32/float16 HardSigmoid on HTP backend.
Decomposes `HardSigmoid(X)` into `max(0, min(1, alpha * X + beta))`.
- Fuses the sequence `X * HardSigmoid<alpha=1/6, beta=0.5>(X)` into a
single `HardSwish(x)`. Only applies to non-quantized HardSigmoid/Mul.


### Motivation and Context
QNN does not natively support HardSigmoid. These changes expand model
support on QNN EP.
TedThemistokleous pushed a commit to TedThemistokleous/onnxruntime that referenced this pull request May 7, 2024
### Description
- Adds support for float32/float16 HardSigmoid on HTP backend.
Decomposes `HardSigmoid(X)` into `max(0, min(1, alpha * X + beta))`.
- Fuses the sequence `X * HardSigmoid<alpha=1/6, beta=0.5>(X)` into a
single `HardSwish(x)`. Only applies to non-quantized HardSigmoid/Mul.


### Motivation and Context
QNN does not natively support HardSigmoid. These changes expand model
support on QNN EP.
@yihonglyu yihonglyu added the rel-merged Cherrypicks merged into release label May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-picked Cherry-picked for a cherrypicks branch ep:QNN issues related to QNN exeution provider rel-merged Cherrypicks merged into release release:1.18.0 triage:approved Approved for cherrypicks for release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants