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

Feature Request : Implement LogSoftmax, Softmax, ReduceMax #680

Open
jsilter opened this issue May 13, 2024 · 3 comments
Open

Feature Request : Implement LogSoftmax, Softmax, ReduceMax #680

jsilter opened this issue May 13, 2024 · 3 comments

Comments

@jsilter
Copy link

jsilter commented May 13, 2024

Feature request

Request the implementation of the following ONNX operators:

  • LogSoftmax
  • Softmax
  • ReduceMax

Motivation

These operators are common in neural networks of many types; softmax is common in classification, reducemax is common in CNNs.

@andrei-stoian-zama
Copy link
Collaborator

Thanks for the suggestion. We don't currently have plans to implement these ops. You can find a softmax implementation in the LLM use case. There is already a ReduceSum operator and a MaxPool operator, you could try to adapt them to obtain ReduceMax.

@jsilter
Copy link
Author

jsilter commented May 16, 2024

Thanks for the pointers. Do you have additional guides on how one implements a custom op in this context? I really would need to convert my existing (torch) model, I can't re-write and retrain a quantized version.

It does seem like the reduce_sum could be adapted easily (np.sum -> np.amax) although I don't know if that's FHE compliant. Also I notice that there's already an implementation for Softmax, although the docstring says it's not FHE compliant it doesn't elaborate as to why.

@jfrery
Copy link
Collaborator

jfrery commented May 17, 2024

We have this documentation / guide on how to proceed to implement a new onnx node. Let us know if anything is unclear!

https://docs.zama.ai/concrete-ml/developers/support_new_onnx_node

@RomanBredehoft RomanBredehoft changed the title Implement LogSoftmax, Softmax, ReduceMax Feature Requests : Implement LogSoftmax, Softmax, ReduceMax Jun 11, 2024
@RomanBredehoft RomanBredehoft changed the title Feature Requests : Implement LogSoftmax, Softmax, ReduceMax Feature Request : Implement LogSoftmax, Softmax, ReduceMax Jun 11, 2024
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

No branches or pull requests

3 participants