-
Notifications
You must be signed in to change notification settings - Fork 3
Add option processing to onnxToFeld. #480
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
Open
kffaxen
wants to merge
1
commit into
Feldspar:master
Choose a base branch
from
kffaxen:onnx-getopt
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think onnxToFeld should be viewed as a part of "Feldspar". With that perspective, it would make sense to have the pass options and everything else that the option handling in Feldspar implements. Can't we just add writeInits to the Options in Feldspar.Compiler.Options, and import most of the option handling logic from Feldspar.Compiler here?
(I realize this makes writeInits visible when just using the Feldspar library and the option wouldn't do anything useful there. I care less about that interface since it's not a user-facing interface.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason I want the plumbing in place from the beginning is that I'm scared, the plumbing has taken a lot of effort to bolt on afterwards in the library (and even with that effort, the result is still not great).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just added error checking to
compileCin Plugin and started using that code in the RegressionTests instead of having duplicate code in the test suite for that. Can we get onnxToFeld to compile everything all the way to an executable by just ending main with:?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be more complicated than that, since onnxToFeld produces Faldpar source code, so you also need to run ghc on that and then run the resulting program with e.g. readProcessWithExitCode and then you could do compileC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, one more level in the tower, and I think when running the resulting program is where compileC is called (perhaps by a regular pass using the pass manager?).
I assume I wasn't very clear, my suggestion for this patch was just to consolidate the option handling so we have one option handling to put us in a good position for taking the steps you outlined at a later time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do not think onnxToFeld will ever need multiple passes, so the PassMgr is beside the point. Apart from that onnxToFeld currently has a '-h' option and might perhaps get a '-o' option or so in the future, but the bulk of its options will probably be specific to its function. Possibly we could have a layer on top of GetOpt dealing with common options; I think that would be better than using the same option type for onnxToFeld and Feldspar compiler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we pass
--writeAfter FPUnASTFalong to the compiled Feldspar program from inside onnxToFeld in the future?