[tmva][sofie] Add HardSigmoid operator for ONNX inference#20933
[tmva][sofie] Add HardSigmoid operator for ONNX inference#20933AdityaDRathore wants to merge 1 commit intoroot-project:masterfrom
Conversation
sanjibansg
left a comment
There was a problem hiding this comment.
Hi @AdityaDRathore,
Thanks for your contribution and developing the operator implementation for Hard-sigmoid. The implementation looks good to me. But, we are in the process of consolidating unary operations (like activation functions) into the ROperator_BasicUnary.hxx file. Can you make the corresponding changes?
Thanks.
Test Results 21 files 21 suites 2d 23h 37m 41s ⏱️ Results for commit d575330. ♻️ This comment has been updated with latest results. |
Hi @sanjibansg, thanks for the review! I started refactoring to move this into Since HardSigmoid is stateful (it must store alpha and beta attributes parsed from the ONNX node), it doesn't fit naturally into the current BasicUnary design without forcing all other simple operators (like Abs, Cos) to carry unused attribute overhead. I also checked how other stateful unary operators are handled and saw that Given this precedent, do you think it is safer to keep HardSigmoid separate to preserve the clean, stateless nature of BasicUnary? Or do you have a specific pattern in mind for handling attributes within the traits system? |
Ah yes! That is correct. Since this is a stateful operator, maybe better to keep this separately. Can you fix the formatting issues flagged in the CI? In the meantime, I will wait for the review of @lmoneta before we can merge this, Thanks! |
7963b08 to
0c6123d
Compare
|
Hi @sanjibansg |
Port of root-project/root#20933, #20944, and #21092. - HardSigmoid: stateful operator with alpha/beta attributes (ONNX Opset 6+) - HardSwish: inline generation with split topology (ONNX Opset 14) - Softplus: numerical stability fix using log1p and threshold at 20.0f All use hexfloat constants for bit-exact reproducibility.
sanjibansg
left a comment
There was a problem hiding this comment.
Hi @AdityaDRathore,
Can you try fixing the merge conflicts, and add the test following the convention in the SOFIE subdirectory:
https://github.com/root-project/root/tree/master/tmva/sofie/test
0c6123d to
d575330
Compare
|
Hi, @sanjibansg |
d575330 to
c56694d
Compare
|
Hi @sanjibansg, |
This Pull Request
Add support for the ONNX HardSigmoid operator in SOFIE.
Checklist:
TestSofieHardSigmoidpassing)cc: @moneta @sanjibansg @guitargeek