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

Trade-off between efficiency and robustness/accuracy #134

Open
jvdp1 opened this issue Jan 31, 2020 · 4 comments
Open

Trade-off between efficiency and robustness/accuracy #134

jvdp1 opened this issue Jan 31, 2020 · 4 comments
Labels
meta Related to this repository

Comments

@jvdp1
Copy link
Member

jvdp1 commented Jan 31, 2020

From #3 where the discussion deviated on efficiency and robusteness of algorithms implemented in stdlib, and the potential associated trade-off .
See this comment and the following ones for more details.

This trade-off should probably be discussed case by case (when submitting PRs), with the main aim that it should benefit the vast majority of the Fortran community??

@jvdp1 jvdp1 mentioned this issue Jan 31, 2020
@milancurcic
Copy link
Member

I see three fundamental pillars here:

  1. API design (ease of use)
  2. Accuracy (correctness)
  3. Efficiency (computational performance)

All three are important and should be discuss in one or more steps of the workflow.

Yes, I think accuracy vs. efficiency trade-offs should be considered on a case by case basis. Some cases may even justify having multiple implementations of a function to serve different requirements.

There's no silver bullet here. Some industries require higher accuracy (I dunno -- astronomy? applied math?). For some others (e.g. weather and ocean prediction, or other chaotic systems) accuracy is completely irrelevant as soon as you start working with real-world data. We need to take it case by case and involve as much community as we can in the design and implementation process.

My position is that API design (ease of use) should be the highest priority by far, at least in the initial stages of design and implementation. Computers are cheap. Programmers are expensive. My experience so far is that ease of use wins in most scenarios. I think our number 1 job with stdlib is to make Fortran easier and more fun to use.

@certik
Copy link
Member

certik commented Jan 31, 2020

I agree with @milancurcic. We should discuss on a case by case basis. In general, we want a nice API to make Fortran easy and fun to use.

My own preferences are that we obviously want the correct answers, and we want excellent performance (I wouldn't like us to make design decisions that would hinder performance in any way). As an example here: #3 (comment), I would need to study the behavior of both of the algorithms, i.e. their performance and accuracy. If the answer is that one is faster but less accurate, the other one is slower but more accurate, then we can have both and the user can choose. That's one way we can handle it.

@jvdp1
Copy link
Member Author

jvdp1 commented Jan 31, 2020

I agree with both @milancurcic and @certik comments: the API should have the highest priority, such that the Fortran community (in its broad sense) can benefit from stdlib.

I like the idea to have different implementations of a function (variance could be a nice example). Hopefully such a strategy would allow to avoid some (not really positive) discussions. I think the spec should also specify the pros and cons of the different implementations. That may help the users in their choice for an adequate implementation.

@leonfoks
Copy link

leonfoks commented Feb 2, 2020

Agree on all fronts. Adding multiple methods for each function is a good idea. Perhaps have a 'primary' function with the standard name, variance, plus extras available like variance_method. That way, it's still easy to use the most generally applicable version, but allows users to dig deeper if they wish.

I think discussions per algorithm is key, since different personal experiences will dictate which are implemented and which might not, and it will allow a consensus on the method that is deemed 'primary'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta Related to this repository
Projects
None yet
Development

No branches or pull requests

5 participants