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

Fix for #6151. Make UnicodeCharSeq into str for comparison. #6153

Merged
merged 1 commit into from Aug 21, 2020

Conversation

stuartarchibald
Copy link
Contributor

Fixes #6151 by making functions implemented for UnicodeType that
also accept UnicodeCharSeq convert the input into unicode string.

Closes #6151

Fixes numba#6151 by making functions implemented for UnicodeType that
also accept UnicodeCharSeq convert the input into unicode string.

Closes numba#6151
@sklam
Copy link
Member

sklam commented Aug 20, 2020

I checked the case in #6136 (comment) and can confirm reduction in the number of compilation attempts, from 133 reduced to 14.

I used the following to log the number of compilation attempts.

diff --git a/numba/core/compiler.py b/numba/core/compiler.py
index d71d8c05f..f0cd04ea0 100644
--- a/numba/core/compiler.py
+++ b/numba/core/compiler.py
@@ -1,3 +1,4 @@
+import logging
 from collections import namedtuple
 import copy
 import warnings
@@ -298,6 +299,8 @@ def _make_subtarget(targetctx, flags):
     return targetctx.subtarget(**subtargetoptions)
 
 
+_counter = 0
+
 class CompilerBase(object):
     """
     Stores and manages states for the compiler
@@ -379,6 +382,10 @@ class CompilerBase(object):
         """
         Populate and run compiler pipeline
         """
+        logger = logging.getLogger(__name__)
+        global _counter
+        _counter += 1
+        logger.debug("Compiling[%d] %s %s", _counter, self.state.func_id.func_qualname, self.state.func_id.pysig)
         pms = self.define_pipelines()
         for pm in pms:
             pipeline_name = pm.pipeline_name
             pipeline_name = pm.pipeline_name

@sklam
Copy link
Member

sklam commented Aug 20, 2020

Is this PR ready for review?

@stuartarchibald
Copy link
Contributor Author

Is this PR ready for review?

Think so, will need manual test as already performed.

Copy link
Member

@sklam sklam 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 the patch

@sklam sklam added 5 - Ready to merge Review and testing done, is ready to merge and removed 3 - Ready for Review labels Aug 21, 2020
@sklam sklam merged commit ea56552 into numba:master Aug 21, 2020
@stuartarchibald stuartarchibald mentioned this pull request Aug 26, 2020
21 tasks
stuartarchibald pushed a commit to stuartarchibald/numba that referenced this pull request Aug 26, 2020
Fix for numba#6151. Make UnicodeCharSeq into str for comparison.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to merge Review and testing done, is ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix unichrseq/unicode_str comparison
2 participants