microsoft / knossos-ksc

Compiler with automatic differentiation
Other
45 stars 10 forks source link

Experience report: new (or returning) user onboarding #299

Open cgravill opened 4 years ago

cgravill commented 4 years ago

It went fairly well.

One suggestion is to include the PowerShell line continuation as well:

./ksc --compile-and-run `
  --ks-source-file src/runtime/prelude.ks `
  --ks-source-file test/ksc/hello-world.ks `
  --ks-output-file obj/test/ksc/hello-world.kso `
  --cpp-output-file obj/test/ksc/hello-world.cpp `
  --c++ g++ `
  --exe-output-file obj/test/ksc/hello-world.exe

(I can pull request if that's helpful)

and one issue with running the test:

./ksc --test --fs-test out.fs

results in an error for finding Futhark

Testing ["test/ksc/vprod.ks","test/ksc/tm-rev.ks","test/ksc/test_stopgrad.ks","test/ksc/test4.ks","test/ksc/test3.ks","test/ksc/test2.ks","test/ksc/test1.ks","test/ksc/test0.ks","test/ksc/syntax-primer.ks","test/ksc/sum.ks","test/ksc/string.ks","test/ksc/power.ks","test/ksc/negative-float-literals.ks","test/ksc/mul8.ks","test/ksc/mul4.ks","test/ksc/mnistcnn.ks","test/ksc/logsumexp.ks","test/ksc/lmzero.ks","test/ksc/inline.ks","test/ksc/hello-world.ks","test/ksc/gmm.ks","test/ksc/gmm-rev.ks","test/ksc/gmm-obj.ks","test/ksc/generated_deltavecs.ks","test/ksc/fold.ks","test/ksc/ex8.ks","test/ksc/ex7.ks","test/ksc/ex6.ks","test/ksc/ex5.ks","test/ksc/ex4.ks","test/ksc/ex3.ks","test/ksc/ex2.ks","test/ksc/ex1.ks","test/ksc/ex0.ks","test/ksc/edef.ks","test/ksc/derivative-selection.ks","test/ksc/comment.ks","test/ksc/CA-subst.ks","test/ksc/bool.ks","test/ksc/awf.ks","test/ksc/adbench-lstm.ks"]

>>>>> TEST: "test/ksc/vprod.ks"
Skipping test/ksc/vprod.ks because it is known not to work with Futhark

>>>>> TEST: "test/ksc/tm-rev.ks"
Linted Typechecked defs
Linted Grad
Linted Grad tupled
Linted Optgrad
Linted Optgrad tupled
Linted Diffs
Linted OptDiffs
Linted CSE
Writing to obj/test/ksc/tm-rev.fut
ksc.exe: futhark-0.11.2-linux-x86_64/bin/futhark: readCreateProcessWithExitCode: does not exist (No such file or directory)

OS Name Microsoft Windows 10 Pro Version 10.0.19041 Build 19041

toelli-msft commented 4 years ago

Thanks for this! It's good to know that part of the README is noticeable :)

One suggestion is to include the PowerShell line continuation as well ... (I can pull request if that's helpful)

Yes, please submit a PR.

and one issue with running the test ... results in an error for finding Futhark

Ah yes, I will try to do something about this.

cgravill commented 4 years ago

I'm glad that such detailed instructions exist! :-)

I had a bit more a bumpy install with my Ubuntu/WSL install. It looks like ghcup has had a rewrite since the instructions were created

C@C:~$ curl https://gitlab.haskell.org/haskell/ghcup/raw/master/ghcup > ghcup
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 73763  100 73763    0     0   157k      0 --:--:-- --:--:-- --:--:--  157k
C@C:~$ sh ./ghcup install 8.6.5
ghcup has been rewritten in haskell. Please upgrade again via 'ghcup upgrade'
Installing GHC-8.6.5 for Ubuntu on architecture x86_64
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  7  180M    7 14.3M    0     0  6136k      0  0:00:30  0:00:02  0:00:28 6133k^C
C@C:~$ ^C
C@C:~$ ./ghcup upgrade
-bash: ./ghcup: Permission denied

In the end I wiped my Ubuntu install and went from scratch with a clean 18.04

sudo apt update
sudo apt install build-essential libgmp-dev

build-essential is for GCC etc libgmp-dev is needed in the Knossos build later. Then new ghcup instructions (from https://www.haskell.org/ghcup/# )

curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh
source ~/.ghcup/env
ghcup install 8.6.5
ghcup set 8.6.5
ghcup install-cabal 3.0.0.0
~/.ghcup/bin/cabal v2-update

then I'm able to get up to the same point

C@C:~/knossos-ksc$ ./ksc --test --fs-test out.fs
Testing ["test/ksc/ex6.ks","test/ksc/bool.ks","test/ksc/tm-rev.ks","test/ksc/string.ks","test/ksc/mul8.ks","test/ksc/test_stopgrad.ks","test/ksc/power.ks","test/ksc/ex7.ks","test/ksc/gmm-rev.ks","test/ksc/CA-subst.ks","test/ksc/test4.ks","test/ksc/lmzero.ks","test/ksc/hello-world.ks","test/ksc/ex2.ks","test/ksc/sum.ks","test/ksc/ex0.ks","test/ksc/ex8.ks","test/ksc/logsumexp.ks","test/ksc/negative-float-literals.ks","test/ksc/awf.ks","test/ksc/edef.ks","test/ksc/fold.ks","test/ksc/gmm-obj.ks","test/ksc/ex3.ks","test/ksc/syntax-primer.ks","test/ksc/adbench-lstm.ks","test/ksc/test3.ks","test/ksc/test2.ks","test/ksc/test0.ks","test/ksc/comment.ks","test/ksc/ex1.ks","test/ksc/inline.ks","test/ksc/test1.ks","test/ksc/vprod.ks","test/ksc/generated_deltavecs.ks","test/ksc/ex5.ks","test/ksc/mnistcnn.ks","test/ksc/mul4.ks","test/ksc/derivative-selection.ks","test/ksc/gmm.ks","test/ksc/ex4.ks"]

>>>>> TEST: "test/ksc/ex6.ks"
Linted Typechecked defs
Linted Grad
Linted Grad tupled
Linted Optgrad
Linted Optgrad tupled
Linted Diffs
Linted OptDiffs
Linted CSE
Writing to obj/test/ksc/ex6.fut
ksc: futhark-0.11.2-linux-x86_64/bin/futhark: readCreateProcessWithExitCode: runInteractiveProcess: exec: does not exist (No such file or directory)

I'm not sure if the above adjustments are the best way but perhaps some of the updates would be useful?

toelli-msft commented 4 years ago

Thanks for reporting that. ghcup does actually work if one ignores the message about the upgrade (and you missed off the sh from the start of the command line -- sh ./ghcup upgrade would have worked). Anyway, I'm a bit annoyed with the ghcup maintainers for breaking people's workflow like this. They are not as respectful of reproducibility as I would like. I will tweak the instructions a bit.

Thanks for the info about build-essential and libgmp-dev. I will sort that out.