Giter VIP home page Giter VIP logo

asp's Introduction

asp's People

Contributors

hcook avatar jvmiller224 avatar pbirsinger avatar sbeamer avatar shoaibkamil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

asp's Issues

Make internal imports relative

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.

Asp should handle getting a function's source code

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).

JIT compilation hangs with 'could not acquire lock' messsage

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

Asp should run on Windows

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).

Running_test issue

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 !

'If' statements fail to generate with error about split()

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.

Implement a callback interface for Python functions

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).

tree grammar declaration should not be order-dependent

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.

asp tree grammar sometimes needs to generate a final newline

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.

Asp should have a standard config file format

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)

Array_doubler incompatible with newest version of codepy (2011.1)?

After setting up my workspace, my install passes all tests except for array_doubler. The trace is below:

ERROR: test_generated (main.BasicTests)

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?

Add logging to Asp

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)

SpecializedFunction objects should be able to return C++ data structs

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).

Asp should support incremental compilation

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.