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

Gram matrix initialization #15

Open
UnixJunkie opened this issue Sep 1, 2020 · 7 comments
Open

Gram matrix initialization #15

UnixJunkie opened this issue Sep 1, 2020 · 7 comments

Comments

@UnixJunkie
Copy link

Dear futharckers,
I wrote this recently:
https://github.com/ocaml-bench/sandmark/blob/master/benchmarks/multicore-grammatrix/grammatrix.ml
The Gram matrix is quite useful in several machine learning settings.
I think it might be a nice, real-world, addition to the futhark benchmarks.
Futharkly yours,
F.

@UnixJunkie
Copy link
Author

UnixJunkie commented Sep 1, 2020

@UnixJunkie
Copy link
Author

My bench results can be seen there:
https://github.com/UnixJunkie/gram-matrix-bench

@athas
Copy link
Member

athas commented Sep 1, 2020

Is there much to gain by exploiting the symmetry, when compared to just doing a normal matrix multiplication? It seems like it would only reduce the work by a factor of two.

@UnixJunkie
Copy link
Author

The matrix is diagonal symmetric. Usually, I only compute one half plus the diagonal.
Also, this matrix can be quite big quite fast, because of the dataset size.

@UnixJunkie
Copy link
Author

Also, probably stupid question, can we read a file in Futhark, and write to one?
I have read that there is no IO in the futhark doc, so I am really wondering.

@athas
Copy link
Member

athas commented Sep 2, 2020

No, Futhark is pure. For testing and benchmarking programs, the compiler automatically inserts IO for reading input and writing results (see here), but for actual production use, Futhark code must be invoked from a conventional programming language (discussed here).

@UnixJunkie
Copy link
Author

Wow, amazing. Thanks for the pointers.
I read that: "Simplicity. I think modern computers are too slow, too fragile, and too incorrect, and I believe the root cause is uncontrolled complexity. Attempts to introduce simplicity by mindlessly adding abstraction layers are ultimately counterproductive. Simplicity is best achieved by lowering feature count and flexibility."
Now, I feel less lonely. :)

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

2 participants