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

osx build with unittest #12

Closed
wants to merge 38 commits into from

Conversation

gyanesh-m
Copy link

Trial to fix build for osx.
Fixes : #1901

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipe) and found some lint.

Here's what I've got...

For recipe:

  • Selectors are suggested to take a <two spaces>#<one space>[<expression>] form. See lines [63]

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@menshikh-iv
Copy link
Member

menshikh-iv commented Feb 28, 2018

@gyanesh-m hey, great, you reproduced a problem (with stuck of Doc2Vec test), now you need to investigate, what's exactly happens and why.

@gyanesh-m
Copy link
Author

@menshikh-iv Yea sure , I will get started with it. Also is it advisable to edit .travis.yml file manually even though it is generated automatically ?

@menshikh-iv
Copy link
Member

@gyanesh-m that's not really good, but for debugging - OK

@gyanesh-m
Copy link
Author

@menshikh-iv Hey, its been 5 hours but job in travis-ci is not getting scheduled. Any ideas ?

@menshikh-iv
Copy link
Member

@gyanesh-m sometimes Travis stuck (or have no free MacOSX machines), this is the standard situation.
I re-run your build, I hope that this will help.

.travis.yml Outdated
source run_conda_forge_build_setup

script:
- travis_wait conda build ./recipe
Copy link
Member

Choose a reason for hiding this comment

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

this doesn't look like the solution, but you can try (in debugging propose).

@souravsingh
Copy link
Contributor

@gyanesh-m conda-forge can have problems in requisitioning machines when many packages run through CI services. I suggest waiting for a while.

@souravsingh
Copy link
Contributor

Travis Wait command fails. I would suggest looking for other solutions.

@menshikh-iv
Copy link
Member

I propose

  • check "FAST_VERSION" before run tests (should be != -1)
  • run ONLY doc2vec tests with max verbosity (logging.DEBUG)

@menshikh-iv
Copy link
Member

@souravsingh good news, I added SKIP_NETWORK_TESTS flag (for cases when CI have some problems with SSL or any network issues).

@gyanesh-m
Copy link
Author

@menshikh-iv Ok, I will give that a try. I have one doubt, are you talking about the logging level mentioned here test_doc2vec.py. If so, then it is already set to DEBUG. Also, can we split the test file of doc2vec for parallel testing method so that we can know more precisely which part consumes more time ?

@menshikh-iv
Copy link
Member

menshikh-iv commented Mar 1, 2018

@gyanesh-m not quiet, when you run it in current manner - no debug logs, for more pricely testing - python -m unittest -v gensim.test.<test_file>.<class_name>.<method_name>

You can also run it as file python path/to/doc2vec/tests, in this case you'll see logs.

@gyanesh-m
Copy link
Author

@menshikh-iv I have written the test file for fast version check, so should I add it here or in the main repo ?

@menshikh-iv
Copy link
Member

menshikh-iv commented Mar 1, 2018

@gyanesh-m you can check it in one line here (no need to add it as distinct test to main repo)

@gyanesh-m
Copy link
Author

@menshikh-iv In the travis build log I can't find the line which shows the test for fast version check mentioned in test_fast.py. Any idea why it didn't execute ?

@menshikh-iv
Copy link
Member

@gyanesh-m or this one https://github.com/conda-forge/gensim-feedstock/pull/12/files#diff-e178b687b10a71a3348107ae3154e44cR63 (maybe this line is stuck and you didn't achieve your line)

@gyanesh-m
Copy link
Author

@menshikh-iv Oh ya, got it. It needs to be added in forge_test.sh. Thanks.

@gyanesh-m gyanesh-m closed this Apr 18, 2018
@gyanesh-m gyanesh-m reopened this Apr 18, 2018
@gyanesh-m
Copy link
Author

@menshikh-iv Hi, earlier I tried to profile the test cases with pytest-profiling but I was facing some difficulty in its installation as I couldn't find it in any existing conda-forge channel. So I did the profiling using cprofile for word2vec test file and what I found was the method which deals with acquiring of thread locks in the threading library executes 30 times more slower in osx than in linux. This leads to the completion of test file in linux in around 55s but the same test takes around 26 minutes in osx. Also, the test file in osx makes around 1300 more calls to the threading library as compared to the linux version. The graphs and the corresponding stat files are available here.

@menshikh-iv
Copy link
Member

menshikh-iv commented Apr 19, 2018

Thanks for the investigation @gyanesh-m, looks like optimized version doesn't work on OSX (although compiled successfully) =/, any ideas?

@gyanesh-m
Copy link
Author

gyanesh-m commented Apr 19, 2018

@menshikh-iv I looked up and found that multi threaded program in mac osx can be slower than single threaded for the BLAS library provided by Apple as compared to the one available from MacPorts [Source] . I am not sure if this is true now since that post is very old but it can be tried as a solution.

@menshikh-iv
Copy link
Member

@gyanesh-m one important tip - we build OSX wheels for PyPI for a long time and this works as expected, check https://github.com/MacPython/gensim-wheels/.

Also, please check how works https://github.com/conda-forge/scikit-learn-feedstock (and numpy/scipy), I think we missed something critical here.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I was trying to look for recipes to lint for you, but it appears we have a merge conflict.
Please try to merge or rebase with the base branch to resolve this conflict.

Please ping the 'conda-forge/core' team (using the @ notation in a comment) if you believe this is a bug.

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@gyanesh-m gyanesh-m closed this Apr 20, 2018
@gyanesh-m gyanesh-m reopened this Apr 20, 2018
@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I wanted to let you know that I linted all conda-recipes in your PR (recipe) and found some lint.

Here's what I've got...

For recipe:

  • Selectors are suggested to take a <two spaces>#<one space>[<expression>] form. See lines [29]

@conda-forge-linter
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@menshikh-iv
Copy link
Member

@gyanesh-m any updates? What's a current status?

@gyanesh-m
Copy link
Author

@menshikh-iv Hey, I haven't looked into this for quite a while and I am busy for sometime now, so I won't be able to help further in this.

@menshikh-iv
Copy link
Member

@gyanesh-m ok, but can you describe please, what are you tried, what you found, this will be really useful for future investigation, thanks!

@gyanesh-m
Copy link
Author

@menshikh-iv Ok, I will do it over the weekend.

@menshikh-iv menshikh-iv mentioned this pull request Sep 22, 2018
@menshikh-iv
Copy link
Member

outdated, closing.

@menshikh-iv menshikh-iv closed this Feb 1, 2019
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.

4 participants