shoaibkamil / asp Goto Github PK
View Code? Open in Web Editor NEWASP: A SEJITS Implementation for Python
Home Page: See https://github.com/shoaibkamil/asp/wiki
License: Other
ASP: A SEJITS Implementation for Python
Home Page: See https://github.com/shoaibkamil/asp/wiki
License: Other
ASP -- A SEJITS Implementation for Python ------- See https://github.com/shoaibkamil/asp/wiki
It currently must be an AST node. It should work with a string.
This is more of a sticky for the upcoming refactoring rather than a bug. To make the asp most usable as a module, all of the import statements referring to asp code should be made relative. Currently they heavily rely on PYTHONPATH.
For the graph specializer I have already started it using asp as a submodule. From the the specializer code, I can refer to the needed asp code by import asp.asp..., but when imported files try to import other asp files, it breaks. Setting PYTHONPATH to the subdirectory where asp is present doesn't fix this because Python checks the same directory as the original import statement (my specializer) before checking PYTHONPATH. It sees asp and thinks it is going to work, but the next word is something like jit or codegen, rather than another asp which is what it needs. My workaround has been to import asp as a submodule named asplib. My code can import it as asplib.asp... and the internal imports work because they fail on the source directory (no asp, just asplib) so it checks PYTHONPATH next.
Currently, each specializer is responsible for obtaining source code of a function if necessary. Asp should have a method to do this (perhaps asp.get_source(foo)
or some other variant). Should have meaningful errors thrown if something goes wrong.
For a starting point, see how the stencil specializer does it in stencil_kernel.py
.
Est. time: O(hours).
When the default ASP cache directory (/tmp/asp_cache) is owned by another user, the codepy framework will loop infinitely trying to gain permission to write to it. In order to allow multiple users (or one user ssh'd multiple times) to use ASP at once, per-user cache directories should be created.
offending line in codepy:
codepy/jit.py:350
default cache directory set in ASP:
asp/jit/asp_module.py:302
Currently Asp does not work on Windows, mainly due to CodePy using posix-y functions and not understanding Windows compilers/conventions.
A first step would be to see if mingw can be made to work with CodePy/Asp (this may involve editing codepy source code).
A second step would be to get CodePy working with MSVC. A proof of concept exists that can do "hello world" via CodePy on Windows using MSVC (contact Shoaib to get that).
Est time: O(1-2 weeks).
There are seemingly duplicate node types Call and FunctionCall and it is not clear which one we are to be using.
Hello,
I tried to install asp and pycasp on OSX 10.9.5 by following the instructions on theses links :
https://github.com/shoaibkamil/asp/wiki/Installing-boost-on-Mac-OS-X
https://github.com/shoaibkamil/asp/wiki/Installing-required-libraries (Longer install)
when I'm running tests I have these errors :
asp_run_tests.txt
pycasp_run_all_tests.txt
Here is my bash_profile :
bash_profile.txt
Let me know If I'm missing something obvious or if you need any informations,
Thanks a lot for your time !
The asp repository should only contain the asp infrastructure, and all specializers should be in separate repositories.
For each of icc, gcc, etc., we should have two sets of default compiler flags: one for debug, and one for production/optimized compilation.
Est time: O(days).
Cgen seems to expect the Compare AST element to possess a split() method, which it does not. This makes translation of meaningful branches difficult. Minimal code to produce such an error is reproduced below:
import asp.codegen.ast_tools as ast_tools
import asp.codegen.cpp_ast as cpp_ast
import inspect, ast
def if_test( x ):
if x != 0:
return x
else:
return 0
if __name__ == '__main__':
if_src = inspect.getsource( if_test )
if_ast = ast.parse( if_src.lstrip() )
nt = ast_tools.ConvertAST()
c_src = str( nt.visit( if_ast ) )
print c_src
The error is thrown at line 473 of cgen/init.py.
If specializers need to call back into Python, we should provide a standard interface that does it in a serialized manner. The idea is that, when entering the C++ world, a thread gets spawned off and all that thread does is watch a global queue for requests; other threads can put things on that queue and read the returned values from another queue.
Est time: O(1-3 weeks).
We should only get the minimum timing for each set of parameters, not all of them and do a scan.
Should have no failures; probably due to semicolon handling.
Currently, in the tree_grammar implementation, a rule like:
Foo = Bar | Baz
requires Foo to be above the declarations of Bar and Baz. We should move all superclass declarations to the the top of the generated output, avoiding this problem.
For some grammars, I have a mysterious "syntax error" that occurs at the last line in the generated code from tree_grammar.py. This seems to be fixed by adding an additional newline to the generated program text, i.e.:
program += "\n"
right before executing it.
Users sometimes need to specify locations of libraries/include files/etc., or special compilers/flags to use. We should have a standard config file in a standard location and an interface to read stuff from the config file.
Config files should use YAML format, since it is readable and cross-language.
Est. time: O(days)
First, stencil needs to be separated out into a new repository. Then, asp's current setup.py needs to be refactored using best practices so it is installable using pip.
After setting up my workspace, my install passes all tests except for array_doubler. The trace is below:
Traceback (most recent call last):
File "tests/arraydoubler_test.py", line 13, in test_generated
result = ArrayDoubler().double_using_template(arr)
File "/Users/sbeamer/Graphs/special/asp/array_doubler.py", line 16, in double_using_template
mod.add_function(rendered, fname="double_in_c")
File "/Users/sbeamer/Graphs/special/asp/asp/jit/asp_module.py", line 113, in add_function
self.add_function_with_variants(variant_funcs, fname, variant_names, cuda_func=cuda_func)
File "/Users/sbeamer/Graphs/special/asp/asp/jit/asp_module.py", line 98, in add_function_with_variants
self.add_function_helper(variant_funcs[x], fname=variant_names[x], cuda_func=cuda_func)
File "/Users/sbeamer/Graphs/special/asp/asp/jit/asp_module.py", line 82, in add_function_helper
module.add_function(func)
File "build/bdist.macosx-10.6-universal/egg/codepy/bpl.py", line 84, in add_function
func.fdecl.name, func.fdecl.name)))
AttributeError: 'unicode' object has no attribute 'fdecl'
Talking to hcook, he was unable to reproduce the bug. I used easy_install to get codepy, and it seems to have grabbed the latest version (2011.1 which was released on 3/18/11). He is not using this version. Is this update the cause of the bug?
Right now, the only feedback users can get is through setting the environment variable ASP_DEBUG
, which triggers debug_print
to output things. Asp should instead use a Python logging framework and allow standardized, multiple levels of logging (e.g. 0 = no logging, 1 = just specialization decisions, etc.).
Est time: O(days)
add_header currently only sets the Include type to be C style (e.g. "stdlib.h") and not C++ style (e.g. ).
Boost allows you to declare "return policies" to dictate how return values from C++ functions are handled. We currently always use the default policy, which translates objects; we should allow users to declare at least the "opaque" policy which does nothing special with the data (not even GC).
Right now, we have to write a single large source file and have that compiled; it would be better if we could write many small files (incrementally, perhaps) that are compiled into object files and then into a DLL. This way we would only recompile things if necessary.
O(1-2 weeks)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.