Skip to content

DOC: Refactor Numba enhancing performance and add parallelism caveat #42439

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

Merged
merged 10 commits into from
Jul 12, 2021

Conversation

mroeschke
Copy link
Member

@mroeschke mroeschke commented Jul 7, 2021

  • Ensure all linting tests pass, see here for how to run them

@jreback jreback added the numba numba-accelerated operations label Jul 8, 2021
@jreback
Copy link
Contributor

jreback commented Jul 8, 2021

doc/source/user_guide/window.rst:264:12: F401 'pandas.api.indexers.BaseIndexer' imported but unused
doc/source/user_guide/window.rst:281:22: F821 undefined name 'CustomIndexer'
doc/source/user_guide/enhancingperf.rst:341:18: E225 missing whitespace around operator

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

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

linting issue

@jreback jreback modified the milestones: 1.4, 1.3.1 Jul 8, 2021
Copy link

@stuartarchibald stuartarchibald left a comment

Choose a reason for hiding this comment

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

Thanks for updating these docs. I've a query (inline) relating to SIGSEGV. If you are (or indeed anyone is!) finding segmentation faults arising in the use of Numba then please report them. Numba tries to ensure it will:

  • not segfault on legal code.
  • catch illegal code at compile time (i.e. before executing and segfaulting/corrupting etc)!
  • catch illegal states in the threading layers and abort before corruption occurs.

Thanks again!

troubleshooting Numba modes, see the `Numba troubleshooting page
<https://numba.pydata.org/numba-doc/latest/user/troubleshoot.html#the-compiled-code-is-too-slow>`__.

Read more in the `Numba docs <https://numba.pydata.org/>`__.
Using ``parallel=True`` (e.g. ``@jit(parallel=True)``) may use an unsafe threading layer to execute parallelism, potentially
leading to segfaults. You may need to first `specify a safe threading layer <https://numba.readthedocs.io/en/stable/user/threading-layer.html#selecting-a-threading-layer-for-safe-parallel-execution>`__

Choose a reason for hiding this comment

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

Numba should not end up causing a SIGSEGV, if this happens, it's probably a bug, please report it!

Numba might print a message to STDERR saying it's detected unsafe behaviour and then signal with SIGABRT to protect users from corruption that would occur in the case of user defined code violating the assumptions of certain threading layers.

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the clarification in behavior. I've clarified in this section that SIGSEGV are bugs that should be reported instead.

Choose a reason for hiding this comment

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

Thank you, much appreciated.

@jreback jreback merged commit 55a03d2 into pandas-dev:master Jul 12, 2021
@jreback
Copy link
Contributor

jreback commented Jul 12, 2021

thanks @mroeschke

@jreback
Copy link
Contributor

jreback commented Jul 12, 2021

@meeseeksdev backport 1.3.x

@lumberbot-app
Copy link

lumberbot-app bot commented Jul 12, 2021

Something went wrong ... Please have a look at my logs.

@mroeschke mroeschke deleted the docs/numba_perf branch July 12, 2021 00:38
jreback pushed a commit that referenced this pull request Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
numba numba-accelerated operations
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants