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

Irreproducible results on another machine #24

Closed
xtrojak opened this issue Oct 4, 2021 · 12 comments · Fixed by #31
Closed

Irreproducible results on another machine #24

xtrojak opened this issue Oct 4, 2021 · 12 comments · Fixed by #31
Labels
bug Something isn't working

Comments

@xtrojak
Copy link

xtrojak commented Oct 4, 2021

It seems like both hybrid and unsupervised functions are deterministic but machine specific - the same machine produces consistent results, but they are different compared to another machine. After doing some digging I conclude that this has nothing to do with the number of cores used.

Therefore the current tests are failing.

@xtrojak xtrojak added the bug Something isn't working label Oct 4, 2021
@xtrojak
Copy link
Author

xtrojak commented Oct 4, 2021

It might be related to operating system.

@hechth
Copy link
Member

hechth commented Oct 4, 2021

@martenson Both @xtrojak and I use Ubuntu 20.04 operating based systems (Linux Mint 20 / Ubuntu 20.04 WSL) and the tests pass (the expected outputs were created on the Mint 20 based machine), on abiff (Debian 10) they fail and the results are different (5 detected features +-, so not only numerical or ordering differences).

Any ideas why the OS (I assume) has an influence? They all run in conda.

@xtrojak
Copy link
Author

xtrojak commented Oct 4, 2021

We suspected that it is caused by stochastic behavior of randomForest function used in eic.pred.R file. We should try to get rid of randomness by setting the same seed.

@xtrojak
Copy link
Author

xtrojak commented Oct 4, 2021

We suspected that it is caused by stochastic behavior of randomForest function used in eic.pred.R file. We should try to get rid of randomness by setting the same seed.

This is not the case, the randomness is actually used in semi.sup.learn function which is never called in hybrid and unsupervised functions. Just to be sure we tried to set the seed using

set.seed(10, kind = "Mersenne-Twister", normal.kind = "Inversion", sample.kind = "Rejection")

but it had no effect on the result.

@hechth
Copy link
Member

hechth commented Oct 4, 2021

This line calls some sampling function in the rt alignment stage, which is the one having visible differences:

if(length(this.d)>100) this.d<-sample(this.d,100)

@xtrojak
Copy link
Author

xtrojak commented Oct 5, 2021

This line calls some sampling function in the rt alignment stage, which is the one having visible differences:

if(length(this.d)>100) this.d<-sample(this.d,100)

This is another dead end, the sample function this is used in adjust.time and recover.weaker, but neither of them is actually used to compute recovered_feature_sample_table which is being compared in the tests (they are used to compute extracted_features and corrected_features).

Also changing seed before a test run has no influence on the test result (within single machine). From this I would conclude randomness is not the reason why results are different across multiple machines. What do you think @hechth ?

EDIT: recover.weaker is actually used to compute recovered_feature_sample_table in unsupervised, but still holds that setting seed has no effect.

@xtrojak
Copy link
Author

xtrojak commented Oct 5, 2021

It might be related to operating system.

This is confirmed, on the same OS (Ubuntu 20 based), the tests are passing (tried on 3 separate machines).

@martenson
Copy link
Member

martenson commented Oct 5, 2021

This is indeed weird, since Debian and Ubuntu are the same OS family. However we probably do not need to spend time on this now since UMSA is ubuntu and we will run the tool in a container anyways (betting on this not being caused by the kernel).

@hechth
Copy link
Member

hechth commented Oct 5, 2021

Since we get the biocontainers, do we actually know which underlying OS they will serve us? What will happen if that changes?

@martenson
Copy link
Member

biocontainers use busybox as a minimalist base and I doubt that will change.

@martenson
Copy link
Member

Using the latest biocontainer image (docker pull quay.io/biocontainers/mulled-v2-dceaa6ce3d797c3153f327c7fc15983c4e882d4d:6584615d53d9bbb9d333d3928bdd6074d82193ce-0) I get identical results from a run on UMSA and a run on my macos dev machine.

I'd treat that image as the canonical source of truth -- at least for now.

@martenson
Copy link
Member

xref RECETOX/galaxytools#161

@maximskorik maximskorik linked a pull request Feb 6, 2022 that will close this issue
@martenson martenson changed the title Unreproducible results on another machine Irreproducible results on another machine Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants