[tmva][sofie] Add Softplus operator for ONNX Inference#21023
Closed
AdityaDRathore wants to merge 1 commit intoroot-project:masterfrom
Closed
[tmva][sofie] Add Softplus operator for ONNX Inference#21023AdityaDRathore wants to merge 1 commit intoroot-project:masterfrom
AdityaDRathore wants to merge 1 commit intoroot-project:masterfrom
Conversation
Implement the Softplus operator (y = ln(1 + exp(x))) for the SOFIE inference engine to support ONNX Opset compliance. technical details: - Adopt std::log1p(std::exp(x)) to preserve precision for small or negative inputs. - Implement a threshold check. For x >= 20.0, the function returns x directly to avoid std::exp() overflow. - Optimization: Generated code utilizes a local variable to minimize redundant memory loads and instruction cache pressure. - Validation: Add GTest suite TestSofieSoftplus verifying hexfloat constants and numerical correctness limits.
Author
|
Superseded by merged PR #21050. Closing this to avoid redundancy. However, I have opened issue #21071 to track the numerical stability improvements ( |
Author
|
Superseded by PR #21092 to accommodate the rebase and architecture changes requested. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This Pull Request
This PR implements the
Softplusoperator for the SOFIE engine. This operator is required for ensuring compliance with ONNX Opset specifications and supporting modern neural network architectures that utilize smooth approximations of ReLU.Changes or fixes:
New Operator: Implemented
TMVA::Experimental::SOFIE::ROperator_Softplus.std::log1pfor precision near zero and implements a hard threshold for overflow protection:0x1.4p+4f(20.0f) Inputs above this bypassexp()to prevent overflow.std::log1p(std::exp(x))instead oflog(1+exp(x))to preserve precision for negative inputs.RModelParser_ONNXto registerSoftplus.Validation: Added
TestSofieSoftplusGTest suite.std::log1preference values.Checklist:
TestSofieSoftpluspassing )This PR fixes # (No specific issue linked, strictly feature addition)
cc: @guitargeek @moneta @devajithvs @bellenot