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

Fix softmax parsing in pytorch and add test #1086

Merged
merged 5 commits into from
Oct 25, 2024

Conversation

JanFSchulte
Copy link
Contributor

@JanFSchulte JanFSchulte commented Oct 22, 2024

Fixes issues with softmax activation in pytorch parser reported in #1083 and adds softmax activation to the pytest.

I also added a one-line change to fix #1074 while I'm messing with the pytorch parser.

Type of change

  • Bug fix (non-breaking change that fixes an issue)

Tests

Added softmax to the pytest, where it works now.

Test Configuration:

Checklist

  • I have read the guidelines for contributing.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings.
  • I have installed and run pre-commit on the files I edited or added.
  • I have added tests that prove my fix is effective or that my feature works.

@JanFSchulte JanFSchulte added the please test Trigger testing by creating local PR branch label Oct 22, 2024
@JanFSchulte JanFSchulte added please test Trigger testing by creating local PR branch bug and removed please test Trigger testing by creating local PR branch labels Oct 22, 2024
@JanFSchulte JanFSchulte added please test Trigger testing by creating local PR branch and removed please test Trigger testing by creating local PR branch labels Oct 22, 2024
layer['axis'] = class_object.dim
if layer['class_name'] == 'Softmax' and layer['axis'] is None:
layer['axis'] = -1
if 'IOType' in config:
Copy link
Contributor

Choose a reason for hiding this comment

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

We have done these types of checks before, but now I think we should parse everything into the IR, and then backbends should check if the feature is supported. We can have optimizers for that. Check out feature_check.py in Vitis backend. We could add similar checks for all backends and move away from the parser (in a future PR)

@jmitrevs jmitrevs merged commit ab45708 into fastmachinelearning:main Oct 25, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug please test Trigger testing by creating local PR branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Compiling PyTorch LSTM with Hidden State Input
3 participants