-
Notifications
You must be signed in to change notification settings - Fork 289
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
[WIP]Scikit-learn commit #1308
Open
Daetalus
wants to merge
4,712
commits into
pyston:master
Choose a base branch
from
Daetalus:sklearn_nexedi_1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[WIP]Scikit-learn commit #1308
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string is special in that it is a c++ type which has tp_as_number and tp_as_sequence. This causes problems because when we fixup the slot dispatcher we will set the tp_as_number fields but not the tp_as_sequence because setting both can cause problems. Some extensions (e.g. numpy) require that we use the sq_* functions instead of nb_*. Therefore clear the tp_as_number fields (except nb_remainder which cpython has set too because it is not part of tp_as_sequence).
str: use tp_as_sequence instead of tp_as_number
that is just based off of pulling our latest release
PyObject_New: register the type if the type is not yet registered
The problem is that we emit an llvm "unreachable" instruction, and then continue to emit other code, which fails the verifier. endBlock(DEAD) is supposed to be the right way to handle that, but there is some more work that would need to be done there to get that working properly. So just do the easy thing for now -- create a new BB so that it's ok to emit more code.
We were doing a "call bumpUse() early" optimization to free up registers when we can, but as a side-effect it looked to the refcounter like the reference was done being used.
Not using it in this commit, just wanted to get the unmodified version in so it's easier to see the changes.
…ypes via their descrobject.c
This is for adding a guard on a non-immortal object, since we need to be safe against that object getting deallocated and a different object is allocated in its spot. We had support for this already, but it leaked memory. The biggest was that we never freed our runtimeICs, so if those ended up getting any GC references in them, then we would leak memory. So I started freeing those, but then that exposed the issue that the ICInvalidators expect that their dependent ICs never get freed. So I added back a mapping from ICSlotInfo-> ICInvalidators that reference them.
Create a simple Dockerfile
until I realize that it's because we were passing more tests than we expected.
The behavior changed in CPython 2.7.4, and Travis-CI runs 2.7.3.
Switch to CPython's descrobject.c
before we added a it as a module which made code fail which does something like __builtins__["unicode"]
Some packaging / distributing updates
Bump version numbers
update list of failing cpython tests
exec, input: if globals has no __builtins__ add it as a dictwrapper
since we were installing it from the LLVM APT repo, which they took down since it was getting too expensive. I guess we can just run with the gcc build until that situation gets resolved.
They end up generating "pass" statements with a lineno of 0, which trips an assert later on. This commit just sets them to have a lineno of 1. I'm not sure how to test this, since piping into stdin is supposed to be treated as a file (not as the repl). Though, we get that wrong right now.
Support empty lines on the repl
using cpython's `sys.flags` inplementation
enable `PyObject_Format` in `from_cpython/Objects/abstract.c`
Fix evaluation order for dict operations
+ use pyston::DenseMap to save a little more memory this saves about 5%-10% of peak memory on django
hidden classes: split into subclasses to reduce memory consumption
Update to fewer-pyston-changes virtualenv
and change it to use a unordered_map because it uses less memory in this case and is faster (I assume because it does not have align the key value tuples) saves about 10% of peak memory on django
ScopeNameUsage merge dicts into a single big one
Comment out some part of listobject.c, use the CPython list sort and apply some changes to existed Pyston code.
CPython listsort need "allocated" to check and throw exception: https://github.com/Daetalus/pyston/blob/d84105ffc8a4855bb6e00d9c22ba2baa8bddf969/from_cpython/Objects/listobject.c#L2091 https://github.com/Daetalus/pyston/blob/d84105ffc8a4855bb6e00d9c22ba2baa8bddf969/from_cpython/Objects/listobject.c#L2180
If BoxedList::allocated is -1, it means the items inside were changed. Some CPython list functions need this to check exceptions.
Switch to CPython list sort(Not its list implementation)
this saves a lot of memory
delete the llvm module after code generation
ICSlotInfo: remove old invalidator entries
Daetalus
force-pushed
the
sklearn_nexedi_1
branch
2 times, most recently
from
August 6, 2016 18:26
94530a6
to
e1e9870
Compare
Daetalus
force-pushed
the
sklearn_nexedi_1
branch
from
August 6, 2016 22:14
e1e9870
to
9d6603e
Compare
src/runtime/set.cpp
Outdated
PyErr_BadInternalCall(); | ||
return NULL; | ||
} | ||
return setPop(static_cast<BoxedSet*>(set)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be return callCXXFromStyle<CAPI>(setPop, static_cast<BoxedSet*>(set));
kmod
force-pushed
the
master
branch
2 times, most recently
from
October 28, 2020 21:01
352fd89
to
6488a3e
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In CPython list sort function, before the list get sort, it will reverse the list itself first. See here: https://github.com/python/cpython/blob/2.7/Objects/listobject.c#L2115
This will cause the incompatibility in below:
Pyston:
CPython && PyPy:
The differences is in Reverse with key.
CPython use TimSort, this algorithm need the list is descending. So for maintain the stability in reverse sort, it need to reverse the list first, then reverse again when the list got sorted.
So in order to let Pyston compatible with CPython. I add the second commit.
That's just my investigation, @undingen @kmod please correct me if I was wrong. Thanks!
References:
TimSort Java Implementation
TimSort CPython Implementation