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

Add docs and regressions tests for SIMD vectorization of simple dual number operations #152

Merged
merged 4 commits into from
Oct 13, 2016

Conversation

jrevels
Copy link
Member

@jrevels jrevels commented Oct 13, 2016

Closes #98.

@@ -34,3 +34,10 @@ println("Testing miscellaneous functionality...")
tic()
include("MiscTest.jl")
println("done (took $(toq()) seconds).")

if Base.JLOptions().opt_level >= 3 && VERSION >= v"0.5"
Copy link
Member Author

Choose a reason for hiding this comment

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

@KristofferC Do you know what I should add to this conditional to disable these tests for users who won't get SIMD in the LLVM IR?

Also is there any point to me getting this to run on Travis, since Travis just downloads Julia binaries, or are these tests doomed to be local only?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Could try to run the build sysimg.jl script first in .travis.yml file and then start the actual tests?

Copy link
Member Author

Choose a reason for hiding this comment

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

Alright, attempted what you suggested. Let's see if Travis's infrastructure works for this...

@@ -8,6 +8,7 @@ notifications:
sudo: false
script:
- if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
- julia -e 'Pkg.clone(pwd()); Pkg.build("ForwardDiff"); Pkg.test("ForwardDiff"; coverage=true)';
- if (julia -e 'VERSION < v"0.5" && exit(1)'); then julia -e 'include(joinpath(JULIA_HOME, Base.DATAROOTDIR, "julia", "build_sysimg.jl")); build_sysimg(force=true)'; fi
- if (julia -e 'VERSION < v"0.5" && exit(1)'); then julia -O3 -e 'Pkg.clone(pwd()); Pkg.build("ForwardDiff"); Pkg.test("ForwardDiff"; coverage=true)'; else julia -O3 -e 'Pkg.clone(pwd()); Pkg.build("ForwardDiff"); Pkg.test("ForwardDiff"; coverage=true)'; fi
Copy link
Member Author

@jrevels jrevels Oct 13, 2016

Choose a reason for hiding this comment

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

Is there a way to do a multiline command here to tidy this up, or would I have to call out to an external script to accomplish that?

EDIT: Looks like multiline conditionals in Travis scripts "just work": https://github.com/JuliaLang/julia/blob/master/.travis.yml#L65

@jrevels jrevels force-pushed the jr/simd branch 2 times, most recently from d86480b to 5dd63dd Compare October 13, 2016 19:49
@KristofferC
Copy link
Collaborator

Seems to work? Cool. Maybe the sysimg.jl build should be mentioned for users to get full benefit?

@jrevels
Copy link
Member Author

jrevels commented Oct 13, 2016

Seems to work?

Not yet, it's not actually hitting the SIMD tests :( It seems that Pkg.test resets Base.JLOptions().opt_level back to 2, which is really annoying (I guess it spawns a subshell to run the tests?). I would just include("runtests.jl") manually, but still want to emit coverage information. Can I do that manually by using the --code-coverage flag (do I want to use the default user setting or the all setting)?

Maybe the sysimg.jl build should be mentioned for users to get full benefit?

That's a good idea.

@jrevels
Copy link
Member Author

jrevels commented Oct 13, 2016

Guess I should just do these things, but preserve the optimization level.

@KristofferC
Copy link
Collaborator

If you want to see what Pkg.test does you can see it here: https://github.com/JuliaLang/julia/blob/3b5c9755b7e2b8f7b4e202ff2d4d3dc07d6decca/base/pkg/entry.jl#L714. Perhaps the -O option from the julia process calling Pkg.test() should be forwarded here too?

@KristofferC
Copy link
Collaborator

To be explicit, it seems that you should use user for the coverage flag.

@jrevels
Copy link
Member Author

jrevels commented Oct 13, 2016

Beat you to it 😛 It'd be nice if Entry.test! preserved more of Base.JLOptions()...

@jrevels jrevels force-pushed the jr/simd branch 2 times, most recently from a9b5741 to 27a4a92 Compare October 13, 2016 20:23
@jrevels
Copy link
Member Author

jrevels commented Oct 13, 2016

Well at least now the SIMD tests are running. It seems like the CPU the job is running on supports SIMD, but it's not passing because it doesn't work with inlining off. Maybe we can do two separate runs, then, with the second one being just the SIMD tests and inlining on.

@jrevels
Copy link
Member Author

jrevels commented Oct 13, 2016

Awesome, SIMD tests now run and pass on Travis!

@jrevels jrevels merged commit 5e18945 into master Oct 13, 2016
@jrevels jrevels deleted the jr/simd branch October 13, 2016 21:04
@KristofferC
Copy link
Collaborator

Great stuff.

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

Successfully merging this pull request may close these issues.

2 participants